EEM Script to reset Dspfarms nightly

Answered Question
May 17th, 2012
User Badges:
  • Cisco Employee,

Hello,


I have been unsuccessful on my own in creating a EEM TCL script to catch, log and reset dspfarms that are down on a nightly basis.


This can be a EEM tcl script or applet that do the following:


1. Run the following command: "show sccp all | Begin MTP"

2. From the outout catch the Profile Identifier of the DSPFarm(s) that have KEEPALIVE_FAILED.

3. Log or append to flash file: If a failed DSPFarm was found log the date and Profile Identifier to the flash file.

4. Email the system admin that Profile Identifiers X, Y and Z were reset.

5. Reset the DSPFarms with KEEPALIVE_FAILED.


Here is an example of the "Show sccp all | Begin MTP" - The actually output is very large.


#    MTP Oper State: ACTIVE - Cause Code: KEEPALIVE_FAILED

#    Active Call Manager: NONE

#    TCP Link Status: CONNECTED, Profile Identifier: 21

#    Reported Max Streams: 1000, Reported Max OOS Streams: 0

#    Supported Codec: g729r8, Maximum Packetization Period: 60

#    Supported Codec: rfc2833 dtmf, Maximum Packetization Period: 30

#    Supported Codec: rfc2833 pass-thru, Maximum Packetization Period: 30

#    Supported Codec: inband-dtmf to rfc2833 conversion, Maximum Packetization Period: 30

#    TLS : ENABLED

#

#    MTP Oper State: ACTIVE - Cause Code: NONE

#    Active Call Manager: 10.97.212.48, Port Number: 2000

#    TCP Link Status: CONNECTED, Profile Identifier: 22

#    Reported Max Streams: 150, Reported Max OOS Streams: 0

#    Supported Codec: g711ulaw, Maximum Packetization Period: 30

#    Supported Codec: rfc2833 dtmf, Maximum Packetization Period: 30

#    Supported Codec: rfc2833 pass-thru, Maximum Packetization Period: 30

#    Supported Codec: inband-dtmf to rfc2833 conversion, Maximum Packetization Period: 30

#    TLS : ENABLED

#

#    MTP Oper State: ACTIVE - Cause Code: NONE

#    Active Call Manager: 10.97.83.32, Port Number: 2000

#    TCP Link Status: CONNECTED, Profile Identifier: 30

#    Reported Max Streams: 1000, Reported Max OOS Streams: 0

#    Supported Codec: g729r8, Maximum Packetization Period: 60

#    Supported Codec: rfc2833 dtmf, Maximum Packetization Period: 30

#    Supported Codec: rfc2833 pass-thru, Maximum Packetization Period: 30

#    Supported Codec: inband-dtmf to rfc2833 conversion, Maximum Packetization Period: 30

#    TLS : ENABLED

#

#    MTP Oper State: ACTIVE - Cause Code: KEEPALIVE_FAILED

#    Active Call Manager: NONE

#    TCP Link Status: CONNECTED, Profile Identifier: 31

#    Reported Max Streams: 1000, Reported Max OOS Streams: 0

#    Supported Codec: g729r8, Maximum Packetization Period: 60

#    Supported Codec: rfc2833 dtmf, Maximum Packetization Period: 30

#    Supported Codec: rfc2833 pass-thru, Maximum Packetization Period: 30

#    Supported Codec: inband-dtmf to rfc2833 conversion, Maximum Packetization Period: 30

#    TLS : ENABLED


Commands to reset the dspfarm profile:

#        WAIT XXX AMOUNT TIME

#        cli_exec $cli(fd) "enable"

#        cli_exec $cli(fd) "configure terminal"

#        cli_exec $cli(fd) "dspfarm profile " + $IDENT     <---- the Profile Identifier

#        cli_exec $cli(fd) "shutdown"

#        cli_exec $cli(fd) "no shutdown"

#        cli_exec $cli(fd) "end"



I would also have to run a command that would limit the EEM TCL or Applet from using all the memory resources on the router. This script will run on a 3945 with 15.0 and 15.1.


Hopefully, someone can help out with this. My attempts have failed and caused router reloads hence the requirement for memory management.


Thanks,

Lee

Correct Answer by Joe Clarke about 4 years 11 months ago

This script should do what you want.  It requires you to set one environment variable in addition to the standard set of email variables like _email_server, _email_from, etc.


This will control where the log file is stored:


event manager environment dspfarm_log flash:dspfarm.log
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
lstonesi Thu, 05/17/2012 - 10:43
User Badges:
  • Cisco Employee,

A small update:


5. Reset the DSPFarms with KEEPALIVE_FAILED at 1:00 am nightly.

Correct Answer
Joe Clarke Sat, 05/19/2012 - 23:28
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

This script should do what you want.  It requires you to set one environment variable in addition to the standard set of email variables like _email_server, _email_from, etc.


This will control where the log file is stored:


event manager environment dspfarm_log flash:dspfarm.log
lstonesi Mon, 05/21/2012 - 11:48
User Badges:
  • Cisco Employee,

Thanks for your help Joseph.


This script did the trick.

Actions

This Discussion

Related Content