09-22-2013 04:49 PM - edited 03-07-2019 03:37 PM
Dears,
I have the following EEM script:
event manager applet CPU_Test
event snmp oid 1.3.6.1.4.1.9.2.1.58.0 get-type exact entry-op ge entry-val "10" poll-interval 0.5
action 1.0 mail server "192.168.1.1" to "essmmamn@gmail.com" from "Router@mail.com" cc "noc@mail.com" subject "EEM Script test" body "The test is Ok! EEM Script executed successfully!" source-address 192.168.1.4
I want to complete this script to do the following:
Send an E-mail only for once as long as the CPU threshold is exceeding the threshold value (10%), and when the CPU is lower than another threshold (5%) it will send another E-mail only for once informing that the CPU utilization is normal now.
Also I need another option to run this script only for once and then it will be disabled or distroyed, whatever.
Could you please assist me in this configuration?
Best Regards,
09-22-2013 08:03 PM
Hello,
You can created two different EEM scripts. One for CPU going higher than certain threshold and another going below that threshold. Then you can crate some non-feasible exit value for the correpsonding script. E.G. if script expecting CPU to raise above threshold you can specifiy exit value to ve above 100 which wont be reached and script will never rerun. Similar with the second one:
exit-op eq exit-val 101
orexit-op eq exit-val 0Niko
09-23-2013 05:21 AM
Thanks, but I have some questions:
1-What about running the script to be triggered for only one time and then destroyed, what is the required configuration? (you didn't reply on this point)
2-With your suggestion, If the CPU utilization reached the threshold value and the script is executed once, then the CPU utilization went down under the threshold again, will the script going to be executed again?
This question is because I think (and correct me if I'm wrong) that the exit-op eq exit-val 101 will keep the script in a closed loop untill the condition of exit-val 101 is met which will never happen, and hence it will not execute again if the CPU threshold is reached again which is not acceptable for me.
Best Regards,
09-24-2013 07:59 PM
Hello,
Seems that I did not get you. What do you mean by destroying script? Removing it form config? The way I suggested will do the following:
- it will hit once when CPU got higher tan threshold. It will then wait for exit event to restart again. As the exit event will never happen - it wont restart and never run once again.
Can you just explain on examples on what you want to do with script. I thought you wanted to run it once but as per your last statement you want it still to be able to re-run so get confused here.
Niko
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide