cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2899
Views
0
Helpful
5
Replies

Shutdown muliple interface by EEM

Vinod Hira
Level 1
Level 1

Hello Guys

 

I have a problem with multiple Nortel VOIP phone which are connected to Cisco3750G stack and due to the designed fault in power module of the phone, all the phones slowly failing. We have find the solution to fix phone power module but the solution I am looking for here is the EEM script which can provide the solution for following reason:

 

Every time any phone fails, switch generate the syslog such as “%ILPOWER-3-CONTROLLER_PORT_ERR: Controller port error, Interface Gi1/0/12: Power Controller reports power Imax error detected” and it’s generating error and keep filling up the log and until you remove the phone or we shut the interface.

 

Our syslog server keep alerting via email for every entry and filling up the mailbox.

 

I have created the EEM script as follows:

 

event manager applet POWER_DETECT

 event syslog pattern "Controller port error"

 action 1.0 syslog msg " Interface Gi1/0/12: Power Controller reports power Imax error detected"

 action 2.0 cli command "enable"

 action 3.0 cli command "conf t"

 action 4.0 cli command " interface Gi1/0/12 "

 action 5.0 cli command "shut"

 action 6.0 cli command "end"

!

end

 

This is working fine but it’s only works for one interface so what modification EEM requires or what regexp needed so one EEM can do for any interface which report this error.

 

Thank you.

 

 

2 Accepted Solutions

Accepted Solutions

Change action 0.0 to:

 

action 0.0 regexp "Interface ([^:]+)" "$_syslog_msg" match intf

View solution in original post

In addition to the Cisco.com docs, go to http://ciscolive.com/online and search for EEM.  There are a lot of presentations that have been given on the subject at CiscoLive.  I've personally done BRKNMS-3021 and BRKNMS-2030 that cover different aspects of EEM.

 

Also, the examples and threads on this forum can be a good learning guide.

View solution in original post

5 Replies 5

Joe Clarke
Cisco Employee
Cisco Employee

Add:

 

action 0.0 regexp "Interface ([^,]+)" "$_syslog_msg" match intf

action 1.0 syslog msg "Interface $intf: Power Controller reports power Imax error detected"

...

action 4.0 cli command " interface $intf"

Hi Joseph

 

Thank you so much for your quick response but sorry, due to the weekend, I couldn’t test it.

 

I have tested and looks like it’s partially working. EEM finding the related affected interface but in CLI ACTION it’s putting whole syslog message in interface command, that’s why it’s failing.

 

This is the EEM as you have suggested:

 

event manager applet POWER

 event syslog pattern "Controller port error"

 action 0.0 regexp "Interface ([^,]+)" "$_syslog_msg" match intf

 action 1.0 syslog msg "Interface $intf: Power Controller reports power Imax error detected"

 action 2.0 cli command "enable"

 action 3.0 cli command "conf t"

 action 4.0 cli command " interface $intf"

 action 5.0 cli command "shut"

 action 6.0 cli command "end"

!

End

 

AND below the debug report:

 

Switch#

%ILPOWER-7-DETECT: Interface Gi1/0/12: Power Device detected: IEEE PD

: %ILPOWER-5-POWER_GRANTED: Interface Gi1/0/12: Power granted

%ILPOWER-3-CONTROLLER_PORT_ERR: Controller port error, Interface Gi1/0/12: Power Controller reports power Imax error detected

%HA_EM-6-LOG: POWER: Interface Gi1/0/12: Power Controller reports power Imax error detected: Power Controller reports power Imax error detected

: %HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : CTL : cli_open called.

: %HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT :

 Switch>

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : IN  : Switch>enable

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT : Switch#

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : IN  : Switch#conf t

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT : Enter configuration commands, one per line.  End with CNTL/Z.

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT : Switch(config)#

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : IN  : Switch(config)# interface Gi1/0/12: Power Controller reports power Imax error detected

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT :  interface Gi1/0/12: Power Controller reports power Imax error detected

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT :                     ^

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT : % Invalid input detected at '^' marker.

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT :

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT : Switch(config)#

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : IN  : Switch(config)#shut

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT : % Incomplete command.

: %HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT :

%HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT : Switch(config)#

*Mar  1 02:38:47.008: %HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : IN  : Switch(config)#end

: %SYS-5-CONFIG_I: Configured from console by  on vty0 (EEM:POWER)

: %HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : OUT : Switch#

: %HA_EM-6-LOG: POWER : DEBUG(cli_lib) : : CTL : cli_close called.

 

Could you please investigate?

 

Thank you.

 

Vinod

 

Change action 0.0 to:

 

action 0.0 regexp "Interface ([^:]+)" "$_syslog_msg" match intf

Hi Joseph

Hurrreyyyy!!!

Well done buddy you are genius.

It's working now as expected as I have tested on multiple interface and EEM shutting the any numbers of affected interface.

Thank you so much, you are a life saver.

Now if you don't mind then could you please suggest me any good training material for this as I am really keen to learn this.

Once again I really appreciated you and this community.

God bless!!!

Vinod

 

 

In addition to the Cisco.com docs, go to http://ciscolive.com/online and search for EEM.  There are a lot of presentations that have been given on the subject at CiscoLive.  I've personally done BRKNMS-3021 and BRKNMS-2030 that cover different aspects of EEM.

 

Also, the examples and threads on this forum can be a good learning guide.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: