Page 1 of 2

check_cisco_ping

Posted: Tue Nov 12, 2013 11:26 am
by debashmit
How to use check_cisco_ping plugin in Nagios core for Monitoring vrf Links.

Re: check_cisco_ping

Posted: Tue Nov 12, 2013 11:41 am
by tmcdonald
Have you looked at the help output of the plugin?

Code: Select all

[root@localhost libexec]# ./check_cisco_ping --help
Parameter to use lib must be directory, not file at ./check_cisco_ping line 31
check_cisco_ping v1.0 (nagios-plugins 1.4.13)
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute
copies of the plugins under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Copyright (c) 2005 Colin Stubbs <[email protected]>

This plugin runs commands on a Cisco device via telnet
Usage: check_cisco_ping -H <host> -u <username> -p <password> -r <router address>
                  -w <wrta,wpl>% -c <crta,cpl>% [-vrf <vrf>] [-P <packets>]
                  [-h <help>] [-V]

-r, --router=HOST
   Name or IP address of Cisco device to run ping on
-H, --hostname=HOST
   Name or IP address to ping
-u --username=USERNAME
   Username to login with
-p --password=PASSWORD
   Password to login with
-v --vrf=VRF
   VRF routing target
-P --packets=5
   Number of ICMP ECHO packets to send (Default: 5)
-w --warning=THRESHOLD
   Warning threshold pair
-c --critical=THRESHOLD
   Critical threshold pair
-h --help
   This screen
-V --version
   Plugin version
THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel
time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the
percentage of packet loss to trigger an alarm state.


Send email to [email protected] if you have questions
regarding use of this software. To submit patches or suggest improvements,
send email to [email protected].
Please include version information with all correspondence (when possible,
use output from the --version option of the plugin itself).

Note that "-vrf" should either be "--vrf" or just "-v".

Re: check_cisco_ping

Posted: Wed Nov 13, 2013 4:17 am
by debashmit
Hi tmcdonald
thanks for reply mu query.But i get below out put when i put this commnad.

[root@localhost libexec]# ./check_cisco_ping --help
Parameter to use lib must be directory, not file at ./check_cisco_ping line 31
Can't locate Net/Telnet/Cisco.pm in @INC (@INC contains: utils.pm /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./check_cisco_ping line 34.
BEGIN failed--compilation aborted at ./check_cisco_ping line 34.

Re: check_cisco_ping

Posted: Wed Nov 13, 2013 10:18 am
by tmcdonald
debashmit wrote: Can't locate Net/Telnet/Cisco.pm in @INC (@INC contains: utils.pm /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./check_cisco_ping line 34.
BEGIN failed--compilation aborted at ./check_cisco_ping line 34.
Lines like this mean you are missing a module that the perl script uses, in this case the Net::Telnet::Cisco module. Assuming you are on a RedHat or CentOS machine:

Code: Select all

yum install perl-Net-Telnet-Cisco

Re: check_cisco_ping

Posted: Thu Nov 14, 2013 12:13 am
by debashmit
Hi tmcdonald ,
It work but when i give a to test vfr link it display an error

root@localhost libexec]# ./check_cisco_ping -H 192.168.2.10 -u support -p support123 -r 192.168.2.25
Parameter to use lib must be directory, not file at ./check_cisco_ping line 31
pattern match read eof at ./check_cisco_ping line 212





192.168.2.10-VRF Link IP
192.168.2.25-Router from which i test the vrf ping.

Re: check_cisco_ping

Posted: Thu Nov 14, 2013 11:27 am
by yancy
it looks like line 31 is looking for utils.pm

run the following:

Code: Select all

updatedb && locate utils.pm
and then update line 31 to use that location.

for example,

Code: Select all

use lib /usr/local/nagios/libexec/utils.pm

Re: check_cisco_ping

Posted: Tue Nov 19, 2013 10:21 pm
by debashmit
Hi,yancy
These are working ..
updatedb && locate utils.pm
use lib /usr/local/nagios/libexec/utils.pm

but when i give the command at ask for telent connection on port no 23 but i have ssh 22 port open on router how connect throug this script.The erro give below.

root@localhost libexec]# ./check_cisco_ping -H 192.168.2.10 -u support -p support123 -r 192.168.2.25
Parameter to use lib must be directory, not file at ./check_cisco_ping line 31
problem connecting to "192.168.2.25", port 23: connect timed-out at ./check_cisco_ping line 211

Re: check_cisco_ping

Posted: Wed Nov 20, 2013 3:38 pm
by sreinhardt
This plugin does not work with ssh, it only works telnet. You might want to look into another plugin if you require ssh access.

Re: check_cisco_ping

Posted: Thu Nov 21, 2013 2:14 am
by debashmit
Hi sreinhardt ,
Can u tell me the SSH plugin Name.

Re: check_cisco_ping

Posted: Thu Nov 21, 2013 2:44 pm
by tmcdonald
debashmit wrote:Hi sreinhardt ,
Can u tell me the SSH plugin Name.
Searching for "check cisco ping ssh" doesn't come up with what you need, so chances are there's not a plugin written for it that supports SSH. I didn't find anything on Google either. It shouldn't be too hard to modify the script to use SSH.