Running a TCL script through EEM every 60 seconds
I have a script written in the TCLSH of IOS, I can test this script from the shell using the following commands
LAB-RTR#tclsh
LAB-RTR(tcl)#source flash:test.tcl
NO CALLS
Is there a way I can run this test.tcl script every 60 seconds on the router.
SCRIPT test.tcl
proc get_ints {} {
set syslog [open "syslog:" w+]
#puts "BEFORE\n"
set check ""
set int_out [ exec "show voice call status\n" ]
#puts "INTOUT $int_out\n"
set mylist [regexp -nocase -line -inline {(^([0-9]*|No) active calls? found)} $int_out]
#puts "MYLIST $mylist\n"
foreach int $mylist {
#puts "INT $int\n"
if {$int == "No"} {
puts " NO CALLS\n";
puts $syslog "NO CALLS"
} elseif {[string is integer -strict $int]} {
puts "$int CALLS\n";
puts $syslog "$int CALLS"
} else {
#puts "GARBAGE\n";
close $syslog
#puts ""
puts [eval get_ints]
Hey Joseph, Thanks for all your help. I have one last question, so now that I am running my script every 60 seconds if there is an issue I send multiple traps to our monitoring system. Is there any way you can keep track if the trap was already sent I will not send another trap again.
One way I can think of is using a loopback interface. But I would prefer not shutting down the loopback interface just to keep track of what my script is doing.
IF issue {
IF Loop1 is up {
don't send trap
} ELSE {
bring Loop1 up
Send Trap
} ELSE (No issue) {
shutdown Loop1
Similar Messages
-
Creating a job that runs a Tcl script
Hi,
We currently have a scheduled job running a Tcl script on a 8.1.7 DB. My question is, can I still use the same setup in 10g DB (i.e. creating a job that runs Tcl script)? If I can, how am I gonna do it?
Thanks,
howieIt depends on how you scheduled the job in 8.1.7 DB.
By Cronjob? Yes you can do the same to connect to 10g
By DBMS_JOB?. Yes you can do it in 10g and in addition, can improve it with DBMS_SCHEDULER
Via OEM? Yes in can use Enterprise Manager to create a Job that runs the Script. -
To run a tcl script in ombplus
how do i run a script in ombplus
when i give a command ompplus.bat test.tcl the script doesnt run.
it is given in a doc that in INTERACTIVE SHELL the SOURCE should be set as test.tcl
and then ombplus.bat test.tcl command should be given in the ombplus command line.
what is interactive shell in ombplus.
and how to run a tcl script in ombplus.What is in the script?
Try starting ombplus - you get cmd window and then type:
eg.
source c:/test.tcl
and so on... -
Running Unix Shell scripts through Java
How to run Unix shell scripts through Java program ?
Use:
Process p = Runtime.getRuntime().exec("sh script.sh");Then you can use:
p.getOutputStream and read the output of your program. -
Running a shell script through java
Hi all,
I have a simple question here.
How can I run a shell script through java and put the text output into a string.
I'd be very grateful if you could show me sample code...
Have a great day,
PeshoRuntime.exec()
There are plenty of examples. Read the following before continuing, however, as it will save alot of headaches:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html -
Running a *.tcl script via an Expert
I'm trying to build a metadata promotion wizard/expert which will promote metadata from our Dev repository to our QA repository
In order to acheive this, we have created an exp_imp.tcl script which exports a collection from our Dev repository and imports it into QA our QA repository - this works fine if I run it via OMBPlus.bat. However, I would like to incorporate this within an OWB Expert - the problem we are experiencing is that the OMB+ task within the expert doesn't allow us to connect to a different repository (QA repos) without first disconnecting from the current repository (Dev repos) - if we do disconnect the expert will run through to completion, however, the expert window then hangs (presumably, because of the earlier disconnection)
Any help with this would be much appreciated.Hi skifarm,
It sounds like this message may be more related to the TCL script than to LabVIEW. Could you put a simple command very early in the script that gives some output, to help you determine whether it's a LabVIEW issue? If the command provides the output, then it's probably not a LabVIEW issue. If it doesn't get that far, then that somewhat narrows it down.
Regards,
James R.
National Instruments -
Signing byte-encoded TCL script for EEM
Good day,
I am trying to figure out how to sign a TCL script which is distributed in byte-encoded form.
The byte coding is performed with TCL pro (http://sourceforge.net/projects/tclpro/files/TclPro-1.4.1/)
Any pointers on how to do it will be much appreciated.
Regards,
AlexeiEEM 3.4 should support third party signing of Tcl policies. As to whether or not byte-code compiled policies will be supported is uncertain. However, you should be able to sign a byte-code compiled Tcl script (regular Tcl script, and not EEM policy) by putting the signature after the closing tbcload '}'. I assume the same thing will eventually be doable with EEM.
-
Running a Unix Script through a Java Program
Hi !!!!!!!!! Can anybody plz suggest me an approach for the following queries -
1. How to execute a unix script through a java program ?
2. How to send the o/p of the script to a java program so that it can be used .import java.io.*;
public RunScript
public static void main(String args[])
try
Process p = Runtime.getRuntime().exec("script.sh");
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null)
System.out.println(line);
input.close();
catch(Exception e)
e.printStackTrace(); -
How to run a Test Script through RFC
I created a Test Script A in system A.
And I created Test Script B in system B.
I want to refer Test Script A in in Test Script B.
But there is an information "Test Script A cannot found in local system.",
because the 2 Test Script are in different systems.
I do not want upload Script A into system B.
Is there a way to call Test Script A in system B?Hi Uwe,
Thanks for your help.
I have a question about the Function module ECATT_EXECUTE.
I want to to run a eCATT Test Configuration with External Variants.
So I enter the following valus into import parameters
TO_EXECUTE-OBJ_TYPE = 'ECTC'
TO_EXECUTE-OBJ_NAME = '/SMB91/ARTICLE_O001_R80'
IT_VAR_EXT-OBJ_TYPE = 'ECTC'
IT_VAR_EXT-OBJ_NAME = '/SMB91/ARTICLE_O001_R80'
IT_VAR_EXT-VAR_EXT_MODE = 'X'
IT_VAR_EXT-VAR_EXT_FILE = 'SMB99_RETAIL_MM41_711.TXT'
IT_VAR_EXT-VAR_EXT_PATH = 'C:\DATA\RETAIL'
When EXECUTE the Function,
the ecatt is not get the External Variants 'SMB99_RETAIL_MM41_711.TXT'
from the path 'C:\DATA\RETAIL' I entered.
it use a different path which is form the Start profile values .
How to make the ecatt use the path I entered ?
Hope for your reply , thanks.
Weston -
Running a powershell script through task scheduler
Hi,
when I run a script using task scheduler, the prompt closes after the script ended. What is the argument to leave the prompt open?
Thanks,
AshleyHi Ashromeo,
Maybe you need to set excution plicy efore you running the script by the following command :
Set-ExecutionPolicy RemoteSigned
For details please refer to following link :
http://technet.microsoft.com/en-us/library/hh849812.aspx
Best Regards
Elton Ji
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
Run a .sh script through JAVA ?
Hi All,
I have a shell script that basically gives me some status on my UNIX box. The name of the script is "scstat". But I need to parse the output shown by this script using JAVA.
Does anybody know of any code or let me know the ways to implement this......your help is appreciated.
Best Regards, sangitaTest with string "ls -al", etc..
import java.io.DataInputStream;
import java.io.IOException;
* Created on Apr 26, 2004
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
* @author root
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
public class Execute {
public static void main(String[] args) {
Execute ex = new Execute();
ex.execute("./scstat.sh" ); //if in current directory, need the path.
/**Returns the output
* @param string
public static String execute(String string) {
Process p;
String s = null;
try {
p = Runtime.getRuntime().exec(string);
// p.waitFor();
DataInputStream in = new DataInputStream(p.getInputStream());
while ( (s=in.readLine()) != null){
System.out.println(s);
} catch (IOException e) {
e.printStackTrace();
return s;
} -
Embedded Event Manager - SNMP - run TCL script
I would like to run a tcl script on a router using snmp. I understand Embedded Event Manager can do this but haven't found what I need to run that. Can someone point me in the right direction?
Yeah, you could do this, but it depends on your version of IOS. You will need EEM 3.1 or higher (15.0) to be able to intercept SNMP GET requests. Then, you could do something like:
event manager applet snmp-trigger event snmp-object oid 1.9.9.9.9 type gauge sync yes istable no action 1.0 policy my_tcl_policy.tcl action 2.0 snmp-object-value event-id _event_id gauge 0 next-oid 1.9.9.9.9.0 action 3.0 exit 1!snmp-server manager
Then, when you query 1.9.9.9.9.0 on the device, the Tcl policy "my_tcl_policy.tcl" should execute, and the snmp-trigger applet policy will return a value of 0.
Please support CSC Helps Haiti
https://supportforums.cisco.com/docs/DOC-8895
https://supportforums.cisco.com -
Running tcl script in parallel with vi code
i need to run a tcl script from within a vi but i don't want to be blocked by tcl script. right now when i call tcl script within my vi using "system exec" vi, the rest of the code in my vi does not get executed until tcl script exits. i need to run tcl script in parallel.
an equivalent operation in unix can be done by running a script in background using &.
any ideas how to do it in labview.Go to your help menu and select Show Context Help. Move your mouse over the function. You'll now see the help for the function and you can read what the input called 'wait until completion? (T)' means.
-
Runnig TCL script manually?
We are running a TCL script via a cron job with no issue, every 2 minutes and it working like a bomb.
When i try run the script manually via the event manager run xxx.tcl it say that it is not registered?
When i check the sh event manamger policy registed it says it is?
Any ideas?
Regards
NoelYou don't need kron or Tcl for this. You can use the built-in config archive feature of IOS:
http://www.cisco.com/en/US/docs/ios/12_3t/12_3t7/feature/guide/gtrollbk.html#wp1100253
If you do want to go the scheduled route with EEM, start a new thread for your issue. -
TcL Scripting for Cisco IOS,
anyone has idea how useful this book
TcL Scripting for Cisco IOS,
http://www.ciscopress.com/bookstore/product.asp?isbn=1587059541
thank youHi Joe
it is interesting that you are the technical reviewer of this book
i was think to get mid level in Tcl scripting with EEM to give me the ability to implement some automated things
i am good with EEM but Tcl not
will this book take the reader from scratch to tcl scripting ?
thank you and happy new year
Marwan
Maybe you are looking for
-
How can you improve the performance of an hp pavillion a6350z?
Hi, I bought an HP Pavillion a6350z desktop in Feb. of 08. It worked very well the 1st 3 yrs.,but this past yr. I have had constant problems with it. It is VERY slow. My DSL speed is supposed to be up to 4 MBPS download and I have tested it on many
-
I want to change the "solid straight blinking line"....to something easier to see. It is really hard to see it especially in the box where one types in a URL. Thanks
-
I have been looking everywhere to try and figure this out!
-
Hi all, I had created a RFC (function Module) , I called this FM in a program With "BACKGROUND TASK" CALL FUNCTION "ZBAPI_ROUND" BACKGROUND TASK DESTINATION 'NONE' AS SEPARATE UNIT. But I couldn't get the data from the FM , But when I'm
-
I add security to my ADF application. Login.jspx is the first page which does not has PageDef file. Welcome.jspx is the second page. I drop a panelTabbed with a showDetailItem to it. Then, I create a taskflow with only one view and drop it to that sh