Hello community,
here is the log from the commit of package nagios-plugins-qlogic_sanbox for
openSUSE:Factory checked in at 2013-03-08 13:25:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nagios-plugins-qlogic_sanbox (Old)
and /work/SRC/openSUSE:Factory/.nagios-plugins-qlogic_sanbox.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nagios-plugins-qlogic_sanbox", Maintainer is ""
Changes:
--------
---
/work/SRC/openSUSE:Factory/nagios-plugins-qlogic_sanbox/nagios-plugins-qlogic_sanbox.changes
2013-01-25 09:35:13.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.nagios-plugins-qlogic_sanbox.new/nagios-plugins-qlogic_sanbox.changes
2013-03-08 13:25:08.000000000 +0100
@@ -1,0 +2,8 @@
+Fri Mar 8 10:08:53 UTC 2013 - [email protected]
+
+- update to 1.3 (thanks to Christian Fertig):
+ + added configurable warning and critical options for sensor 4
+ (the CPU sensor)
+ + added explanation for --filename option in help text
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nagios-plugins-qlogic_sanbox.spec ++++++
--- /var/tmp/diff_new_pack.4ZJzyc/_old 2013-03-08 13:25:09.000000000 +0100
+++ /var/tmp/diff_new_pack.4ZJzyc/_new 2013-03-08 13:25:09.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package nagios-plugins-qlogic_sanbox
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Author: Lars Vogdt
#
# All modifications and additions to the file contributed by third parties
@@ -19,15 +19,15 @@
Name: nagios-plugins-qlogic_sanbox
Summary: Check QLogic FC Sanboxes
-Version: 1.2
-Release: 1
-Url: http://en.opensuse.org/Nagios-plugins-qlogic_sanbox
License: BSD-3-Clause
Group: System/Monitoring
+Version: 1.3
+Release: 0
+Url: http://en.opensuse.org/Nagios-plugins-qlogic_sanbox
Source0: check_qlogic_sanbox
-Requires: perl(Net::SNMP)
Requires: perl(Getopt::Long)
Requires: perl(Net::Ping)
+Requires: perl(Net::SNMP)
Requires: perl(Pod::Usage)
Recommends: perl(Config::IniFiles)
Recommends: perl(Data::Dumper)
++++++ check_qlogic_sanbox ++++++
--- /var/tmp/diff_new_pack.4ZJzyc/_old 2013-03-08 13:25:09.000000000 +0100
+++ /var/tmp/diff_new_pack.4ZJzyc/_new 2013-03-08 13:25:09.000000000 +0100
@@ -47,17 +47,19 @@
$ENV{'ENV'} = '';
our $conf = {
- 'VERSION' => '1.2',
+ 'VERSION' => '1.3',
'PROGNAME' => 'check_qlogic_sanbox',
'timeout' => '60',
'critical' => '45',
'warning' => '35',
+ 'sensor_4_warn' => '70',
+ 'sensor_4_crit' => '75',
'debug' => 0,
- 'hostname' => 'localhost',
+ 'hostname' => 'localhost',
'community' => 'public',
'snmp_version' => '2c',
'snmp_port' => '161',
- 'maxmsgsize' => '65535',
+ 'maxmsgsize' => '65535',
};
our $print_version = 0;
@@ -108,7 +110,7 @@
if ( ! defined ( $response = $session->get_request($query))){
$answer=$session->error;
$session->close;
- print "CRITICAL: no response with SNMP version
$conf->{'snmp_version'} for get_request on $query (error $answer)\n";
+ print "CRITICAL: no response with SNMP version
$conf->{'snmp_version'} for get_request on $query (error $answer)\n";
exit $ERRORS{'CRITICAL'};
}
return($response->{$query});
@@ -144,6 +146,8 @@
"warning=f" => \$conf->{'warning'},
"c=f" => \$conf->{'critical'},
"critical=f" => \$conf->{'critical'},
+ "sensor4_warn=f"=> \$conf->{'sensor_4_warn'},
+ "sensor4_crit=f"=> \$conf->{'sensor_4_crit'},
"t=i" => \$conf->{'timeout'},
"timeout=i" => \$conf->{'timeout'},
"C=s" => \$conf->{'community'},
@@ -190,6 +194,8 @@
$conf->{'snmp_port'} = $ini->val($conf->{'hostname'}, 'snmp_port')
if (defined($ini->val($conf->{'hostname'},'snmp_port')));
$conf->{'warning'} = $ini->val($conf->{'hostname'}, 'warning')
if (defined($ini->val($conf->{'hostname'},'warning')));
$conf->{'critical'} = $ini->val($conf->{'hostname'}, 'critical')
if (defined($ini->val($conf->{'hostname'},'critical')));
+ $conf->{'sensor_4_warn'}= $ini->val($conf->{'hostname'}, 'sensor4_warn')
if (defined($ini->val($conf->{'hostname'},'sensor4_warn')));
+ $conf->{'sensor_4_crit'}= $ini->val($conf->{'hostname'}, 'sensor4_crit')
if (defined($ini->val($conf->{'hostname'},'sensor4_crit')));
}
if ( !defined($conf->{'hostname'}) ) {
@@ -204,6 +210,12 @@
alarm(0);
exit $ERRORS{'UNKNOWN'};
}
+if ($conf->{'sensor_4_warn'} gt $conf->{'sensor_4_crit'}){
+ print "ERROR: sensor 4 warning level ($conf->{'sensor_4_warn'}) should not
be greater than sensor 4 critical level ($conf->{'sensor_4_crit'})\n";
+ pod2usage(2);
+ alarm(0);
+ exit $ERRORS{'UNKNOWN'};
+}
if ($conf->{'debug'}){
use Data::Dumper;
@@ -321,17 +333,17 @@
my $conf_warn = $conf->{'warning'};
my $conf_crit = $conf->{'critical'};
if ($sensor_number == 4) {
- $conf_warn = 70;
- $conf_crit = 75;
+ $conf_warn = $conf->{'sensor_4_warn'};
+ $conf_crit = $conf->{'sensor_4_crit'};
}
$perfdata.="$temp;$conf_warn;$conf_crit;; ";
if ($temp gt $conf_crit){
$exitcode=$ERRORS{'CRITICAL'};
- $output="CRITICAL: temperatur $status->{$value} exceeds
critical level ($conf_crit); ".$output;
+ $output="CRITICAL: temperatur $status->{$value} on
sensor $sensor_number exceeds critical level ($conf_crit); ".$output;
}
elsif ($temp gt $conf_warn){
$exitcode=$ERRORS{'WARNING'};
- $output="WARNING: temperatur $status->{$value} exceeds
warning level ($conf_warn); ".$output;
+ $output="WARNING: temperatur $status->{$value} on
sensor $sensor_number exceeds warning level ($conf_warn); ".$output;
}
}
if ($is_temp_status){
@@ -395,6 +407,11 @@
-V <string> | --snmp-version <string>
-p <int> | --port <int>
+ -f <file> | --filename <file>
+
+ --sensor4_warn <int>
+ --sensor4_crit <int>
+
-h | --help
-d | --debug
@@ -430,6 +447,37 @@
SNMP version to use. Default: 2c.
+=item B<--filename F<path_to_file>
+
+You can put the configuration in a file with ini-file syntax (using the
hostname as section separator) using the long format of the available options.
+
+Example:
+
+ [192.168.0.1]
+ warning=37
+ critical=39
+ community=public
+ sensor4_warn=50
+ sensor4_crit=55
+
+ [192.168.0.2]
+ warning=40
+ critical=45
+ community=secure
+ sensor4_warn=60
+ sensor4_crit=65
+
+The script should be called with the hostname/IP and the filename option like:
+ B<$USER1$/check_qlogic_sanbox -H 192.168.0.1 --filename
/etc/nagios-plugins/sanboxes.ini>
+
+=item B<--sensor4_warn F<int>
+
+Warning temperature level for the CPU sensor (Sensor 4). Default is 70 degrees
Celsius.
+
+=item B<--sensor4_crit F<int>
+
+Critical temperature level for the CPU sensor (Sensor 4). Default is 75
degrees Celsius.
+
=item B<--help>
Produces this output.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]