Script for automatically shutting flapping interface
dear all,
I am looking for a eem scrip so that when interface flap up/down for atleast five times, script should shutdown this interface and no shut another interface based on logs generated. and after three hours or so it should again no shut the flaping link.
Thanks
Saju
Hello,
I wrote a similar script to passive-interface EIGRP if it is flapping. The logic remains the same. Just change the trigger and what actions you want it to take.
event manager applet CIRCUIT_STABILITY authorization bypass
event syslog occurs 3 pattern " %DUAL-5-NBRCHANGE: EIGRP-IPv4 10: Neighbor 10.51.2.1 .*down" period 45000 maxrun 120
action 1.0 cli command "enable"
action 1.1 syslog priority errors msg "%EEM-ACTION-ENGAGED% due to Multiple EIGRP Flaps"
action 2.0 cli command "conf t"
action 3.0 cli command "router eigrp 10"
action 4.0 cli command "passive-interface tunnel 512"
action 4.1 syslog priority errors msg "Tunnel 512 has been made passive by TEST"
Similar Messages
-
VBA script for automatically indexing topics
A big disadvantage with InDesign's indexing system is that you cannot automatically index all occurences of topics currently in the index.
Instead, you have to find an occurence of each topic in the document itself and go to the Index menus and then click New Page Reference...Add All, for each index topic individually.
To get around this, I have been trying to produce a VBA script to automatically index all occurrences in a document of the topics currently in the document index.
I have been using the MS Excel VBA development environment but find the definitions of the object model in the Excel VBA browser rather inadequate and ambiguous .
Is there a more thorough reference work for these?
The plan was to start by taking each individual topic in the index which I tried to access with something along the lines of:
MyDocument.Index.Topic(1)
This hasn't worked.
The plan then was to take each index topic and use it to find an occurence in the document of that topic and then use that occurence to invoke the New Page Reference...Add All option to index all occcurences of that selected term, using something like:
MyDocument.PageReferences.Add
Again, without success.
Any guidance or suggestions would be appreciated.Dear Peter,
Many thanks for your posting, that was very helpful.
This is the state of the script so far (I have added a large number of MsgBox entries - these aren't needed, they are just for debugging purposes during development):
'VBA script which tries to work through all of the topics in the index and automatically index each occurence of them in the current text frame:
main
Function main()
Set MyInDesign = CreateObject("InDesign.Application.CS4")
If MyInDesign.Documents.Count > 0 Then
Set MyDocument = MyInDesign.ActiveDocument
Set MyPage = MyDocument.Pages.Item(1)
Set MyTextFrame = MyPage.TextFrames.Item(1)
Set MyStory = MyTextFrame.ParentStory
Set MyIndex = MyDocument.Indexes(1)
Set MyTopics = MyIndex.AllTopics
MyIndexesCount = MyDocument.Indexes.Count
MsgBox "Current indexes Count: " & MyIndexesCount
MyIndexTopicsCount = MyTopics.Count
MsgBox "Current index topics Count: " & MyIndexTopicsCount
For i = 1 To MyTopics.Count Step 1 'work through the topics
MyIndexTerm=MyTopics(i)
MsgBox "Current indexes Topic: " & MyIndexTerm
'search for MyIndexTerm :
'Clear Find preferences:
MyInDesign.FindTextPreferences = idNothingEnum.idNothing
'Set up search paramaters:
If MyIndexTerm <> "" Then
MyInDesign.FindTextPreferences.FindWhat = MyIndexTerm
'Set search options:
MyInDesign.FindChangeTextOptions.CaseSensitive = False
MyInDesign.FindChangeTextOptions.IncludeFootnotes = False
MyInDesign.FindChangeTextOptions.IncludeHiddenLayers = False
MyInDesign.FindChangeTextOptions.IncludeLockedLayersForFind = False
MyInDesign.FindChangeTextOptions.IncludeLockedStoriesForFind = False
MyInDesign.FindChangeTextOptions.IncludeMasterPages = False
MyInDesign.FindChangeTextOptions.WholeWord = False
'Search for the string:
Set MyFoundItems = MyDocument.FindText 'this ought to be limited to the Story, not the Document eg MyStory
MsgBox "Found index terms:" & MyFoundItems.Count
For j = MyFoundItems.Count To 1 Step -1
MyTopics(i).PageReferences.Add MyFoundItems(j)
Next
'Clear preference:
MyInDesign.FindTextPreferences = idNothingEnum.idNothing
'Having found it, add page reference:
'MyDocument.PageReferences.Add
Else
MsgBox "No search term specified"
End If
Response=MsgBox ("Continue?", vbYesNo)
If Response = vbNo then
Exit For
End If
Next
'Set up Index options:
MyIndex.IndexOptions.Title = "Index"
MyIndex.IndexOptions(1).TitleStyle="Chapter Head"
MyIndex.IndexOptions(1).ReplaceExistingIndex = True
'Generate the index:
MyIndex.Generate
Else
MsgBox ("Please open a document, select an object, and try again.")
End If
End Function
There are a couple of problem areas still:
1. Index terms appear to be added irrespective of whether or not that particular page reference already exists in the index.
This can result in duplicate page references under each topic - especially if the script is run several times.
Is there any way of avoiding these duplicate references?
2. I haven't yet suceeded in getting the script to generate the index - so far I've had to do it manually after the script has run.
The problem lies somewhere in the code to set up the index options and then generate the index.
3. It might be useful to be able to limit the indexing to the curent story rather than the whole document - but I haven't yet got it to do that.
Best wishes. -
Shell script for Automatic Awr Report
Hi Good Morning,
I have a requirement to generate the AWR report daily between (10AM - 06PM , 10AM - 01PM , 01PM - 10PM) . I have the below script for this . But the issue is this script is working only when i run it two times and before running i have to delete snap_list.lst file. Please let me know what is the problem in this script and how to resolve it.
Script :
dt=`date +%d%m%Y`
cd /orabkp/awr_report
chmod 777 *
rm -rf snap_list.lst
touch snap_list.lst
#rm -rf snap_list.lst
#rm -rf snap_list.lst
sqlplus -s " /as sysdba " <<EOF > snap_list.lst
host sleep 10
@/oracle/scripts/cron_scripts/rpt1.sql;
@?/rdbms/admin/awrrpt.sql
HTML
1
`cat snap_list.lst | grep "10:0" | awk '{print $1}'`
`cat snap_list.lst | grep "13:0" | awk '{print $1}'`
awrrpt\_$dt\_10AM\-01PM.html
prompt 2
@?/rdbms/admin/awrrpt.sql
HTML
1
`cat snap_list.lst | grep "13:0" | awk '{print $1}'`
`cat snap_list.lst | grep "18:0" | awk '{print $1}'`
awrrpt\_$dt\_01PM\-06PM.html
@?/rdbms/admin/awrrpt.sql
HTML
1
`cat snap_list.lst | grep "10:0" | awk '{print $1}'`
`cat snap_list.lst | grep "18:0" | awk '{print $1}'`
awrrpt\_$dt\_10AM\-06PM.html
@?/rdbms/admin/addmrpt.sql
`cat snap_list.lst | grep "06:0" | awk '{print $1}'`
`cat snap_list.lst | grep "12:0" | awk '{print $1}'`
ADDM_REPORT\_$dt\_10AM\-06PM.txt
EOF
exit
cat /oracle/scripts/cron_scripts/rpt1.sql
host echo 1
host sleep 10
@?/rdbms/admin/awrrpt.sql
HTML
1
`cat snap_list.lst | grep "10:0" | awk '{print $1}'`
`cat snap_list.lst | grep "13:0" | awk '{print $1}'`
awrrpt\_$dt\_10AM\-01PM.html
Regards
RajasekarHi,
Modify & Try this script used for rac awr ..
#!/bin/ksh
set -x
ORACLE_SID=DBSID
ORACLE_HOME=/u01/app/ora11g/product/11.2.0/db_1
export ORACLE_HOME
TERM=vt100
export TERM
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/local/bin:/usr/bin/X11:/bin:/sbin:.
PATH=$ORACLE_HOME/bin:$PATH
export DT=`date '+%d_%b_%Y_%HH_%MM'`
export ORACLE_BASE ORACLE_SID ORACLE_HOME PATH DT
echo $DT
MAIL="[email protected]"
CMAIL="[email protected]"
AWRR="/u01/DBA_Scripts/AWR_REPO"
sqlplus -s "/ as sysdba"<<EOFSQL
set head off
set feed off
spool /tmp/bsnap.lst
select max(SNAP_ID)- 3 from dba_hist_snapshot;
spool off
spool /tmp/esnap.lst
select max(SNAP_ID) from dba_hist_snapshot;
spool off
spool /tmp/iname.lst
select instance_name from v\$instance;
spool off
spool /tmp/dname.lst
select database_name from v\$database;
spool off
spool /tmp/inum.lst
select instance_number from v\$instance;
spool off
spool /tmp/dbid.lst
select dbid from v\$database;
spool off
EOFSQL
BSNAP=`cat /tmp/bsnap.lst | tail -1 | awk '{ print $1}'`;export BSNAP
ESNAP=`cat /tmp/esnap.lst | tail -1 | awk '{ print $1}'`;export ESNAP
INAME=`cat /tmp/iname.lst | tail -1 | awk '{ print $1}'`;export INAME
DNAME=`cat /tmp/dname.lst | tail -1 | awk '{ print $1}'`;export DNAME
INUM=`cat /tmp/inum.lst | tail -1 | awk '{ print $1}'`;export INUM
DID=`cat /tmp/dbid.lst| tail -1 | awk '{ print $1}'`;export DID
echo "Begin Snap : $BSNAP"
echo "End Snap : $ESNAP"
#echo "InstanceName: $INAME"
echo "DB Name : $DNAME"
#echo "InstanceId : $INUM"
echo "DB ID : $DID"
sqlplus -s "/ as sysdba"<<EOFSQL
define inst_num = $INUM;
define num_days = 12;
define inst_name = 'ALL';
define db_name = '$DNAME';
define dbid = $DID;
define begin_snap = $BSNAP;
define end_snap = $ESNAP;
define report_type = 'html';
define report_name = $AWRR/Awr_report_$DT.html
@@?/rdbms/admin/awrgrpti
EOFSQL
cat /u01/DBA_Scripts/mail_body.txt | mailx -a $AWRR/Awr_report_$DT.html -c $CMAIL -s "DB Report - DB " $MAILThanks,
Ajay More
http://www.moreajays.com -
Script for automatic delete of archive logs/redologs
Hi Experts,
Do you have any idea on how to create a shell script. Actually the function of it, is to automatically deletes the archive logs/redologs if reaches the limit. Or is there any parameter to change to set the automatic deletion of archive logs/redologs.
RegardsHi,
at first, archivelogs should always be saved to tape before you delete them. If you don't want to backup them, may be for a test system, you can suppress them in ORACLE instead to delete them later.
You can run the database in "NOARCHIVE LOG MODE". If you do so, the online redologs are not archived, they are still reused and overwritten. You can not run an online Backup, when the database is in noarchive log mode. If you want to backup the database, you have to run an offline backup.
Do not use the NOARCHIVE LOG MODE for production or developemet systems.
To change the archive log mode:
shutdown the database
startup mount;
alter database noarchivelog;
alter database open;
archive log list will show the actual status
regards Ulrich -
Script for automate export of idml for many docs (perhaps using hot folder)
Hi all,
I am looking for a solution to automate export many INDD docs to IDML. Did anyone have done such a solution?
Thanks in advance!HI,
You will be certainly interested in Peter Kahrel's Batch Exporter Script.
Not related to HotFolder though for what I know of.
Free script Batch convert/export InDesign documents | Peter Kahrel
Best,
Loic
http://www.ozalto.com -
Shell Script for automatic backup
Hello Every one,
We have windows network and sun solaris sparc box. (both from Sun Box and from Windows machine I can communcate using Telnet.)
I wish to take data backup of a system having windows operating system, into
the sun solaris sparc box automatically by week end .
Can anyone help me with the shell script which does this operation.
Regards,
Dwarakfirst of all, is there nfs running? and on windoze box, do u have any nfs client program running?
you cant transfer files frm the windoze machine via telnet..
once you can settle the above, what you can do is a simple copy script and put it in your crontab. -
Script for automatically copying DVDs/CDs to disk on insert?
I just started to copy about 500 Data-DVDs (and some CDs) to an external FAT32 USB-disk. I do that by dragging the mounted disk from the desktop to the drive while holding down the option-key.
Is there a way to automate that? Would be easier if the Mac started the copying whenever a new DVD/CD is mounted on the desktop. And ejecting the disk by itself would be nice too. That way I'd be sure to notice that another copy is done and could put in the next disk ...Udo Schmitz wrote:
Hi,
I want to copy DVDs/CDs to a harddisk as well. But to an external USB drive.
So, when "/dev/disk1" is my MacBooks internal optical drive, how do I address the external USB-HD?
Apple-Script doesn't want me to use the path: "/Volumes/FILME/" ...
You'll want to leave the superdrive path the same but change the duplicate to desktop part to your own external hd. I'm pretty sure you get it just making sure.
Applescript doesn't mind the path you chose just the UNIX style slash format oppose to mac colon delimintated. Try this
(/Volumes/FILME/...) as POSIX path
--or
:Volumes:FILME:... -
Apple Script for deleting podcasts
I subscribe to a lot of podcasts, but I don't want to keep them in my iTunes library after I'm done listening to them. Is there an Apple Script for automatically deleting podcasts? Thanks.
Thanks - once I'm in Automator and select Music, I don't see any options for finding Podcasts. Any suggestions which item/step I should select next in Automator? Thanks.
-
EEM -automatic shut down or switch over of WAN link in OSPF when packet drop increase
Hi,
Need help..
can any one help me how can EEM help for automatic shut down or switch over of WAN link in OSPF when packet drop increase a predefined level.
I have a set up different branches connected together...OSPF is the routing protocol and need to communicate with two branches via hub locations.
need to shut or switch some percent of traffic from primary to back up when packet drop in the link.I am not sure EEM can do what you want.
Another option could be to use SLA tacking/monitoring. But you will fall back to the new route when you lose some percentage of pings, you can't switch only part of the traffic.
I hope it helps.
PK -
Does ios8 automatically shut down applications?
I'm running ios8.1.2 on an iPhone 4s. I use a couple of GPS-based recording applications to record my cycling training (one app is Strava, one is MotionX-GPS). I've had ongoing problems with the GPS-recording shutting down at various points during my rides and ceasing to record GPS data.... Strava is particularly bad and I've quit using it in favor of MotionX-GPS. MotionX, however, has shut down (or perhaps a better description is ceased to record... not sure) twice recently. I would sure like to find the cause of this.
Some information: my process generally when using these applications is to start my music on my phone (usually Google Play using downloaded-only music), then start the GPS-recorder, then sleep my phone and start riding. Normally, my next interaction with the phone is un-sleeping it to stop the GPS-recorder after the ride. Sadly, about half the time, now, when I un-sleep my phone the GPS application has shut down and didn't record some part of my ride. On one occasion, based on the point where the recording stop, I could associate the stoppage with the taking of a picture from the lock screen (MotionX-GPS, but that used to happen all the time with Strava), but that's the only event I have been able to associate with an app shutdown.
I have noticed that the recording of GPS data does not stop when I do not listen to music - I don't think the culprit is the music player, per se, but perhaps an unusually high memory consumption by the player at some point?
What I'm trying to find out via this question is: does iOS8 have some sort of mechanism for automatically shutting down applications when triggered by some certain event? e.g. memory reaches a certain level so shut down all other running apps? (In this case, though, it seems like such a trigger would shut down the music player, not the GPS-recorder, since the music player was backgrounded before starting the GPS-recorder, which should be the "primary" app even though the phone is asleep).
Very confusing and frustrating.
Anyone have any thoughts?
ScottNo one here is familiar enough with the internals of iOS to comment on iOS contingency handling. This is a user forum.
More likely your scenario is triggering a bug in the GPS applications which is causing them to abort. A resource problem could also be causing problem ( a exhaustion of internal memory or a exhaustion of external storage for the App(s)). This might cause an abort for the App requesting the resource rather than the music. Of course, if the music isn't playing, there is more memory available.
However, this is all just speculation.You should try contacting the developers of these applications to see if they have any ideas or fixes for these problems. They may also have a user forum. -
Rc script, for activate numlock on ttys
Hello, and sorry for my bad English...
I've made a script, for automatically turn on numlock on ttys (Script is little edited version of gentoo script)
You just add 'numlock' to DAEMONS in rc.conf
can You test it works for everybody? And submit me any suggestions?
PKGBUILD in AUR, name 'numlock'
EDIT -- Sorry for bad forum, mod please move topic to: [PKGBUILDs & ABS Support]
Last edited by canni (2007-09-08 19:17:46)I usually use screen(1) to capture info/debug msg from the tunnel. For example:
screen -d -m -S ntc-tunnel ssh -YNMS /tmp/ssh-%r@%h:%p -D $socks_port -L $ntcgrid_bind_port:ntcgrid:22 ntc -
How to shut no shut interface of switch using(EEM) Script for 3560 switch
Dear community experts,
I'm new for creating scripting for EEM and below is my situation, need your support.
Present I'm using 3560 switch, one of the switch port(FA0/1) has added Cisco Access point(PoE), actually what happening daily this Access point getting struct when I'M doing the switch port (FA0/1) shut then no shut it is working fine .
So my question is i need script, that should continuously ping the IP off the Access point if the IP will drop 4 packets the switch do shut and then no shut for that I need the script, Please help me.
if it is not possible please provide the batch file, which will ping the particular IP if 4 packet drops it will telnet the switch and go to the interface do shut no shut
Note:
instead of mentioned 3560, I mentioned 2960 now corrected it please provide the script.This should work:
ip sla 1
icmp-echo 10.10.10.1
frequency 15
ip sla schedule 1 life forever start now
ip sla enable reaction-alerts
ip sla reaction-configuration 1 react timeout action-type trapOnly threshold-type consecutive 4
event manager applet reset-ap
event ipsla operation-id 1 reaction-type timeout
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "int fa0/1"
action 4.0 cli command "shut"
action 5.0 cli command "no shut"
action 6.0 cli command "end" -
HACMP Clustering Script for SAP ECC 6.0 (SR1) - Automatic Failover
Hello,
I have installed the SAP ECC 6.0 (SR1) under AIX 5.3 / DB2 V8 FP12 with HACMP Clustering environment. Manual Failover is working fine. Central System has been installed in share drive with Virtual IP and Virtual name inNode A. Dialog Instance is loaded locally in Node B. I want to get HACMP Clustering script(automatic failover script) for Automation. Please help me if you have. It is single package clustering. If Node A fails, Node B will take care ( Central System and Dialog instance will run in Node B)
Thanks
Gautam Poddarthis post is duplicated at Upgrade to ERP 2005/ECC 6.0 from R/3 4.72/Basis 640 on Z/OS 1.4 DB2 8.1
-
HACMP Clustering Script for SAP ECC 6.0 (SR1) - Automatic Failover-Oracle10
Hello,
I have installed the SAP ECC 6.0 (SR1) under AIX 5.3 / Oracle 10g with HACMP Clustering environment. Manual Failover is working fine. ASCS and Database instances are loaded in share drive with Virtual IP and Virtual name. Central Instance and Dialog Instance are loaded locally in Node A and Node B. I want to get HACMP Clustering script(automatic failover script) for Automation. Please help me if you have.
Thanks
Gautam PoddarHere are HA stop & start scripts that you should be able adapt for your particular circumstances. Based on earlier versions of SAP / Oracle but assume should be a reasonable guide
Script to start SAP is start_sap_prd
#!/bin/ksh
Script: /usr/local/bin/cluster/start_sap_prd
Comments: HACMP Application START script for PRD
Show me obvious information in hacmp.out
banner "Starting"
banner "PRD SAP"
Set the oracle and sap owner.
ORASID="PRD"
SAPADM="prdadm"
ORAUSR="oraprd"
VIRTUALHOST="vhost"
DEVHOST="vhostdev"
Get the volume groups for this resource group
RG=$( /usr/es/sbin/cluster/utilities/cllsgrp | grep -i $ )
VG_LIST=$( /usr/es/sbin/cluster/utilities/cllsres -g $ | \
grep "VOLUME_GROUP=" | \
awk -F\" '{ print $2 }' )
Check the transport directory is mounted.
if mount | grep -w "/usr/sap/trans"
then
print "Transport directory is already mounted."
else
cd /tmp
print "Attempting a background mount of the transport directory."
nohup mount -o intr,bg,soft :/usr/sap/trans1 /usr/sap/trans &
fi
#Start SAP and Oracle
#Start listener
su - $ -c /rprd/oracle/PRD/920_64/bin/lsnrctl start
rc=$?
if [ $? != 0 ]
then
echo "ERROR: Listener failed to start\n"
fi
#Start Database
su - $ -c "/rprd/oracle/PRD/bin/start_database_PRD.sh"
sleep 20
Standard sapstart script
su - $ -c startsap $
Script: /usr/local/bin/cluster/stop_sap_prd
Dated: 01/11/06
Application: Oracle/SAP
Comments: HACMP Application STOP script for SAP / Oracle PRD
Show me obvious information in hacmp.out
Set the oracle and sap owner.
rc=$?
if [ $? != 0 ]
then
echo "ERROR: Failed to start SAP\n"
fi
exit 0
Script to stop SAP is stop_sap_prd
#!/bin/ksh
set -x
banner "stopping"
banner "PRD SAP"
ORASID="PRD"
SAPADM="prdadm"
ORAUSR="oraprd"
VIRTUALHOST="vhost"
#Stop SAP/Oracle
su - $ -c stopsap $
rc=$?
if [ $? != 0 ]
then
echo "ERROR: Failed to stop SAP and Oracle\n"
break
fi
Stop SAP collector and Oracle listener.
su - $ -c /usr/sap/PRD/SYS/exe/run/saposcol -k
rc=$?
if [ $? != 0 ]
then
echo "ERROR: Failed to stop SAPOSCOL \n"
fi
su - $ -c /rprd/oracle/PRD/920_64/bin/lsnrctl stop
rc=$?
if [ $? != 0 ]
then
echo "ERROR: Listener failed to stop\n"
fi
if mount | grep -w "/usr/sap/trans"
then
print "Transport directory is mounted."
/usr/es/sbin/cluster/events/utils/cl_nfskill -k -u /usr/sap/trans
sleep 1
/usr/es/sbin/cluster/events/utils/cl_nfskill -k -u /usr/sap/trans
sleep 1
umount -f /usr/sap/trans &
else
print "Transport directory is not mounted."
fi
exit 0 -
Automate script for import data
automate script for importing data to the cube from txt files.
Ex: - I have below 2 files for import
aaaa.txt
bbbb.txt
For the above simply i can write esscmd or Maxl script for importing files .
Esscmd :
IMPORT 3 "\aaaa.txt" 4 "N";
IMPORT 3 "\bbbb.txt" 4 "N"
my question , suppose if some more files added to the existing files, for example cccc.txt got added ,how can i write a code for this?Well I guess this will do
dataDir=" " # Give the data directory path here
maxlFile="maxl1.msh"
cd $dataDir
for file in `ls *` ;
do
maxlStmt="import database sample.basic data from data_file '$file' using rules_file 'xxx.rul'
on error write to 'xxx.log';";
printf $maxlStmt >> $maxlFile
done
ls * is lists all the files in the directory. If you want to be more specific and if you yhink tat your data folder may contain more files then you can use "ls *.txt" if your file extension to load is txt.
Well I haven't tested this as I am on vacation...So you can just follow the similar way.
This is only for the 3rd point which you said
Maybe you are looking for
-
How to convert mobi books to ePub format?
Hello, I have a question for help here, I have a lot of .mobi books on my computer, I wanna transfer these mobi books to my iPhone and iPad for reading, but I found they doesn't accept mobi format, I tried many ways to convert mobi to ePub but failed
-
Mass Seiban costing (CKW1)
At my current client we will be using Seiban costing in order to generate a cost specific for prject stock materials (which will include parameter effectivity). I know you can use transaction code CKW1 to cost a specific WBS element/material. My qu
-
i get below error whn i try to retrieve the data No data was generated .suppress Missing = [true], zeros = [true]. Sheet not over written. cheers
-
Catalog procurement from Maintenance Order
Hi Gurus, My client is implementing Punchout Catalog from SAP ECC 6.0. we are not into SRM server. I made the settings in Web services ID and Description and i am able to do shopping from Vendors URl and return back to SAP ECC. Now 1) they want to po
-
Use of key figure based on period
Hello All, I have 2 key figures in my multiprovider, e.g. Actual Amount and Budget Amount. I need to display one of the key figure based on period. Reports have January to December columns. Now, if current period is October, I have to display Actu