Skip to content

UPTIME after reboot no function #37

Description

@chherse

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";
        }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions