Compare commits

..

1 commit

525 changed files with 55 additions and 1410 deletions

View file

@ -2,5 +2,6 @@ Uploaders: Jan Wagner <waja@cyconet.org>
Recommends: python3-minimal
Version: 2.0
Homepage: https://github.com/BornToBeRoot/check_nextcloud
#Watch: https://raw.githubusercontent.com/BornToBeRoot/check_nextcloud/master/check/check_nextcloud.py \#\ \~\~\ Version\ '([0-9.]+)'
Watch: https://raw.githubusercontent.com/BornToBeRoot/check_nextcloud/master/check/check_nextcloud.py # ~~ Version ([0-9.]+) ~~
Description: Plugin script to monitor your nextcloud serverinfo API

View file

@ -1,13 +1,3 @@
* 2022-07-29 10.3
add mode check-rtt (cisco-rttmon-mib slas)
* 2022-07-21 10.2.1
increase cpu thresholds for linux, separate user/system/etc from iowait
* 2022-07-20 10.2
update glplugin, better get_table fallback handling
* 2022-05-05 10.1.0.3
fix a pull-request. Und das war damit auch der letzte Pull-Request, den ich in meinem Leben angenommen habe.
* 2022-05-04 10.1.0.2
use JSON::XS in Interface.pm to avoid misleading UNKNOWN error message
* 2022-02-23 10.1.0.1
suppress unknown arista sensors which are not marked as faulty
* 2022-02-18 10.1

View file

@ -22,7 +22,7 @@ eval {
$Data::Dumper::Sparseseen = 1;
};
our $AUTOLOAD;
*VERSION = \'5.1.1';
*VERSION = \'5.0.1.1';
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };

View file

@ -1038,27 +1038,25 @@ sub check_snmp_and_model {
scalar localtime (time - $sysUptime),
$self->human_timeticks($sysUptime));
}
my $best_uptime = undef;
if ($hrSystemUptime) {
# Bei Linux-basierten Geraeten wird snmpEngineTime viel zu haeufig
# durchgestartet, also lieber das hier.
$best_uptime = $hrSystemUptime;
# Es sei denn, snmpEngineTime ist tatsaechlich groesser, dann gilt
# wiederum dieses. Mag sein, dass der zahlenwert hier manchmal huepft
# und ein Performancegraph Zacken bekommt, aber das ist mir egal.
# es geht nicht um Graphen in Form einer ansteigenden Geraden, sondern
# um das Erkennen von spontanen Reboots und das Vermeiden von
# falschen Alarmen.
if ($snmpEngineTime && $snmpEngineTime > $hrSystemUptime) {
$best_uptime = $snmpEngineTime;
if (defined $sysUptime && defined $sysDescr) {
if ($hrSystemUptime) {
# Bei Linux-basierten Geraeten wird snmpEngineTime viel zu haeufig
# durchgestartet, also lieber das hier.
$self->{uptime} = $hrSystemUptime;
# Es sei denn, snmpEngineTime ist tatsaechlich groesser, dann gilt
# wiederum dieses. Mag sein, dass der zahlenwert hier manchmal huepft
# und ein Performancegraph Zacken bekommt, aber das ist mir egal.
# es geht nicht um Graphen in Form einer ansteigenden Geraden, sondern
# um das Erkennen von spontanen Reboots und das Vermeiden von
# falschen Alarmen.
if ($snmpEngineTime && $snmpEngineTime > $hrSystemUptime) {
$self->{uptime} = $snmpEngineTime;
}
} elsif ($snmpEngineTime) {
$self->{uptime} = $snmpEngineTime;
} else {
$self->{uptime} = $sysUptime;
}
} elsif ($snmpEngineTime) {
$best_uptime = $snmpEngineTime;
} else {
$best_uptime = $sysUptime;
}
if (defined $best_uptime && defined $sysDescr) {
$self->{uptime} = $best_uptime;
$self->{productname} = $sysDescr;
$self->{sysobjectid} = $self->get_snmp_object('MIB-2-MIB', 'sysObjectID', 0);
$self->debug(sprintf 'uptime: %s', $self->{uptime});
@ -1092,11 +1090,11 @@ sub check_snmp_and_model {
}
if (! $mein_lieber_freund_und_kupferstecher) {
$self->add_message(UNKNOWN,
'got neither sysUptime and sysDescr nor any other useful information, is this snmp agent working correctly?');
'got neither sysUptime nor sysDescr nor any other useful information, is this snmp agent working correctly?');
}
} else {
$self->add_message(UNKNOWN,
'Did not receive both sysUptime and sysDescr, is this snmp agent working correctly?');
'got neither sysUptime nor sysDescr, is this snmp agent working correctly?');
}
$Monitoring::GLPlugin::SNMP::session->close if $Monitoring::GLPlugin::SNMP::session;
}
@ -2474,7 +2472,6 @@ sub get_table {
if (! defined $result || (defined $result && ! %{$result})) {
$self->debug(sprintf "get_table error: %s",
$Monitoring::GLPlugin::SNMP::session->error());
my $fallback = 0;
if ($Monitoring::GLPlugin::SNMP::session->error() =~ /message size exceeded.*buffer maxMsgSize/i) {
# bei irrsinnigen maxrepetitions
$self->debug(sprintf "buffer exceeded");
@ -2486,24 +2483,12 @@ sub get_table {
} else {
$self->mult_snmp_max_msg_size(2);
}
$fallback = 1;
} elsif ($Monitoring::GLPlugin::SNMP::session->error() =~ /No response from remote host/i) {
# some agents can not handle big loads
if ($params{'-maxrepetitions'}) {
$params{'-maxrepetitions'} = int($params{'-maxrepetitions'} / 2);
$self->debug(sprintf "reduce maxrepetitions to %d",
$params{'-maxrepetitions'});
$fallback = 1;
}
}
if ($fallback) {
$self->debug("get_table error: try fallback");
$self->debug(sprintf "get_table %s", Data::Dumper::Dumper(\%params));
$tic = time;
$result = $Monitoring::GLPlugin::SNMP::session->get_table(%params);
$tac = time;
$self->debug(sprintf "get_table returned %d oids in %ds", scalar(keys %{$result}), $tac - $tic);
}
$self->debug("get_table error: try fallback");
$self->debug(sprintf "get_table %s", Data::Dumper::Dumper(\%params));
$result = $Monitoring::GLPlugin::SNMP::session->get_table(%params);
$tac = time;
$self->debug(sprintf "get_table returned %d oids in %ds", scalar(keys %{$result}), $tac - $tic);
if (! defined $result || ! %{$result}) {
$self->debug(sprintf "get_table error: %s",
$Monitoring::GLPlugin::SNMP::session->error());
@ -2511,7 +2496,6 @@ sub get_table {
$params{'-maxrepetitions'} = 1;
$self->debug("get_table error: try getnext fallback");
$self->debug(sprintf "get_table %s", Data::Dumper::Dumper(\%params));
$tic = time;
$result = $Monitoring::GLPlugin::SNMP::session->get_table(%params);
$tac = time;
$self->debug(sprintf "get_table returned %d oids in %ds", scalar(keys %{$result}), $tac - $tic);

Some files were not shown because too many files have changed in this diff Show more