Build precise queries to find exactly what you need
Press ESC to close
Works great with debian 7.7. I needed IPv6 support so created a patch to add support for it using the -6 or –use-ipv6 parameters, attached below. If it is up to standards, please include it in future versions as more and more systems are using IPv6 (only).
— check_uptime.pl 2015-01-17 18:30:29.885907443 +0100 +++ check_uptime_w_ipv6.pl 2015-01-17 18:19:23.209912963 +0100 @@ -213,6 +213,7 @@ my $o_warn= undef; # WARNING alert if system has been up for $o_host, ‘p:i’ => $o_port, ‘port:i’ => $o_port, ‘C:s’ => $o_community, ‘community:s’ => $o_community, – ‘2’ => $o_version2, ‘v2c’ => $o_version2, + ‘2’ => $o_version2, ‘v2c’ => $o_version2, ‘l:s’ => $o_login, ‘login:s’ => $o_login, ‘x:s’ => $o_passwd, ‘passwd:s’ => $o_passwd, ‘X:s’ => $o_privpass, ‘privpass:s’ => $o_privpass, @@ -376,6 +379,7 @@ ‘label:s’ => $o_label, ‘P:s’ => $o_prevperf, ‘prev_perfdata:s’ => $o_prevperf, ‘T:s’ => $o_type, ‘type:s’ => $o_type, + ‘6’ => $o_domain, ‘use-ipv6’ => $o_domain, ); if (defined ($o_help) ) { help(); exit $ERRORS{“UNKNOWN”}}; if (defined($o_version)) { p_version(); exit $ERRORS{“UNKNOWN”}}; @@ -445,11 +449,19 @@ sub create_snmp_session { my ($session,$error);
+ # Check IPv6 + if (defined ($o_domain)) { + $o_domain=”udp/ipv6″; + } else { + $o_domain=”udp/ipv4″; + } + if ( defined($o_login) && defined($o_passwd)) { # SNMPv3 login if (!defined ($o_privpass)) { verb(“SNMPv3 AuthNoPriv login : $o_login, $o_authproto”); ($session, $error) = Net::SNMP->session( + -domain => $o_domain, -hostname => $o_host, -version => ‘3’, -port => $o_port, @@ -461,6 +473,7 @@ } else { verb(“SNMPv3 AuthPriv login : $o_login, $o_authproto, $o_privproto”); ($session, $error) = Net::SNMP->session( + -domain => $o_domain, -hostname => $o_host, -version => ‘3’, -username => $o_login, @@ -477,6 +490,7 @@ # SNMPv2c Login verb(“SNMP v2c login”); ($session, $error) = Net::SNMP->session( + -domain => $o_domain, -hostname => $o_host, -version => 2, -community => $o_community, @@ -487,6 +501,7 @@ # SNMPV1 login verb(“SNMP v1 login”); ($session, $error) = Net::SNMP->session( + -domain => $o_domain, -hostname => $o_host, -community => $o_community, -port => $o_port,
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!