08-22-2010 05:49 PM
Hi Guys...
I want to write script which will check CPU and Memory Utilization every 2 hours and send a mail to monitoring team and when utilization reaches to a certain level.
regards
Dbn
Solved! Go to Solution.
08-22-2010 07:57 PM
Are you looking to do with with the Embedded Event Manager (i.e. on-box) or do you need to have an external script to collect this information?
08-23-2010 12:06 AM
This applet assumes that your device only has one CPU:
event manager applet watch-cpu
event snmp oid 1.3.6.1.4.1.9.9.109.1.1.1.1.11.1 entry-op ge entry-val 70 poll-interval 7200 get-type exact
action 1.0 mail to addr@company.com from addr@company.com subject "High CPU" server 10.1.1.1 body "CPU is currently at $_snmp_oid_val %"
This will send an email to addr@company.com if the CPU utilization reachs 70%.
For memory, you could use:
event manager applet watch-mem
event snmp oid 1.3.6.1.4.1.9.9.48.1.1.1.6.1 entry-op le entry-val 4194304 poll-interval 7200 get-type exact
action 1.0 mail to addr@company.com from addr@company.com subject "Low Free Memory" server 10.1.1.1 body "Free memory is currently at $_snmp_oid_val bytes"
This will send an email if free memory dips below 4 MB.
For external scripting, I suggest you look into the Expect programming language. You can use this to wrap programs like telnet and SSH to connect to devices and run arbitrary CLI commands.
08-22-2010 07:57 PM
Are you looking to do with with the Embedded Event Manager (i.e. on-box) or do you need to have an external script to collect this information?
08-22-2010 11:52 PM
Hi ,
I want to do with EEM. Please also guide for external scripts.
thanks in adv
Deben
08-23-2010 12:06 AM
This applet assumes that your device only has one CPU:
event manager applet watch-cpu
event snmp oid 1.3.6.1.4.1.9.9.109.1.1.1.1.11.1 entry-op ge entry-val 70 poll-interval 7200 get-type exact
action 1.0 mail to addr@company.com from addr@company.com subject "High CPU" server 10.1.1.1 body "CPU is currently at $_snmp_oid_val %"
This will send an email to addr@company.com if the CPU utilization reachs 70%.
For memory, you could use:
event manager applet watch-mem
event snmp oid 1.3.6.1.4.1.9.9.48.1.1.1.6.1 entry-op le entry-val 4194304 poll-interval 7200 get-type exact
action 1.0 mail to addr@company.com from addr@company.com subject "Low Free Memory" server 10.1.1.1 body "Free memory is currently at $_snmp_oid_val bytes"
This will send an email if free memory dips below 4 MB.
For external scripting, I suggest you look into the Expect programming language. You can use this to wrap programs like telnet and SSH to connect to devices and run arbitrary CLI commands.
08-23-2010 12:54 AM
HI Joseph,
Thanks a lot.
RGDS
Deben
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