Problems with check_cisco_ping_ssh
Jairo Saravia
jairosaravia93 at gmail.com
Mon Oct 29 18:42:29 CET 2012
Hello,
I have problems with check_cisco_ping_ssh pluglin
Code: Select all<http://support.nagios.com/forum/viewtopic.php?f=7&t=7972&e=0#>
"
#!/usr/bin/perl
#
# Usa la libreria Net::SSH de http://www.stupidfool.org/perl/net-ssh/
#
# Uso: /usr/local/sbin//usr/local/sbin/check_cisco_ping_ssh <host> <port>
<user> <pass> <ip> <warn> <crit>
#
#
use strict;
use Net::SSH::Perl;
$ENV{'HOME'} = '/var/lib/nagios/';
my $router=$ARGV[0];
my $puerto=$ARGV[1];
my $usuariort=$ARGV[2];
my $clave=$ARGV[3];
my $ip=$ARGV[4];
my $warn=$ARGV[5];
my $crit=$ARGV[6];
my $sesion_ssh = Net::SSH::Perl->new($router, protocol=>1, cipher=>'DES',
port=>$puerto, debug=> 'false');
$sesion_ssh->login($usuariort, $clave);
my $comando="ping $ip";
my($salida, $salida_error, $valor_exit) = $sesion_ssh->cmd($comando);
$salida =~ /Success rate is (\d*) (.*)/;
my $rate=$1;
if ( $rate <= $crit ) {
print "PROBLEMA: Rate=$rate%\n";
exit 2;
}
if ( $rate <= $warn ) {
print "WARNING: Rate=$rate%\n";
exit 1;
}
if ( $rate <= 100 ) {
print "OK: Rate=$rate%\n";
exit 0;
}
exit 3;
"
becasuse when I execute the plugin it presente me this error
"Waiting for server public key.
Connection closed by remote host. at
/usr/share/perl5/vendor_perl/Net/SSH/Perl/SSH1.pm line 78"
I install:
Code: Select all<http://support.nagios.com/forum/viewtopic.php?f=7&t=7972&e=0#>yum
install perl-Net-Telnet-Cisco.noarch
yum install perl-Net-SSH-Perl.noarch
yum install perl-Net-OpenSSH-Parallel.noarch
but the problem persists, somebody have any idea of this error
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20121029/571e017f/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
-------------- next part --------------
_______________________________________________
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