{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.v5OIltSa/b1/mon-contrib_1.0+dfsg-4_amd64.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.v5OIltSa/b2/mon-contrib_1.0+dfsg-4_amd64.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,2 +1,2 @@\n \n- 9b645b95b4f3482a4e474eb128c0fb4c 73876 admin extra mon-contrib_1.0+dfsg-4_amd64.deb\n+ fc428b924d26c7db13c348d38ca51527 74260 admin extra mon-contrib_1.0+dfsg-4_amd64.deb\n"}, {"source1": "mon-contrib_1.0+dfsg-4_amd64.deb", "source2": "mon-contrib_1.0+dfsg-4_amd64.deb", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,3 +1,3 @@\n -rw-r--r-- 0 0 0 4 2017-08-27 04:57:17.000000 debian-binary\n--rw-r--r-- 0 0 0 3472 2017-08-27 04:57:17.000000 control.tar.xz\n--rw-r--r-- 0 0 0 70212 2017-08-27 04:57:17.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 3480 2017-08-27 04:57:17.000000 control.tar.xz\n+-rw-r--r-- 0 0 0 70588 2017-08-27 04:57:17.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./control", "source2": "./control", "unified_diff": "@@ -1,12 +1,12 @@\n Package: mon-contrib\n Version: 1.0+dfsg-4\n Architecture: amd64\n Maintainer: Dario Minnucci \n-Installed-Size: 447\n+Installed-Size: 454\n Depends: mon (>= 1.2.0-3)\n Section: admin\n Priority: extra\n Homepage: https://mon.wiki.kernel.org/articles/c/o/n/Contrib_repository.html\n Description: contributed tools, monitors and alert for mon\n mon-contrib is the mon /contrib archive. It contains user-submitted\n add-ons to mon, which are not included in the main mon distribution.\n"}, {"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -7,15 +7,15 @@\n drwxr-xr-x 0 root (0) root (0) 0 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/\n drwxr-xr-x 0 root (0) root (0) 0 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/alert.d/\n -rwxr-xr-x 0 root (0) root (0) 4948 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/alert.d/aim.alert\n -rwxr-xr-x 0 root (0) root (0) 4041 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/alert.d/bugzilla.alert\n -rwxr-xr-x 0 root (0) root (0) 3108 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/alert.d/gnats.alert\n -rwxr-xr-x 0 root (0) root (0) 4477 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/alert.d/hpov.alert\n -rwxr-xr-x 0 root (0) root (0) 3880 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/alert.d/ipvs.alert\n--rwxr-xr-x 0 root (0) root (0) 460 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/alert.d/sms.alert\n+-rwxr-xr-x 0 root (0) root (0) 2330 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/alert.d/sms.alert\n -rwxr-xr-x 0 root (0) root (0) 3960 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/alert.d/snapdelete.alert\n -rwxr-xr-x 0 root (0) root (0) 2580 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/alert.d/winpopup.alert\n drwxr-xr-x 0 root (0) root (0) 0 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon-local.d/\n drwxr-xr-x 0 root (0) root (0) 0 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/\n -rwxr-xr-x 0 root (0) root (0) 6967 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/bgp.monitor\n -rwxr-xr-x 0 root (0) root (0) 7258 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/cisco-env.monitor\n -rwxr-xr-x 0 root (0) root (0) 2490 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/citrix.monitor\n@@ -33,15 +33,15 @@\n -rwxr-xr-x 0 root (0) root (0) 1289 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/ipsec.monitor\n -rwxr-xr-x 0 root (0) root (0) 2301 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/ipvs.monitor\n -rwxr-xr-x 0 root (0) root (0) 7051 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/krb5.monitor\n -rwxr-xr-x 0 root (0) root (0) 3837 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/lmtp.monitor\n -rwxr-xr-x 0 root (0) root (0) 5088 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/mailloop.monitor\n -rwxr-xr-x 0 root (0) root (0) 3857 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/mupdate.monitor\n -rwxr-xr-x 0 root (0) root (0) 7497 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/netsnmp-exec.monitor\n--rwxr-xr-x 0 root (0) root (0) 3208 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/netsnmp-freespace.monitor\n+-rwxr-xr-x 0 root (0) root (0) 6648 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/netsnmp-freespace.monitor\n -rwxr-xr-x 0 root (0) root (0) 7359 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/netsnmp-proc.monitor\n -rwxr-xr-x 0 root (0) root (0) 7799 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/netwarefree.monitor\n -rwxr-xr-x 0 root (0) root (0) 8405 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/ospf.monitor\n -rwxr-xr-x 0 root (0) root (0) 3165 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/postgresql.monitor\n -rwxr-xr-x 0 root (0) root (0) 4415 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/printmib.monitor\n -rwxr-xr-x 0 root (0) root (0) 3314 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/process-full-command-line.monitor\n -rwxr-xr-x 0 root (0) root (0) 5740 2017-08-27 04:57:17.000000 ./usr/lib/mon-contrib/mon.d/pubcookielogin.monitor\n@@ -94,15 +94,15 @@\n -rw-r--r-- 0 root (0) root (0) 1421 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/informix.monitor.README\n -rw-r--r-- 0 root (0) root (0) 921 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/informixdbspace.monitor.README\n -rw-r--r-- 0 root (0) root (0) 1410 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/ipsec.monitor.README\n -rw-r--r-- 0 root (0) root (0) 982 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/krb5.monitor.README\n -rw-r--r-- 0 root (0) root (0) 439 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/lwp-http.mon.README\n -rw-r--r-- 0 root (0) root (0) 2517 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/mailloop.monitor.README\n -rw-r--r-- 0 root (0) root (0) 2345 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/netsnmp-exec.monitor.README\n--rw-r--r-- 0 root (0) root (0) 813 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/netsnmp-freespace.monitor.README\n+-rw-r--r-- 0 root (0) root (0) 2116 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/netsnmp-freespace.monitor.README\n -rw-r--r-- 0 root (0) root (0) 980 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/netsnmp-proc.monitor.README\n -rw-r--r-- 0 root (0) root (0) 1784 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/postgresql.monitor.README\n -rw-r--r-- 0 root (0) root (0) 1462 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/printmib.monitor.README\n -rw-r--r-- 0 root (0) root (0) 253 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/process-full-command-line.monitor.README\n -rw-r--r-- 0 root (0) root (0) 906 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/radius.monitor.detailcheck.README\n -rw-r--r-- 0 root (0) root (0) 3522 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/remote.monitor.README\n -rw-r--r-- 0 root (0) root (0) 2090 2017-08-27 04:57:17.000000 ./usr/share/doc/mon-contrib/monitors/rptr.monitor.README\n"}, {"source1": "./usr/lib/mon-contrib/alert.d/sms.alert", "source2": "./usr/lib/mon-contrib/alert.d/sms.alert", "unified_diff": "@@ -1,26 +1,75 @@\n-#!/usr/bin/perl\r\n-\r\n-use Getopt::Std;\r\n-getopts (\"s:g:h:t:l:u\");\r\n-\r\n-$summary=;\r\n-chomp $summary;\r\n-\r\n-$rest=\"\";\r\n-while () {\r\n- $rest .= $_;\r\n-}\r\n-\r\n-foreach $number (@ARGV) {\r\n-\r\n- # system(\"echo `date` `id` $number $summary >> /var/lib/mon/sms.alert.log\");\r\n-\r\n- open (SMS, \"| /usr/bin/gnokii --sendsms $number\") || die \"could not open pipe to sms: $!\\n\";\r\n-\r\n- print SMS $summary;\r\n- print SMS \"\\n\";\r\n- print SMS $rest;\r\n-\r\n- close (SMS);\r\n-\r\n-}\r\n+#!/usr/bin/perl\n+#\n+# sms.alert - send an alert via SMS (sendsms) v1.5 2003-04-07\n+#\n+# This will accept multiple phone numbers in @ARGV and call \n+# sendsms for each one of them.\n+#\n+# sendsms-specific options:\n+# -n destination number\n+# -t \"message\"\n+# host\n+#\n+# Peter Holzleitner, P.Holzleitner@computer.org\n+# Jim Trocki, trockij@transmeta.com\n+#\n+# Copyright (C) 1998, Peter Holzleitner\n+# Copyright (C) 1998, Jim Trocki\n+#\n+# This program is free software; you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 2 of the License, or\n+# (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program; if not, write to the Free Software\n+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n+#\n+# History:\n+#\n+# 1.5 filter single quotes (Erik Bolso)\n+# 1.4 fix loop break bug (Geta Andualem)\n+# 1.0 original release (P.Holzleitner)\n+#\n+use Getopt::Std;\n+use Sys::Syslog;\n+\n+openlog('sms.alert', '', 'user');\n+getopts (\"s:g:h:t:c:f:l:q:u\");\n+\n+#\n+# the first line is summary information, adequate to send to a pager\n+# or email subject line\n+#\n+# the following lines normally contain more detailed information,\n+# but this is monitor-dependent\n+#\n+@MSG=;\n+$summary = shift @MSG;\n+chomp $summary;\n+$detail = join(' ', @MSG);\n+$detail =~ tr/\\r\\n\\'/ /s;\n+$detail = substr($detail, 0, 130); # real cutoff to 160 total done in sendsms\n+\n+$t = localtime($opt_t);\n+($wday,$mon,$day,$tm) = split (/\\s+/, $t);\n+($hr,$min,$sec) = split(':', $tm);\n+\n+$ALERT = $opt_u ? \"UPALERT\" : \"ALERT\";\n+\n+foreach $pagedest (@ARGV) {\n+ syslog('notice', \"sendsms calling $pagedest\");\n+ SMS: for($retry = 1; $retry < 4; $retry++)\n+ {\n+ $res = system(\"/usr/sbin/sendsms -n '$pagedest' -t '$ALERT $opt_g/$opt_s: $summary ($hr:$min) $detail' &\");\n+ last SMS if $res == 0;\n+ syslog('warning', \"sendsms to $pagedest failed, retrying($retry) after delay\");\n+ sleep 15;\n+ }\n+ sleep 5;\n+}\n"}, {"source1": "./usr/lib/mon-contrib/mon.d/netsnmp-freespace.monitor", "source2": "./usr/lib/mon-contrib/mon.d/netsnmp-freespace.monitor", "unified_diff": "@@ -1,29 +1,50 @@\n #!/usr/bin/perl\n #\n # Monitor diskspace via SNMP\n # (based on process.monitor by Brian Moore)\n #\n-# Arguments are:\n+# Originally written by SATOH Fumiyasu .\n+# Modified Oct 2001 by Dan Urist \n+# Changes: added usage, SNMP v.3 support, -T threshold option and\n+# unique-ified errors\n+#\n+# Usage:\n+# [-h] # Usage\n+# [-t Timeout] # Timeout in ms (default: 1000000)\n+# [-r Retries] # Retries before failure (default: 5)\n+# [-v SNMPversion] # 1,2,2c or 3 (default: 1)\n+# [-c Community] # For SNMP v.1,2,2c (default: public)\n+# [-u snmpuser] # For SNMP v.3 (default: initial)\n+# [-l seclevel] # For SNMP v.3 (default: noAuthNoPriv)\n+# [-A authpassphrase] # For SNMP v.3 \n+# [-T threshold] # If a disk threshold is given, the script\n+# # will exit with the value of the highest\n+# # disk percentage found that is over the\n+# # threshold; if no disks are over the threshold\n+# # it will exit with value 0, and it will exit\n+# # with value 2 for SNMP error\n+# host [host ...]\n #\n-# [-c community] host [host ...]\n #\n # This script will exit with value 1 if host:community has dskErrorFlag\n # set. The summary output line will be the host names that failed\n # and the disk information. The detail lines are what UCD snmp returns\n # for an dskErrMessage. ('/filesystem: less than WATERMARK free (= CURRENT)').\n # If there is an SNMP error (either a problem with the SNMP libraries,\n # or a problem communicating via SNMP with the destination host),\n # this script will exit with a warning value of 2.\n #\n-# There probably should be a better way to specify a given filesystem to\n-# watch instead of everything-ucd-snmp-is-watching.\n-#\n-# $Id: netsnmp-freespace.monitor,v 1.2 2005/03/18 19:25:27 trockij Exp $\n-#\n+# If the -T threshold option is used, the script will exit with the\n+# highest disk percentage found that is over the threshold. The intent\n+# is to allow use with mon's \"alert exit=value\" parameter to allow for\n+# finer-grained alerts based on disk usage. If no disks are over the\n+# threshold, the script will exit with value 0; if an SNMP error\n+# occurs (and there are no other errors), the script will exit with\n+# value 2.\n #\n # Copyright (C) 2001 SATOH Fumiyasu \n #\n # This program is free software; you can redistribute it and/or modify\n # it under the terms of the GNU General Public License as published by\n # the Free Software Foundation; either version 2 of the License, or\n # (at your option) any later version.\n@@ -33,69 +54,132 @@\n # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n # GNU General Public License for more details.\n #\n # You should have received a copy of the GNU General Public License\n # along with this program; if not, write to the Free Software\n # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n #\n-use SNMP;\n+\n+use SNMP; \n use Getopt::Std;\n \n $ENV{'MIBS'} = \"UCD-SNMP-MIB\";\n \n-getopts(\"c:\");\n-$community = $opt_c || $ENV{'COMMUNITY'} || 'public';\n-\n-$RETVAL = 0;\n+getopts(\"ht:r:v:c:u:l:A:T:\");\n+my $VERSION = \"0.1\";\n+if( $opt_h || (scalar @ARGV == 0) ){\n+ print <<\"USAGE\";\n+$0 Version $VERSION; original version by SATOH Fumiyasu ,\n+SNMP v.3 support by Daniel J. Urist .\n+\n+Usage:\n+ [-h] # Usage\n+ [-t Timeout] # Timeout in ms (default: 1000000)\n+ [-r Retries] # Retries before failure (default: 5)\n+ [-v SNMPversion] # 1,2,2c or 3 (default: 1)\n+ [-c Community] # For SNMP v.1,2,2c (default: public)\n+ [-u snmpuser] # For SNMP v.3 (default: initial)\n+ [-l seclevel] # For SNMP v.3 (default: noAuthNoPriv)\n+ [-A authpassphrase] # For SNMP v.3 \n+ [-T threshold] # If a disk threshold is given, the script will exit\n+ # with the value of the highest disk percentage found\n+ # that is over the threshold; if no disks are over the\n+ # the threshold it will exit with value 0, and it will\n+ # exit with value 2 for SNMP error\n+ host [host ...]\n \n-foreach $host (@ARGV) {\n- $session = new SNMP::Session(DestHost => $host,\n- Community => $community);\n- if (!defined ($session)) {\n- \t$RETVAL = ($RETVAL == 1) ? 1 : 2;\n-\tpush @failures, \"$host session error\";\n-\tpush @longerr, \"$host could not get SNMP session\";\n-\tnext;\n- }\n+USAGE\n+ exit;\n+}\n \n- my $v = new SNMP::Varbind ([\"dskIndex\"]);\n- $session->getnext ($v);\n+# FIXME we should probably offer all the v3 options that the SNMP module does\n+my $Timeout = $opt_t || 1000000;\n+my $Retries = $opt_r || 5;\n+my $SNMPVersion = $opt_v || 1;\n+my $Community = $opt_c || 'public';\n+my $SecName = $opt_u || 'initial'; \n+my $SecLevel = $opt_l || 'noAuthNoPriv';\n+my $Authpass = $opt_A || '';\n+my $Threshold = $opt_T if defined($opt_T);\n+\n+my %SNMPARGS = (\n+\t\tTimeout => $Timeout,\n+\t\tVersion => $SNMPVersion,\n+\t );\n+\n+if ($SNMPVersion eq \"3\"){\n+ $SNMPARGS{SecName} = $SecName;\n+ $SNMPARGS{SecLevel} = $SecLevel;\n+ $SNMPARGS{AuthPass} = $Authpass;\n+}\n+else{\n+ $SNMPARGS{Community} = $Community;\n+}\n \n- while (!$session->{\"ErrorStr\"} && $v->tag eq \"dskIndex\") {\n-\tmy @q = $session->get ([\n-\t [\"dskPath\", $v->iid],\t# 0\n-\t [\"dskDevice\", $v->iid],\t# 1\n-\t [\"dskMinimum\", $v->iid],\t# 2\n-\t [\"dskMinPercent\", $v->iid],\t# 3\n-\t [\"dskTotal\", $v->iid],\t# 4\n-\t [\"dskAvail\", $v->iid],\t# 5\n-\t [\"dskUsed\", $v->iid],\t# 6\n-\t [\"dskPercent\", $v->iid],\t# 7\n-\t [\"dskPercentNode\", $v->iid],# 8\n-\t [\"dskErrorFlag\", $v->iid],\t# 9\n-\t [\"dskErrorMsg\", $v->iid],\t# 10\n-\t]);\n-\n-\tlast if ($session->{\"ErrorStr\"});\n-\n- if ($q[9] > 0) {\n-\t $RETVAL = 1;\t \n-\t my ($t, $u, $a) = map { int($_/1024) } @q[4, 6, 5];\n- \t push (@failures, $host);\n- push (@longerr, \"$host:$q[0]($q[1]) total=$t used=$u($q[7]%) free=$a err=$q[10]\");\n- }\n+my $RETVAL = 0;\n+my %Failures;\n+my %Longerr;\n+my $Session;\n \n-\t$session->getnext ($v);\n+foreach $host (@ARGV) {\n+ $Session = new SNMP::Session(\n+\t\t\t DestHost => $host,\n+\t\t\t %SNMPARGS,\n+\t\t\t );\n+ unless( defined($Session) ) {\n+ $RETVAL = 2 if $RETVAL == 0; # Other errors take precedence over SNMP error\n+ $Failures{\"$host session error\"} = \"\";\n+ $Longerr{\"$host could not get SNMP session\"} = \"\";\n+ next;\n+ }\n+\n+ my $v = new SNMP::Varbind ([\"dskIndex\"]);\n+ $Session->getnext ($v);\n+\n+ while (!$Session->{\"ErrorStr\"} && $v->tag eq \"dskIndex\") {\n+ my @q = $Session->get ([\n+\t\t\t [\"dskPath\", $v->iid],\t# 0\n+\t\t\t [\"dskDevice\", $v->iid],\t# 1\n+\t\t\t [\"dskMinimum\", $v->iid],\t# 2\n+\t\t\t [\"dskMinPercent\", $v->iid],\t# 3\n+\t\t\t [\"dskTotal\", $v->iid],\t# 4\n+\t\t\t [\"dskAvail\", $v->iid],\t# 5\n+\t\t\t [\"dskUsed\", $v->iid],\t# 6\n+\t\t\t [\"dskPercent\", $v->iid],\t# 7\n+\t\t\t [\"dskPercentNode\", $v->iid],# 8\n+\t\t\t [\"dskErrorFlag\", $v->iid],\t# 9\n+\t\t\t [\"dskErrorMsg\", $v->iid],\t# 10\n+\t\t\t ]);\n+ last if ($Session->{\"ErrorStr\"});\n+\n+ if( defined $Threshold ){\n+ if($q[7] > $Threshold){\n+\t$RETVAL = $q[7] if $q[7] > $RETVAL;\n+\tmy ($t, $u, $a) = map { int($_/1024) } @q[4, 6, 5];\n+\t$Failures{$host} = \"\";\n+\t$Longerr{\"$host:$q[0]($q[1]) total=$t used=$u($q[7]%) free=$a threshold=$Threshold%\"} = \"\";\n+ }\n }\n-\n- if ($session->{\"ErrorStr\"}) {\n- \tpush (@failures, $host);\n-\tpush (@longerr, \"$host returned an SNMP error: \" . $session->{\"ErrorStr\"});\n+ elsif ($q[9] > 0) {\n+ $RETVAL = 1;\t \n+ my ($t, $u, $a) = map { int($_/1024) } @q[4, 6, 5];\n+ $Failures{$host} = \"\";\n+ $Longerr{\"$host:$q[0]($q[1]) total=$t used=$u($q[7]%) free=$a err=$q[10]\"} = \"\";\n }\n+\n+ $Session->getnext ($v);\n+ }\n+ \n+ if ($Session->{\"ErrorStr\"}) {\n+ $RETVAL = 2 if $RETVAL == 0; # Other errors take precedence over SNMP error\n+ $Failures{$host} = \"\";\n+ $Longerr{\"$host returned an SNMP error: \" . $Session->{\"ErrorStr\"}} = \"\";\n+ }\n }\n \n-if (@failures) {\n- print join (\", \", @failures), \"\\n\", \"\\n\";\n- print join (\"\\n\", @longerr), \"\\n\";\n+if (scalar keys %Failures) {\n+ print join (\", \", sort keys %Failures), \"\\n\", \"\\n\";\n+ print join (\"\\n\", sort keys %Longerr), \"\\n\";\n }\n \n exit $RETVAL;\n+\n"}, {"source1": "./usr/share/doc/mon-contrib/monitors/netsnmp-freespace.monitor.README", "source2": "./usr/share/doc/mon-contrib/monitors/netsnmp-freespace.monitor.README", "unified_diff": "@@ -1,20 +1,43 @@\n-Date: Thu, 21 Jun 2001 05:46:47 +0900\n-From: SATOH Fumiyasu \n-To: trockij@transmeta.com\n-Subject: freespace-snmp.monitor\n+#\n+# Monitor diskspace via SNMP\n+# (based on process.monitor by Brian Moore)\n+#\n+# Originally written by SATOH Fumiyasu .\n+# Modified Oct 2001 by Dan Urist \n+# Changes: added usage, SNMP v.3 support, -T threshold option and\n+# unique-ified errors\n+#\n+# Usage:\n+# [-h] # Usage\n+# [-t Timeout] # Timeout in ms (default: 1000000)\n+# [-r Retries] # Retries before failure (default: 5)\n+# [-v SNMPversion] # 1,2,2c or 3 (default: 1)\n+# [-c Community] # For SNMP v.1,2,2c (default: public)\n+# [-u snmpuser] # For SNMP v.3 (default: initial)\n+# [-l seclevel] # For SNMP v.3 (default: noAuthNoPriv)\n+# [-A authpassphrase] # For SNMP v.3 \n+# [-T threshold] # If a disk threshold is given, the script\n+# # will exit with the value of the highest\n+# # disk percentage found that is over the\n+# # threshold; if no disks are over the threshold\n+# # it will exit with value 0, and it will exit\n+# # with value 2 for SNMP error\n+# host [host ...]\n+#\n+#\n+# This script will exit with value 1 if host:community has dskErrorFlag\n+# set. The summary output line will be the host names that failed\n+# and the disk information. The detail lines are what UCD snmp returns\n+# for an dskErrMessage. ('/filesystem: less than WATERMARK free (= CURRENT)').\n+# If there is an SNMP error (either a problem with the SNMP libraries,\n+# or a problem communicating via SNMP with the destination host),\n+# this script will exit with a warning value of 2.\n+#\n+# If the -T threshold option is used, the script will exit with the\n+# highest disk percentage found that is over the threshold. The intent\n+# is to allow use with mon's \"alert exit=value\" parameter to allow for\n+# finer-grained alerts based on disk usage. If no disks are over the\n+# threshold, the script will exit with value 0; if an SNMP error\n+# occurs (and there are no other errors), the script will exit with\n+# value 2.\n \n-Hi, ``mon'' developper.\n-\n-I wrote freespace-snmp.monitor based on process.monitor for mon.\n-This monitors disk space via SNMP (NET-SNMP, aka UCD-SNMP).\n-\n-I want to commit this monitor to mon archive. Any comments?\n-If you think that ``freespace-snmp'' is not suitable name,\n-please name this monitor as you wish :-).\n-\n--- \n-SATOH Fumiyasu - fumiya @net-thrust.com, @samba.gr.jp, @namazu.org or ...\n-THRUST Co., Ltd. @ Fujisawa, Kanagawa, Japan - http://www.net-thrust.com\n-Samba-JP, aka `Samba Users Group Japan' - http://www.samba.gr.jp\n-Apache-JP(?), aka `Japan Apache Users Group' - http://www.apache.or.jp\n-Namazu, a full-text search engine - http://www.namazu.org\n"}]}]}]}]}