Command execution on Cisco routers
Stanley Hopcroft
Stanley.Hopcroft at IPAustralia.Gov.AU
Fri Oct 1 05:42:30 CEST 2004
Dear Sir,
I am writing to thank you for your letter and say,
On Thu, Sep 30, 2004 at 08:09:45PM -0700, nagios-users-request at lists.sourceforge.net wrote:
>
> Message: 7
> Date: Thu, 30 Sep 2004 22:10:58 +0200
> From: Horvath Tamas <zsitfa at axelero.hu>
> To: nagusers <nagios-users at lists.sourceforge.net>
> Subject: [Nagios-users] Command execution on Cisco routers
>
> Hi members!
>
> I would like to run some commands on Cisco routers via Nagios. I'm going
> to write a simple shell script as a Nagios plug-in, but I've didn't
> managed to handle Telnet interactive behavior (give it automatically the
> username and password) yet.
>
> I need this method, because I don't do what I want via SNMP. I can use
> Telnet, because I access our routers via IPSec VPN, but I can use SSH as
> well, if someone know a working solution for SSH.
>
> Did someone managed to do this?
>
I am using Expect/TCL in a Nag plugin to do this (check that a
backup link is up by using the router CLI to ping the other end of an
ISDN circuit).
However, done again I would use Perl with either of the CPAN modules
Net::Telnet::Cisco
Net::Telnet
Expect
This is because Perl is easier to use than Expect/TCL for this
application and the plugins more reliable (much easier to eliminate
errors that should be trapped at compile time).
Net::Telnet::Cisco is particuarly nice to use.
OTOH, if want to have Nag periodically download configs, use RANCID +
cron.
(The problem with ssh is that not all Ciscos support it. If you have ssh
on your router, then all of these approaches can be used for ssh).
> Any help would be appreciate!
>
> Thanks, Tamas!
Yours sincerely.
--
Stanley Hopcroft
Network specialist, IT Infrastructure
IP Australia
Ph: (02) 6283 3189 Fax: (02) 6281 1353
PO Box 200 Woden ACT 2606
http://www.ipaustralia.gov.au
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list