Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPTIME after reboot no function #37

Open
chherse opened this issue Aug 3, 2018 · 0 comments
Open

UPTIME after reboot no function #37

chherse opened this issue Aug 3, 2018 · 0 comments

Comments

@chherse
Copy link

chherse commented Aug 3, 2018

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";
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant