--- nagios-snmp-plugins-1.1.1.orig/debian/README.Debian +++ nagios-snmp-plugins-1.1.1/debian/README.Debian @@ -0,0 +1,260 @@ +nagios-snmp-plugins for Debian +------------------------------ + + If you are using snmp v1 and v2c, you can provide your community as last + argument with your check_command. So you can specify different communities + for different services. With snmp v3 you need to set $USER9$ like shown in + the config snipsets in your resource.cfg or you need to modify your + command definitions! + + See http://www.manubulon.com/nagios/index_commands.html#snmplogin + and http://www.manubulon.com/nagios/index_info.html#snmplogin + + These snipsets are dumped from nagios-snmp-plugins website. + Look at and + for more (actual) info! + + Here are commands example to use the scripts with nagios. + + All these commands use $USER$ macros to put snmp login. You + have to do this for these examples to work. + The $USER$ macro are defined in the resources.cfg file + + If you are using snmp v1 : + $USER7$=-C + + If you are using snmp v2c : + $USER7$=-C -2 + + Examples of snmp v3 login : + AuthNoPriv (md5) : + $USER8$=-l -x + + AuthPriv (md5,aes) : + $USER8$=-l -x -X -L md5,aes + + About regular expressions + + With all these scripts, when you select an interface, a service or process name + etc... you use by default regular expresions : + Note : you can disable this by using "-r" + + Examples : Don't forget it is perl regular expressions. + Regexp Will match + eth eth0, eth1, eth2 but also Fastethernet0/0 .... + eth[1-9] eth1, eth2, ... eth9 but also eth10, eth11 + eth[1-2]$ eth1, eth2 only (not eth11 for ex). + dhcp dhcpc, dhpcd + +* check_snmp_cpfw.pl + + define command { + command_name check_snmp_cpfw_v3 + command_line $USER1$/check_snmp_cpfw.pl -H $HOSTADDRESS$ $USER8$ + $ARG1$ + } + + define service { + name checkpoint_verification + check_command check_snmp_cpfw_v3!-swa -p Solsoft_Policy \ + -c 100000,200000 -f + } + +* check_snmp_load.pl + + define command { + command_name check_snmp_load_v1 + command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $USER7$ -T + $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + } + + define command { + command_name check_snmp_load_v3 + command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $USER8$ -T + $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + } + + define service { + name bluecoat_load + check_command check_snmp_load_v1!bc!95!99 + } + + define service { + name Linux_load + check_command check_snmp_load_v1!netsl!4,3,3!8,5,5 + } + + define service { + name Cisco_load + check_command check_snmp_load_v1!cisco!90,80,60!100,100,100 + } + + define service { + name lp_load + check_command check_snmp_load_v1!lp!90!99 + } + +* check_snmp_interface.pl + + define command { + command_name check_snmp_int_v1 + command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ $USER7$ -n + $ARG1$ $ARG2$ + } + + define command{ + command_name check_snmp_int_v3 + command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ $USER8$ -n + $ARG1$ $ARG2$ + } + + define service { + name check_int_1_6 + check_command check_snmp_int_v1!"FastEthernet-[1-6]" + } + + define service { + name check_int_eth0_bdw + check_command check_snmp_int_v3!eth0!-k -w 100,50 -c 0,0 + } + +* check_snmp_mem.pl + + define command { + command_name check_snmp_mem_v1 + command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ $USER7$ $ARG1$ + -w $ARG2$ -c $ARG3$ $ARG4$ + } + + define command { + command_name check_snmp_mem_v3 + command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ $USER8$ $ARG1$ + -w $ARG2$ -c $ARG3$ $ARG4$ + } + + define service { + name Linux_memory + check_command check_snmp_mem_v1!-N!95,60!99,90 + } + + define service { + name Cisco_mem + check_command check_snmp_mem_v1!-I!80!99 + } + +* check_snmp_process.pl + + define command { + command_name check_snmp_process_v1 + command_line $USER1$/check_snmp_process.pl -H $HOSTADDRESS$ $USER7$ -n + $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + } + + define service { + name proxy_checks + check_command check_snmp_process_v1!proxy!21,1999!20,2000!-2 + } + + define service { + name Check_httpd_all + check_command check_snmp_process_v1!httpd!5,100!0!-2 -m 20,30 -u 90,99 + } + + define service { + name check_crontab + service_description Check Crontab service + check_command check_snmp_process!crond!0!0 + } + +* check_snmp_storage.pl + + define command { + command_name check_snmp_storage_v1 + command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ $USER7$ -m + $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + } + + define command { + command_name check_snmp_storage_v3 + command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ $USER8$ -m + $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + } + + define service { + name Check_LinDisk_home + service_description Check /home + check_command check_snmp_storage_v3!/home!90!97!-r + } + + define service { + name Win_check_swap + service_description Check Windows swap + check_command check_snmp_storage_v3!Virtual!60!90 + } + + define service { + name check_linux_swap + service_description Check swap linux + check_command check_snmp_storage_v1!Swap!60!90! + } + + define service { + name check_disk_all + service_description Check / /opt /var /config + check_command check_snmp_storage_v1!"^/$|opt|config|var"!80!90! + } + +* check_snmp_vrrp.pl + + define command { + command_name check_snmp_vrrp_v1 + command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER7$ -T + $ARG1$ -s $ARG2$ + } + + define command { + command_name check_snmp_vrrp_v3 + command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER8$ -T + $ARG1$ -s $ARG2$ + } + + define service { + name Linkproof_check_vrrp_master + service_description Check vrrp in master state + check_command check_snmp_vrrp_v3!lp!master + } + + define service { + name Linkproof_check_vrrp_backup + service_description Check vrrp in backup state + check_command check_snmp_vrrp_v3!lp!backup + } + + define service { + name Nokia_clustering + check_command check_snmp_vrrp_v3!ipso!2,98% + } + +* check_snmp_win.pl + + define command { + command_name check_win + command_line $USER1$/check_snmp_win.pl -H $HOSTADDRESS$ $USER7$ -n + $ARG2$ + # comment community service(s) name + } + + define service { + name check_win_dhcp + service_description Check dhcp service + check_command check_win!dhcp + register 0 + } + + define service { + name check_win_reg_spool + service_description Verification acces au registre en spooleur + check_command check_win!"au registre",spouleur + register 0 + } + -- Jan Wagner Fri, 26 Jan 2007 16:32:47 +0100 --- nagios-snmp-plugins-1.1.1.orig/debian/docs +++ nagios-snmp-plugins-1.1.1/debian/docs @@ -0,0 +1 @@ +README --- nagios-snmp-plugins-1.1.1.orig/debian/control +++ nagios-snmp-plugins-1.1.1/debian/control @@ -0,0 +1,16 @@ +Source: nagios-snmp-plugins +Section: net +Priority: optional +Maintainer: Debian Nagios Maintainer Group +Uploaders: Jan Wagner +Build-Depends: debhelper (>= 5), dpatch +Homepage: http://www.manubulon.com/nagios/index_snmp.html +Vcs-Browser: http://svn.debian.org/wsvn/pkg-nagios/nagios-snmp-plugins/ +Vcs-Svn: svn://svn.debian.org/pkg-nagios/nagios-snmp-plugins/trunk/ +Standards-Version: 3.8.4 + +Package: nagios-snmp-plugins +Architecture: all +Depends: ${perl:Depends}, ${misc:Depends}, libnet-snmp-perl, nagios-plugins-basic (>= 1.4.5-2), perl-base (>= 5.8.4-8), ucf +Description: SNMP Plugins for nagios + A set of Nagios plugins to check hosts/devices using snmp protocol --- nagios-snmp-plugins-1.1.1.orig/debian/README.source +++ nagios-snmp-plugins-1.1.1/debian/README.source @@ -0,0 +1,3 @@ +We use dpatch for patch handling inside our package(s). Please see +/usr/share/doc/dpatch/README.source.gz (if you have installed dpatch) for +documentation about dpatch. --- nagios-snmp-plugins-1.1.1.orig/debian/rules +++ nagios-snmp-plugins-1.1.1/debian/rules @@ -0,0 +1,71 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +include /usr/share/dpatch/dpatch.make + +COMMANDDEFPATH:=/etc/nagios-plugins/config/ +NP_DIR:=debian/nagios-snmp-plugins +NP_TEMPLATES:=$(NP_DIR)/usr/share/nagios-snmp-plugins/pluginconfig +NP_LIBEXEC:=/usr/lib/nagios/plugins + +plugin_cfgs:=snmp_cpfw snmp_env snmp_int snmp_load snmp_mem snmp_process \ + snmp_storage snmp_vrrp snmp_win + +build: patch-stamp + +clean: unpatch + dh_testdir + dh_testroot + + dh_clean + -rm -f debian/postrm + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/nagios-snmp-plugins. + for PLUGINS in *.pl; \ + do \ + install -D -m 0755 $$PLUGINS $(NP_DIR)$(NP_LIBEXEC)/$$PLUGINS || exit 1; \ + sed -i "s#/usr/local/nagios/libexec#$(NP_LIBEXEC)#" $(NP_DIR)$(NP_LIBEXEC)/$$PLUGINS || exit 1; \ + done + # copying templates them into seperate "template" directories outside of + # /usr/share/doc for ucf to use. + install -d $(NP_DIR)/usr/share/nagios-snmp-plugins/pluginconfig + for c in ${plugin_cfgs}; do \ + cp debian/pluginconfig/$${c}.cfg ${NP_TEMPLATES}; \ + done + # here the list of config templates are writen to postrm + sed -e 's/@PLUGINS@/${plugin_cfgs}/' \ + < debian/postrm.in \ + > debian/postrm + # copy html documentation over + install -d $(NP_DIR)/usr/share/doc/nagios-snmp-plugins/html/ + cp doc/* $(NP_DIR)/usr/share/doc/nagios-snmp-plugins/html/ + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_link + dh_compress + dh_fixperms + dh_perl + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build install +# We have nothing to do for now. + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- nagios-snmp-plugins-1.1.1.orig/debian/postinst +++ nagios-snmp-plugins-1.1.1/debian/postinst @@ -0,0 +1,23 @@ +#!/bin/sh -e + +templdir=/usr/share/nagios-snmp-plugins/pluginconfig + +if [ "$1" = "configure" ]; then + if [ -f /usr/share/nagios-plugins/dpkg/functions ]; then + # only working with nagios-plugins-basic (>= 1.4.5-2) + . /usr/share/nagios-plugins/dpkg/functions + register_cfgs $2 + else + # to get working with etch + ( + cd $templdir + for f in *cfg; do + ucf $f /etc/nagios-plugins/config/$f + done + ); + fi +fi + +#DEBHELPER# + +exit 0 --- nagios-snmp-plugins-1.1.1.orig/debian/changelog +++ nagios-snmp-plugins-1.1.1/debian/changelog @@ -0,0 +1,73 @@ +nagios-snmp-plugins (1.1.1-8) unstable; urgency=low + + * Add 10_fix_net_snmp_version.dpatch + - Fixing Net::SNMP version (Closes: #699413) + + -- Jan Wagner Thu, 31 Jan 2013 08:56:00 +0100 + +nagios-snmp-plugins (1.1.1-7) unstable; urgency=low + + * Add "Copyright" to all copyrights in debian/copyright + * Updating standards version to 3.8.4 + - Add README.source + * Add 1.0 to debian/source/format + * Add trailing trunk/ at Vcs-Svn-field + + -- Jan Wagner Wed, 10 Mar 2010 10:18:35 +0100 + +nagios-snmp-plugins (1.1.1-6) unstable; urgency=low + + * instead of suggest depend on nagios-plugins-basic to get command + definitions installed into /etc/nagios-plugins/config and registered via + ucf, since /usr/share/nagios-plugins/dpkg/functions is used in postinst + (Closes: #513872) + + -- Jan Wagner Sun, 01 Feb 2009 23:49:10 +0100 + +nagios-snmp-plugins (1.1.1-5) unstable; urgency=low + + * implement machine-interpretable copyright file + + -- Jan Wagner Sun, 20 Jul 2008 13:17:39 +0200 + +nagios-snmp-plugins (1.1.1-4) unstable; urgency=low + + * adjust copyright, it's GPL2 (and not later) + * update some scripts to newest available version from website + * rename 02_disable_epn.dpatch to 50_disable_epn.dpatch to be the last one + (Closes: #484462) + * Updating standards version to 3.8.0, no changes needed + + -- Jan Wagner Mon, 07 Jul 2008 22:08:37 +0200 + +nagios-snmp-plugins (1.1.1-3) unstable; urgency=low + + * change unit to bit/s in interface check + * add option for scale of bandwidth to interface check + * added Vcs- fields, moved Homepage into source header's field + * bump standards version to 3.7.3 (no changes needed) + * add 02_disable_epn.dpatch to disable epn, since the plugins don't + work with it + * bump copyright of packaging to 2008 + + -- Jan Wagner Mon, 14 Apr 2008 23:20:52 +0200 + +nagios-snmp-plugins (1.1.1-2) unstable; urgency=low + + * make use of dpatch infrastructure + * include a fix for check_snmp_env.pl from cvs + + -- Jan Wagner Fri, 6 Jul 2007 22:22:02 +0200 + +nagios-snmp-plugins (1.1.1-1) unstable; urgency=low + + * new upstream + * include (new) html docs into package + + -- Jan Wagner Wed, 25 Apr 2007 22:00:50 +0200 + +nagios-snmp-plugins (1.1-1) unstable; urgency=low + + * Initial release (Closes: #401678). + + -- Jan Wagner Mon, 15 Jan 2007 20:34:19 +0100 --- nagios-snmp-plugins-1.1.1.orig/debian/postrm.in +++ nagios-snmp-plugins-1.1.1/debian/postrm.in @@ -0,0 +1,19 @@ +#!/bin/sh -e + +PLUGINS="@PLUGINS@" + +if [ "$1" = "purge" ]; then + if which ucf >/dev/null 2>&1; then + have_ucf="yes" + fi + for f in $PLUGINS; do + rm -f /etc/nagios-plugins/config/${f}.cfg + if [ "$have_ucf" = "yes" ]; then + ucf --purge /etc/nagios-plugins/config/${f}.cfg + fi + done +fi + +#DEBHELPER# + +exit 0 --- nagios-snmp-plugins-1.1.1.orig/debian/compat +++ nagios-snmp-plugins-1.1.1/debian/compat @@ -0,0 +1 @@ +5 --- nagios-snmp-plugins-1.1.1.orig/debian/watch +++ nagios-snmp-plugins-1.1.1/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://www.manubulon.com/nagios/nagios-snmp-plugins\.(.*)\.tgz debian uupdate --- nagios-snmp-plugins-1.1.1.orig/debian/copyright +++ nagios-snmp-plugins-1.1.1/debian/copyright @@ -0,0 +1,46 @@ +Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196 +Packaged-By: Jan Wagner +Packaged-Date: Tue, 5 Dec 2006 11:52:19 +0100 +Upstream-Name: Nagios SNMP Plugins +Upstream-Maintainer: Patrick Proy (nagios at proy.org) +Upstream-Source: http://www.manubulon.com/nagios + +Files: * +Copyright: Copyright (C) 2004-2007 Patrick Proy (nagios at proy.org) +License: GPL-2 + +Files: debian/* +Copyright: Copyright (C) 2006, 2008 Jan Wagner +License: GPL-2+ + +License: GPL-2 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +License: GPL-2+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL file. --- nagios-snmp-plugins-1.1.1.orig/debian/patches/50_disable_epn.dpatch +++ nagios-snmp-plugins-1.1.1/debian/patches/50_disable_epn.dpatch @@ -0,0 +1,133 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 50_disable_epn.dpatch by Jan Wagner +## +## DP: leave marks to disable epn + +@DPATCH@ + +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_boostedge.pl nagios-snmp-plugins-1.1.1/check_snmp_boostedge.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_boostedge.pl 2007-01-16 23:57:14.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_boostedge.pl 2008-05-23 14:09:04.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_boostedge.pl ################# + # Version : 1.0 + # Date : Jan 16 2007 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_cpfw.pl nagios-snmp-plugins-1.1.1/check_snmp_cpfw.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_cpfw.pl 2007-04-20 00:03:30.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_cpfw.pl 2008-05-23 14:09:09.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_cpfw ############## + # Version : 1.2.1 + # Date : April 19 2007 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_css_main.pl nagios-snmp-plugins-1.1.1/check_snmp_css_main.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_css_main.pl 2006-10-05 23:40:55.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_css_main.pl 2008-05-23 14:09:25.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_css_main.pl ################# + # Version : 1.0 + # Date : 27 Sept 2006 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_css.pl nagios-snmp-plugins-1.1.1/check_snmp_css.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_css.pl 2007-01-11 17:06:08.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_css.pl 2008-05-23 14:09:18.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_css.pl ################# + # Version : 1.0.1 + # Date : 27 Sept 2006 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_env.pl nagios-snmp-plugins-1.1.1/check_snmp_env.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_env.pl 2008-05-23 14:05:14.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_env.pl 2008-05-23 14:09:32.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_env ################# + # Version : 1.3 + # Date : May 24 2007 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_int.pl nagios-snmp-plugins-1.1.1/check_snmp_int.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_int.pl 2008-05-23 14:05:14.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_int.pl 2008-05-23 14:09:39.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_int ############## + my $Version='1.24'; + # Date : Oct 10 2007 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_linkproof_nhr.pl nagios-snmp-plugins-1.1.1/check_snmp_linkproof_nhr.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_linkproof_nhr.pl 2006-08-26 14:37:12.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_linkproof_nhr.pl 2008-05-23 14:09:46.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_linkproof_nhr ################# + # Version : 1.0 + # Date : Aug 24 2006 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_load.pl nagios-snmp-plugins-1.1.1/check_snmp_load.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_load.pl 2008-05-23 14:05:14.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_load.pl 2008-05-23 14:09:52.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_load ################# + my $Version='1.12'; + # Date : Oct 12 2007 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_mem.pl nagios-snmp-plugins-1.1.1/check_snmp_mem.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_mem.pl 2006-07-09 22:52:37.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_mem.pl 2008-05-23 14:09:58.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_mem ############## + # Version : 1.1 + # Date : Jul 09 2006 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_nsbox.pl nagios-snmp-plugins-1.1.1/check_snmp_nsbox.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_nsbox.pl 2007-01-16 23:55:21.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_nsbox.pl 2008-05-23 14:10:04.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_nsbox ################# + # Version : 1.0 + # Date : Jan 16 2007 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_process.pl nagios-snmp-plugins-1.1.1/check_snmp_process.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_process.pl 2008-05-23 14:05:14.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_process.pl 2008-05-23 14:10:10.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_process ############## + my $Version='1.10'; + # Date : Oct 12 2007 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_storage.pl nagios-snmp-plugins-1.1.1/check_snmp_storage.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_storage.pl 2008-05-23 14:05:14.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_storage.pl 2008-05-23 14:10:15.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_storage ############## + # Version : 1.3.3 + # Date : Jun 1 2007 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_vrrp.pl nagios-snmp-plugins-1.1.1/check_snmp_vrrp.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_vrrp.pl 2006-08-23 23:39:48.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_vrrp.pl 2008-05-23 14:10:21.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_vrrp ############## + # Version : 1.3 + # Date : Aug 23 2006 +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_win.pl nagios-snmp-plugins-1.1.1/check_snmp_win.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_win.pl 2008-05-23 14:05:14.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_win.pl 2008-05-23 14:10:26.000000000 +0200 +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_win ############## + my $Version='1.1'; + # Date : Oct 12 2007 --- nagios-snmp-plugins-1.1.1.orig/debian/patches/01_check_snmp_env.dpatch +++ nagios-snmp-plugins-1.1.1/debian/patches/01_check_snmp_env.dpatch @@ -0,0 +1,133 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 01_check_snmp_env.dpatch by Jan Wagner +## +## DP: Fix some issues via cvs version + +@DPATCH@ + +--- old/check_snmp_env.pl 2007-07-04 09:46:55.000000000 +0200 ++++ new/check_snmp_env.pl 2007-07-06 22:17:06.000000000 +0200 +@@ -1,7 +1,7 @@ + #!/usr/bin/perl -w + ############################## check_snmp_env ################# +-# Version : 1.2 +-# Date : April 19 2007 ++# Version : 1.3 ++# Date : May 24 2007 + # Author : Patrick Proy ( patrick at proy.org) + # Help : http://www.manubulon.com/nagios/ + # Licence : GPL - http://www.fsf.org/licenses/gpl.txt +@@ -145,9 +145,24 @@ + + my @foundry_status = (3,0,2); # oper status : 1:other, 2: Normal, 3: Failure + ++# Linux Net-SNMP with LM-SENSORS ++my $linux_temp = "1.3.6.1.4.1.2021.13.16.2.1"; # temperature table ++my $linux_temp_descr = "1.3.6.1.4.1.2021.13.16.2.1.2"; # temperature entry description ++my $linux_temp_value = "1.3.6.1.4.1.2021.13.16.2.1.3"; # temperature entry value (mC) ++my $linux_fan = "1.3.6.1.4.1.2021.13.16.3.1"; # fan table ++my $linux_fan_descr = "1.3.6.1.4.1.2021.13.16.3.1.2"; # fan entry description ++my $linux_fan_value = "1.3.6.1.4.1.2021.13.16.3.1.3"; # fan entry value (RPM) ++my $linux_volt = "1.3.6.1.4.1.2021.13.16.4.1"; # voltage table ++my $linux_volt_descr = "1.3.6.1.4.1.2021.13.16.4.1.2"; # voltage entry description ++my $linux_volt_value = "1.3.6.1.4.1.2021.13.16.4.1.3"; # voltage entry value (mV) ++my $linux_misc = "1.3.6.1.4.1.2021.13.16.4.1"; # misc table ++my $linux_misc_descr = "1.3.6.1.4.1.2021.13.16.4.1.2"; # misc entry description ++my $linux_misc_value = "1.3.6.1.4.1.2021.13.16.4.1.3"; # misc entry value ++ ++ + # Globals + +-my $Version='1.2'; ++my $Version='1.3'; + + my $o_host = undef; # hostname + my $o_community = undef; # community +@@ -160,7 +175,7 @@ + my $o_version2= undef; # use snmp v2c + # check type + my $o_check_type= "cisco"; # default Cisco +-my @valid_types =("cisco","nokia","bc","iron","foundry"); ++my @valid_types =("cisco","nokia","bc","iron","foundry","linux"); + my $o_temp= undef; # max temp + my $o_fan= undef; # min fan speed + +@@ -177,7 +192,7 @@ + sub p_version { print "check_snmp_env version : $Version\n"; } + + sub print_usage { +- print "Usage: $0 [-v] -H -C [-2] | (-l login -x passwd [-X pass -L ,]) [-p ] -T (cisco|nokia|bc|iron|foundry) [-F ] [-c ] [-f] [-t ] [-V]\n"; ++ print "Usage: $0 [-v] -H -C [-2] | (-l login -x passwd [-X pass -L ,]) [-p ] -T (cisco|nokia|bc|iron|foundry|linux) [-F ] [-c ] [-f] [-t ] [-V]\n"; + } + + sub isnnum { # Return true if arg is not a number +@@ -221,17 +236,18 @@ + -P, --port=PORT + SNMP port (Default 161) + -T, --type=cisco|nokia|bc|iron|foundry +- Environemental check : +- cisco : voltage,temp,fan,power supply status +- will try to check everything present +- nokia : fan and power supply +- bc : fans, power supply, voltage, disks +- iron : fans, power supply, temp +- foundry : power supply, temp ++ Environemental check : ++ cisco : All Cisco equipements : voltage,temp,fan,power supply ++ (will try to check everything in the env mib) ++ nokia : Nokia IP platforms : fan and power supply ++ bc : BlueCoat platforms : fans, power supply, voltage, disks ++ iron : IronPort platforms : fans, power supply, temp ++ foundry : Foundry Network platforms : power supply, temp ++ linux : Net-SNMP with LM-SENSORS : temp, fan, volt, misc + -F, --fan= +- Minimum fan rpm value ++ Minimum fan rpm value (only needed for 'iron' & 'linux') + -c, --celcius= +- Maximum temp in degree celcius ++ Maximum temp in degree celcius (only needed for 'iron' & 'linux') + -f, --perfparse + Perfparse compatible output + -t, --timeout=INTEGER +@@ -428,8 +444,10 @@ + if (!defined ($cur_status)) { ### Error TODO + $volt_global=1; + } +- $perf_output.=" '".$$resultat{$ciscoVoltageTableDesc .".".$voltindex[$i]}."'=" ; +- $perf_output.=$$resultat{$ciscoVoltageTableValue."." . $voltindex[$i]}; ++ if (defined($$resultat{$ciscoVoltageTableValue."." . $voltindex[$i]})) { ++ $perf_output.=" '".$$resultat{$ciscoVoltageTableDesc .".".$voltindex[$i]}."'=" ; ++ $perf_output.=$$resultat{$ciscoVoltageTableValue."." . $voltindex[$i]}; ++ } + if ($Nagios_state[$CiscoEnvMonNagios{$cur_status}] ne "OK") { + $volt_global= 1; + $volt_status{$$resultat{$ciscoVoltageTableDesc .".".$voltindex[$i]}}=$cur_status; +@@ -448,8 +466,10 @@ + if (!defined ($cur_status)) { ### Error TODO + $temp_global=1; + } +- $perf_output.=" '".$$resultat{$ciscoTempTableDesc .".".$tempindex[$i]}."'=" ; +- $perf_output.=$$resultat{$ciscoTempTableValue."." . $tempindex[$i]}; ++ if (defined($$resultat{$ciscoTempTableValue."." . $tempindex[$i]})) { ++ $perf_output.=" '".$$resultat{$ciscoTempTableDesc .".".$tempindex[$i]}."'=" ; ++ $perf_output.=$$resultat{$ciscoTempTableValue."." . $tempindex[$i]}; ++ } + if ($Nagios_state[$CiscoEnvMonNagios{$cur_status}] ne "OK") { + $temp_global= 1; + $temp_status{$$resultat{$ciscoTempTableDesc .".".$tempindex[$i]}}=$cur_status; +@@ -1003,4 +1023,14 @@ + + } + +-exit (3); ++########### Cisco env checks ############## ++if ($o_check_type eq "linux") { ++ ++ verb("Checking linux env"); ++ ++ print "Not implemented yet : UNKNOWN\n"; ++ exit $ERRORS{"UNKNOWN"}; ++} ++ ++print "Unknown check type : UNKNOWN\n"; ++exit $ERRORS{"UNKNOWN"}; --- nagios-snmp-plugins-1.1.1.orig/debian/patches/05_check_snmp_storage.dpatch +++ nagios-snmp-plugins-1.1.1/debian/patches/05_check_snmp_storage.dpatch @@ -0,0 +1,225 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 05_check_snmp_storage.dpatch by Jan Wagner +## +## DP: Update script to version 1.3.3 + +@DPATCH@ + +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_storage.pl nagios-snmp-plugins-1.1.1/check_snmp_storage.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_storage.pl 2007-03-12 22:01:36.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_storage.pl 2007-10-12 22:23:24.000000000 +0200 +@@ -1,12 +1,12 @@ + #!/usr/bin/perl -w + ############################## check_snmp_storage ############## +-# Version : 1.3.2 +-# Date : March 12 2007 ++# Version : 1.3.3 ++# Date : Jun 1 2007 + # Author : Patrick Proy ( patrick at proy.org) + # Help : http://nagios.manubulon.com + # Licence : GPL - http://www.fsf.org/licenses/gpl.txt + # TODO : +-# Contribs : Dimo Velev, Makina Corpus ++# Contribs : Dimo Velev, Makina Corpus, A. Greiner-Bär + ################################################################# + # + # help : ./check_snmp_storage -h +@@ -57,7 +57,7 @@ + # Globals + + my $Name='check_snmp_storage'; +-my $Version='1.3.2'; ++my $Version='1.3.3'; + + my $o_host = undef; # hostname + my $o_community = undef; # community +@@ -80,6 +80,8 @@ + my $o_perf= undef; # Output performance data + my $o_short= undef; # Short output parameters + my @o_shortL= undef; # output type,where,cut ++my $o_reserve= 0; # % reserved blocks (A. Greiner-Bär patch) ++my $o_giga= undef; # output and levels in gigabytes instead of megabytes + # SNMPv3 specific + my $o_login= undef; # Login for snmpv3 + my $o_passwd= undef; # Pass for snmpv3 +@@ -95,7 +97,7 @@ + sub p_version { print "$Name version : $Version\n"; } + + sub print_usage { +- print "Usage: $Name [-v] -H -C [-2] | (-l login -x passwd [-X pass -L ,]) [-p ] -m [-q storagetype] -w -c [-t ] [-T pl|pu|bl|bu ] [-r] [-s] [-i] [-e] [-S 0|1[,1,]] [-o ]\n"; ++ print "Usage: $Name [-v] -H -C [-2] | (-l login -x passwd [-X pass -L ,]) [-p ] -m [-q storagetype] -w -c [-t ] [-T pl|pu|bl|bu ] [-r -s -i -G] [-e] [-S 0|1[,1,]] [-o ] [-R <% reserved>]\n"; + } + + sub round ($$) { +@@ -122,7 +124,7 @@ + + sub help { + print "\nSNMP Disk Monitor for Nagios version ",$Version,"\n"; +- print "(c)2004-2006 Patrick Proy\n\n"; ++ print "(c)2004-2007 Patrick Proy\n\n"; + print_usage(); + print <[,,] +@@ -245,7 +252,9 @@ + 'q:s' => \$o_storagetype, 'storagetype:s'=> \$o_storagetype, + 'S:s' => \$o_short, 'short:s' => \$o_short, + 'o:i' => \$o_octetlength, 'octetlength:i' => \$o_octetlength, +- 'f' => \$o_perf, 'perfparse' => \$o_perf ++ 'f' => \$o_perf, 'perfparse' => \$o_perf, ++ 'R:i' => \$o_reserve, 'reserved:i' => \$o_reserve, ++ 'G' => \$o_giga, 'gigabyte' => \$o_giga + ); + if (defined($o_help) ) { help(); exit $ERRORS{"UNKNOWN"}}; + if (defined($o_version) ) { p_version(); exit $ERRORS{"UNKNOWN"}}; +@@ -271,6 +280,9 @@ + # Check compulsory attributes + if ( ! defined($o_descr) || ! defined($o_host) || !defined($o_warn) || + !defined($o_crit)) { print_usage(); exit $ERRORS{"UNKNOWN"}}; ++ # Get rid of % sign if any ++ $o_warn =~ s/\%//; ++ $o_crit =~ s/\%//; + # Check for positive numbers + if (($o_warn < 0) || ($o_crit < 0)) { print " warn and critical > 0 \n";print_usage(); exit $ERRORS{"UNKNOWN"}}; + # check if warn or crit in % and MB is tested +@@ -278,9 +290,6 @@ + print "warning or critical cannot be in % when MB are tested\n"; + print_usage(); exit $ERRORS{"UNKNOWN"}; + } +- # Get rid of % sign +- $o_warn =~ s/\%//; +- $o_crit =~ s/\%//; + # Check warning and critical values + if ( ( $o_type eq 'pu' ) || ( $o_type eq 'bu' )) { + if ($o_warn >= $o_crit) { print " warn < crit if type=",$o_type,"\n";print_usage(); exit $ERRORS{"UNKNOWN"}}; +@@ -306,6 +315,10 @@ + if (defined ($o_octetlength) && (isnnum($o_octetlength) || $o_octetlength > 65535 || $o_octetlength < 484 )) { + print "octet lenght must be < 65535 and > 484\n";print_usage(); exit $ERRORS{"UNKNOWN"}; + } ++ #### reserved blocks checks (A. Greiner-Bär patch). ++ if (defined ($o_reserve) && (isnnum($o_reserve) || $o_reserve > 99 || $o_reserve < 0 )) { ++ print "reserved blocks must be < 100 and >= 0\n";print_usage(); exit $ERRORS{"UNKNOWN"}; ++ } + } + + ########## MAIN ####### +@@ -521,21 +534,35 @@ + my $crit_state=0; + my ($p_warn,$p_crit); + my $output=undef; ++my $output_metric_val = 1024**2; ++my $output_metric = "M"; ++# Set the metric ++if (defined($o_giga)) { ++ $output_metric_val *= 1024; ++ $output_metric='G'; ++} ++ + for ($i=0;$i<$num_int;$i++) { + verb("Descr : $descr[$i]"); + verb("Size : $$result{$size_table . $tindex[$i]}"); + verb("Used : $$result{$used_table . $tindex[$i]}"); + verb("Alloc : $$result{$alloc_units . $tindex[$i]}"); +- my $to = $$result{$size_table . $tindex[$i]} * $$result{$alloc_units . $tindex[$i]} / 1024**2; ++ if (!defined($$result{$size_table . $tindex[$i]}) || ++ !defined($$result{$used_table . $tindex[$i]}) || ++ !defined ($$result{$alloc_units . $tindex[$i]})) { ++ print "Data not fully defined for storage ",$descr[$i]," : UNKNOWN\n"; ++ exit $ERRORS{"UNKNOWN"}; ++ } ++ my $to = $$result{$size_table . $tindex[$i]} * ( ( 100 - $o_reserve ) / 100 ) * $$result{$alloc_units . $tindex[$i]} / $output_metric_val; + my $pu=undef; + if ( $$result{$used_table . $tindex[$i]} != 0 ) { +- $pu = $$result{$used_table . $tindex[$i]}*100 / $$result{$size_table . $tindex[$i]}; ++ $pu = $$result{$used_table . $tindex[$i]}* 100 / ( $$result{$size_table . $tindex[$i]} * ( 100 - $o_reserve ) / 100 ); + }else { + $pu=0; + } +- my $bu = $$result{$used_table . $tindex[$i]} * $$result{$alloc_units . $tindex[$i]} / 1024**2; ++ my $bu = $$result{$used_table . $tindex[$i]} * $$result{$alloc_units . $tindex[$i]} / $output_metric_val; + my $pl = 100 - $pu; +- my $bl = ($$result{$size_table . $tindex[$i]}- $$result{$used_table . $tindex[$i]}) * $$result{$alloc_units . $tindex[$i]} / 1024**2; ++ my $bl = ( ( $$result{$size_table . $tindex[$i]} * ( ( 100 - $o_reserve ) / 100 ) - ( $$result{$used_table . $tindex[$i]} ) ) * $$result{$alloc_units . $tindex[$i]} / $output_metric_val ); + # add a ' ' if some data exists in $perf_out + $perf_out .= " " if (defined ($perf_out)) ; + ##### Ouputs and checks +@@ -554,7 +581,7 @@ + || (($pu >= $o_warn) && ($locstate=$warn_state=1)); + if (defined($o_shortL[2])) {} + if (!defined($o_shortL[0]) || ($locstate==1)) { # print full output if warn or critical state +- $output.=sprintf ("%s: %.0f%%used(%.0fMB/%.0fMB) ",$descr[$i],$pu,$bu,$to); ++ $output.=sprintf ("%s: %.0f%%used(%.0f%sB/%.0f%sB) ",$descr[$i],$pu,$bu,$output_metric,$to,$output_metric); + } elsif ($o_shortL[0] == 1) { + $output.=sprintf ("%s: %.0f%% ",$descr[$i],$pu); + } +@@ -566,9 +593,9 @@ + ( ($bu >= $o_crit) && ($locstate=$crit_state=1) ) + || ( ($bu >= $o_warn) && ($locstate=$warn_state=1) ); + if (!defined($o_shortL[0]) || ($locstate==1)) { # print full output if warn or critical state +- $output.=sprintf("%s: %.0fMBused/%.0fMB (%.0f%%) ",$descr[$i],$bu,$to,$pu); ++ $output.=sprintf("%s: %.0f%sBused/%.0f%sB (%.0f%%) ",$descr[$i],$bu,$output_metric,$to,$output_metric,$pu); + } elsif ($o_shortL[0] == 1) { +- $output.=sprintf("%s: %.0fMB ",$descr[$i],$bu); ++ $output.=sprintf("%s: %.0f%sB ",$descr[$i],$bu,$output_metric); + } + } + +@@ -578,9 +605,9 @@ + ( ($bl <= $o_crit) && ($locstate=$crit_state=1) ) + || ( ($bl <= $o_warn) && ($locstate=$warn_state=1) ); + if (!defined($o_shortL[0]) || ($locstate==1)) { # print full output if warn or critical state +- $output.=sprintf ("%s: %.0fMBleft/%.0fMB (%.0f%%) ",$descr[$i],$bl,$to,$pl); ++ $output.=sprintf ("%s: %.0f%sBleft/%.0f%sB (%.0f%%) ",$descr[$i],$bl,$output_metric,$to,$output_metric,$pl); + } elsif ($o_shortL[0] == 1) { +- $output.=sprintf ("%s: %.0fMB ",$descr[$i],$bl); ++ $output.=sprintf ("%s: %.0f%sB ",$descr[$i],$bl,$output_metric); + } + } + +@@ -590,13 +617,13 @@ + ( ($pl <= $o_crit) && ($locstate=$crit_state=1) ) + || ( ($pl <= $o_warn) && ($locstate=$warn_state=1) ); + if (!defined($o_shortL[0]) || ($locstate==1)) { # print full output if warn or critical state +- $output.=sprintf ("%s: %.0f%%left(%.0fMB/%.0fMB) ",$descr[$i],$pl,$bl,$to); ++ $output.=sprintf ("%s: %.0f%%left(%.0f%sB/%.0f%sB) ",$descr[$i],$pl,$bl,$output_metric,$to,$output_metric); + } elsif ($o_shortL[0] == 1) { + $output.=sprintf ("%s: %.0f%% ",$descr[$i],$pl); + } + } + # Performance output (in MB) +- $perf_out .= "'".$Pdescr. "'=" . round($bu,0) . "MB;" . round($p_warn,0) ++ $perf_out .= "'".$Pdescr. "'=" . round($bu,0) . $output_metric ."B;" . round($p_warn,0) + . ";" . round($p_crit,0) . ";0;" . round($to,0); + } + +@@ -606,8 +633,8 @@ + my $comp_unit=undef; + ($o_type eq "pu") && ($comp_oper ="<") && ($comp_unit ="%"); + ($o_type eq "pl") && ($comp_oper =">") && ($comp_unit ="%"); +-($o_type eq "bu") && ($comp_oper ="<") && ($comp_unit ="MB"); +-($o_type eq 'bl') && ($comp_oper =">") && ($comp_unit ="MB"); ++($o_type eq "bu") && ($comp_oper ="<") && ($comp_unit = $output_metric."B"); ++($o_type eq 'bl') && ($comp_oper =">") && ($comp_unit =$output_metric."B"); + + if (!defined ($output)) { $output="All selected storages "; } + --- nagios-snmp-plugins-1.1.1.orig/debian/patches/10_fix_net_snmp_version.dpatch +++ nagios-snmp-plugins-1.1.1/debian/patches/10_fix_net_snmp_version.dpatch @@ -0,0 +1,451 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_fix_net_snmp_version.dpatch by Jan Wagner +## +## DP: Fixing Net::SNMP version +## DP: (see https://wiki.icinga.org/display/howtos/check_snmp#checksnmp-Argumentv601isntnumericinnumericlt) + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_boostedge.pl nagios-snmp-plugins-1.1.1/check_snmp_boostedge.pl +--- nagios-snmp-plugins-1.1.1~/check_snmp_boostedge.pl 2007-01-16 23:57:14.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_boostedge.pl 2013-01-31 08:38:55.000000000 +0100 +@@ -249,7 +249,7 @@ + + # Get global status + my @oidlist=($be_global_status); +-my $resultat = (Net::SNMP->VERSION < 4) ? ++my $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@oidlist) + : $session->get_request(-varbindlist => \@oidlist); + +@@ -266,7 +266,7 @@ + + $resultat=undef; + # Get service table +-$resultat = (Net::SNMP->VERSION < 4) ? ++$resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($be_service_table) + : $session->get_table(Baseoid => $be_service_table); + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_css.pl nagios-snmp-plugins-1.1.1/check_snmp_css.pl +--- nagios-snmp-plugins-1.1.1~/check_snmp_css.pl 2007-01-11 17:06:08.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_css.pl 2013-01-31 08:38:55.000000000 +0100 +@@ -356,7 +356,7 @@ + } + close (FILE); + } else { +- $resultat = (Net::SNMP->VERSION < 4) ? ++ $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($css_svc_name) + : $session->get_table(Baseoid => $css_svc_name); + +@@ -392,7 +392,7 @@ + } + + $resultat = undef; +-$resultat = (Net::SNMP->VERSION < 4) ? ++$resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@oid_list) + : $session->get_request(-varbindlist => \@oid_list); + +@@ -402,7 +402,7 @@ + exit $ERRORS{"UNKNOWN"}; + } + my $resultat2 = undef; +-$resultat2 = (Net::SNMP->VERSION < 4) ? ++$resultat2 = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@oid_list2) + : $session->get_request(-varbindlist => \@oid_list2); + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_css_main.pl nagios-snmp-plugins-1.1.1/check_snmp_css_main.pl +--- nagios-snmp-plugins-1.1.1~/check_snmp_css_main.pl 2006-10-05 23:40:55.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_css_main.pl 2013-01-31 08:38:55.000000000 +0100 +@@ -219,7 +219,7 @@ + ########### Cisco CSS checks ############## + + # Get load table +-my $resultat = (Net::SNMP->VERSION < 4) ? ++my $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($css_svc_name) + : $session->get_table(Baseoid => $css_svc_name); + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_env.pl nagios-snmp-plugins-1.1.1/check_snmp_env.pl +--- nagios-snmp-plugins-1.1.1~/check_snmp_env.pl 2013-01-31 08:37:55.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_env.pl 2013-01-31 08:38:55.000000000 +0100 +@@ -390,7 +390,7 @@ + verb("Checking cisco env"); + + # Get load table +-my $resultat = (Net::SNMP->VERSION < 4) ? ++my $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($ciscoEnvMonMIB) + : $session->get_table(Baseoid => $ciscoEnvMonMIB); + +@@ -594,7 +594,7 @@ + my $global_status=0; + my $output=""; + # get temp +-$resultat = (Net::SNMP->VERSION < 4) ? ++$resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($nokia_temp_tbl) + : $session->get_table(Baseoid => $nokia_temp_tbl); + if (defined($resultat)) { +@@ -609,7 +609,7 @@ + } + + # Get fan table +-$resultat = (Net::SNMP->VERSION < 4) ? ++$resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($nokia_fan_table) + : $session->get_table(Baseoid => $nokia_fan_table); + +@@ -631,7 +631,7 @@ + } + + # Get ps table +-$resultat = (Net::SNMP->VERSION < 4) ? ++$resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($nokia_ps_table) + : $session->get_table(Baseoid => $nokia_ps_table); + +@@ -697,7 +697,7 @@ + + + # get sensor table +- $resultat = (Net::SNMP->VERSION < 4) ? ++ $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($bc_sensor_table) + : $session->get_table(Baseoid => $bc_sensor_table); + if (defined($resultat)) { +@@ -740,7 +740,7 @@ + } + + # Get disk table +- $resultat = (Net::SNMP->VERSION < 4) ? ++ $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($bc_dsk_table) + : $session->get_table(Baseoid => $bc_dsk_table); + +@@ -811,7 +811,7 @@ + # get temp if $o_temp is defined + if (defined($o_temp)) { + verb("Checking temp < $o_temp"); +- $resultat = (Net::SNMP->VERSION < 4) ? ++ $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($iron_tmp_table) + : $session->get_table(Baseoid => $iron_tmp_table); + if (defined($resultat)) { +@@ -843,7 +843,7 @@ + # Get fan status if $o_fan is defined + if (defined($o_fan)) { + verb("Checking fan > $o_fan"); +- $resultat = (Net::SNMP->VERSION < 4) ? ++ $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($iron_fan_table) + : $session->get_table(Baseoid => $iron_fan_table); + if (defined($resultat)) { +@@ -874,7 +874,7 @@ + + # Get power supply status + verb("Checking PS"); +- $resultat = (Net::SNMP->VERSION < 4) ? ++ $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($iron_ps_table) + : $session->get_table(Baseoid => $iron_ps_table); + if (defined($resultat)) { +@@ -966,7 +966,7 @@ + + # Get PS table (TODO : Bug in FAN table, see with Foundry). + +-my $result_ps = (Net::SNMP->VERSION < 4) ? ++my $result_ps = (Net::SNMP->VERSION lt 4) ? + $session->get_table($foundry_ps_table) + : $session->get_table(Baseoid => $foundry_ps_table); + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_linkproof_nhr.pl nagios-snmp-plugins-1.1.1/check_snmp_linkproof_nhr.pl +--- nagios-snmp-plugins-1.1.1~/check_snmp_linkproof_nhr.pl 2006-08-26 14:37:12.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_linkproof_nhr.pl 2013-01-31 08:38:56.000000000 +0100 +@@ -232,7 +232,7 @@ + my $global_status=0; + + # Get load table +-my $resultat = (Net::SNMP->VERSION < 4) ? ++my $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($lp_type) + : $session->get_table(Baseoid => $lp_type); + +@@ -261,7 +261,7 @@ + } + + my $result=undef; +-if (Net::SNMP->VERSION < 4) { ++if (Net::SNMP->VERSION lt 4) { + $result = $session->get_request(@oids); + } else { + if ($session->version == 0) { +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_load.pl nagios-snmp-plugins-1.1.1/check_snmp_load.pl +--- nagios-snmp-plugins-1.1.1~/check_snmp_load.pl 2013-01-31 08:37:55.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_load.pl 2013-01-31 08:38:56.000000000 +0100 +@@ -346,7 +346,7 @@ + + verb("Checking linux load"); + # Get load table +-my $resultat = (Net::SNMP->VERSION < 4) ? ++my $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($linload_table) + : $session->get_table(Baseoid => $linload_table); + +@@ -410,7 +410,7 @@ + + if ($o_check_type eq "cisco") { + my @oidlists = ($cisco_cpu_5m, $cisco_cpu_1m, $cisco_cpu_5s); +-my $resultat = (Net::SNMP->VERSION < 4) ? ++my $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@oidlists) + : $session->get_request(-varbindlist => \@oidlists); + +@@ -465,7 +465,7 @@ + + if ($o_check_type eq "cata") { + my @oidlists = ($ciscocata_cpu_5m, $ciscocata_cpu_1m, $ciscocata_cpu_5s); +-my $resultat = (Net::SNMP->VERSION < 4) ? ++my $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@oidlists) + : $session->get_request(-varbindlist => \@oidlists); + +@@ -520,7 +520,7 @@ + + if ($o_check_type eq "nsc") { + my @oidlists = ($nsc_cpu_5m, $nsc_cpu_1m, $nsc_cpu_5s); +-my $resultat = (Net::SNMP->VERSION < 4) ? ++my $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@oidlists) + : $session->get_request(-varbindlist => \@oidlists); + +@@ -577,7 +577,7 @@ + # Get load table + my @oidlist = $cpu_oid{$o_check_type}; + verb("Checking OID : @oidlist"); +-my $resultat = (Net::SNMP->VERSION < 4) ? ++my $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@oidlist) + : $session->get_request(-varbindlist => \@oidlist); + if (!defined($resultat)) { +@@ -625,7 +625,7 @@ + verb("Checking hpux load"); + + my @oidlists = ($hpux_load_1_min, $hpux_load_5_min, $hpux_load_15_min); +-my $resultat = (Net::SNMP->VERSION < 4) ? ++my $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@oidlists) + : $session->get_request(-varbindlist => \@oidlists); + +@@ -678,7 +678,7 @@ + + ########## Standard cpu usage check ############ + # Get desctiption table +-my $resultat = (Net::SNMP->VERSION < 4) ? ++my $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($base_proc) + : $session->get_table(Baseoid => $base_proc); + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_mem.pl nagios-snmp-plugins-1.1.1/check_snmp_mem.pl +--- nagios-snmp-plugins-1.1.1~/check_snmp_mem.pl 2006-07-09 22:52:37.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_mem.pl 2013-01-31 08:38:56.000000000 +0100 +@@ -316,7 +316,7 @@ + if (defined ($o_cisco)) { + + # Get Cisco memory table +- $resultat = (Net::SNMP->VERSION < 4) ? ++ $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($cisco_mem_pool) + :$session->get_table(Baseoid => $cisco_mem_pool); + +@@ -393,7 +393,7 @@ + if (defined ($o_hp)) { + + # Get hp memory table +- $resultat = (Net::SNMP->VERSION < 4) ? ++ $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($hp_mem_pool) + :$session->get_table(Baseoid => $hp_mem_pool); + +@@ -462,7 +462,7 @@ + if (defined ($o_netsnmp)) { + + # Get NetSNMP memory values +- $resultat = (Net::SNMP->VERSION < 4) ? ++ $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@nets_oids) + :$session->get_request(-varbindlist => \@nets_oids); + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_nsbox.pl nagios-snmp-plugins-1.1.1/check_snmp_nsbox.pl +--- nagios-snmp-plugins-1.1.1~/check_snmp_nsbox.pl 2007-01-16 23:55:21.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_nsbox.pl 2013-01-31 08:38:56.000000000 +0100 +@@ -265,7 +265,7 @@ + + ########### check global status ############## + my @oidlist=($ns_service_status); +-my $resultat = (Net::SNMP->VERSION < 4) ? ++my $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@oidlist) + : $session->get_request(-varbindlist => \@oidlist); + +@@ -282,7 +282,7 @@ + + ########### check vhost & diode status ############## + $resultat=undef; +-$resultat = (Net::SNMP->VERSION < 4) ? ++$resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($ns_service_table) + : $session->get_table(Baseoid => $ns_service_table); + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_process.pl nagios-snmp-plugins-1.1.1/check_snmp_process.pl +--- nagios-snmp-plugins-1.1.1~/check_snmp_process.pl 2013-01-31 08:37:55.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_process.pl 2013-01-31 08:38:56.000000000 +0100 +@@ -407,11 +407,11 @@ + my %result_cons=(); + my ($getall_run,$getall_cpu,$getall_mem)=(undef,undef,undef); + if ( !defined ($o_path) ) { +- $resultat = (Net::SNMP->VERSION < 4) ? ++ $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($run_name_table) + : $session->get_table(Baseoid => $run_name_table); + } else { +- $resultat = (Net::SNMP->VERSION < 4) ? ++ $resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($run_path_table) + :$session->get_table(Baseoid => $run_path_table); + } +@@ -424,7 +424,7 @@ + + my $resultat_param=undef; + if (defined($o_param)) { # Get parameter table too +- $resultat_param = (Net::SNMP->VERSION < 4) ? ++ $resultat_param = (Net::SNMP->VERSION lt 4) ? + $session->get_table($run_param_table) + :$session->get_table(Baseoid => $run_param_table); + if (!defined($resultat_param)) { +@@ -436,7 +436,7 @@ + } + + if (defined ($o_get_all)) { +- $getall_run = (Net::SNMP->VERSION < 4) ? ++ $getall_run = (Net::SNMP->VERSION lt 4) ? + $session->get_table($proc_run_state ) + :$session->get_table(Baseoid => $proc_run_state ); + if (!defined($getall_run)) { +@@ -447,7 +447,7 @@ + foreach my $key ( keys %$getall_run) { + $result_cons{$key}=$$getall_run{$key}; + } +- $getall_cpu = (Net::SNMP->VERSION < 4) ? ++ $getall_cpu = (Net::SNMP->VERSION lt 4) ? + $session->get_table($proc_cpu_table) + : $session->get_table(Baseoid => $proc_cpu_table); + if (!defined($getall_cpu)) { +@@ -458,7 +458,7 @@ + foreach my $key ( keys %$getall_cpu) { + $result_cons{$key}=$$getall_cpu{$key}; + } +- $getall_mem = (Net::SNMP->VERSION < 4) ? ++ $getall_mem = (Net::SNMP->VERSION lt 4) ? + $session->get_table($proc_mem_table) + : $session->get_table(Baseoid => $proc_mem_table); + if (!defined($getall_mem)) { +@@ -539,7 +539,7 @@ + $toid[$i]=$oids[$i+$tmp_index]; + #verb("$i : $toid[$i] : $oids[$i+$tmp_index]"); + } +- $tmp_result = (Net::SNMP->VERSION < 4) ? ++ $tmp_result = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@toid) + : $session->get_request(Varbindlist => \@toid); + if (!defined($tmp_result)) { printf("ERROR: running table : %s.\n", $session->error); $session->close; +@@ -551,7 +551,7 @@ + } + + } else { +- $result = (Net::SNMP->VERSION < 4) ? ++ $result = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@oids) + : $session->get_request(Varbindlist => \@oids); + if (!defined($result)) { printf("ERROR: running table : %s.\n", $session->error); $session->close; +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_storage.pl nagios-snmp-plugins-1.1.1/check_snmp_storage.pl +--- nagios-snmp-plugins-1.1.1~/check_snmp_storage.pl 2013-01-31 08:37:55.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_storage.pl 2013-01-31 08:38:56.000000000 +0100 +@@ -411,13 +411,13 @@ + # Get rid of UTF8 translation in case of accentuated caracters (thanks to Dimo Velev). + $session->translate(Net::SNMP->TRANSLATE_NONE); + if (defined ($o_index)){ +- if (Net::SNMP->VERSION < 4) { ++ if (Net::SNMP->VERSION lt 4) { + $resultat = $session->get_table($index_table); + } else { + $resultat = $session->get_table(Baseoid => $index_table); + } + } else { +- if (Net::SNMP->VERSION < 4) { ++ if (Net::SNMP->VERSION lt 4) { + $resultat = $session->get_table($descr_table); + } else { + $resultat = $session->get_table(Baseoid => $descr_table); +@@ -425,7 +425,7 @@ + } + #get storage typetable for reference + if (defined($o_storagetype)){ +- if (Net::SNMP->VERSION < 4) { ++ if (Net::SNMP->VERSION lt 4) { + $stype = $session->get_table($storagetype_table); + } else { + $stype = $session->get_table(Baseoid => $storagetype_table); +@@ -491,7 +491,7 @@ + + my $result=undef; + +-if (Net::SNMP->VERSION < 4) { ++if (Net::SNMP->VERSION lt 4) { + $result = $session->get_request(@oids); + } else { + if ($session->version == 0) { +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_vrrp.pl nagios-snmp-plugins-1.1.1/check_snmp_vrrp.pl +--- nagios-snmp-plugins-1.1.1~/check_snmp_vrrp.pl 2006-08-23 23:39:48.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_vrrp.pl 2013-01-31 08:38:56.000000000 +0100 +@@ -306,7 +306,7 @@ + if ($o_type eq "ipso") { + # Get cluster table + my $resultat; +-if (Net::SNMP->VERSION < 4) { ++if (Net::SNMP->VERSION lt 4) { + $resultat = $session->get_table( $nokia_clust_table ); + } else { + $resultat = $session->get_table( Baseoid => $nokia_clust_table ); +@@ -364,7 +364,7 @@ + + # Get vrrp table + my $resultat; +-if (Net::SNMP->VERSION < 4) { ++if (Net::SNMP->VERSION lt 4) { + $resultat = $session->get_table( $base_vrrp{$o_type} ); + } else { + $resultat = $session->get_table( Baseoid => $base_vrrp{$o_type} ); +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_win.pl nagios-snmp-plugins-1.1.1/check_snmp_win.pl +--- nagios-snmp-plugins-1.1.1~/check_snmp_win.pl 2013-01-31 08:37:55.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_win.pl 2013-01-31 08:38:56.000000000 +0100 +@@ -256,7 +256,7 @@ + # Look for process in name or path name table + my $resultat=undef; + +-$resultat = (Net::SNMP->VERSION < 4) ? ++$resultat = (Net::SNMP->VERSION lt 4) ? + $session->get_table($win_serv_name) + : $session->get_table(Baseoid => $win_serv_name); + +@@ -314,7 +314,7 @@ + my $result=undef; + my $num_int_ok=0; + +-$result = (Net::SNMP->VERSION < 4) ? ++$result = (Net::SNMP->VERSION lt 4) ? + $session->get_request(@oids) + : $session->get_request(Varbindlist => \@oids); + --- nagios-snmp-plugins-1.1.1.orig/debian/patches/03_check_snmp_load.dpatch +++ nagios-snmp-plugins-1.1.1/debian/patches/03_check_snmp_load.dpatch @@ -0,0 +1,46 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 03_check_snmp_load.dpatch by Jan Wagner +## +## DP: Update script to version 1.12 + +@DPATCH@ + +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_load.pl nagios-snmp-plugins-1.1.1/check_snmp_load.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_load.pl 2007-04-16 19:41:20.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_load.pl 2007-10-12 22:23:23.000000000 +0200 +@@ -1,11 +1,10 @@ + #!/usr/bin/perl -w + ############################## check_snmp_load ################# +-# Version : 1.3.2 +-# Date : Jan 16 2007 ++my $Version='1.12'; ++# Date : Oct 12 2007 + # Author : Patrick Proy ( patrick at proy.org) +-# Help : http://www.manubulon.com/nagios/ ++# Help : http://nagios.manubulon.com/ + # Licence : GPL - http://www.fsf.org/licenses/gpl.txt +-# Changelog : HP-UX load added. + # Contributors : F. Lacroix and many others !!! + ################################################################# + # +@@ -18,10 +17,8 @@ + + # Nagios specific + +-use lib "/usr/local/nagios/libexec"; +-use utils qw(%ERRORS $TIMEOUT); +-#my $TIMEOUT = 15; +-#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4); ++my $TIMEOUT = 15; ++my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4); + + # SNMP Datas + +@@ -94,7 +91,6 @@ + + # Globals + +-my $Version='1.3.2'; + + my $o_host = undef; # hostname + my $o_community = undef; # community --- nagios-snmp-plugins-1.1.1.orig/debian/patches/00list +++ nagios-snmp-plugins-1.1.1/debian/patches/00list @@ -0,0 +1,8 @@ +01_check_snmp_env.dpatch +02_check_snmp_int.dpatch +03_check_snmp_load.dpatch +04_check_snmp_process.dpatch +05_check_snmp_storage.dpatch +06_check_snmp_win.dpatch +10_fix_net_snmp_version.dpatch +50_disable_epn.dpatch --- nagios-snmp-plugins-1.1.1.orig/debian/patches/02_check_snmp_int.dpatch +++ nagios-snmp-plugins-1.1.1/debian/patches/02_check_snmp_int.dpatch @@ -0,0 +1,375 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 02_check_snmp_int.dpatch by Jan Wagner +## +## DP: Update script to version 1.24 + +@DPATCH@ + + +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_int.pl nagios-snmp-plugins-1.1.1/check_snmp_int.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_int.pl 2007-04-23 11:40:39.000000000 +0200 ++++ nagios-snmp-plugins-1.1.1/check_snmp_int.pl 2007-10-12 22:23:22.000000000 +0200 +@@ -1,13 +1,12 @@ + #!/usr/bin/perl -w + ############################## check_snmp_int ############## +-# Version : 1.4.6 +-# Date : April 23 2007 ++my $Version='1.24'; ++# Date : Oct 10 2007 + # Author : Patrick Proy ( patrick at proy.org ) + # Help : http://nagios.manubulon.com + # Licence : GPL - http://www.fsf.org/licenses/gpl.txt + # Contrib : J. Jungmann, S. Probst, R. Leroy, M. Berger + # TODO : +-# Check isdn "dormant" state + # Maybe put base directory for performance as an option + ################################################################# + # +@@ -23,10 +22,8 @@ + + # Nagios specific + +-use lib "/usr/local/nagios/libexec"; +-use utils qw(%ERRORS $TIMEOUT); +-#my $TIMEOUT = 5; +-#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4); ++my $TIMEOUT = 15; ++my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4); + + # SNMP Datas + +@@ -36,6 +33,7 @@ + my $oper_table = '1.3.6.1.2.1.2.2.1.8.'; + my $admin_table = '1.3.6.1.2.1.2.2.1.7.'; + my $speed_table = '1.3.6.1.2.1.2.2.1.5.'; ++my $speed_table_64 = '1.3.6.1.2.1.31.1.1.1.15.'; + my $in_octet_table = '1.3.6.1.2.1.2.2.1.10.'; + my $in_octet_table_64 = '1.3.6.1.2.1.31.1.1.1.6.'; + my $in_error_table = '1.3.6.1.2.1.2.2.1.14.'; +@@ -49,7 +47,6 @@ + + # Globals + +-my $Version='1.4.6'; + + # Standard options + my $o_host = undef; # hostname +@@ -58,6 +55,7 @@ + my $o_help= undef; # wan't some help ? + my $o_admin= undef; # admin status instead of oper + my $o_inverse= undef; # Critical when up ++my $o_dormant= undef; # Dormant state is OK + my $o_verb= undef; # verbose mode + my $o_version= undef; # print version + my $o_noreg= undef; # Do not use Regexp for name +@@ -66,16 +64,16 @@ + # Performance data options + my $o_perf= undef; # Output performance data + my $o_perfe= undef; # Output discard/error also in perf data +-my $o_perfs= undef; # include speed in performance output (-S) +-my $o_perfp= undef; # output performance data in % of max speed (-y) +-my $o_perfr= undef; # output performance data in bits/s or Bytes/s (-Y) ++my $o_perfs= undef; # include speed in performance output (-S) ++my $o_perfp= undef; # output performance data in % of max speed (-y) ++my $o_perfr= undef; # output performance data in bits/s or Bytes/s (-Y) + # Speed/error checks + my $o_checkperf= undef; # checks in/out/err/disc values + my $o_delta= 300; # delta of time of perfcheck (default 5min) + my $o_ext_checkperf= undef; # extended perf checks (+error+discard) + my $o_warn_opt= undef; # warning options + my $o_crit_opt= undef; # critical options +-my $o_kbits= undef; # Warn and critical in Kbits instead of KBytes ++my $o_kbits= undef; # Warn and critical in Kbits instead of KBytes + my @o_warn= undef; # warning levels of perfcheck + my @o_crit= undef; # critical levels of perfcheck + my $o_highperf= undef; # Use 64 bits counters +@@ -152,7 +150,7 @@ + sub p_version { print "check_snmp_int version : $Version\n"; } + + sub print_usage { +- print "Usage: $0 [-v] -H -C [-2] | (-l login -x passwd [-X pass -L ,) [-p ] -n [-i] [-a] [-r] [-f[eSyY]] [-k[qBMGu] -g -w -c -d] [-o ] [-t ] [-s] --label [-V]\n"; ++ print "Usage: $0 [-v] -H -C [-2] | (-l login -x passwd [-X pass -L ,) [-p ] -n [-i -a -D] [-r] [-f[eSyY]] [-k[qBMGu] -g -w -c -d] [-o ] [-t ] [-s] --label [-V]\n"; + } + + sub isnnum { # Return true if arg is not a number +@@ -195,6 +193,8 @@ + Make critical when up + -a, --admin + Use administrative status instead of operational ++-D, --dormant ++ Dormant state is an OK state + -o, --octetlength=INTEGER + max-size of the SNMP message, usefull in case of Too Long responses. + Be carefull with network filters. Range 484 - 65535, default are +@@ -214,8 +214,8 @@ + --label + Add label before speed in output : in=, out=, errors-out=, etc... + -g, --64bits +- Use 64 bits counters instead of the standard counters +- when checking bandwidth & performance data. ++ Use 64 bits counters instead of the standard counters when checking ++ bandwidth & performance data for interface >= 1Gbps. + You must use snmp v2c or v3 to get 64 bits counters. + -d, --delta=seconds + make an average of seconds (default 300=5min) +@@ -284,7 +284,8 @@ + 'u' => \$o_prct, 'prct' => \$o_prct, + 'o:i' => \$o_octetlength, 'octetlength:i' => \$o_octetlength, + 'label' => \$o_label, +- 'd:i' => \$o_delta, 'delta:i' => \$o_delta ++ 'd:i' => \$o_delta, 'delta:i' => \$o_delta, ++ 'D' => \$o_dormant, 'dormant' => \$o_dormant + ); + if (defined ($o_help) ) { help(); exit $ERRORS{"UNKNOWN"}}; + if (defined($o_version)) { p_version(); exit $ERRORS{"UNKNOWN"}}; +@@ -460,6 +461,7 @@ + my (@oid_perf,@oid_perf_outoct,@oid_perf_inoct,@oid_perf_inerr,@oid_perf_outerr,@oid_perf_indisc,@oid_perf_outdisc)= + (undef,undef,undef,undef,undef,undef,undef); + my @oid_speed=undef; ++my @oid_speed_high=undef; + my $num_int = 0; + + # Change to 64 bit counters if option is set : +@@ -494,7 +496,8 @@ + if (defined($o_perf) || defined($o_checkperf)) { + $oid_perf_inoct[$num_int]= $in_octet_table . $tindex[$num_int]; + $oid_perf_outoct[$num_int]= $out_octet_table . $tindex[$num_int]; +- $oid_speed[$num_int]=$speed_table . $tindex[$num_int]; ++ $oid_speed[$num_int]=$speed_table . $tindex[$num_int]; ++ $oid_speed_high[$num_int]=$speed_table_64 . $tindex[$num_int]; + if (defined($o_ext_checkperf) || defined($o_perfe)) { + $oid_perf_indisc[$num_int]= $in_discard_table . $tindex[$num_int]; + $oid_perf_outdisc[$num_int]= $out_discard_table . $tindex[$num_int]; +@@ -509,25 +512,25 @@ + # No interface found -> error + if ( $num_int == 0 ) { print "ERROR : Unknown interface $o_descr\n" ; exit $ERRORS{"UNKNOWN"};} + +-my ($result,$resultf)=(undef,undef); ++my $result=undef; ++# Add performance oids if requested ++if (defined($o_perf)||defined($o_checkperf)) { ++ @oids=(@oids,@oid_perf_outoct,@oid_perf_inoct,@oid_speed); ++ if (defined($o_highperf)) { ++ @oids=(@oids,@oid_speed_high); ++ } ++ if (defined ($o_ext_checkperf) || defined($o_perfe)) { ++ @oids=(@oids,@oid_perf_inerr,@oid_perf_outerr,@oid_perf_indisc,@oid_perf_outdisc); ++ } ++} ++ + # Get the requested oid values + $result = $session->get_request( + Varbindlist => \@oids + ); +-if (!defined($result)) { printf("ERROR: Status table : %s.\n", $session->error); $session->close; ++if (!defined($result)) { printf("ERROR: Status/statistics table : %s.\n", $session->error); $session->close; + exit $ERRORS{"UNKNOWN"}; + } +-# Get the perf value if -f (performance) option defined or -k (check bandwidth) +-if (defined($o_perf)||defined($o_checkperf)) { +- @oid_perf=(@oid_perf_outoct,@oid_perf_inoct,@oid_perf_inerr,@oid_perf_outerr,@oid_perf_indisc,@oid_perf_outdisc,@oid_speed); +- $resultf = $session->get_request( +- Varbindlist => \@oid_perf +- ); +- if (!defined($resultf)) { printf("ERROR: Statistics table : %s.\n", $session->error); $session->close; +- exit $ERRORS{"UNKNOWN"}; +- } +-} +- + + $session->close; + +@@ -544,6 +547,7 @@ + my $trigger_low=$timenow - 3*$o_delta; + my ($old_value,$old_time)=undef; + my $speed_unit=undef; ++my $speed_real=undef; # speed of interface using either standard or highperf mib. + + # define the OK value depending on -i option + my $ok_val= defined ($o_inverse) ? 2 : 1; +@@ -570,7 +574,22 @@ + $n_rows = shift(@ret_array); + if ($n_rows != 0) { @file_values = @ret_array }; + verb ("File read returns : $return with $n_rows rows"); +- verb ("Interface speed : $$resultf{$oid_speed[$i]}"); ++ # Get the speed in normal or highperf speed counters ++ if ($$result{$oid_speed[$i]} == 4294967295) { # Too high for this counter (cf IF-MIB) ++ if (! defined($o_highperf) && (defined($o_prct) || defined ($o_perfs) || defined ($o_perfp))) { ++ print "Cannot get interface speed with standard MIB, use highperf mib (-g) : UNKNOWN\n"; ++ exit $ERRORS{"UNKNOWN"} ++ } ++ if (defined ($$result{$oid_speed_high[$i]}) && $$result{$oid_speed_high[$i]} != 0) { ++ $speed_real=$$result{$oid_speed_high[$i]} * 1000000; ++ } else { ++ print "Cannot get interface speed using highperf mib : UNKNOWN\n"; ++ exit $ERRORS{"UNKNOWN"} ++ } ++ } else { ++ $speed_real=$$result{$oid_speed[$i]}; ++ } ++ verb ("Interface speed : $speed_real"); + #make the checks if the file is OK + if ($return ==0) { + my $j=$n_rows-1; +@@ -583,7 +602,7 @@ + my $speed_metric=undef; + if (defined($o_prct)) { # in % of speed + # Speed is in bits/s, calculated speed is in Bytes/s +- $speed_metric=$$resultf{$oid_speed[$i]}/800; ++ $speed_metric=$speed_real/800; + $speed_unit="%"; + } else { + if (defined($o_kbits)) { # metric in bits +@@ -614,24 +633,24 @@ + # First set the modulus depending on highperf counters or not + my $overfl_mod = defined ($o_highperf) ? 18446744073709551616 : 4294967296; + # Check counter (s) +- my $overfl = ($$resultf{$oid_perf_inoct[$i]} >= $file_values[$j][1] ) ? 0 : $overfl_mod; +- $checkperf_out_raw[0] = ( ($overfl + $$resultf{$oid_perf_inoct[$i]} - $file_values[$j][1])/ ++ my $overfl = ($$result{$oid_perf_inoct[$i]} >= $file_values[$j][1] ) ? 0 : $overfl_mod; ++ $checkperf_out_raw[0] = ( ($overfl + $$result{$oid_perf_inoct[$i]} - $file_values[$j][1])/ + ($timenow - $file_values[$j][0] )); + $checkperf_out[0] = $checkperf_out_raw[0] / $speed_metric; + +- $overfl = ($$resultf{$oid_perf_outoct[$i]} >= $file_values[$j][2] ) ? 0 : $overfl_mod; +- $checkperf_out_raw[1] = ( ($overfl + $$resultf{$oid_perf_outoct[$i]} - $file_values[$j][2])/ ++ $overfl = ($$result{$oid_perf_outoct[$i]} >= $file_values[$j][2] ) ? 0 : $overfl_mod; ++ $checkperf_out_raw[1] = ( ($overfl + $$result{$oid_perf_outoct[$i]} - $file_values[$j][2])/ + ($timenow - $file_values[$j][0] )); + $checkperf_out[1] = $checkperf_out_raw[1] / $speed_metric; + + if (defined($o_ext_checkperf)) { +- $checkperf_out[2] = ( ($$resultf{$oid_perf_inerr[$i]} - $file_values[$j][3])/ ++ $checkperf_out[2] = ( ($$result{$oid_perf_inerr[$i]} - $file_values[$j][3])/ + ($timenow - $file_values[$j][0] ))*60; +- $checkperf_out[3] = ( ($$resultf{$oid_perf_outerr[$i]} - $file_values[$j][4])/ ++ $checkperf_out[3] = ( ($$result{$oid_perf_outerr[$i]} - $file_values[$j][4])/ + ($timenow - $file_values[$j][0] ))*60; +- $checkperf_out[4] = ( ($$resultf{$oid_perf_indisc[$i]} - $file_values[$j][5])/ ++ $checkperf_out[4] = ( ($$result{$oid_perf_indisc[$i]} - $file_values[$j][5])/ + ($timenow - $file_values[$j][0] ))*60; +- $checkperf_out[5] = ( ($$resultf{$oid_perf_outdisc[$i]} - $file_values[$j][6])/ ++ $checkperf_out[5] = ( ($$result{$oid_perf_outdisc[$i]} - $file_values[$j][6])/ + ($timenow - $file_values[$j][0] ))*60; + } + } +@@ -641,13 +660,13 @@ + } + # Put the new values in the array and write the file + $file_values[$n_rows][0]=$timenow; +- $file_values[$n_rows][1]=$$resultf{$oid_perf_inoct[$i]}; +- $file_values[$n_rows][2]=$$resultf{$oid_perf_outoct[$i]}; ++ $file_values[$n_rows][1]=$$result{$oid_perf_inoct[$i]}; ++ $file_values[$n_rows][2]=$$result{$oid_perf_outoct[$i]}; + if (defined($o_ext_checkperf)) { # Add other values (error & disc) +- $file_values[$n_rows][3]=$$resultf{$oid_perf_inerr[$i]}; +- $file_values[$n_rows][4]=$$resultf{$oid_perf_outerr[$i]}; +- $file_values[$n_rows][5]=$$resultf{$oid_perf_indisc[$i]}; +- $file_values[$n_rows][6]=$$resultf{$oid_perf_outdisc[$i]}; ++ $file_values[$n_rows][3]=$$result{$oid_perf_inerr[$i]}; ++ $file_values[$n_rows][4]=$$result{$oid_perf_outerr[$i]}; ++ $file_values[$n_rows][5]=$$result{$oid_perf_indisc[$i]}; ++ $file_values[$n_rows][6]=$$result{$oid_perf_outdisc[$i]}; + } + $n_rows++; + $return=write_file($temp_file_name,$n_rows,$n_items_check,@file_values); +@@ -703,62 +722,79 @@ + } + # Get rid of special caracters for performance in description + $descr[$i] =~ s/'\/\(\)/_/g; +- if ( $int_status == $ok_val) { ++ if (( $int_status == $ok_val)||(defined($o_dormant) && $int_status == 5)) { + $num_ok++; + } + if (( $int_status == 1 ) && defined ($o_perf)) { + if (defined ($o_perfp)) { # output in % of speed + if ($usable_data==1) { ++ my $warn_factor=1; ++ if (!defined($o_prct)) { # warn&crit in K|M|G B|bps -> put warn_factor to make % ++ $warn_factor = (defined($o_meg)) ? 1000000 : (defined($o_gig)) ? 1000000000 : 1000; ++ if (!defined($o_kbits)) { $warn_factor*=8;} ++ $warn_factor/=$speed_real; ++ $warn_factor*=100; # now turn into displayed % : 0,1 = 10% ++ } + $perf_out .= "'" . $descr[$i] ."_in_prct'="; +- $perf_out .= sprintf("%.0f",$checkperf_out_raw[0] * 800 / $$resultf{$oid_speed[$i]}) ."%;"; +- $perf_out .= ($o_warn[0]!=0) ? $o_warn[0] . ";" : ";"; +- $perf_out .= ($o_crit[0]!=0) ? $o_crit[0] . ";" : ";"; ++ $perf_out .= sprintf("%.0f",$checkperf_out_raw[0] * 800 / $speed_real) ."%;"; ++ $perf_out .= ($o_warn[0]!=0) ? sprintf("%.0f",$o_warn[0]*$warn_factor) . ";" : ";"; ++ $perf_out .= ($o_crit[0]!=0) ? sprintf("%.0f",$o_crit[0]*$warn_factor) . ";" : ";"; + $perf_out .= "0;100 "; + $perf_out .= "'" . $descr[$i] ."_out_prct'="; +- $perf_out .= sprintf("%.0f",$checkperf_out_raw[1] * 800 / $$resultf{$oid_speed[$i]}) ."%;"; +- $perf_out .= ($o_warn[1]!=0) ? $o_warn[1] . ";" : ";"; +- $perf_out .= ($o_crit[1]!=0) ? $o_crit[1] . ";" : ";"; ++ $perf_out .= sprintf("%.0f",$checkperf_out_raw[1] * 800 / $speed_real) ."%;"; ++ $perf_out .= ($o_warn[1]!=0) ? sprintf("%.0f",$o_warn[1]*$warn_factor) . ";" : ";"; ++ $perf_out .= ($o_crit[1]!=0) ? sprintf("%.0f",$o_crit[1]*$warn_factor) . ";" : ";"; + $perf_out .= "0;100 "; + } + } elsif (defined ($o_perfr)) { # output in bites or Bytes /s + if ($usable_data==1) { + if (defined($o_kbits)) { # bps + # put warning and critical levels into bps or Bps +- my $warn_factor = (defined($o_meg)) ? 1000000 : (defined($o_gig)) ? 1000000000 : 1000; ++ my $warn_factor; ++ if (defined($o_prct)) { # warn&crit in % -> put warn_factor to 1% of speed in bps ++ $warn_factor=$speed_real/100; ++ } else { # just convert from K|M|G bps ++ $warn_factor = (defined($o_meg)) ? 1000000 : (defined($o_gig)) ? 1000000000 : 1000; ++ } + $perf_out .= "'" . $descr[$i] ."_in_bps'="; + $perf_out .= sprintf("%.0f",$checkperf_out_raw[0] * 8) .";"; + $perf_out .= ($o_warn[0]!=0) ? $o_warn[0]*$warn_factor . ";" : ";"; + $perf_out .= ($o_crit[0]!=0) ? $o_crit[0]*$warn_factor . ";" : ";"; +- $perf_out .= "0;". $$resultf{$oid_speed[$i]} ." "; ++ $perf_out .= "0;". $speed_real ." "; + $perf_out .= "'" . $descr[$i] ."_out_bps'="; + $perf_out .= sprintf("%.0f",$checkperf_out_raw[1] * 8) .";"; + $perf_out .= ($o_warn[1]!=0) ? $o_warn[1]*$warn_factor . ";" : ";"; + $perf_out .= ($o_crit[1]!=0) ? $o_crit[1]*$warn_factor . ";" : ";"; +- $perf_out .= "0;". $$resultf{$oid_speed[$i]} ." "; ++ $perf_out .= "0;". $speed_real ." "; + } else { # Bps +- my $warn_factor = (defined($o_meg)) ? 1048576 : (defined($o_gig)) ? 1073741824 : 1024; ++ my $warn_factor; ++ if (defined($o_prct)) { # warn&crit in % -> put warn_factor to 1% of speed in Bps ++ $warn_factor=$speed_real/800; ++ } else { # just convert from K|M|G bps ++ $warn_factor = (defined($o_meg)) ? 1048576 : (defined($o_gig)) ? 1073741824 : 1024; ++ } + $perf_out .= "'" . $descr[$i] ."_in_Bps'=" . sprintf("%.0f",$checkperf_out_raw[0]) .";"; + $perf_out .= ($o_warn[0]!=0) ? $o_warn[0]*$warn_factor . ";" : ";"; + $perf_out .= ($o_crit[0]!=0) ? $o_crit[0]*$warn_factor . ";" : ";"; +- $perf_out .= "0;". $$resultf{$oid_speed[$i]} ." "; ++ $perf_out .= "0;". $speed_real / 8 ." "; + $perf_out .= "'" . $descr[$i] ."_out_Bps'=" . sprintf("%.0f",$checkperf_out_raw[1]) .";" ; + $perf_out .= ($o_warn[1]!=0) ? $o_warn[1]*$warn_factor . ";" : ";"; + $perf_out .= ($o_crit[1]!=0) ? $o_crit[1]*$warn_factor . ";" : ";"; +- $perf_out .= "0;". $$resultf{$oid_speed[$i]} ." "; ++ $perf_out .= "0;". $speed_real / 8 ." "; + } + } + } else { # output in octet counter +- $perf_out .= "'" . $descr[$i] ."_in_octet'=". $$resultf{$oid_perf_inoct[$i]} ."c "; +- $perf_out .= "'" . $descr[$i] ."_out_octet'=". $$resultf{$oid_perf_outoct[$i]} ."c"; ++ $perf_out .= "'" . $descr[$i] ."_in_octet'=". $$result{$oid_perf_inoct[$i]} ."c "; ++ $perf_out .= "'" . $descr[$i] ."_out_octet'=". $$result{$oid_perf_outoct[$i]} ."c "; + } + if (defined ($o_perfe)) { +- $perf_out .= " '" . $descr[$i] ."_in_error'=". $$resultf{$oid_perf_inerr[$i]} ."c "; +- $perf_out .= "'" . $descr[$i] ."_in_discard'=". $$resultf{$oid_perf_indisc[$i]} ."c "; +- $perf_out .= "'" . $descr[$i] ."_out_error'=". $$resultf{$oid_perf_outerr[$i]} ."c "; +- $perf_out .= "'" . $descr[$i] ."_out_discard'=". $$resultf{$oid_perf_outdisc[$i]} ."c"; ++ $perf_out .= "'" . $descr[$i] ."_in_error'=". $$result{$oid_perf_inerr[$i]} ."c "; ++ $perf_out .= "'" . $descr[$i] ."_in_discard'=". $$result{$oid_perf_indisc[$i]} ."c "; ++ $perf_out .= "'" . $descr[$i] ."_out_error'=". $$result{$oid_perf_outerr[$i]} ."c "; ++ $perf_out .= "'" . $descr[$i] ."_out_discard'=". $$result{$oid_perf_outdisc[$i]} ."c "; + } + if (defined ($o_perfs)) { +- $perf_out .= " '" . $descr[$i] ."_speed_bps'=".$$resultf{$oid_speed[$i]}; ++ $perf_out .= "'" . $descr[$i] ."_speed_bps'=".$speed_real; + } + } + } --- nagios-snmp-plugins-1.1.1.orig/debian/patches/06_check_snmp_win.dpatch +++ nagios-snmp-plugins-1.1.1/debian/patches/06_check_snmp_win.dpatch @@ -0,0 +1,70 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 06_check_snmp_win.dpatch by Jan Wagner +## +## DP: Update script to version 1.1 + +@DPATCH@ + +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_win.pl nagios-snmp-plugins-1.1.1/check_snmp_win.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_win.pl 2006-11-29 20:59:55.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_win.pl 2007-10-12 22:23:25.000000000 +0200 +@@ -1,10 +1,11 @@ + #!/usr/bin/perl -w + ############################## check_snmp_win ############## +-# Version : 0.6 +-# Date : Nov 29 2006 ++my $Version='1.1'; ++# Date : Oct 12 2007 + # Author : Patrick Proy (patrick at proy.org) +-# Help : http://www.manubulon.com/nagios/ ++# Help : http://nagios.manubulon.com/ + # Licence : GPL - http://www.fsf.org/licenses/gpl.txt ++# Contrib : Tenaku + # TODO : + ############################################################### + # +@@ -16,10 +17,10 @@ + + # Nagios specific + +-use lib "/usr/local/nagios/libexec"; +-use utils qw(%ERRORS $TIMEOUT); +-#my $TIMEOUT = 5; +-#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4); ++#use lib "/usr/local/nagios/libexec"; ++#use utils qw(%ERRORS $TIMEOUT); ++my $TIMEOUT = 15; ++my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4); + + # SNMP Datas for processes (MIB II) + my $process_table= '1.3.6.1.2.1.25.4.2.1'; +@@ -44,7 +45,6 @@ + + # Globals + +-my $Version='0.6'; + my $Name='check_snmp_win'; + + my $o_host = undef; # hostname +@@ -93,7 +93,7 @@ + + sub help { + print "\nSNMP Windows Monitor for Nagios version ",$Version,"\n"; +- print "GPL licence, (c)2004-2005 Patrick Proy\n\n"; ++ print "GPL licence, (c)2004-2007 Patrick Proy\n\n"; + print_usage(); + print < +## +## DP: Update script to version 1.10 + +@DPATCH@ + +diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_process.pl nagios-snmp-plugins-1.1.1/check_snmp_process.pl +--- nagios-snmp-plugins-1.1.1.orig/check_snmp_process.pl 2007-03-12 21:36:02.000000000 +0100 ++++ nagios-snmp-plugins-1.1.1/check_snmp_process.pl 2007-10-12 22:23:24.000000000 +0200 +@@ -1,45 +1,43 @@ + #!/usr/bin/perl -w + ############################## check_snmp_process ############## +-# Version : 1.4 +-# Date : March 12 2007 +-# Author : Patrick Proy (patrick at proy.org) ++my $Version='1.10'; ++# Date : Oct 12 2007 ++# Author : Patrick Proy (patrick at proy dot org) + # Help : http://nagios.manubulon.com + # Licence : GPL - http://www.fsf.org/licenses/gpl.txt +-# Contrib : Makina Corpus ++# Contrib : Makina Corpus, adam At greekattic d0t com + # TODO : put $o_delta as an option +-# Contrib : ++# If testing on localhost, selects itself.... + ############################################################### + # + # help : ./check_snmp_process -h + ++use strict; ++use Net::SNMP; ++use Getopt::Long; ++ + ############### BASE DIRECTORY FOR TEMP FILE ######## + my $o_base_dir="/tmp/tmp_Nagios_proc."; + my $file_history=200; # number of data to keep in files. + my $delta_of_time_to_make_average=300; # 5minutes by default +- +-use strict; +-use Net::SNMP; +-use Getopt::Long; + + # Nagios specific + +-use lib "/usr/local/nagios/libexec"; +-use utils qw(%ERRORS $TIMEOUT); +-#my $TIMEOUT = 5; +-#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4); ++my $TIMEOUT = 15; ++my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4); + + # SNMP Datas + my $process_table= '1.3.6.1.2.1.25.4.2.1'; + my $index_table = '1.3.6.1.2.1.25.4.2.1.1'; + my $run_name_table = '1.3.6.1.2.1.25.4.2.1.2'; + my $run_path_table = '1.3.6.1.2.1.25.4.2.1.4'; ++my $run_param_table = '1.3.6.1.2.1.25.4.2.1.5'; + my $proc_mem_table = '1.3.6.1.2.1.25.5.1.1.2'; # Kbytes + my $proc_cpu_table = '1.3.6.1.2.1.25.5.1.1.1'; # Centi sec of CPU + my $proc_run_state = '1.3.6.1.2.1.25.4.2.1.7'; + + # Globals + +-my $Version='1.4'; + + my $o_host = undef; # hostname + my $o_community =undef; # community +@@ -57,6 +55,8 @@ + my $o_path= undef; # check path instead of name + my $o_inverse= undef; # checks max instead of min number of process + my $o_get_all= undef; # get all tables at once ++my $o_param= undef; # Add process parameters for selection ++my $o_perf= undef; # Add performance output + my $o_timeout= 5; # Default 5s Timeout + # SNMP V3 specific + my $o_login= undef; # snmp v3 login +@@ -80,7 +80,7 @@ + sub p_version { print "check_snmp_process version : $Version\n"; } + + sub print_usage { +- print "Usage: $0 [-v] -H -C [-2] | (-l login -x passwd) [-p ] -n [-w [,] -c [,max_proc] ] [-m, -a -u, ] [-t ] [-o ] [-f ] [-r] [-V] [-g]\n"; ++ print "Usage: $0 [-v] -H -C [-2] | (-l login -x passwd) [-p ] -n [-w [,] -c [,max_proc] ] [-m, -a -u, -d ] [-t ] [-o ] [-f -A -F ] [-r] [-V] [-g]\n"; + } + + sub isnotnum { # Return true if arg is not a number +@@ -174,6 +174,12 @@ + -f, --fullpath + Use full path name instead of process name + (Windows doesn't provide full path name) ++-A, --param ++ Add parameters to select processes. ++ ex : "named.*-t /var/named/chroot" will only select named process with this parameter ++-F, --perfout ++ Add performance output ++ outputs : memory_usage, num_process, cpu_usage + -w, --warn=MIN[,MAX] + Number of process that will cause a warning + -1 for no warning, MAX must be >0. Ex : -w-1,50 +@@ -193,6 +199,8 @@ + checks cpu usage of all process + values are warning and critical values in % of CPU usage + if more than one CPU, value can be > 100% : 100%=1 CPU ++-d, --delta=seconds ++ make an average of seconds for CPU (default 300=5min) + -g, --getall + In some cases, it is necessary to get all data at once because + process die very frequently. +@@ -242,6 +250,9 @@ + '2' => \$o_version2, 'v2c' => \$o_version2, + 'o:i' => \$o_octetlength, 'octetlength:i' => \$o_octetlength, + 'g' => \$o_get_all, 'getall' => \$o_get_all, ++ 'A' => \$o_param, 'param' => \$o_param, ++ 'F' => \$o_perf, 'perfout' => \$o_perf, ++ 'd:i' => \$o_delta, 'delta:i' => \$o_delta, + 'V' => \$o_version, 'version' => \$o_version + ); + if (defined ($o_help)) { help(); exit $ERRORS{"UNKNOWN"}}; +@@ -411,6 +422,19 @@ + exit $ERRORS{"UNKNOWN"}; + } + ++my $resultat_param=undef; ++if (defined($o_param)) { # Get parameter table too ++ $resultat_param = (Net::SNMP->VERSION < 4) ? ++ $session->get_table($run_param_table) ++ :$session->get_table(Baseoid => $run_param_table); ++ if (!defined($resultat_param)) { ++ printf("ERROR: Process param table : %s.\n", $session->error); ++ $session->close; ++ exit $ERRORS{"UNKNOWN"}; ++ } ++ ++} ++ + if (defined ($o_get_all)) { + $getall_run = (Net::SNMP->VERSION < 4) ? + $session->get_table($proc_run_state ) +@@ -458,8 +482,14 @@ + verb("Filter : $o_descr"); + + foreach my $key ( keys %$resultat) { +- verb("OID : $key, Desc : $$resultat{$key}"); + # test by regexp or exact match ++ # First add param if necessary ++ if (defined($o_param)){ ++ my $pid = (split /\./,$key)[-1]; ++ $pid = $run_param_table .".".$pid; ++ $$resultat{$key} .= " " . $$resultat_param{$pid}; ++ } ++ verb("OID : $key, Desc : $$resultat{$key}"); + my $test = defined($o_noreg) + ? $$resultat{$key} eq $o_descr + : $$resultat{$key} =~ /$o_descr/; +@@ -545,6 +575,7 @@ + } + + my $final_status=0; ++my $perf_output; + my ($res_memory,$res_cpu)=(0,0); + my $memory_print=""; + my $cpu_print=""; +@@ -571,6 +602,9 @@ + } else { + $memory_print=", Mem : ".sprintf("%.1f",$res_memory)."Mb OK"; + } ++ if (defined($o_perf)) { ++ $perf_output= "'memory_usage'=".sprintf("%.1f",$res_memory) ."MB;".$o_memL[0].";".$o_memL[1]; ++ } + } + + ######## Checks CPU usage +@@ -609,6 +643,10 @@ + if ($file_values[$j][0] > $trigger_low) { + # found value = centiseconds / seconds = %cpu + $found_value= ($res_cpu-$file_values[$j][1]) / ($timenow - $file_values[$j][0] ); ++ if ($found_value <0) { # in case of program restart ++ $j=0;$found_value=undef; # don't look for more values ++ $n_rows=0; # reset file ++ } + } + } + $j--; +@@ -631,6 +669,10 @@ + } else { + $cpu_print.=", Cpu : ".sprintf("%.0f",$found_value)."% OK"; + } ++ if (defined($o_perf)) { ++ if (!defined($perf_output)) {$perf_output="";} else {$perf_output.=" ";} ++ $perf_output.= "'cpu_usage'=". sprintf("%.0f",$found_value)."%;".$o_cpuL[0].";".$o_cpuL[1]; ++ } + } else { + if ($final_status==0) { $final_status=3 }; + $cpu_print.=", No data for CPU (".$n_rows." line(s)):UNKNOWN"; +@@ -659,7 +701,14 @@ + print " (<= ",$o_warnL[1],"):OK"; + } + +-print $memory_print,$cpu_print,"\n"; ++print $memory_print,$cpu_print; ++ ++if (defined($o_perf)) { ++ if (!defined($perf_output)) {$perf_output="";} else {$perf_output.=" ";} ++ $perf_output.= "'num_process'=". $num_int_ok.";".$o_warnL[0].";".$o_critL[0]; ++ print " | ",$perf_output; ++} ++print "\n"; + + if ($final_status==2) { exit $ERRORS{"CRITICAL"};} + if ($final_status==1) { exit $ERRORS{"WARNING"};} --- nagios-snmp-plugins-1.1.1.orig/debian/source/format +++ nagios-snmp-plugins-1.1.1/debian/source/format @@ -0,0 +1 @@ +1.0 --- nagios-snmp-plugins-1.1.1.orig/debian/pluginconfig/snmp_mem.cfg +++ nagios-snmp-plugins-1.1.1/debian/pluginconfig/snmp_mem.cfg @@ -0,0 +1,20 @@ +# system memory check template, for more see: +# http://www.manubulon.com/nagios/index_commands.html#mem + +# 'check_snmp_mem_v1' command definition +define command { + command_name check_snmp_mem_v1 + command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ -C $ARG5$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ +} + +# 'check_snmp_mem_v2' command definition +define command { + command_name check_snmp_mem_v2 + command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ -C $ARG5$ -2 $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ +} + +# 'check_snmp_mem_v3' command definition +define command { + command_name check_snmp_mem_v3 + command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ $USER9$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ +} --- nagios-snmp-plugins-1.1.1.orig/debian/pluginconfig/snmp_load.cfg +++ nagios-snmp-plugins-1.1.1/debian/pluginconfig/snmp_load.cfg @@ -0,0 +1,20 @@ +# system load check template, for more see: +# http://www.manubulon.com/nagios/index_commands.html#load + +# 'check_snmp_load_v1' command definition +define command { + command_name check_snmp_load_v1 + command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C $ARG5$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ +} + +# 'check_snmp_load_v2' command definition +define command { + command_name check_snmp_load_v2 + command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ +} + +# 'check_snmp_load_v3' command definition +define command { + command_name check_snmp_load_v3 + command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ +} --- nagios-snmp-plugins-1.1.1.orig/debian/pluginconfig/snmp_win.cfg +++ nagios-snmp-plugins-1.1.1/debian/pluginconfig/snmp_win.cfg @@ -0,0 +1,8 @@ +# windows check template, for more see: +# http://www.manubulon.com/nagios/index_commands.html#windows + +# 'check_win' command definition +define command { + command_name check_win + command_line $USER1$/check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG3$ -n $ARG2$ +} --- nagios-snmp-plugins-1.1.1.orig/debian/pluginconfig/snmp_storage.cfg +++ nagios-snmp-plugins-1.1.1/debian/pluginconfig/snmp_storage.cfg @@ -0,0 +1,20 @@ +# system storage check template, for more see: +# http://www.manubulon.com/nagios/index_commands.html#storage + +# 'check_snmp_storage_v1' command definition +define command { + command_name check_snmp_storage_v1 + command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $ARG5$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ +} + +# 'check_snmp_storage_v2' command definition +define command { + command_name check_snmp_storage_v2 + command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ +} + +# 'check_snmp_storage_v3' command definition +define command { + command_name check_snmp_storage_v3 + command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ $USER9$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ +} --- nagios-snmp-plugins-1.1.1.orig/debian/pluginconfig/snmp_vrrp.cfg +++ nagios-snmp-plugins-1.1.1/debian/pluginconfig/snmp_vrrp.cfg @@ -0,0 +1,20 @@ +# vrrp check template, for more see: +# http://www.manubulon.com/nagios/index_commands.html#vrrp + +# 'check_snmp_vrrp_v1' command definition +define command { + command_name check_snmp_vrrp_v1 + command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ -C $ARG3$ -T $ARG1$ -s $ARG2$ +} + +# 'check_snmp_vrrp_v2' command definition +define command { + command_name check_snmp_vrrp_v2 + command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -T $ARG1$ -s $ARG2$ +} + +# 'check_snmp_vrrp_v3' command definition +define command { + command_name check_snmp_vrrp_v3 + command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ -s $ARG2$ +} --- nagios-snmp-plugins-1.1.1.orig/debian/pluginconfig/snmp_cpfw.cfg +++ nagios-snmp-plugins-1.1.1/debian/pluginconfig/snmp_cpfw.cfg @@ -0,0 +1,8 @@ +# check point firewall template, for more info see: +# http://www.manubulon.com/nagios/index_commands.html#cpfw + +# 'check_snmp_cpfw_v3' command definition +define command { + command_name check_snmp_cpfw_v3 + command_line $USER1$/check_snmp_cpfw.pl -H $HOSTADDRESS$ $USER9$ $ARG1$ +} --- nagios-snmp-plugins-1.1.1.orig/debian/pluginconfig/snmp_env.cfg +++ nagios-snmp-plugins-1.1.1/debian/pluginconfig/snmp_env.cfg @@ -0,0 +1,20 @@ +# system environment check template, for more see: +# http://www.manubulon.com/nagios/index_commands.html#env + +# 'check_snmp_env_v1' command definition +define command { + command_name check_snmp_env_v1 + command_line $USER1$/check_snmp_env.pl -H $HOSTADDRESS$ -C $ARG3$ -T $ARG1$ $ARG2$ +} + +# 'check_snmp_env_v2' command definition +define command { + command_name check_snmp_env_v2 + command_line $USER1$/check_snmp_env.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -T $ARG1$ $ARG2$ +} + +# 'check_snmp_env_v3' command definition +define command { + command_name check_snmp_env_v3 + command_line $USER1$/check_snmp_env.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ $ARG2$ +} --- nagios-snmp-plugins-1.1.1.orig/debian/pluginconfig/snmp_process.cfg +++ nagios-snmp-plugins-1.1.1/debian/pluginconfig/snmp_process.cfg @@ -0,0 +1,15 @@ +# system process check template, for more see: +# http://www.manubulon.com/nagios/index_commands.html#process + +# 'check_snmp_process_v1' command definition +define command { + command_name check_snmp_process_v1 + command_line $USER1$/check_snmp_process.pl -H $HOSTADDRESS$ -C $ARG5$ -n $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ +} + +# 'check_snmp_process_v2' command definition +define command { + command_name check_snmp_process_v2 + command_line $USER1$/check_snmp_process.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -n $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ +} + --- nagios-snmp-plugins-1.1.1.orig/debian/pluginconfig/snmp_int.cfg +++ nagios-snmp-plugins-1.1.1/debian/pluginconfig/snmp_int.cfg @@ -0,0 +1,20 @@ +# (network-) interface check template, for more see: +# http://www.manubulon.com/nagios/index_commands.html#interface + +# 'check_snmp_int_v1' command definition +define command { + command_name check_snmp_int_v1 + command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ -C $ARG3$ -n $ARG1$ -B$ARG4$ $ARG2$ +} + +# 'check_snmp_int_v2' command definition +define command { + command_name check_snmp_int_v2 + command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -n $ARG1$ -B$ARG4$ $ARG2$ +} + +# 'check_snmp_int_v3' command definition +define command { + command_name check_snmp_int_v3 + command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ $USER9$ -n $ARG1$ -B$ARG4$ $ARG2$ +}