Problems with check_cisco_ping_ssh
Posted: Fri Oct 26, 2012 1:07 pm
Hello,
I have problems with check_cisco_ping_ssh pluglin
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:
but the problem persists, somebody have any idea of this error
I have problems with check_cisco_ping_ssh pluglin
Code: Select all
"
#!/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;
"
"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
yum install perl-Net-Telnet-Cisco.noarch
yum install perl-Net-SSH-Perl.noarch
yum install perl-Net-OpenSSH-Parallel.noarch