monitor-utils icon indicating copy to clipboard operation
monitor-utils copied to clipboard

UPTIME after reboot no function

Open chherse opened this issue 7 years ago • 0 comments

Hello,

we have a FAS8200 and after a reboot the uptime check give following message.

**ePN /usr/local/icinga/libexec//check_netapp_ng.pl: plugin did not call exit()

The reason ist for the first day after a reboot the uptime output from snmp is

4 hours, 44:54.86

The check expected something like 4 days, 7:14:35:17.12

I have no experience with github so i do not know how i upload the fixed code. Here my recommended code.

### UPTIME ###
} elsif("$opt{'check_type'}" eq "UPTIME") {
        my $check = _get_oid_value($snmp_session,$snmpUpTime);
        $msg = "$opt{'check_type'}: $check";
        if ($check =~ /hours/){
                $check =~ m/^\s*(\d+)\s+hours,\s+(\d+):(\d+).*$/;
                $perf = "uptime=" . ($1*3600 + $2*60 + $3) . "s";
        }else{
                $check =~ m/^\s*(\d+)\s+days,\s+(\d+):(\d+):(\d+).*$/;
                $perf = "uptime=" . ($1*86400 + $2*3600 + $3*60 + $4) . "s";
        }

chherse avatar Aug 03 '18 14:08 chherse