Rebooting interface using SNMP

Answered Question
Apr 24th, 2008

Hi,

I want to reboot my voice-port each morning at 7:00 am using th SNMP.

So I want to use a script, like shell, that I can schedule, into a linux machine.

This script will reboot one interface of the router.

Is it possible?

Thank you

I have this problem too.
0 votes
Correct Answer by Joe Clarke about 8 years 7 months ago

This is similar to a UNIX cron entry. This says to run the EEM policy every day at 0700. Cron timer policies require your router's clock to be authoritative, so it would best to configure NTP on this device.

Correct Answer by Joe Clarke about 8 years 7 months ago

You're missing an "end" after your CLI commands (I meant to include this in my example). And you probably want to change the syslog message since none of your voice-ports are 1/0.

action 15.0 cli command "end"

action 16.0 syslog msg "Bounced all voice ports"

Of course, all of this assumes performing a shut/no shut on these voice ports is what you want.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (4 ratings)
Loading.
Joe Clarke Thu, 04/24/2008 - 08:32

You can use SNMP to set the ifAdminStatus of the voice port interface to down then up to bounce the interface. Of course, if this router is running a new enough version of IOS (12.3(14)T or higher), you can use the Embedded Event Manager to do this:

event manager applet bounce_voice

event timer cron cron-entry "0 7 * * *"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "voice-port 1/0"

action 4.0 cli command "shut"

action 5.0 cli command "no shut"

action 6.0 syslog msg "Bounced voice-port 1/0"

connect101 Thu, 04/24/2008 - 09:20

Thank you,

And if I have 4 voice-port I do these commands ? Like this :

event manager applet bounce_voice

event timer cron cron-entry "0 7 * * *"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "voice-port 0/0/0:15"

action 4.0 cli command "shutdown"

action 5.0 cli command "no shutdown"

action 6.0 cli command "voice-port 0/0/1:15"

action 7.0 cli command "shutdown"

action 8.0 cli command "no shutdown"

action 9.0 cli command "voice-port 0/2/0:15"

action 10.0 cli command "shutdown"

action 11.0 cli command "no shutdown"

action 12.0 cli command "voice-port 0/2/1:15"

action 13.0 cli command "shutdown"

action 14.0 cli command "no shutdown"

action 15.0 syslog msg "Bounced all voice ports 1/0"

Correct Answer
Joe Clarke Thu, 04/24/2008 - 09:28

You're missing an "end" after your CLI commands (I meant to include this in my example). And you probably want to change the syslog message since none of your voice-ports are 1/0.

action 15.0 cli command "end"

action 16.0 syslog msg "Bounced all voice ports"

Of course, all of this assumes performing a shut/no shut on these voice ports is what you want.

connect101 Thu, 04/24/2008 - 10:07

Hi,

Can you explain the line :

event timer cron cron-entry "0 7 * * *"

Best regards

Correct Answer
Joe Clarke Thu, 04/24/2008 - 10:18

This is similar to a UNIX cron entry. This says to run the EEM policy every day at 0700. Cron timer policies require your router's clock to be authoritative, so it would best to configure NTP on this device.

connect101 Thu, 04/24/2008 - 10:27

I've missed this question,

What does mean the line :

action 10.0

Can I do :

action 1.0

action 1.1

action 1.2

.

.

.

Best regds

Joe Clarke Sat, 04/26/2008 - 09:49

Yes, you can label the actions anyway you want. They will be executed in lexicographical order. Some people also choose letters:

AA0

AA1

...

AB0

Actions

This Discussion