06-07-2021 11:37 PM
hi all
I have a question regarding the EEM feature, I have a catalyst 4500 switch with the version (cat4500e-universalk9.SPA.03.11.02.E.152-7.E2.bin ").
I have looked for documentation regarding the sending of temperature alarms and that these are sent via email, I have carried out a test through an interface and this is satisfactory.
when entering the command "show environment temperature "
throws me the following:
Module Sensor Temperature Status
------+--------------------------+--------------------+------------
1 Air inlet 34C (56C,68C,71C) ok
1 Air inlet remote 23C (46C,59C,62C) ok
1 Air outlet 36C (66C,76C,79C) ok
1 Air outlet remote 29C (60C,71C,74C) ok
2 air inlet 26C (43C,58C,61C) ok
2 air outlet (front) 27C (51C,66C,69C) ok
2 air outlet (back) 28C (43C,58C,61C) ok
3 Stub A 34C (58C,71C,74C) ok
3 Stub B 27C (54C,68C,71C) ok
3 XPP 46C (67C,81C,84C) ok
3 VFE 57C (79C,90C,93C) ok
3 NFE 46C (68C,80C,83C) ok
3 CPU 46C (69C,83C,86C) ok
3 FPGA 32C (57C,71C,74C) ok
4 Stub A 31C (58C,71C,74C) ok
4 Stub B 26C (54C,68C,71C) ok
4 XPP 45C (67C,81C,84C) ok
4 VFE 52C (79C,90C,93C) ok
4 NFE 42C (68C,80C,83C) ok
4 CPU 43C (69C,83C,86C) ok
4 FPGA 31C (57C,71C,74C) ok
5 Air inlet 34C (56C,68C,71C) ok
5 Air inlet remote 25C (46C,59C,62C) ok
5 Air outlet 35C (66C,76C,79C) ok
5 Air outlet remote 29C (60C,71C,74C) ok
6 Air inlet 34C (56C,68C,71C) ok
6 Air inlet remote 25C (46C,59C,62C) ok
6 Air outlet 36C (66C,76C,79C) ok
6 Air outlet remote 31C (60C,71C,74C) ok
7 Air inlet 38C (56C,68C,71C) ok
7 Air inlet remote 27C (46C,59C,62C) ok
7 Air outlet 39C (66C,76C,79C) ok
7 Air outlet remote 33C (60C,71C,74C) ok
My question is, can temperature alarms be generated and these can be sent via mail, I can generate by means of EEM, the sending of the first temperature threshold of each module and sensor?
note: I share my script, based on one where cpu notifications were sent
event manager environment _email_to (xxxxxx)
event manager environment _email_server (xxxxxx)
event manager environment _dns_server (xxxxxxx)
event manager environment _email_from (xxxxxxx)
event manager environment _email_from_cc (xxxxxxx)
event manager applet environment
event syslog pattern "%ENVMON-:"
trigger
action 1.0 syslog priority notifications msg "envi error - mailC1 sent"
action 1.5 mail server "104.x.x.x" to "_email_to" from "_email_from" cc "_email_from_cc" subject "Environment" body "$_syslog_msg"
action 2.0 info type syslog history
action 2.5 syslog msg "$_syslog_msg"
action 3.0 cli command "show environment temperature"
action 4.0 set lines "0"
action 5.0 foreach line "$_cli_result" "\n"
action 6.0 if $lines gt "30"
action 7.0 break
action 8.0 append output "$line"
action 9.0 increment lines
regards!
Solved! Go to Solution.
06-08-2021 04:14 AM
Ok no issue, the way you configured CPU, you get an alert in event when the chassis temp go higher ( you can also do with SNMP if you have any NMS in house)
based in the Logs you can generate email. (same way you do in EEM) - for now all OK you wont be able to test (not you can simulate in production)
just for reference how the alerts generated when the chassis get higher temp.
06-08-2021 12:12 AM - edited 06-08-2021 04:06 AM
For now you doing based on the syslog alert trigger sending email, this is working, just to clarity of requirement, you looking ""show environment temperature " command send email using EEM Script ? is this correct ?
action 1.0 cli command "show environment temperature | redirect flash:environ.txt"
action 2.0 cli command "more flash:environ.txt"
action 3.0 mail server "x.x.x.x" to "myname@bb.com" from "eemcisco@bb.com" subject "Environment report" body "$_cli_result"
action 4.0 cli command "del /force flash:environ.txt"
06-08-2021 12:50 AM
06-08-2021 04:14 AM
Ok no issue, the way you configured CPU, you get an alert in event when the chassis temp go higher ( you can also do with SNMP if you have any NMS in house)
based in the Logs you can generate email. (same way you do in EEM) - for now all OK you wont be able to test (not you can simulate in production)
just for reference how the alerts generated when the chassis get higher temp.
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