EEM $_ipsla_condition variable states
I am trying to build an EEM applet on a 3850 switch that will shut a port off when an sla echo times out and no shut's the port when the sla starts receiving a reply. My problem is I don't believe that I am checking the right state in my if logic because the applet triggers but never enters the if/true actions. I have not been able to find what states are available for the built-in environment variable $_ipsla_condition. Where can I find documentation for that variable. Below is my code:
ip sla 110
icmp-echo 192.168.35.250 source-ip 192.168.0.239
frequency 5
ip sla schedule 110 life forever start-time now
ip sla reaction-configuration 110 react timeout threshold-type immediate action-type trapAndTrigger
event manager environment interface_to_shut GigabitEthernet1/0/48
event manager applet Shut_Main_Uplink
event tag 1.0 ipsla operation-id 110 reaction-type timeout
trigger
correlate event 1.0
attribute tag 1.0 occurs 1
action 1.0 if $_ipsla_condition eq "Occured"
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "int $interface_to_shut"
action 1.4 cli command "shut"
action 1.5 cli command "end"
action 1.6 syslog priority errors msg "192.168.0.250 unpingable; shutting down $interface_to_shut"
action 2.0 else
action 2.1 cli command "enable"
action 2.2 cli command "conf t"
action 2.3 cli command "int $interface_to_shut"
action 2.4 cli command "no shut"
action 2.5 cli command "end"
action 2.6 end
Your applet is right (but you don't need the tag and correlate stuff as you only have one event). The value of Occurred is what you'll see when the threshold is crossed. What you're missing is:
ip sla enable reaction-alerts
ip sla logging traps
Similar Messages
-
Error: "Variable State has been used outside the reusable components"
When I open a query in the ad hoc query designer I get several error messages like "Variable State has been used outside the reusable components." I don't what this means or how to fix it.
"State" is one of the variables used. And there is a error for every variable that is used.
All the variables are in the free characteristics.
When I open the query in Query Designer, it is ok.
Any ideas?Hi Fong,
PLease check the following link:
http://help.sap.com/saphelp_nw04/helpdata/en/1f/03223c5f00612be10000000a11402f/content.htm
It states that:
You cannot integrate variables into the query directly.
However, you can use variables in reusable structures, or restricted or calculate key figures, which are used in the Ad-hoc Query Designer
Hope this helps... -
Using variables: Statement must appear within on handler
I would like to use variables in my flash app. The app is quite simple, has many buttons, and on each of those buttons I have a simple script: on-rollover and on-release. For both actions I use the same value, which I want to put in a variable. The following script results in an error message: Statement must appear within on handler. When I have to declare the variable inside the on-handler, I have to declare it twice, which makes it useless as I have to enter the value twice. How can I get this working?
country = "uk"
on (rollOver)
gotoAndPlay(country)
on (release)
getURL("/"+country+"/", "_self");try:
Select a frame on the timeline where your buttons live and then move the buttons handlers there:
e.g.
myButton1.onPress = onPressFunction
myButton2.onPress = onPressFunction
myButton3.onPress = onPressFunction
etc.etc.
myButton1.onRelease = onReleaseFunction
myButton2.onRelease = onReleaseFunction
myButton3.onRelease = onReleaseFunction
etc.etc.
country = "uk"
function onPressFunction(){
this.gotoAndPlay(country)
function onReleaseFunction(){
getURL("/"+country+"/", "_self");
If you use this approach you MUST remove the scripts from buttons themselves.
I hope this helps. -
Save all variables state for next execution
Hello everybody, I am trying to save all the variables values of my Main VI in order to have the exact same state (same settings, devices addresses, array or enum values and so on) on the next execution of the program.
My idea is to analyze each variable reference and to save its state (variable name+value) in a text data before the program is closed (or for example every 10 minutes).
The problem is that some of my programs have a complex structure (for example a Register Tab with an Array of Clusters with Arrays inside the cluster) and the subVI I developed is getting more and more complex (and I'm not scalable enough) so I am here to ask for ideas in order to reach my goal.
So far I developed a simple subVI that according to the Reference ClassID converts the reference to it's specific type and converts the information (variable name and variable value) to a string, and this works for Strings, Numeric, Boolean and Enum. When I have a Register Tab I analyze each page reference and the references in it, when I have an Array of something simple I run the SubVI, but when the element in the array is a cluster I have to analyze each element through my subVI and so on and so on.
As you can see the complexity grows very fast and I think recursive VI is probably an option (but I don't know how to develope it in my case).
Last but not least I have to find a way to code all those strings that describe the values so that I can read them and set all the values back.
I hope you can help me!! Thanks in advance!
Dario CassanitiThere's actually already a VI in OpenG that can be used to read and store all front panel controls as a variant in a .ini file.
-
SELECT INTO ( variable ) STATEMENTS NOT WORKING FOR SYBASE TABLE AS VIEW
Dear Experts,
We have connected our 9i db with Sybase db using Hs connectivity.
and then we have create the view in oracle db for SYBASE_TABLE as SYBASE_TABLE_VIEW.
ALL THE INSERT, UPDATE AND DELETE COMMANDS ARE WORKING BUT THE
select Into (variable) is not working.
Please help to resolve the select into statment which is in BOLD in the below routine
PLEASE NOTE! FORM WAS COMPILED SUCCESSFULLY AND FORM IS RUNNING BUT SELECT INTO COMMAND IS NOT WORKING.
Thanks & Regards
Eidy
PROCEDURE SRBL_INSERT IS
CURSOR SRBL IS
SELECT impno,impcod,impnam
from oracle_table1 a, oracle_table2 b
WHERE a.impcod=b.empcod
v_srpcod varchar2(5);
BEGIN
FOR rec in SRBL loop
begin
select "im_code" into v_impcod
from SYBASE_TABLE_VIEW
where "im_code"=rec.impcod;
exception when no_data_found then
v_srpcod:=null;
end;
END LOOP;
END;
Edited by: Eidy on Aug 16, 2010 11:28 AMhellow
try this.
select "im_code" into v_impcod
from SYBASE_TABLE_VIEW
where "im_code"=rec.impcod;
v_srpcod := v_impcod ;
........ -
EEM variable for show command output and create a filename
I'm configuring EEM applet, example CPU High event. When it triggers the event, action is "show tech | redirect tftp://x.x.x.x/showtechoutput". The EEM event is working fine and triggered the show tech output into the tftp server. My question is, i'd like to add maybe date/time in the filename so it will not overwrite the file everytime there is a triggered event.
The EEM event variable i'm seeing in doc is "_event_pub_sec" but it won't work when i add after or before the filename. any idea?
thanks in advance ...Adding $_event_pub_sec to the end of the filename should work:
action 1.0 "show tech | redirect tftp://x.x.x.x/showtech.$_event_pub_sec"
That said, TFTP is very particular about how files can be created. Typically, a TFTP server will require the file to exist before a remote host can copy to it. If the filename changes each second, this will not work. Using a protocol like FTP or SCP may work better. -
Hi Gurus,
I am useing Tabs in my Layouts, onces the user in layout after entering the Variables. he can move from one tab to another tab.
We have provided the option Variable button in order the changes the variables. so when the user clicks on this button.
i used this Command used: Open_Variable_Dialog.
I get this message on top of the Variable screen: Please Select a Valid Info Object.
How to get raid of this messages and when the user clicks on the Variable Button ( I want to clear all the Variables that user has entered for this first time so that he can enter it again) i tried useing the REMOVE ALL FILTER VALUES and SET Variables State but this did not work.
Any Idea how the Command Sequence should be in order to achive this.
Thanks
sunilHi Josef,
My Default view is fine.
User can see
- Plant
- BA
- PH 1
- PH 2
- PH 3
- PH 4
User can enter any of these PH Levels and enter the layout. Once they are in the layout I have provided with the variable screen button on top of the Tabs. My Container Layout is like this (Rows Cell Floating)ROW 1 Buttons and Row 2 Tabs.
So when the Click on the Row one Button (Variable Screen) the Variable Entry is opened and it is the same order as Default View but on top if the Variable Entry I see this Error message on Top of this Screen (Please select a Valid InfoObject).
But I did try your option having to separate Container Layout. Still I see this message on top of the Variable screen. which i am trying to get rid
Thanks
sunil -
How do I know if this variable is a file handle?
G'day
(This has also been posted on StackOverflow)
Say I have this code:
function doFileStuff(){
var file = "";
try {
file = fileOpen(filePath);
// do stuff with file
finally {
fileClose(file);
If the fileOpen() process fails, the fileClose() call will error. What I need to do is this sort of thing (pseudocode):
if (isFile(file)){
fileClose(file);
I know I can test if file is an empty string still, and this works for me here, but it's not testing what I should be testing: whether file is a file handle. I can check the object's Java class, but this again sounds a bit hacky to me, and there should be a CFML way of doing it.
There should be something like just isFile(), shouldn't there? I can't find anything like this in the docs.
Any thoughts / tips? I have gone into more depth in my investigations on my blog. it's too wordy for here.
Cheers for any help.
AdamThat would just defer the issue.. fileOpen() doesn't return a boolean, so I can't go:
if (fileOpen(filePath)){
fileClose(file);
fileOpen() returns a file object; or nothing if it fails. The whole thing is to identify whether it's a file. That's the question.
As per my original, it's dead easy to work around, provided one leverages known side effects of the situation (original variable state; that if it's a file it exposes some public properties; that one can doa getClass() on it via Java, etc), but one shouldn't have to work around something as fundamental as this. So I was wondering if I had missed something.
Seemingly not (based on feedback I've had from various quarters).
Adam -
EA3/EA2/EA1 - Bind Variables in PL/SQL
EA1 seems to have taken a backward step when it comes to supporting bind variables in PL/SQL.
Back in 1.1.3, according to the bugs fixed list, we apparently fixed bug 5884935 (BINDS IN A PL/SQL STATEMENT HAS "NOT ALL VARIABLES BOUND" ERROR), although this was only ever when running as scripts (as per Bind variables in PLSQL bug not fixed?
Now according to the 1.2 documentation, bind variables are not supported in the script runner (section 1.7.2) and the SQL*Plus variable command is not supported (section 1.7.1). However, I can run the following code "successfully" (no errors reported but the substitution text entered does not appear in the dbms_output):
variable bind_text varchar2(30);
declare
l_text varchar2(30);
begin
:bind_text := '&sub_text';
dbms_output.put_line('Bind text: "' || :bind_text || '"');
end;
Now in EA1, running this as a script results in "ORA-01006: bind variable does not exist"
Running the variable statement results in "ORA-00900: Invalid SQL Statement" and running the PL/SQL results in "ORA-1008: not all variables bound".
Can someone from the SQL Developer team please comment on the intended support for bind variables in PL/SQL?
Thanks,
theFurryOneI know that the variable command isn't supported (as I said above), but that was also the case in 1.2, where it did actually sort of work.
I am not talking about local PL/SQL variables declared within the PL/SQL - I am trying to get user entered values into the PL/SQL in the same way as prompting for bind variable values in SQL.
So using SQL Developer bind variables inside PL/SQL is my end goal - preferably when running anonymous PL/SQL blocks as statements in the worksheet.
However, as there have been "fixed" bugs to enable bind variables in PL/SQL, which require the use of SQL Plus commands that are not supported in SQL Developer (ie variable), I am trying to work out what the development team think the intended support for bind variables in PL/SQL is. Then I will know if what I want needs to be reported as a bug or logged as an enhancement request.
theFurryOne -
BC4J ApplicationModule Pooling and persitent package variables
Scenario:
HttpRequest
starts=> - use SessionCookie API to get an Application Module
- call pck.set_id (packaged procedure which sets i++ )
- call pck.get_id (packaged function returning value of i)
finish=> release application Module (***)
What I've seen:
(***) When release statelessly
Two browser sessions (could) get the same Application Module, in which case the 'i' value is incremented 'by' both browser sessions.
(***) When release statefully
Two browser sessions get their 'own' Application Module and manipulate their own 'i' value (even) between consequitive HTTP Requests.
If both situations are explained and viewed correctly, does BC4J application module pooling guarantee that whenever I want to use an AM statefully I get persistent package variable state reproduced in that AM???
If I understand correctly this doesn't mean I get the 'same' AM instance each time, but the BC4J Application Module pooling makes sure that whichever AM I get has state reproduced?
Thx for explaining/affirming?
-J.Scenario:
HttpRequest
starts=> - use SessionCookie API to get an Application Module
- call pck.set_id (packaged procedure which sets i++ )
- call pck.get_id (packaged function returning value of i)
finish=> release application Module (***)
What I've seen:
(***) When release statelessly
Two browser sessions (could) get the same Application Module, in which case the 'i' value is incremented 'by' both
browser sessions.
(***) When release statefully
Two browser sessions get their 'own' Application Module and manipulate their own 'i' value (even) between
consequitive HTTP Requests.
If both situations are explained and viewed correctly, does BC4J application module pooling guarantee that whenever
I want to use an AM statefully I get persistent package variable state reproduced in that AM???In scenario2 above the reason that two different ApplicationModule instances are returned for each
respective session is that the pool has not yet hit its recycle threshold. Once this threshold is hit then the pool will
begin "recycling" the state managed instances and you will observe the same behaviour as in scenario 1.
If I understand correctly this doesn't mean I get the 'same' AM instance each time, but the BC4J Application Module
pooling makes sure that whichever AM I get has state reproduced?This is true for the state that BC4J is aware of (i.e. iterator state, pending transactional changes, etc).
However, BC4J cannot reproduce user state, like the PL/SQL session state that you have defined above. In order
to maintain "user" state it is necessary to:
1. passivate/activate the user state when BC4J passivates/activates its own state. BC4J currently provides a hook for
this via ApplicationModuleImpl.passivateState(Document, Element) and ApplicationModuleImpl.activateState(Element).
2. reset user state when BC4J recycles an ApplicationModule. 9.0.2 does not define a great mechanism for
resetting user state. However, the upcoming maintenance release will provide an ApplicationModuleImpl.reset
hook to clean up session state properly when an ApplicationModule is recycled.
Hope this helps. -
Java static variables in Stored Java
I'm wondering if someone in Oracle could relate their thinking with regards to static variables in stored java and why were these implemented as they were. The aspect I'm referring to specifically is how these are basically working as PLSQL package variables, i.e. with state maintained for the life of the session.
Outside the database, in the "normal" Java world, statics will only live as long as the program is running. But in the Oracle DB world, the static continues to live as long as the session. With this in mind, doesn't this difference compromise the idea of just inserting working Java code into the Database? i.e. static variables now have to be initialized every time a method is called, and cannot be assumed to have default values. Does that not seem like a rather large departure from what a non-DB java programmer would be doing?
Thanks in advance for your thoughts on this.
Joe TsengIt should generally be the case that all calls in a session see the same static variable values. Some actions will terminate the java session (and lose the static variable state) without ending the RDBMS session, such as calling System.exit from java, but normally this can't happen within a single RDBMS call. Perhaps if you give more details on how you are making the call from java to PLSQL one could say more. In particular, if the call happens to be via the JDBC thin driver then the session running in the JDBC connection will be distinct from the calling session.
-
Auto Email on event - EEM script for NxOS
I generated EEM script for Duplicate IP address detection, but i do not know how to trigger email in NxOS.
event manager environment emailto "[email protected]"
event manager applet Duplicate_IP
description "Detect Duplicate IP and Send Trap"
event syslog pattern "%ARP-2-DUP_SRC_IP"
action 1.0 snmp-trap strdata "Duplicate IP Detected on Host $hostname"
action 2.0 cli sh logg last 100
action 3.0 event-default
Somebody know how to trigger email. There is no good document on EEM email triggering mechanism.Not sure if this would work in NxOS but I think it would go something like this;
Specify the action of sending a short e-mail when the EEM applet is triggered via the event syslog pattern you already have defined:
Router(config-applet)# action label mail server server-address to to-address from from-address subject subject body body-text
Remember to define the EEM environment variables first when setting up the applet as follows:
event manager environment _email_server
event manager environment _email_to
event manager environment _email_from -
I am using the shared variable engine to bind shared variables to an OPC server (DSC/Labview 8.5)
When using read only variables, all works OK
When using a read/write variable (specified either R/W or W only in the shared variable definition), the shared variable engine hangs, and needs to be stopped and restarted for the program to work again. If the engine is not stopped and restarted, I basically get a shared variable is not located error (same as if I stopped the service manually)
I have tried synchronous or asynch writing as per the OPC Client I/O Server Advanced tab definitions (as well as In or Out of process).
Any idea why writes would be failing, but reads are working OKa timed loop fires say every 1 sec, so I may have up to 1 sec latency between the clicking of a switch, an the action required.
If I set the loop interval to less than 500 ms, then I get long delays between the writing to the variable, and when it actually occurs. Even shorter times, I may never see the change in the variable.
I don't need fast updates, I just need them to start occurring without a delay when the event happens. In addition, if possible to have some way to allow the next setting of the variable to happen when the first one is finished.
In effect the sequence required is
1) Write to the variable
2) dissallow any further writes to the variable
3) check if the variable state has changed to that expected, and reallow variable write access
4) have a safety check, so if the write does not happen after a given time, time out, and reallow variable writes -
Hi,
I'm implementing an ASP Javascript page where the items in a
database are returned and sorted based on the results of a
drop-down function. I have it working as follows:
var Recordset1__MMColParam = "Cutting";
if (String(Request("MM_EmptyValue")) != "undefined"
String(Request("MM_EmptyValue")) != "") {
Recordset1__MMColParam = String(Request("MM_EmptyValue"));
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
if not isempty(request("Select")) then
select case request("Select")
case "Brand"
sql="SELECT * FROM Products WHERE Department = ? ORDER BY
Brand;"
case "High"
sql="SELECT * FROM Products WHERE Department = ? ORDER BY
Our_Price DESC;"
case "Low"
sql="SELECT * FROM Products WHERE Department = ? ORDER BY
Our_Price ASC;"
end select
else
sql="SELECT * FROM Products WHERE Department = ? ORDER BY
special_sort ASC;"
end if
</script>
<%
var Recordset1_cmd = Server.CreateObject ("ADODB.Command");
Recordset1_cmd.ActiveConnection = MM_stark_and_whyte_STRING;
Recordset1_cmd.CommandText = "SELECT * FROM Products;"
Recordset1_cmd.CommandText = sql;
Recordset1_cmd.Prepared = true;
Recordset1_cmd.Parameters.Append(Recordset1_cmd.CreateParameter("param1",
200, 1, 255, Recordset1__MMColParam)); // adVarChar
var Recordset1 = Recordset1_cmd.Execute();
var Recordset1_numRows = 0;
%>
The issue is the line in bold, setting the SQL statement to
be a variable statement where all the parameters are resolved
outside of Dreamweaver, except for the Department, which is defined
by MMColParam. When setting
Recordset1_cmd.CommandText = sql, Dreamweaver no longer
displays the Recordset1 in the Server Behaviour window and all the
server behaviours on the page have a red exclamation mark --
however, the page itself works perfectly (including all server
behaviours). Since I no longer see the Recordset in the server
behaviour window or in the Bindings tab, I can't add new behaviours
or add new bindings to the page (without hand-coding it).
Any ideas?
Neal.MacGyver_971 wrote:
> That's kinda silly. There are many things you cannot do
within the Recordset
> dialog box, and it hasn't changed in years either. Add
to that, I've tried
> (unsuccessfully) to install the updated ADDT for CS4,
which may give me
> additional flexibility, but DW simply crashes when that
extension is installed.
ADDT is not yet compatible with CS4. I've heard others
mention early 2009 was when it would be released, but no news
recently.
> So how are we supposed to create something relatively
simple within
> Dreamweaver like sort a database based on the results of
a drop-down list box
> -- without breaking DW?
It's easy to filter a column value from a form field,
however, Dreamweaver seems to not be able to handle dynamic column
names (which you're doing) or even dynamic sort orders. And I'm
sure there are a number of other things that DW will potentially
choke on. As long as you end up with valid SQL, the generated
recordset can be used, but as you've seen the recordset may not be
available in the Server Behaviors panel, or in the bindings panel.
Here's a suggestion:
1. Copy your recordset opening code block. From your earlier
post:
<%
var Recordset1_cmd = Server.CreateObject ("ADODB.Command");
Recordset1_cmd.ActiveConnection = MM_stark_and_whyte_STRING;
Recordset1_cmd.CommandText = "SELECT * FROM Products;"
Recordset1_cmd.CommandText = sql;
Recordset1_cmd.Prepared = true;
Recordset1_cmd.Parameters.Append(Recordset1_cmd.CreateParameter("param1",
200,
1, 255, Recordset1__MMColParam)); // adVarChar
var Recordset1 = Recordset1_cmd.Execute();
var Recordset1_numRows = 0;
%>
2. Paste that code immediately after the code block you
copied.
3. Delete the line with your sql variable.
4. Then comment out the code by adding /* at the beginning
and */ at the end. Like so:
<%
var Recordset1_cmd = Server.CreateObject ("ADODB.Command");
Recordset1_cmd.ActiveConnection = MM_stark_and_whyte_STRING;
Recordset1_cmd.CommandText = "SELECT * FROM Products;"
Recordset1_cmd.Prepared = true;
Recordset1_cmd.Parameters.Append(Recordset1_cmd.CreateParameter("param1",
200,
1, 255, Recordset1__MMColParam)); // adVarChar
var Recordset1 = Recordset1_cmd.Execute();
var Recordset1_numRows = 0;
%>
That should allow you to have DW recognize the recordset from
the commented out code block and not the one that you're generating
dynamically.
In a quick test locally, that seemed to work fine for ASP
JavaScript. For others listening in, ASP VBScript may not work out
so well as it doesn't allow for multi-line comments (that I'm aware
of), and you may run into issues with re-dimmed variables, so play
around with commenting out some lines and maybe you'll find a combo
that works.
Danilo Celic
|
http://blog.extensioneering.com/
| WebAssist Extensioneer
| Adobe Community Expert -
Cisco EEM 2.1 applet monitoring question
I need assistance in configuring an eem applet using an 1841 router running IOS version 12.4(3c) and eem version 2.1. I need the applet to monitor multiple interfaces with condition if all interfaces are down for 15 seconds to execute a clear line 3. This is condition is straight forward when using eem version 3.0/ IOS 15.1 because you can track a list and capture the syslog pattern. When using IOS 12.4(3c), the syslog message does not appear when tracking list object is down. Any ideas on how get this to work?
Thanks.This should give you what you want. You will need to set four EEM environment variables first.
intfs_interval : Time to check the tracked object stateintfs_track : Tracked object IDintfs_line : Line to clearintfs_time : Time to wait before the line is cleared
For example:
event manager environment intfs_interval 60event manager environment intfs_track 5event manager environment intfs_line 3event manager environment intfs_time 15
You will still need your tracked object that watches all interfaces (ID number 5 in the example above).
Maybe you are looking for
-
How to put your money from one apple ID to a different apple ID
does any one know how to do that if u do pls help
-
after using the pram to speed up my restart I am getting a circle with a line onn the apple screen
-
Can open internet Explorer, but not FireFox!
-
Problem with JDBC deploying to App Server 8.1
Hi, I'm trying to deploy my application onto App Server PE 8.1, and it connects to an Oracle database. I created the connection as described in the Creator 2 tutorial, but when I attempt to ping I get the following error: [sunm][Oracle JDBC Driver]OS
-
Java Virtual Machine Tutorials
Hey Everyone, Does anybody know where a good tutorial on the workings of the Java Virtual Machine can be found? I am particularly looking for information on how class loading takes place. Ideally I am looking for a tutorial that isn't to specificatio