From b36c17cb8c77d7d2610ea7fc0a0d7fc4f2a7e93b Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Mon, 18 Nov 2013 10:38:03 +0100 Subject: [PATCH] initial commit --- README | 1 + common.mk | 66 ++ debian/README.Debian.plugins.in | 20 + debian/README.source | 66 ++ debian/changelog | 312 +++++++ debian/compat | 1 + debian/control | 158 ++++ debian/control.in | 25 + debian/copyright | 815 ++++++++++++++++++ debian/copyright.in | 35 + debian/gbp.conf | 3 + debian/monitoring-plugins-cyconet.docs | 1 + ...nitoring-plugins-cyconet.lintian-overrides | 3 + debian/packaging-helper.py | 295 +++++++ .../return_critical_on_failed_connection | 79 ++ .../patches/check_backuppc/use_nagios_plugins | 11 + debian/patches/check_clamav/clamav_locations | 73 ++ debian/patches/check_cups/epn | 8 + debian/patches/check_email_delivery/epn | 45 + debian/patches/check_email_delivery/paths | 27 + debian/patches/check_haproxy/epn | 8 + debian/patches/check_httpd_status/epn | 9 + debian/patches/check_libs/config_location | 11 + debian/patches/check_libs/config_path | 11 + debian/patches/check_lm_sensors/interpreter | 8 + .../check_lm_sensors/manpage_whatis_fix | 12 + .../patches/check_lm_sensors/spelling_errors | 11 + .../check_nfsmounts/nfs_write_location | 20 + debian/patches/check_nfsmounts/perl_module | 19 + debian/patches/check_printer/debian_bts | 35 + .../check_printer/use_data_dumper_if_needed | 18 + .../patches/check_printer/use_nagios_plugin | 18 + .../prefer_cciss_vol_status_over_hpacucli | 15 + debian/patches/check_rbl/disable_solid.net | 11 + debian/patches/check_rbl/interpreter | 8 + debian/patches/check_rbl/pod_encoding_fix | 11 + debian/patches/check_rbl/spelling_errors | 11 + debian/patches/check_snmp_time/epn | 8 + debian/patches/check_webinject/epn | 9 + debian/patches/dsa/check_packages-inifile | 13 + debian/patches/dsa/check_packages_location | 11 + debian/patches/dsa/epn | 8 + debian/patches/dsa/security_updates_critical | 73 ++ debian/patches/dsa/status_directory | 40 + debian/patches/series | 30 + debian/rules | 105 +++ debian/source/format | 1 + debian/sync.sh | 20 + 48 files changed, 2598 insertions(+) create mode 120000 README create mode 100644 common.mk create mode 100644 debian/README.Debian.plugins.in create mode 100644 debian/README.source create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/control.in create mode 100644 debian/copyright create mode 100644 debian/copyright.in create mode 100644 debian/gbp.conf create mode 100644 debian/monitoring-plugins-cyconet.docs create mode 100644 debian/monitoring-plugins-cyconet.lintian-overrides create mode 100755 debian/packaging-helper.py create mode 100644 debian/patches/check_ajp/return_critical_on_failed_connection create mode 100644 debian/patches/check_backuppc/use_nagios_plugins create mode 100644 debian/patches/check_clamav/clamav_locations create mode 100644 debian/patches/check_cups/epn create mode 100644 debian/patches/check_email_delivery/epn create mode 100644 debian/patches/check_email_delivery/paths create mode 100644 debian/patches/check_haproxy/epn create mode 100644 debian/patches/check_httpd_status/epn create mode 100644 debian/patches/check_libs/config_location create mode 100644 debian/patches/check_libs/config_path create mode 100644 debian/patches/check_lm_sensors/interpreter create mode 100644 debian/patches/check_lm_sensors/manpage_whatis_fix create mode 100644 debian/patches/check_lm_sensors/spelling_errors create mode 100644 debian/patches/check_nfsmounts/nfs_write_location create mode 100644 debian/patches/check_nfsmounts/perl_module create mode 100644 debian/patches/check_printer/debian_bts create mode 100644 debian/patches/check_printer/use_data_dumper_if_needed create mode 100644 debian/patches/check_printer/use_nagios_plugin create mode 100644 debian/patches/check_raid/prefer_cciss_vol_status_over_hpacucli create mode 100644 debian/patches/check_rbl/disable_solid.net create mode 100644 debian/patches/check_rbl/interpreter create mode 100644 debian/patches/check_rbl/pod_encoding_fix create mode 100644 debian/patches/check_rbl/spelling_errors create mode 100644 debian/patches/check_snmp_time/epn create mode 100644 debian/patches/check_webinject/epn create mode 100644 debian/patches/dsa/check_packages-inifile create mode 100644 debian/patches/dsa/check_packages_location create mode 100644 debian/patches/dsa/epn create mode 100644 debian/patches/dsa/security_updates_critical create mode 100644 debian/patches/dsa/status_directory create mode 100644 debian/patches/series create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100755 debian/sync.sh diff --git a/README b/README new file mode 120000 index 0000000..71839fd --- /dev/null +++ b/README @@ -0,0 +1 @@ +debian/README.source \ No newline at end of file diff --git a/common.mk b/common.mk new file mode 100644 index 0000000..21798ee --- /dev/null +++ b/common.mk @@ -0,0 +1,66 @@ + +# import buildflags +CFLAGS += $(shell dpkg-buildflags --get CFLAGS) +CPPFLAGS += $(shell dpkg-buildflags --get CPPFLAGS) +CXXFLAGS += $(shell dpkg-buildflags --get CXXFLAGS) +LDFLAGS += $(shell dpkg-buildflags --get LDFLAGS) + +# define common directories +PLUGINDIR := /usr/lib/nagios/plugins +CRONJOBDIR := /usr/lib/nagios/cronjobs +CONFIGDIR := /etc/nagios-plugins/config +INIDIR := /etc/nagios-plugins +CONFIGFILES := $(wildcard *.cfg) + +# guess the name of the plugin to build if not defined +PLUGINNAME := $(shell basename $(CURDIR)) +ifndef PLUGIN +PLUGIN := $(PLUGINNAME) +endif + +DOCDIR := /usr/share/doc/nagios-plugins-contrib/$(PLUGINNAME) + +# add some default files to clean +# we actually need strip here. make is weird sometimes. +CLEANEXTRAFILES := $(strip $(wildcard *.o) $(wildcard *.a) $(wildcard *.so)) + +# build the stuff actually +all:: $(PLUGIN) $(MANPAGES) $(INIFILES) $(CRONJOBS) + +install:: + install -d $(DESTDIR)$(PLUGINDIR) + install -m 755 -o root -g root $(PLUGIN) $(DESTDIR)$(PLUGINDIR) +ifdef CONFIGFILES + install -d $(DESTDIR)$(CONFIGDIR) + install -m 644 -o root -g root $(CONFIGFILES) $(DESTDIR)$(CONFIGDIR) +endif +ifdef MANPAGES + set -e; for m in $(MANPAGES); do \ + section=`echo $$m | sed 's,\.gz$$,,;s,.*\.,,'` ;\ + mandir="/usr/share/man/man$${section}" ;\ + install -d $(DESTDIR)$${mandir} ;\ + install -m 644 -o root -g root $${m} $(DESTDIR)$${mandir} ;\ + done +endif +ifdef INIFILES + install -d $(DESTDIR)$(INIDIR) + install -m 644 -o root -g root $(INIFILES) $(DESTDIR)$(INIDIR) +endif +ifdef DOCFILES + install -d $(DESTDIR)$(DOCDIR) + install -m 644 -o root -g root $(DOCFILES) $(DESTDIR)$(DOCDIR) +endif +ifdef CRONJOBS + install -d $(DESTDIR)$(CRONJOBDIR) + install -m 755 -o root -g root $(CRONJOBS) $(DESTDIR)$(CRONJOBDIR) +endif + +clean:: +ifdef CLEANFILES + rm -f $(CLEANFILES) +endif +ifneq (,$(CLEANEXTRAFILES)) + rm -f $(CLEANEXTRAFILES) +endif + +.PHONY: clean diff --git a/debian/README.Debian.plugins.in b/debian/README.Debian.plugins.in new file mode 100644 index 0000000..5c601e9 --- /dev/null +++ b/debian/README.Debian.plugins.in @@ -0,0 +1,20 @@ +monitoring-plugins-cyconet +====================== + +Some plugins require additional libraries. To prevent you from having to +install dozens of further packages that you don't actually need, there is no +strict dependency on those libraries. Rather, they are listed as recommenda- +tions or suggestions. + +apt-get(8) and aptitude(8) will install recommended packages automatically by +default. If you did not disable this feature you will have everything in place +to operate all plugins when installing the "monitoring-plugins-cyconet" package. +Else you have to install missing dependencies manually (see the section "Plugin +dependencies" below). + + +Plugin dependencies: +-------------------- + +#AUTO_UPDATE_README# + diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..2e52bcc --- /dev/null +++ b/debian/README.source @@ -0,0 +1,66 @@ +monitoring-plugins-cyconet - Plugins for nagios compatible monitoring systems +-------------------------------------------------------------------------- + + +This README.source should give a short instruction about the +way the monitoring-plugins-cyconet repository is structured +and defines basic policies. + +* build-system: git-buildpackage. As we build a Debian native + package pristine-tar is not necessary. + +* debian/changelog: + - preferable generated using git-dch + - versioning schema: X.$(date '+%Y%m%d'). X will be + increased by one with each release. In case there are + bugfixes in stable releases necessary, use + X.$(date '+%Y%m%d').Y + See http://kitenet.net/~joey/blog/entry/version_numbers/ + for details. + +* debian/copyright.in, debian/control.in: + Base files we fill automatically with information from + all plugins to generate the full files. + This is done in the clean target. + DO NOT MODIFY debian/control or debian/copyright! + +* nagios plugins: + - one directory per plugin + - required files: + * $plugin/control: file format similar to debian/control. + - Required is the Description and Uploaders part. + Add Build-Depends, Recommends, Suggests + and Homepage to have their content added to debian/control/ + debian/copyright. Don't use Depends as we don't want to force + people to install dependencies for a plugin they might not + want to use. + - Add Version to be able to track an upstream version of + the plugin. + - Add Watch to check for new versions using + ./debian/packaging-helper.py + Format: + Watch URL python-regex + Watch URL SHA1:sha1sum + - Don't add empty lines - only the first paragraph will be + handled. + * $plugin/copyright: copyright information for the files + in $plugin. Will be added to debian/copyright + automatically, properly indented and with a header which + describes that the coming block is for the files in $plugin. + ** DEP-5 IS NOT SUPPORTED ** + - what you should have: + Currently there are two options on how to build and install + plugins: + * you have a single script or file or need some hand-made + build system anyway: + add $plugin/Makefile and implement the all / install / clean + targets. include ../common.mk is there for common tasks. + If $plugin/Makefile exists the way described below *will not* + be built. + * your plugin comes with a fancy build system already: + extract the source in $plugin and let a symlink called 'src' + point to the subdirectory of $plugin. + If dh_auto_* is not able to build the plugin, please use + the Makefile way as described above. + Please ensure that a proper .cfg file will be installed. + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..8928808 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,312 @@ +nagios-plugins-contrib (9.20131031~6.gbp7313ec) unstable; urgency=low + + [ Bernd Zeimetz ] + * [63ddfa7] Make checksum file readable for nagios. + * [583b6cd] Avoid line overflows due to expansion of $0. + + [ Jan Wagner ] + * [08a214b] solid.net seems expired + * [98008e4] Fixing encoding of check_rbl.pod (Closes: #724175) + * [c1f4a46] Updating check_ssl_cert to 1.15.0 + + [ Bernd Zeimetz ] + * [31a0dc1] Fix POD encoding in check_rbl. + Thanks to David Suárez (Closes: #724175) + * [a58ff4e] Run dh_python2 for plugins and normal modules. + + [ Jan Wagner ] + * [dd4c0ad] Updating check_memcached to 1.3 + + [ Bernd Zeimetz ] + * [cd30e98] Add check_graphite. + * [e234911] Auto update of debian/copyright + * [cb276d0] Auto update of debian/control + + [ Jan Wagner ] + * [9fa88f2] Update check_raid to 3.0.1+ba57f5f + + [ Bernd Zeimetz ] + * [4e577da] Revert accidentally merged, duplicated bugfix. + + [ Jan Wagner ] + * [efec4c8] Update check_rbl to 1.3.1 + * [be9d6a1] Remove upstream picked patch patches/check_rbl/epn + * [26eb4c0] Add patches/check_rbl/disable_solid.net + * [589d71a] Update check_webinject to 1.80 + * [6a7ddc6] Update Version in check_webinject/control + * [4cbb982] Update check_whois to 1.14 + * [4d2397a] Remove accidently double added check_rbl/disable_solid.net in patch series + * [c0395d0] Add check_cups plugin (Closes: #661167). + * [f2ead0f] Auto update of debian/copyright + * [c511bf5] Auto update of debian/control + * [cb92117] Use check_cups_queue as command definition + * [76c7abf] Disable epn for check_cups + + [ Bernd Zeimetz ] + * [bfb67e8] Use dh --with autotools_dev. (Closes: #727468) + * [363af25] Auto update of debian/control + + [ Jan Wagner ] + * [578b78c] Add check_mongodb plugin + + [ Bernd Zeimetz ] + * [952811b] Run dh --with autotools_dev in the clean target, too. + + [ Jan Wagner ] + * [4807ec2] Add check_drdb plugin + * [75b8238] Fix version of check_rbl in control file + * [8dc2960] Fix copyright of check_drbd + * [b843ec3] Add check_snmp_time plugin + * [ba71274] Disable epn for check_webinject, cause it leaves temp files around + * [fc0d096] Add check_bgpstate plugin + + -- Jan Wagner Fri, 01 Nov 2013 14:26:24 +0100 + +nagios-plugins-contrib (8.20130824) unstable; urgency=low + + [ Jan Wagner ] + * [3bce1c4b] Merge remote-tracking branch 'debian/master' + * [bcf6f1d9] Merge remote-tracking branch 'bzed/master' + * [d436ca0e] Fixing check_raid for 3ware controllers when reporting "NOT-PRESENT" (Closes: #692598) + * [8f55cc69] add patch check_raid/3ware_fix_notpresent + * [506000a8] Merge remote-tracking branch 'bzed/master' + * [62bbdd2f] disable epn + * [6c73c15b] Auto update of debian/control + * [5e43a9ae] update check_ssl_cert + * [ad1c463d] update check_ssl_cert + * [4975ff97] Revert "Fixing check_raid for 3ware controllers when reporting "NOT-PRESENT"" + This reverts commit d436ca0e6a4e3147265627afd256856c9fab3836. + * [f6c71f97] drop removed patch + * [4e52a4ad] Merge remote-tracking branch 'bzed/master' + * [c01cd192] fix typo in patches/check_rbl/epn + + [ Bernd Zeimetz ] + * [a61aefc4] Add syslog output to check_checksums + * [62d55e7e] New plugin: check_ajp + * [5a00818c] Auto update of debian/control + * [eb29e6c6] Auto update of debian/copyright + * [cf6c7f44] Delete unused patch file check_raid/cciss_bugfix + * [a3e036b7] Fix an error message in check_raid if not using cciss_vol_status. + Use of uninitialized value in -x at /usr/lib/nagios/plugins/check_raid + line 2495. + Thanks to Stefan Kaltenbrunner + * [6dddc838] Updating changelog. + * [192396b7] Fix check_ajp to return CRITICAL on connection errors. + * [d8d41faf] Add config file for check_ajp. + * [4e092c04] Read 5 bytes only - thats all an AJP pong needs. + * [26cb156f] Be nice and close the AJP connection socket. + * [ccc8f7d6] check_ajp: print an error message if --app is not specified. + * [915d3708] Add -epn to check_packages. + Thanks to Salvatore Bonaccorso (Closes: #691012) + * [240ca0fc] Updating date/version in changelog. + * [8534630e] Update DSA nagios checks/scripts + * [5078ff97] Refresh patches for new dsa plugin versions + + -- Bernd Zeimetz Sat, 24 Aug 2013 00:06:27 +0200 + +nagios-plugins-contrib (7.20130614) unstable; urgency=low + + [ Bernd Zeimetz ] + * [036816ff] Merge pull request #15 from evgeni/master + check_packages should find security updates on the official security mirror too + * [658a2e93] Add check_checksums nagios plugin. + * [9d5d2056] Updating check_raid. + * [e3ec1293] Updating check_ssl_cert to 1.14.6 + * [779543ef] Updating check_hpasm to 4.6.3.2 + * [0c838ee9] Updating check_multipath to 0.1.9 + * [bec11251] Updating check_whois to 1.13 + * [8e0a65d0] Refreshing patches. + * [c0b88cdb] Auto update of debian/copyright + * [59648a17] Fix src link for check_hpasm + * [8c242d0f] Support pre-Wheezy versions of coretutils in check_checksums. + * [7d3d2a06] Update release date in changelog (gah!). + * [768e463b] Merge pull request #16 from evgeni/master + check_libs: ignore /var/lib/postgresql/ and /var/log/ + * [2b9aace5] Bumping standards-Verison, no changes needed. + + [ Jan Wagner ] + * [3bb873e4] disable epn for check_rbl + + [ Evgeni Golov ] + * [2a7ab4b8] check_libs: ignore /var/spool/ + + -- Bernd Zeimetz Fri, 14 Jun 2013 20:53:49 +0200 + +nagios-plugins-contrib (6.20130521) unstable; urgency=low + + * [e68c82e1] check_raid: do not run hpacucli if cciss_vol_status is available. + * [4a1c57e8] Also support tw-cli as additional name for the 3ware binary. + Thanks to Dennis Hoppe + * [eb5e1c7c] Add /run/ to the check_libs ignore file. + + -- Bernd Zeimetz Tue, 21 May 2013 22:11:50 +0200 + +nagios-plugins-contrib (5.20130307) experimental; urgency=low + + * [aa113517] Fix typos s/Recommands/Recommends/ + * [8e2b3019] Ensure typoed fieldnames in control files are not ignored. + * [ecead75d] Add extras folder. + * [0423b2a4] Add check_memory. + * [90ba4bec] Better command example for send_nsca_host_or_service_check_result + * [a564c43d] Add check_nfsmounts. + * [dc3d5425] Add Recommends for check_nfsmounts. + * [bf12e2e0] Add check_apt for check_multi. + * [52d46e1a] Add perl dependencies automatically. + * [e77b2058] Fix building check_memcached in Ubuntu. + * [98c1f4c1] extras needs to Suggests only. + * [f84d3678] Add check_clamav. + * [05cca8f6] Merge branch 'master' of vasks.debian.org:/git/pkg-nagios/pkg-nagios-plugins-contrib + * [80415a76] Add some missing directories to the check-libs config. + * [08a91068] Add check_varnish + * [15385538] Fix watch line of check_clamav. + * [74bf1d94] Update check_raid to version 3.0 + * [26209f4e] Update check_hpasm to 4.6.3 + * [6cd0fa8f] Updating check_multipath to 0.1.8 + * [34fa0ffc] Updating check_mysql_health to 2.1.8.2 + * [9e3f357d] Updating check_ssl_cert to 1.14.4 + * [6e6813a9] Refreshing patches. + * [b6f439c4] Remove unused check_varnish Makefile. + * [6151979b] Rename buggy auto-generated libexec directory. + * [4c08976d] Add pkg-config as check_varnish build dependency. + * [05f09fee] Auto update of debian/copyright + * [9d462776] Auto update of debian/control + * [09060a70] Add --enable-stack-protector to default options. + * [37896ae4] Add a cciss related bugfix to check_raid. + + -- Bernd Zeimetz Thu, 07 Mar 2013 00:31:10 +0100 + +nagios-plugins-contrib (4.20120702) unstable; urgency=low + + * [bf291c63] check_backuppc: move backuppc to Suggests. + Thanks to Werner Detter (Closes: #679871) + * [0997dfd3] Auto update of debian/control + + -- Bernd Zeimetz Mon, 02 Jul 2012 19:28:52 +0200 + +nagios-plugins-contrib (3.20120614) unstable; urgency=low + + * [30fd20be] check_packages should return CRITICAL for outstanding security updates. + * [3cd5656f] Fix last patch; refresh others. + * [2c3c1626] Remove extra debug print statement. + * [4e43ec28] Fix a funky ? : related bug. + * [e9172807] Add a check_apt.cmd example config for check_multi. + * [15d58b48] Remove unneeded || COUNT(CRITICAL) > 0 in check_apt.cmd + * [ea2f8abc] check_ipmi_sensor: updating to 3.1 + * [d405a206] check_ssl_cert: fix version number (was updated already). + + -- Bernd Zeimetz Thu, 14 Jun 2012 22:02:34 +0200 + +nagios-plugins-contrib (2.20120529) unstable; urgency=low + + * [c6b83cea] Fix email_delivery.cfg + * [f250c516] Merge pull request #5 from waja/master. + Add perl-doc at Suggests, as needed by check_email_delivery --help + * [9533beb7] Add check_webinject plugin. + * [05a3af45] Auto update of debian/copyright + * [255aa819] Auto update of debian/control + * [853905cf] Fix CLEANFILES in common.mk + * [3e75a059] Better webinject command definitions. + * [6275a3f3] check_raid should use cciss_vol_status if available. + Only use hpacucli if not. + * [9859f269] Add some missing version information. + * [d142da3c] Update check_raid to 1.107 + * [942e9f23] Updating check_email_delivery. + * [749c40e1] Auto update of debian/control + * [c593192c] Add Enhances: nagios-plugins,.... to the package. + * [24486361] Merge pull request #6 from waja/master + add check_backuppc + * [8d634bb6] Better/fixed CLEANFILES target handling. + Please note that CLEANFILES must be defined before including + ../common.mk + * [558e31aa] Merge branch 'master' of + vasks.debian.org:/git/pkg-nagios/pkg-nagios-plugins-contrib. + Conflicts: + check_backuppc/Makefile + * [dea493d7] Add (unfinished) DSA checks and check_libs from weaselutils. + * [5d0cf660] Finish integration of the check_libs plugin. + * [f2a3d5b6] Add (unfinished) control and copyright file for dsa checks. + * [f7c33de6] Auto update of debian/copyright + * [fd344412] Auto update of debian/control + * [8c9693ee] Updating check_hpasm to 4.5.2 + * [3f0a95dc] Updating check_raid to rev1.119 + * [5220084d] Update check_ssl_cert to 1.13.0 + * [c2c83516] More progress on the DSA plugins + * [a9f80a8d] Implement a way to install cronjob scripts. + CRONJOBDIR := /usr/lib/nagios/cronjobs + * [a8dc3842] Finishing dsa check packaging. + * [de999e73] Add config location patch for check_libs. + * [336ad307] Auto update of debian/control + * [33b86286] Typo fix. + * [d0140fd4] Auto update of debian/control + * [9059ab99] Don't reset LD/C/CXX/CPPFLAGS when including common.mk + * [f0e986fa] Add snmp to check_printer's Recommends. + * [f993848c] Add missing recommends for DSA plugins. + * [80938fd9] Support checks written in Python. + * [cbf5f37f] Auto update of debian/control + * [6f5f3157] Updating changelog. + * [72492690] Fix location of check_packages in cron script. + * [68284bb0] Add patch to fix check_packages output. + * [fd32ac40] check_libs needs libyaml-syck-perl. + * [63d54efa] Updating changelog. + * [f29b76d6] Add check_zone_auth plugin. + * [0f95a649] Add check_whois plugin. + * [3562b848] Add check_zone_rrsig_expiration plugin. + + -- Bernd Zeimetz Tue, 29 May 2012 22:33:51 +0200 + +nagios-plugins-contrib (1.20120228) unstable; urgency=low + + * [9079e12a] Add check-multipath.pl upstream version. + * [8e0a5908] Add patch for check_multipath + * [6da07d78] Ignore .rej and .orig files. + * [4bda0e7c] Upstream included our patch already. + * [21e3756b] Add packaging info for check_multipath. + * [9f664c91] Link debian/README.source to README for github fancyness. + * [a527810c] Add check_snmp_environment (unfinished). + * [41052baf] Add some useful error messages for the packaging-helper.py + * [afa04c7b] Finish check_snmp_environment plugin. + No .cfg file included yet. + * [743e5dfd] Add current version info to check_snmp_environment. + * [76bccfe3] Fix SHA1 watch in packaging-helper.py + * [8f4c4d13] Add check_printer plugin. + * [7dc69bf0] Add check_haproxy and check_httpd_status. + manually merging the work of Jan Wagner . + * [2577af3a] Better sorting of the quilt series file. + * [0526814c] Add nagios: -epn tags to the non epn checks in + check_email_delivery. + * [caadc8e7] Don't add a dependency if it is listed already. + * [974e8d36] Add check_hpasm. + * [0d3b76da] make -j should work for debian/rules now + * [6f4593ac] Fix too long description. + * [a3cce5ad] check_hpasm needs snmpwalk, recommend it. + * [4760a28d] shorter check_snmp_environment desc + * [1af8a931] Fix FSF address. + * [a2e9282a] Auto update of debian/copyright + * [3a702550] Auto update of debian/control + * [d4d74a06] Add --parallel to dh calls. + * [a41f66fe] Merge remote-tracking branch 'github/master' + Conflicts: + debian/control + * [65d87a13] Merge pull request #3 from waja/master + adding check_mysql_health + * [573abd8c] Ensure Depends is nto used in plugin control files. + * [42d0dcfe] Auto update of debian/control + * [58e56a7b] Auto-generate and install README.Debian.plugins + * [4a73d8a7] Enhance dependency description in debian/README.source + * [69f4e3e9] Merge pull request #4 from waja/master + fixing 'check_ipmi_sensor_exclude' command definition + (Closes: #661528) + + -- Bernd Zeimetz Tue, 28 Feb 2012 20:17:06 +0100 + +nagios-plugins-contrib (1.20120220) unstable; urgency=low + + * [462444da] Removing unused code copies of the install module. + + -- Bernd Zeimetz Mon, 20 Feb 2012 22:49:53 +0100 + +nagios-plugins-contrib (1.20120219) unstable; urgency=low + + * Initial Release. + + -- Bernd Zeimetz Sun, 19 Feb 2012 00:42:17 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..f044c9a --- /dev/null +++ b/debian/control @@ -0,0 +1,158 @@ +Source: nagios-plugins-contrib +Section: net +Priority: extra +Maintainer: Debian Nagios Maintainer Group +Uploaders: Bernd Zeimetz , Jan Wagner +Build-Depends: debhelper (>= 8.0.0), python, python-debian, quilt (>= 0.46-7), autotools-dev, autotools-dev, flex, libmemcached-dev, libvarnishapi-dev, pkg-config +Standards-Version: 3.9.4 +Vcs-Git: git://git.debian.org/pkg-nagios/pkg-nagios-plugins-contrib +Vcs-Browser: http://git.debian.org/?p=pkg-nagios/pkg-nagios-plugins-contrib;a=summary + +Package: nagios-plugins-contrib +Architecture: any +Depends: ${misc:Depends} +Recommends: ${shlibs:Depends}, ${python:Depends}, libsocket-perl, libnagios-plugin-perl, nagios-plugins-basic, libnet-dns-perl, libdate-manip-perl, libnagios-plugin-perl (>= 0.31), libnet-cups-perl, libio-socket-ssl-perl, libmail-imapclient-perl, libnet-smtp-tls-perl, libnet-ssleay-perl, python, liblocale-gettext-perl, liblwp-useragent-determined-perl, snmp, freeipmi-tools, libipc-run-perl, lsof, libyaml-syck-perl, libdbd-mysql-perl, libreadonly-perl, libnet-snmp-perl, openssl, libwebinject-perl, libnet-dns-sec-perl, ruby | ruby-interpreter, ${perl:Depends} +Suggests: backuppc, perl-doc, cciss-vol-status, mpt-status, expect, nagios-plugin-check-multi, moreutils +Enhances: nagios-plugins, nagios-plugins-basic, nagios-plugins-standard +Description: Plugins for nagios compatible monitoring systems + This package provides various plugins for Nagios compatible monitoring + systems like Nagios and Icinga. + It contains the following plugins: + . + * check_ajp (1): plugin to monitor the AJP ping response time + Should work with all application servers (Tomcat, JBoss,....) + which provide an AJPv13 connector. + * check_backuppc (1.1.0): plugin for checking on the status of + BackupPC backups + * check_checksums (20130611): plugin to verify file checksums + against (local, not 100% secure) lists. + Supports md5 sha1 sha224 sha256 sha384 sha512 checksums. + * check_clamav (1.2): plugin to check for clamav signature freshness + This script is used to compare the version and signature + level of the currently running clamd daemon with the latest + available versions listed in the TXT record for + current.cvd.clamav.net. + * check_cups (0.2): plugin to check queues on a remote CUPS server + This plugin is monitoring of queues on a remote CUPS server, + which means that it doesn't need to be installed on the print + server and run via NRPE. + * check_email_delivery (0.7.1b): plugin to monitor email delivery + Some typical uses of this plugin include: + - check SMTP server + - check messages and quota on IMAP server + - check email delivery loop + - check auto-responder function + - keep an eye on email lag + - monitor automated mailboxes + - check email-to-FTP or other special email gateways + * check_graphite: Plugin to monitor graphite metrics + * check_haproxy (rev135): plugin check the HAProxy statistics url + * check_hpasm (4.6.3.2): plugin to check the hardware health of + HP Proliant Servers + It either uses snmp or - if installed - the hpasm package locally. + The plugin checks the health of + * Processors + * Power supplies + * Memory modules + * Fans + * CPU- and board-temperatures + * Raids + and alerts you if one of these components is faulty or operates + outside its normal parameters. + * check_httpd_status (rev140): plugin checking Apache or Lighthttpd + server-status page (using mod_status) + * check_ipmi_sensor (3.1): IPMI Sensor Monitoring Plugin + Plugin to monitor the hardware status (fan speed, temperaturs, + voltages, power usage, ...) of a server using IPMI. + * check_libs (520): plugin to report the usage of no longer existing + libraries by running processes + * check_lm_sensors (3.1.1): plugin to monitor hardware sensors + and disk temperatures + * check_memcached (1.3): plugin to check memcached instances + It will give a critical message if a partiular memcached host is + inaccessible and generate a warning if the hit/miss ratio falls + below a given threshold or the number of evictions exceeds a given + limit. + Hit/miss and evictions are measured over a 30 minute interval, + using a memcached object to store the earlier statistics. + * check_memory (1.0): plugin to check for free memory + This plugin excludes the system cache and buffer, because + on some system with very stable memory usage it is perfectly + normal for system cache to fill in all available memory. + * check_multipath (0.1.9): plugin to monitor the number of available and + failed paths of multipath devices + * check_mysql_health (2.1.8.2): plugin to check various parameters of a + MySQL database + * check_nfsmounts: checks whether there are stale NFS mounts on the host + * check_printer: plugin to check printer supply levels using SNMP + It outputs performance data for all supplies + found, for example toner and drum. + * check_raid (3.0.1+ba57f5f): plugin to check sw/hw RAID status + The plugin looks for any known types of RAID configurations, + and checks them all. + . + Supports: + - Adaptec AAC RAID via aaccli or afacli or arcconf + - AIX software RAID via lsvg + - HP/Compaq Smart Array via cciss_vol_status (hpsa supported too) + - HP Smart Array Controllers and MSA Controllers via hpacucli + - HP Smart Array (MSA1500) via serial line + - Linux 3ware SATA RAID via tw_cli + - Linux DPT/I2O hardware RAID controllers via /proc/scsi/dpt_i2o + - Linux GDTH hardware RAID controllers via /proc/scsi/gdth + - Linux LSI MegaRaid hardware RAID via CmdTool2 + - Linux LSI MegaRaid hardware RAID via megarc + - Linux LSI MegaRaid hardware RAID via /proc/megaraid + - Linux MegaIDE hardware RAID controllers via /proc/megaide + - Linux MPT hardware RAID via mpt-status + - Linux software RAID (md) via /proc/mdstat + - LSI Logic MegaRAID SAS series via MegaCli + - LSI MegaRaid via lsraid + - Serveraid IPS via ipssend + - Solaris software RAID via metastat + - Areca SATA RAID Support via cli64/cli32 + * check_rbl (1.3.0): plugin to check if a server is blacklisted + * check_snmp_environment (0.7): plugin to check various hardware statuses + Using snmp the plugin is able to retrieve Fan, power-supply, + voltage, temperature, card and module status and various other + information from Cisco, Nokia, Blue Coat, IronPort, + Foundry Network, Linux (using lm-sensors), Extreme Networks, + Juniper Networks, HP ProCurve, Netscreen, Citrix NetScaler + and Transmode Systems hardware. + * check_ssl_cert (1.15.0): plugin to check the CA and validity of an + X.509 certificate + * check_varnish (1.1): plugin to monitor varnish instances + * check_webinject (1.80): plugin for testing web services + It uses the WebInject Perl module for automated testing of + web applications and web services. It can be used to check + individual system components that have HTTP interfaces + (JSP, ASP, CGI, PHP, AJAX, Servlets, HTML Forms, + XML/SOAP Web Services, REST, etc). + * check_whois (1.14): plugin to check for the expiration of a domain. + The plugin may not yet work with all registrars, since their + output formats differ or there is no expiration date in the + whois output. + * check_zone_auth (1.13): plugin to ensure that the authoritative nameservers + for a given zone remain in sync. + * check_zone_rrsig_expiration (1.10): plugin to check for expiration of + signatures in dnssec-enabled zones. + * dsa: plugins from the Debian System Administrators + nagios plugins repository. + * check_cert_expire: check for certificate expiration + using openssl on the certificate file + * check_dnssec_delegation: check for correct DNSSEC + delegation + * check_entropy: check if there is enough entropy available. + * check_packages: replacement for check_apt; needs a cronjob + to update the apt database regularily + * check_running_kernel: check if a system was rebooted after + a kernel upgrade + * check_soas: check SOA records + * check_statusfile: deliver the content of a status file + as check result + * extras (1): various scripts and extras + Not a plugin, but a collection of various useful + event/obsession handlers and similar scripts. + . + Some scripts and binaries need more packages installed to work, which is + implemented as recommends. diff --git a/debian/control.in b/debian/control.in new file mode 100644 index 0000000..1f0ccfd --- /dev/null +++ b/debian/control.in @@ -0,0 +1,25 @@ +Source: monitoring-plugins-cyconet +Section: net +Priority: extra +Maintainer: Debian Nagios Maintainer Group +Uploaders: #AUTO_UPDATE_Uploaders# +Build-Depends: debhelper (>= 8.0.0), python, python-debian, quilt (>= 0.46-7), autotools-dev, #AUTO_UPDATE_Build-Depends# +Standards-Version: 3.9.4 +Vcs-Git: git://github.com/waja/blah +Vcs-Browser: http://github.com/waja/blah + +Package: monitoring-plugins-cyconet +Architecture: any +Depends: ${misc:Depends} +Recommends: ${shlibs:Depends}, ${python:Depends}, #AUTO_UPDATE_Recommends#, ${perl:Depends} +Suggests: #AUTO_UPDATE_Suggests# +Enhances: nagios-plugins, nagios-plugins-basic, nagios-plugins-standard +Description: Plugins for nagios compatible monitoring systems + This package provides various plugins for Nagios compatible monitoring + systems like Nagios and Icinga. + It contains the following plugins: + . +#AUTO_UPDATE_Description# + . + Some scripts and binaries need more packages installed to work, which is + implemented as recommends. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..65644e1 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,815 @@ + +The Debian packaging is Copyright © 2012 Bernd Zeimetz and +is licensed under der GPL, either version 3 of the License, or +(at your option) any later version. + + + 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 3 of the License, or + (at your option) any later version. + . + This package 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, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + + +Part of the Debian packaging is the content of the debian directory, +and the following files: + common*.mk + */control + */copyright + */Makefile + + +The copyright information for the included plugins is listed below: + + +check_ajp: + +The plugin was downloaded from: +http://blog.devnu11.net/projects/ + + Comment: Please send bug fixes and enhancements to + + check_ajp - nagios plugin for jboss monitoring + Copyright (C) 2010 Michel Rode + + 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 3 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, see . + + +------------------------------------------------------------------------------ + +check_backuppc: + +The plugin was downloaded from: +http://n-backuppc.sourceforge.net/ + + Copyright (C) 2006,2007 Seneca Cunningham + + License: GPL v2 + + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + + +------------------------------------------------------------------------------ + +check_checksums: + + Copyright (C) 2013 Bernd Zeimetz + + 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 3 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, see . + + + +------------------------------------------------------------------------------ + +check_clamav: + +The plugin was downloaded from: +http://exchange.nagios.org/directory/Plugins/Anti-2DVirus/ClamAV/ClamAV-check-plugin/details + + Copyright (c) 2005-2008 Darren Spruell + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + + +------------------------------------------------------------------------------ + +check_cups: + +The plugin was downloaded from: +https://www.monitoringexchange.org/inventory/Check-Plugins/Hardware/Devices/Printer/check_cups + + Copyright (C) Steve Huff + + This Nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY. + It may be used, redistributed and/or modified under the terms of the GNU + General Public Licence (see http://www.fsf.org/licensing/licenses/gpl.txt). + + + +------------------------------------------------------------------------------ + +check_email_delivery: + +The plugin was downloaded from: +http://buhacoff.net/software/check_email_delivery/ + + Copyright (C) 2005-2011 Jonathan Buhacoff + + 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 3 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, see . + + + +------------------------------------------------------------------------------ + +check_graphite: + +The plugin was downloaded from: +https://github.com/disqus/nagios-plugins + + Copyright: (c) 2012 DISQUS. + License: Apache License 2.0, see LICENSE for more details. + + On Debian systems, a copy of the Apache License 2.0 can be found in + /usr/share/common-licenses/Apache-2.0 + + +------------------------------------------------------------------------------ + +check_haproxy: + +The plugin was downloaded from: +http://cvs.orion.education.fr/viewvc/viewvc.cgi/nagios-plugins-perl/trunk/plugins/check_haproxy.pl?view=log + + 2010 Stéphane Urbanovski + + License: GPL v2 + + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + + + + +------------------------------------------------------------------------------ + +check_hpasm: + +The plugin was downloaded from: +http://labs.consol.de/lang/en/nagios/check_hpasm/ + + AUTHOR: Gerhard Lausser + + 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. + + + +------------------------------------------------------------------------------ + +check_httpd_status: + +The plugin was downloaded from: +http://cvs.orion.education.fr/viewvc/viewvc.cgi/nagios-plugins-perl/trunk/plugins/check_httpd_status.pl?view=log + + Dennis D. Spreen (dennis at spreendigital.de) + De Bodt Lieven (Lieven dot DeBodt at gmail.com) + Karsten Behrens (karsten at behrens dot in) + Geoff McQueen (geoff dot mcqueen at hiivesystems dot com ) + Dave Steinberg (dave at redterror dot net) + Gerhard Lausser (gerhard dot lausser at consol dot de) + Stéphane Urbanovski + + License: GPL v2 + + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + + + + +------------------------------------------------------------------------------ + +check_ipmi_sensor: + +The plugin was downloaded from: +http://www.thomas-krenn.com/en/oss/ipmi-plugin.html + + Copyright (C) 2009-2011 Thomas-Krenn.AG (written by Werner Fischer), + additional contributors see changelog.txt + + 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 3 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, see . + + + + License and copyright for contrib/default-combinedgraph.template: + + Author: Andy Spiegl + + 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, see . + + + +------------------------------------------------------------------------------ + +check_libs: + +The plugin was downloaded from: +http://svn.noreply.org/cgi-bin/viewvc.cgi/weaselutils/trunk/?logsort=cvs&diff_format=s&sortby=file#dirlist + + Copyright (C) 2005, 2006, 2007, 2008, 2012 Peter Palfrader + 2012 Uli Martens + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +------------------------------------------------------------------------------ + +check_lm_sensors: + +The plugin was downloaded from: +https://trac.id.ethz.ch/projects/nagios_plugins/wiki/check_lm_sensors + + Copyright (c) 2007, ETH Zurich. + + Author: Matteo Corti + + This module is free software; you can redistribute it and/or modify it + under the terms of GNU general public license (gpl) version 3. + + +------------------------------------------------------------------------------ + +check_memcached: + +The plugin was downloaded from: +http://exchange.nagios.org/directory/Plugins/Websites,-Forms-and-Transactions/check_memcached-IV/details + + This program was initially developed by Lonely Planet for internal use + and has kindly been made available to the Open Source community for + redistribution and further development under the terms of the + GNU General Public License v3: http://www.gnu.org/licenses/gpl.html + + This program is supplied 'as-is', in the hope that it will be useful, but + neither Lonely Planet nor the authors make any warranties or guarantees + as to its correct operation, including its intended function. + + Or in other words: + Test it yourself, and make sure it works for YOU. + + Author: George Hansper e-mail: George.Hansper@lonelyplanet.com.au + + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + + +------------------------------------------------------------------------------ + +check_memory: + +The plugin was downloaded from: +https://www.monitoringexchange.org/inventory/Check-Plugins/Operating-Systems/Linux/check_memory + + Copyright (C) 2007 Thomas Guyot-Sionnest + + 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + + +------------------------------------------------------------------------------ + +check_multipath: + +The plugin was downloaded from: +http://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check-2Dmultipath-2Epl/details + + Copyright (C) 2011 Hinnerk Rümenapf, Trond H. Amundsen, Gunther Schlegel, Matija Nalis, + Bernd Zeimetz + + 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 3 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, see . + + + +------------------------------------------------------------------------------ + +check_mysql_health: + +The plugin was downloaded from: +http://labs.consol.de/lang/en/nagios/check_mysql_health/ + + AUTHOR: Gerhard Lausser + + 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. + + + +------------------------------------------------------------------------------ + +check_nfsmounts: + +The plugin was downloaded from: +http://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check_nfsmounts/details + + Author: Clint Byrum + + Copyright 2007 Adicio, Inc. + + 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 3 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, see . + + + +------------------------------------------------------------------------------ + +check_printer: + +The plugin was downloaded from: +https://www.secure-computing.net/svn/trunk/nagios/ + + Copyright (c) 2007,2011 Eric F Crist + + All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, are permitted provided that the following + conditions are met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +------------------------------------------------------------------------------ + +check_raid: + +The plugin was downloaded from: +https://github.com/glensc/nagios-plugin-check_raid + + 2004-2006 Steve Shipway, university of auckland, + 2009-2012 Elan Ruusamäe + + License: GPL v2 + + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + + + + +------------------------------------------------------------------------------ + +check_rbl: + +The plugin was downloaded from: +https://svn.id.ethz.ch/projects/nagios_plugins/wiki/check_rbl + + Copyright (c) 2009 ETH Zurich + Copyright (c) 2010 Elan Ruusamae + + 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 3 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. + + +------------------------------------------------------------------------------ + +check_snmp_environment: + +The plugin was downloaded from: +http://exchange.nagios.org/directory/Plugins/Hardware/Network-Gear/Cisco/Check-various-hardware-environmental-sensors/details + + + Author : Michiel Timmers ( michiel.timmers AT gmx.net) + Based on : "check_snmp_env" plugin (version 1.3) from Patrick Proy + + 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 3 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, see + + + +------------------------------------------------------------------------------ + +check_ssl_cert: + +The plugin was downloaded from: +https://trac.id.ethz.ch/projects/nagios_plugins/wiki/check_ssl_cert + + Copyright (c) 2007-2011 ETH Zurich + + Authors: + + Dan Wallis + Lawren Quigley-Jones + Marc Fournier + Marcus Rejås + Matteo Corti + Matthias Fuhrmeister + Raphael Thoma + Scott Worthington + Sven Nierlein + Tuomas Haarala + Wolfgang Schricker + Yannick Gravel + + This module is free software; you can redistribute it and/or modify it + under the terms of GNU general public license (gpl) version 3. + + +------------------------------------------------------------------------------ + +check_varnish: + +The plugin was downloaded from: +http://repo.varnish-cache.org/source/ + + + Copyright (c) 2007-2009 Linpro AS + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + +------------------------------------------------------------------------------ + +check_webinject: + +The plugin was downloaded from: +http://labs.consol.de/lang/en/nagios/check_webinject/ + + Copyright 2010 Sven Nierlein (nierlein@cpan.org) + Copyright 2004-2006 Corey Goldberg (corey@goldb.org) + + This file is part of WebInject. + + WebInject 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. + + WebInject 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. + + + +------------------------------------------------------------------------------ + +check_whois: + +The plugin was downloaded from: +http://dns.measurement-factory.com/tools/nagios-plugins/check_whois.html + + Copyright (c) 2008, The Measurement Factory, Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + Neither the name of The Measurement Factory nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + +------------------------------------------------------------------------------ + +check_zone_auth: + +The plugin was downloaded from: +http://dns.measurement-factory.com/tools/nagios-plugins/check_zone_auth.html + + Copyright (c) 2008, The Measurement Factory, Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + Neither the name of The Measurement Factory nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + +------------------------------------------------------------------------------ + +check_zone_rrsig_expiration: + +The plugin was downloaded from: +http://dns.measurement-factory.com/tools/nagios-plugins/check_zone_rrsig_expiration.html + + Copyright (c) 2008, The Measurement Factory, Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + Neither the name of The Measurement Factory nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + +------------------------------------------------------------------------------ + +dsa: + +The plugin was downloaded from: +http://anonscm.debian.org/gitweb/?p=mirror/dsa-nagios.git;a=tree;f=dsa-nagios-checks;hb=HEAD + + checks/dsa-check-cert-expire:# Copyright 2009 Peter Palfrader + checks/dsa-check-dnssec-delegation:# Copyright (c) 2010 Peter Palfrader + checks/dsa-check-entropy:# Copyright 2011 Peter Palfrader + checks/dsa-check-soas:# Copyright 2006, 2012 Peter Palfrader + checks/dsa-check-packages:# Copyright (C) 2008, 2009 Peter Palfrader + checks/dsa-check-statusfile:# Copyright 2008, 2012 Peter Palfrader + checks/dsa-check-running-kernel:# Copyright 2008,2009,2011 Peter Palfrader + checks/dsa-check-running-kernel:# Copyright 2009 Stephen Gran + checks/dsa-check-running-kernel:# Copyright 2010 Uli Martens + checks/dsa-check-running-kernel:# Copyright 2011 Alexander Reichle-Schmehl + sbin/dsa-update-apt-status:# Copyright 2009 Peter Palfrader + sbin/dsa-update-unowned-file-status:# Copyright 2012 Peter Palfrader + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +------------------------------------------------------------------------------ + +extras: + + + send_nsca_host_or_service_check_result: + + Based on the example in the icinga documentation. + Enhanced to handle service and host checks by + Bernd Zeimetz . + + Copyright (c) 1999-2009 Ethan Galstad (nagios@nagios.org) + Copyright (c) 2009-2010 Icinga Development Team (info@icinga.org) + Copyright (c) 2012 Bernd Zeimetz + + License: + + 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. + + On Debian systems, the complete text of the GNU General Public + License, version 2, can be found in /usr/share/common-licenses/GPL-2. + + diff --git a/debian/copyright.in b/debian/copyright.in new file mode 100644 index 0000000..c12b00e --- /dev/null +++ b/debian/copyright.in @@ -0,0 +1,35 @@ + +The Debian packaging is Copyright © 2012 Bernd Zeimetz and is licensed under der GPL, either version 3 +of the License, or (at your option) any later version. + + + 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 3 of the License, or + (at your option) any later version. + . + This package 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, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + + +Part of the Debian packaging is the content of the debian directory, +and the following files: + common*.mk + */control + */copyright + */Makefile + + +The copyright information for the included plugins is listed below: + + +#AUTO_UPDATE_Copyright# diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..cf46e43 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,3 @@ +[git-buildpackage] +sign-tags = True +posttag = git push && git push --tags diff --git a/debian/monitoring-plugins-cyconet.docs b/debian/monitoring-plugins-cyconet.docs new file mode 100644 index 0000000..27af518 --- /dev/null +++ b/debian/monitoring-plugins-cyconet.docs @@ -0,0 +1 @@ +debian/README.Debian.plugins diff --git a/debian/monitoring-plugins-cyconet.lintian-overrides b/debian/monitoring-plugins-cyconet.lintian-overrides new file mode 100644 index 0000000..f06bbfe --- /dev/null +++ b/debian/monitoring-plugins-cyconet.lintian-overrides @@ -0,0 +1,3 @@ +# as mentioned in the description people need to +# install whats mentioned in recommends. +monitoring-plugins-cyconet: missing-depends-line diff --git a/debian/packaging-helper.py b/debian/packaging-helper.py new file mode 100755 index 0000000..42bf5f5 --- /dev/null +++ b/debian/packaging-helper.py @@ -0,0 +1,295 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +import sys +import os +import re +from debian import deb822 + +ALLOWED_FIELDS = ('Suggests', + 'Recommends', + 'Depends', + 'Uploaders', + 'Version', + 'Homepage', + 'Watch', + 'Description', + 'Build-Depends') + +# find all plugins +__basedir__ = os.path.realpath(os.path.dirname(sys.argv[0]) + os.path.sep + '..') +__plugins__ = [p for p in os.listdir(__basedir__) + if (os.path.isdir(__basedir__ + os.path.sep + p) and p!='debian' and p!='.git' and p!='.pc')] +__plugins__.sort() + + +__uploaders_re__ = re.compile(r', *') +__shlibs_re__ = re.compile(r'shlibs:Depends=(.+)') + +def __get_control_data__(): + # returns (plug, parsed control field data) + # We look at the first paragraph only! + for plugin in __plugins__: + data=(plugin, [x for x in deb822.Packages.iter_paragraphs(file(__basedir__ + os.path.sep+ plugin + os.path.sep + 'control'))][0]) + for key in data[1].iterkeys(): + if key not in ALLOWED_FIELDS: + raise Exception("Unknown control field in plugin %s: %s" %(data[0],key)) + yield data + +def generate_debian_readme_plugins(): + plugins_depends={} + for plugin, _control in __get_control_data__(): + plugins_depends[plugin]={} + # look trough keys we might want to merge + for key in ['Suggests', 'Recommends']: + if _control.has_key(key): + plugins_depends[plugin][key]=deb822.PkgRelation.parse_relations(_control[key]) + + # check for generated substvars files + substvarsfile = __basedir__ + os.path.sep + 'debian' + os.path.sep + plugin + os.path.sep + 'substvars' + if os.path.exists(substvarsfile): + with open(substvarsfile, 'r') as fd: + substvars = fd.read() + try: + rel = deb822.PkgRelation.parse_relations(__shlibs_re__.findall(substvars)[0]) + if plugins_depends[plugin].has_key('Recommends'): + plugins_depends[plugin]['Recommends'].extend(rel) + else: + plugins_depends[plugin]['Recommends']=rel + except IndexError: + pass + + # generate content + result=[] + for plugin in __plugins__: + if len(plugins_depends[plugin]) > 0: + rtext = '%s:' %(plugin,) + if plugins_depends[plugin].has_key('Recommends'): + rtext = '%s\n Required Packages: %s' %( + rtext, + deb822.PkgRelation.str(plugins_depends[plugin]['Recommends']) + ) + if plugins_depends[plugin].has_key('Suggests'): + rtext = '%s\n Optional Packages: %s' %( + rtext, + deb822.PkgRelation.str(plugins_depends[plugin]['Suggests']) + ) + result.append(rtext) + + readmefile=__basedir__ + os.path.sep + 'debian' + os.path.sep + 'README.Debian.plugins' + with open(readmefile + '.in', 'r') as fd: + readme=fd.read() + + readme=readme.replace('#AUTO_UPDATE_README#', '\n\n'.join(result)) + + with open(readmefile, 'w') as fd: + fd.write(readme) + + + +def update_control(): + control_data = { + 'Suggests' : [], + 'Recommends' : [], + 'Build-Depends' : [], + 'Description' : [], + 'Uploaders' : [] + } + + for plugin, _control in __get_control_data__(): + # look trough keys we might want to merge + if _control.has_key('Depends'): + print "Don't use 'Depends' in %s/control - use 'Recommends' instead" %(plugin,) + sys.exit(1) + for key in ['Build-Depends', 'Suggests', 'Recommends']: + if _control.has_key(key): + for rel in deb822.PkgRelation.parse_relations(_control[key]): + if not rel in control_data[key]: + control_data[key].append(rel) + # extract description + description = ' * %s' %(plugin,) + if _control.has_key('Version'): + description = '%s (%s)' %(description, _control['Version']) + try: + description = '%s: %s' %(description, _control['Description'].replace('\n','\n ')) + except KeyError: + print 'Description for plugin %s missing!' %(plugin,) + sys.exit(1) + + try: + for uploader in __uploaders_re__.split(_control['Uploaders']): + if uploader not in control_data['Uploaders']: + control_data['Uploaders'].append(uploader) + except KeyError: + 'Uploaders for plugin %s missing!' %(plugin,) + sys.exit(1) + +# disables right now. do we want to have the homepage in the description? +# if _control.has_key('Homepage'): +# description = '%s\n Homepage: %s' %(description, _control['Homepage']) + + control_data['Description'].append(description) + + + with open(__basedir__ + os.path.sep + 'debian' + os.path.sep + 'control.in', 'r') as f: + control_in = f.read() + + for k, v in control_data.iteritems(): + if k == 'Description': + control_in = control_in.replace('#AUTO_UPDATE_Description#', u'\n'.join(v)) + elif k == 'Uploaders': + control_in = control_in.replace('#AUTO_UPDATE_Uploaders#', u', '.join(v)) + else: + control_in = control_in.replace('#AUTO_UPDATE_%s#' %(k, ), deb822.PkgRelation.str(v)) + + with open(__basedir__ + os.path.sep + 'debian' + os.path.sep + 'control', 'w') as f: + f.write(control_in) + + + + +def update_copyright(): + + copyrights = [] + for plugin, _control in __get_control_data__(): + _p_copyright = '%s:\n\n' %(plugin,) + if _control.has_key('Homepage'): + _p_copyright = '%sThe plugin was downloaded from: \n%s\n\n' %(_p_copyright, _control['Homepage']) + + try: + with open(__basedir__ + os.path.sep + plugin + os.path.sep + 'copyright', 'r') as f: + _p_copyright = '%s %s' %(_p_copyright, f.read().decode('utf-8').replace('\n','\n ')) + except IOError: + print 'copyright file for plugin %s missing!' %(plugin,) + sys.exit(1) + + copyrights.append(_p_copyright) + + with open(__basedir__ + os.path.sep + 'debian' + os.path.sep + 'copyright.in', 'r') as f: + copyright_in = f.read().decode('utf-8') + + copyright_in = copyright_in.replace('#AUTO_UPDATE_Copyright#', u'\n\n------------------------------------------------------------------------------\n\n'.join(copyrights)) + + with open(__basedir__ + os.path.sep + 'debian' + os.path.sep + 'copyright', 'w') as f: + f.write(copyright_in.encode('utf-8')) + + +def watch(): + + import apt_pkg + apt_pkg.init_system() + + import hashlib + + import urllib2 + url_opener = urllib2.build_opener() + url_opener.addheaders = [('User-agent', 'Debian nagios-plugins-contrib 1.0')] + + watch_re = re.compile(r'([^ ]+) (.+)') + whitespace_re = re.compile(r'\s') + for plugin, _control in __get_control_data__(): + if not _control.has_key('Watch'): + print 'WARNING: %s - missing watch information!' %(plugin,) + continue + try: + url, check = watch_re.findall(_control['Watch'])[0] + except IndexError: + print 'WARNING: %s - failed to parse Watch line!' %(plugin,) + continue + try: + f=url_opener.open(url) + content = f.read() + f.close() + except IOError: + print 'WARNING: %s - failed to retrieve %s !' %(plugin,url) + continue + check=check.strip() + if check.startswith('SHA1:'): + check=check.replace('SHA1:','') + new_sha=hashlib.sha1(content).hexdigest() + if check != new_sha: + print 'UPDATE NECESSARY: %s - SHA1 checksum does not match! New checksum: %s' %(plugin,new_sha) + else: + print 'OK: %s' %(plugin,) + else: + if not _control.has_key('Version'): + print 'WARNING: %s - missing current version information!' %(plugin,) + continue + check_re=re.compile(check) + # check for simple matches + found_versions=check_re.findall(content) + # now also see if the regexp author added too many .* parts and the match is a bit buggy + # we replace all whitespaces with \n and try again. + for v in check_re.findall(whitespace_re.sub('\n',content)): + if not v in found_versions: + found_versions.append(v) + if not found_versions: + print "WARNING: %s - regex does not match!" %(plugin) + continue + + new_version = found_versions[0] + for v in found_versions: + if (apt_pkg.version_compare(v, found_versions[0]) > 0): + new_version = v + if (apt_pkg.version_compare(new_version, _control['Version'].strip()) > 0): + print 'UPDATE NECESSARY: %s - found new version %s' %(plugin, new_version) + elif (apt_pkg.version_compare(new_version, _control['Version'].strip()) < 0): + print 'WARNING: %s - could not find the current version (found: %s, control says: %s)!' %(plugin, new_version, _control['Version']) + else: + print 'OK: %s' %(plugin,) + + + +if __name__ == '__main__': + from optparse import OptionParser + prog = os.path.basename(sys.argv[0]) + usage = ('%s [--copyright] [--control] [--watch] [--generate-readme] [-h|--help]') %(prog,) + parser = OptionParser(usage=usage) + + parser.add_option( + '--copyright', + dest='copyright', + action='store_true', + default=False, + help='Update debian/copyright' + ) + + parser.add_option( + '--control', + dest='control', + action='store_true', + default=False, + help='Update debian/control' + ) + + parser.add_option( + '--watch', + dest='watch', + action='store_true', + default=False, + help='Search for updates' + ) + parser.add_option( + '--generate-readme', + dest='generate_readme', + action='store_true', + default=False, + help='Generate debian/README.Debian.plugins' + ) + (options, args) = parser.parse_args() + + if not (options.control or options.copyright or options.watch or options.generate_readme): + parser.print_help() + sys.exit(1) + + if options.control: + update_control() + + if options.copyright: + update_copyright() + + if options.watch: + watch() + + if options.generate_readme: + generate_debian_readme_plugins() diff --git a/debian/patches/check_ajp/return_critical_on_failed_connection b/debian/patches/check_ajp/return_critical_on_failed_connection new file mode 100644 index 0000000..80f18f4 --- /dev/null +++ b/debian/patches/check_ajp/return_critical_on_failed_connection @@ -0,0 +1,79 @@ +--- a/check_ajp/check_ajp ++++ b/check_ajp/check_ajp +@@ -7,6 +7,7 @@ + # + # check_ajp - nagios plugin for jboss monitoring + # Copyright (C) 2010 Michel Rode ++# Copyright (C) 2013 Bernd Zeimetz + # + # 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 +@@ -30,6 +31,8 @@ use strict; + use Getopt::Long; + use Socket; + use Time::HiRes 'time'; ++use IO::Socket; ++ + + my $app = ''; + my $port = '8009'; +@@ -37,9 +40,14 @@ my $warntime = '1.5'; + my $crittime = '3'; + my $timeout = '10'; + +-my ($iaddr, $paddr, $proto, $sock, $time1, $time2); ++my ($sock, $time1, $time2); + my $pong = 'null'; + ++sub conndie{ ++ my $msg = shift; ++ print "CRITICAL : $msg\n"; ++ exit 2; ++} + sub xdie{ + my $msg = shift; + printf STDERR "Usage: check_ajp --app ip.of.the.app [--port 8009 --warn 1 --crit 2 --timeout 5]\n\n"; +@@ -49,6 +57,10 @@ sub xdie{ + + GetOptions("app=s" => \$app, "port=s" => \$port, "warn=f" => \$warntime, "crit=f" => \$crittime, "timeout=f" => \$timeout); + ++if ($app eq '') { ++ xdie('--app not given') ++} ++ + my $ping = pack 'C5' # Format template. + , 0x12, 0x34 # Magic number for server->container packets. + , 0x00, 0x01 # 2 byte int length of payload. +@@ -61,24 +73,23 @@ my $expected = pack 'C5' # Format tem + , 0x09 # Type of packet. 9 = CPong reply. + ; + +-$iaddr = inet_aton($app) || xdie("No host given !"); +-$paddr = sockaddr_in($port, $iaddr) || xdie("Wrong port !"); +-$proto = getprotobyname 'tcp'; +- + $time1 = time(); + + eval { + local $SIG{ALRM} = sub { die "alarm\n" }; + alarm($timeout); +- socket $sock, PF_INET, SOCK_STREAM, $proto || xdie("socket !"); +- connect $sock, $paddr || xdie("connect !"); +- syswrite $sock, $ping || xdie("syswrite !"); +- sysread $sock, $pong, 5 || xdie("sysread !"); ++ $sock = IO::Socket::INET->new(Proto => "tcp", ++ PeerAddr => $app, ++ PeerPort => $port) || conndie($@); ++ $sock->autoflush(1); ++ print $sock $ping; ++ $sock->recv($pong,5); ++ close $sock; + alarm(0); + }; + + if ($@) { +- die unless $@ eq "alarm\n"; ++ conndie($@) unless $@ eq "alarm\n"; + $time2 = (time() - $time1); + printf "CRITICAL - AJP - Timeout after %1.0fs\n",$time2; + exit 2; diff --git a/debian/patches/check_backuppc/use_nagios_plugins b/debian/patches/check_backuppc/use_nagios_plugins new file mode 100644 index 0000000..9154573 --- /dev/null +++ b/debian/patches/check_backuppc/use_nagios_plugins @@ -0,0 +1,11 @@ +--- a/check_backuppc/src/check_backuppc ++++ b/check_backuppc/src/check_backuppc +@@ -32,7 +32,7 @@ no utf8; + + # Nagios + use lib "NAGIOS_LIB"; +-use utils qw(%ERRORS $TIMEOUT); ++use Nagios::Plugin qw(%ERRORS); + use POSIX qw(strftime difftime); + use Getopt::Long; + Getopt::Long::Configure('bundling'); diff --git a/debian/patches/check_clamav/clamav_locations b/debian/patches/check_clamav/clamav_locations new file mode 100644 index 0000000..c857987 --- /dev/null +++ b/debian/patches/check_clamav/clamav_locations @@ -0,0 +1,73 @@ +--- a/check_clamav/check_clamav ++++ b/check_clamav/check_clamav +@@ -16,18 +16,18 @@ + # + ################################################################################ + # This script is used to compare the version and signature level of the +-# currently running clamd daemon with the latest available versions listed in ++# currently running clamscan daemon with the latest available versions listed in + # the TXT record for current.cvd.clamav.net. + # + # In order to use this script, you might need to make the following adjustments: + # - Set the "use lib" path correctly (where utils.pm is located.) +-# - Set the path to your clamd binary in $clamd_cmd. ++# - Set the path to your clamscan binary in $clamscan_cmd. + # + # This plugin requires the Net::DNS Perl module. + ################################################################################ + + # Plugin directory / home of utils.pm. +-use lib "/usr/local/libexec/nagios"; ++use lib "/usr/lib/nagios/plugins"; + use utils qw(%ERRORS &print_revision &support &usage); + use Getopt::Long qw(:config no_ignore_case bundling); + use File::Basename; +@@ -35,8 +35,8 @@ use Net::DNS; + + use strict; + +-# Path to installed clamd binary. +-my $clamd_cmd = "/usr/local/sbin/clamd"; ++# Path to installed clamscan binary. ++my $clamscan_cmd = "/usr/bin/clamscan"; + + # Leave the rest of this alone: + my $prog_name = basename $0; +@@ -153,28 +153,28 @@ if ($vers_val != 0) { + } + + # Make sure the binary exists. +-if (-x $clamd_cmd) { +- &print_debug("Found clamd at $clamd_cmd"); ++if (-x $clamscan_cmd) { ++ &print_debug("Found clamscan at $clamscan_cmd"); + } else { +- &print_debug("Can't execute clamd at $clamd_cmd"); +- die("FATAL: Unable to execute $clamd_cmd"); ++ &print_debug("Can't execute clamscan at $clamscan_cmd"); ++ die("FATAL: Unable to execute $clamscan_cmd"); + } + + &print_debug("Threshhold values: warning=$warn_val, critical=$crit_val"); + + # Should return something like: ClamAV 0.87.1/1205/Wed Dec 7 07:00:48 2005 +-chomp(my $clamd_ver = `$clamd_cmd -V`); ++chomp(my $clamscan_ver = `$clamscan_cmd -V`); + + # Should return something like: 0.87.1:34:1206:1134072033:1 + chomp(my $dnstxt_ver = &lookup_current()); + +-# Parse what we get from clamd -V and our DNS query +-my @clamdresults = split(/\//,$clamd_ver); ++# Parse what we get from clamscan -V and our DNS query ++my @clamscanresults = split(/\//,$clamscan_ver); + my @txtresults = split(/:/,$dnstxt_ver); + + # Get the currently running ClamAV sig level and cvd date out of this +-my $local_latest_daily = $clamdresults[1]; +-my $local_latest_date = $clamdresults[2]; ++my $local_latest_daily = $clamscanresults[1]; ++my $local_latest_date = $clamscanresults[2]; + + &print_debug("Local daily.cvd dated $local_latest_date"); + &print_debug("Local daily.cvd version = $local_latest_daily"); diff --git a/debian/patches/check_cups/epn b/debian/patches/check_cups/epn new file mode 100644 index 0000000..cd836f4 --- /dev/null +++ b/debian/patches/check_cups/epn @@ -0,0 +1,8 @@ +--- a/check_cups/check_cups ++++ b/check_cups/check_cups +@@ -1,4 +1,5 @@ + #!/usr/bin/perl ++# nagios: -epn + + =head1 NAME + diff --git a/debian/patches/check_email_delivery/epn b/debian/patches/check_email_delivery/epn new file mode 100644 index 0000000..02d5424 --- /dev/null +++ b/debian/patches/check_email_delivery/epn @@ -0,0 +1,45 @@ +--- a/check_email_delivery/src/check_email_delivery ++++ b/check_email_delivery/src/check_email_delivery +@@ -1,4 +1,6 @@ + #!/usr/bin/perl ++# nagios: -epn ++ + use strict; + my $VERSION = '0.7.1'; + my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +--- a/check_email_delivery/src/check_imap_quota ++++ b/check_email_delivery/src/check_imap_quota +@@ -1,4 +1,6 @@ + #!/usr/bin/perl ++# nagios: -epn ++ + use strict; + my $VERSION = '0.2'; + my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +--- a/check_email_delivery/src/check_imap_receive ++++ b/check_email_delivery/src/check_imap_receive +@@ -1,4 +1,6 @@ + #!/usr/bin/perl ++# nagios: -epn ++ + use strict; + my $VERSION = '0.7.5'; + my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +--- a/check_email_delivery/src/check_smtp_send ++++ b/check_email_delivery/src/check_smtp_send +@@ -1,4 +1,6 @@ + #!/usr/bin/perl ++# nagios: -epn ++ + use strict; + use POSIX qw(strftime); + my $VERSION = '0.7.3'; +--- a/check_email_delivery/src/imap_ssl_cert ++++ b/check_email_delivery/src/imap_ssl_cert +@@ -1,4 +1,6 @@ + #!/usr/bin/perl ++# nagios: -epn ++ + use strict; + my $VERSION = '0.1'; + my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; diff --git a/debian/patches/check_email_delivery/paths b/debian/patches/check_email_delivery/paths new file mode 100644 index 0000000..e4c8fc6 --- /dev/null +++ b/debian/patches/check_email_delivery/paths @@ -0,0 +1,27 @@ +Author: Tom Jampen +Description: + Patches check_email_delivery and check_email_delivery_epn to use debian + specific paths. + +--- a/check_email_delivery/src/check_email_delivery ++++ b/check_email_delivery/src/check_email_delivery +@@ -63,7 +63,7 @@ my $default_warn = 15; + my $default_wait = 5; + my $default_timeout = 60; + my $time_hires = ""; +-my $libexec = "/usr/local/nagios/libexec"; ++my $libexec = "/usr/lib/nagios/plugins"; + my $ok; + $ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, +--- a/check_email_delivery/src/check_email_delivery_epn ++++ b/check_email_delivery/src/check_email_delivery_epn +@@ -61,7 +61,7 @@ my $default_warn = 15; + my $default_wait = 5; + my $default_timeout = 60; + my $time_hires = ""; +-my $libexec = "/usr/local/nagios/libexec"; ++my $libexec = "/usr/lib/nagios/plugins"; + my $ok; + $ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, diff --git a/debian/patches/check_haproxy/epn b/debian/patches/check_haproxy/epn new file mode 100644 index 0000000..1514373 --- /dev/null +++ b/debian/patches/check_haproxy/epn @@ -0,0 +1,8 @@ +--- a/check_haproxy/check_haproxy ++++ b/check_haproxy/check_haproxy +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + # + # Copyright (c) 2010 Stéphane Urbanovski + # diff --git a/debian/patches/check_httpd_status/epn b/debian/patches/check_httpd_status/epn new file mode 100644 index 0000000..07a015c --- /dev/null +++ b/debian/patches/check_httpd_status/epn @@ -0,0 +1,9 @@ +--- a/check_httpd_status/check_httpd_status ++++ b/check_httpd_status/check_httpd_status +@@ -1,4 +1,6 @@ + #!/usr/bin/perl -w ++# nagios: -epn ++# + ####################### check_apachestatus_auto.pl ####################### + # Version : 1.3 + # Date : 06 Aug 2010 diff --git a/debian/patches/check_libs/config_location b/debian/patches/check_libs/config_location new file mode 100644 index 0000000..ee0181d --- /dev/null +++ b/debian/patches/check_libs/config_location @@ -0,0 +1,11 @@ +--- a/check_libs/nagios-check-libs ++++ b/check_libs/nagios-check-libs +@@ -71,7 +71,7 @@ if ($params->{'version'}) { + }; + + if (! defined $params->{'config'}) { +- $params->{'config'} = '/etc/nagios-plugins/check-libs.conf'; ++ $params->{'config'} = '/etc/nagios/check-libs.conf'; + } elsif (! -e $params->{'config'}) { + dief("Config file $params->{'config'} does not exist.\n"); + } diff --git a/debian/patches/check_libs/config_path b/debian/patches/check_libs/config_path new file mode 100644 index 0000000..330d637 --- /dev/null +++ b/debian/patches/check_libs/config_path @@ -0,0 +1,11 @@ +--- a/check_libs/nagios-check-libs ++++ b/check_libs/nagios-check-libs +@@ -71,7 +71,7 @@ if ($params->{'version'}) { + }; + + if (! defined $params->{'config'}) { +- $params->{'config'} = '/etc/nagios/check-libs.conf'; ++ $params->{'config'} = '/etc/nagios-plugins/check-libs.conf'; + } elsif (! -e $params->{'config'}) { + dief("Config file $params->{'config'} does not exist.\n"); + } diff --git a/debian/patches/check_lm_sensors/interpreter b/debian/patches/check_lm_sensors/interpreter new file mode 100644 index 0000000..e46ed48 --- /dev/null +++ b/debian/patches/check_lm_sensors/interpreter @@ -0,0 +1,8 @@ +--- a/check_lm_sensors/src/check_lm_sensors ++++ b/check_lm_sensors/src/check_lm_sensors +@@ -1,4 +1,4 @@ +-#!perl ++#!/usr/bin/perl + + # check_lm_sensors is a Nagios plugin to monitor the values of on board sensors and hard + # disk temperatures on Linux systems diff --git a/debian/patches/check_lm_sensors/manpage_whatis_fix b/debian/patches/check_lm_sensors/manpage_whatis_fix new file mode 100644 index 0000000..53290de --- /dev/null +++ b/debian/patches/check_lm_sensors/manpage_whatis_fix @@ -0,0 +1,12 @@ +--- a/check_lm_sensors/src/check_lm_sensors.pod ++++ b/check_lm_sensors/src/check_lm_sensors.pod +@@ -2,8 +2,7 @@ + + =head1 NAME + +-C is a Nagios plugin to monitor the values of on +-board sensors and hard disk temperatures on Linux systems ++C - Nagios plugin to monitor hardware sensors and disk temperatures + + =head1 DESCRIPTION + diff --git a/debian/patches/check_lm_sensors/spelling_errors b/debian/patches/check_lm_sensors/spelling_errors new file mode 100644 index 0000000..b684280 --- /dev/null +++ b/debian/patches/check_lm_sensors/spelling_errors @@ -0,0 +1,11 @@ +--- a/check_lm_sensors/src/check_lm_sensors.pod ++++ b/check_lm_sensors/src/check_lm_sensors.pod +@@ -49,7 +49,7 @@ verbosity. + =head1 EXIT STATUS + + 0 if OK, 1 in case of a warning, 2 in case of a critical status and 3 +-in case of an unkown problem ++in case of an unknown problem + + =head1 DEPENDENCIES + diff --git a/debian/patches/check_nfsmounts/nfs_write_location b/debian/patches/check_nfsmounts/nfs_write_location new file mode 100644 index 0000000..d353587 --- /dev/null +++ b/debian/patches/check_nfsmounts/nfs_write_location @@ -0,0 +1,20 @@ +--- a/check_nfsmounts/check_nfsmounts ++++ b/check_nfsmounts/check_nfsmounts +@@ -23,6 +23,7 @@ + + use Nagios::Plugin qw(%ERRORS); + use Time::HiRes qw{time alarm}; ++use Sys::Hostname; + use Getopt::Long; + use strict; + +@@ -107,7 +108,8 @@ foreach $dir (@dirs) { + if($pid==0) { + chdir $dir or &bad_mount($dir,$!); + if($writemode and exists($mountmodes{$dir}->{"rw"})) { +- open X,"> $dir/.nfscheck" or exit $?; ++ my $check_filename="$dir/.nfscheck_" . hostname; ++ open X,"> $check_filename" or exit $?; + print X $ENV{HOSTNAME}."\n".localtime()."\n"; # XXX Full disk may fail.. + close X or exit $?; + } diff --git a/debian/patches/check_nfsmounts/perl_module b/debian/patches/check_nfsmounts/perl_module new file mode 100644 index 0000000..8cb326d --- /dev/null +++ b/debian/patches/check_nfsmounts/perl_module @@ -0,0 +1,19 @@ +--- a/check_nfsmounts/check_nfsmounts ++++ b/check_nfsmounts/check_nfsmounts +@@ -21,14 +21,14 @@ + # along with this program. If not, see . + # + +-use utils qw{$TIMEOUT %ERRORS}; ++use Nagios::Plugin qw(%ERRORS); + use Time::HiRes qw{time alarm}; + use Getopt::Long; + use strict; + + my $version="1.0"; + +-my $nfs_timeout=$TIMEOUT; ++my $nfs_timeout=15; + my $nfs_warn=-1; + my $writemode=0; + my $help=0; diff --git a/debian/patches/check_printer/debian_bts b/debian/patches/check_printer/debian_bts new file mode 100644 index 0000000..ebaafb9 --- /dev/null +++ b/debian/patches/check_printer/debian_bts @@ -0,0 +1,35 @@ +--- a/check_printer/check_printer ++++ b/check_printer/check_printer +@@ -35,10 +35,6 @@ use warnings; + + use Nagios::Plugin qw(%ERRORS); + +-'$Revision$' =~ m/Revision: (\d+)/; +-my $revision = $1; +-'$HeadURL$' =~ m/HeadURL: ([\w\:\/\-\.\_]+) /; +-my $src_url = $1; + my $usage = " + Usage: $0 host_addr community warn% crit% + +@@ -52,7 +48,6 @@ my $debug = 0; + if ($ARGV[4]){ + use Data::Dumper; + $debug = 1; +- print "check_printer Revision $revision\n$src_url\n\n"; + } + die $usage unless ($#ARGV >= 3); + my $base_oid = ".1.3.6.1.2.1.43.11.1.1"; +@@ -235,10 +230,9 @@ while (my($key, $value) = each(%status)) + if ($debug){ + print Dumper(\%status); + print "\n\n############ ATTENTION ############\n"; +- print "You have debug enabled. If asked to enable debug by the developer,\n"; +- print "please send all of the output, including your command line to\n"; +- print "ecrist\@secure-computing.net with the subject line 'check_printer DEBUG' along\n"; +- print "with a description of the problem you're experiencing.\n###################################\n"; ++ print "You have debug enabled. If asked to enable debug by the Debian Maintainer,\n"; ++ print "please send all of the output to the Debian Bug Tracking System, either by \n"; ++ print "replying to an existing bug or by opening a new bug.\n"; + } + if ($is_crit){ + print "$err_str CRITICAL. See http://$ARGV[0] | $perf_str"; diff --git a/debian/patches/check_printer/use_data_dumper_if_needed b/debian/patches/check_printer/use_data_dumper_if_needed new file mode 100644 index 0000000..374d10f --- /dev/null +++ b/debian/patches/check_printer/use_data_dumper_if_needed @@ -0,0 +1,18 @@ +--- a/check_printer/check_printer ++++ b/check_printer/check_printer +@@ -41,7 +41,6 @@ if ($OS =~ m/^\wBSD/){ + } + + use utils qw(%ERRORS); +-use Data::Dumper; + + '$Revision$' =~ m/Revision: (\d+)/; + my $revision = $1; +@@ -58,6 +57,7 @@ found for toner and drum. + ## set to 1 if you want debug output for development + my $debug = 0; + if ($ARGV[4]){ ++ use Data::Dumper; + $debug = 1; + print "check_printer Revision $revision\n$src_url\n\n"; + } diff --git a/debian/patches/check_printer/use_nagios_plugin b/debian/patches/check_printer/use_nagios_plugin new file mode 100644 index 0000000..f12bfee --- /dev/null +++ b/debian/patches/check_printer/use_nagios_plugin @@ -0,0 +1,18 @@ +--- a/check_printer/check_printer ++++ b/check_printer/check_printer +@@ -33,14 +33,7 @@ + use strict; + use warnings; + +-my $OS = `uname`; +-if ($OS =~ m/^\wBSD/){ +- use lib "/usr/local/libexec/nagios"; +-} elsif ($OS =~ m/Linux/){ +- use lib "/usr/local/nagios/libexec"; +-} +- +-use utils qw(%ERRORS); ++use Nagios::Plugin qw(%ERRORS); + + '$Revision$' =~ m/Revision: (\d+)/; + my $revision = $1; diff --git a/debian/patches/check_raid/prefer_cciss_vol_status_over_hpacucli b/debian/patches/check_raid/prefer_cciss_vol_status_over_hpacucli new file mode 100644 index 0000000..f06c746 --- /dev/null +++ b/debian/patches/check_raid/prefer_cciss_vol_status_over_hpacucli @@ -0,0 +1,15 @@ +--- a/check_raid/check_raid ++++ b/check_raid/check_raid +@@ -2728,8 +2728,10 @@ sub check { + package hpacucli; + use base 'plugin'; + +-# register +-push(@utils::plugins, __PACKAGE__); ++# register if cciss_vol_status is not available ++if (! utils::which('cciss_vol_status')) { ++ push(@utils::plugins, __PACKAGE__); ++} + + sub program_names { + __PACKAGE__; diff --git a/debian/patches/check_rbl/disable_solid.net b/debian/patches/check_rbl/disable_solid.net new file mode 100644 index 0000000..c12e2c2 --- /dev/null +++ b/debian/patches/check_rbl/disable_solid.net @@ -0,0 +1,11 @@ +--- a/check_rbl/src/check_rbl.ini ++++ b/check_rbl/src/check_rbl.ini +@@ -36,7 +36,7 @@ + server=blacklist.sci.kun.nl + server=bl.technovision.dk + server=dnsbl.kempt.net +-server=dnsbl.solid.net ++;server=dnsbl.solid.net ; domain offline + server=dul.ru + server=forbidden.icm.edu.pl + server=hil.habeas.com diff --git a/debian/patches/check_rbl/interpreter b/debian/patches/check_rbl/interpreter new file mode 100644 index 0000000..984165b --- /dev/null +++ b/debian/patches/check_rbl/interpreter @@ -0,0 +1,8 @@ +--- a/check_rbl/src/check_rbl ++++ b/check_rbl/src/check_rbl +@@ -1,4 +1,4 @@ +-#!perl ++#!/usr/bin/perl + + package main; + diff --git a/debian/patches/check_rbl/pod_encoding_fix b/debian/patches/check_rbl/pod_encoding_fix new file mode 100644 index 0000000..a367312 --- /dev/null +++ b/debian/patches/check_rbl/pod_encoding_fix @@ -0,0 +1,11 @@ +--- a/check_rbl/src/check_rbl.pod ++++ b/check_rbl/src/check_rbl.pod +@@ -6,6 +6,8 @@ + + =pod + ++=encoding utf8 ++ + =head1 NAME + + C - a Nagios plugin to check if an SMTP server is blacklisted diff --git a/debian/patches/check_rbl/spelling_errors b/debian/patches/check_rbl/spelling_errors new file mode 100644 index 0000000..5213e96 --- /dev/null +++ b/debian/patches/check_rbl/spelling_errors @@ -0,0 +1,11 @@ +--- a/check_rbl/src/check_rbl.pod ++++ b/check_rbl/src/check_rbl.pod +@@ -58,7 +58,7 @@ the querying mechanism. + =head1 EXIT STATUS + + 0 if OK, 1 in case of a warning, 2 in case of a critical status and 3 +-in case of an unkown problem ++in case of an unknown problem + + =head1 DEPENDENCIES + diff --git a/debian/patches/check_snmp_time/epn b/debian/patches/check_snmp_time/epn new file mode 100644 index 0000000..f78de4c --- /dev/null +++ b/debian/patches/check_snmp_time/epn @@ -0,0 +1,8 @@ +--- a/check_snmp_time/check_snmp_time ++++ b/check_snmp_time/check_snmp_time +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_time.pl ################# + my $Version='1.1'; + # Date : Dec 08 2010 diff --git a/debian/patches/check_webinject/epn b/debian/patches/check_webinject/epn new file mode 100644 index 0000000..203e5fd --- /dev/null +++ b/debian/patches/check_webinject/epn @@ -0,0 +1,9 @@ +--- a/check_webinject/check_webinject ++++ b/check_webinject/check_webinject +@@ -1,5 +1,5 @@ + #!/usr/bin/perl +-# nagios: +epn ++# nagios: -epn + + package Webinject; + diff --git a/debian/patches/dsa/check_packages-inifile b/debian/patches/dsa/check_packages-inifile new file mode 100644 index 0000000..056b70a --- /dev/null +++ b/debian/patches/dsa/check_packages-inifile @@ -0,0 +1,13 @@ +--- a/dsa/checks/dsa-check-packages ++++ b/dsa/checks/dsa-check-packages +@@ -37,8 +37,8 @@ use strict; + use warnings; + use English; + +-my $IGNORE = "/etc/nagios/obsolete-packages-ignore"; +-my $IGNORED = "/etc/nagios/obsolete-packages-ignore.d"; ++my $IGNORE = "/etc/nagios-plugins/obsolete-packages-ignore"; ++my $IGNORED = "/etc/nagios-plugins/obsolete-packages-ignore.d"; + + my %CODE = ( + 'OK' => 0, diff --git a/debian/patches/dsa/check_packages_location b/debian/patches/dsa/check_packages_location new file mode 100644 index 0000000..eb71d75 --- /dev/null +++ b/debian/patches/dsa/check_packages_location @@ -0,0 +1,11 @@ +--- a/dsa/sbin/dsa-update-apt-status ++++ b/dsa/sbin/dsa-update-apt-status +@@ -78,7 +78,7 @@ fi + tmp=`tempfile` + trap "rm -f '$tmp'" exit + #/usr/share/dsa/apt-status-check --noupdate --timeout=600 > "$tmp" +-/usr/lib/nagios/plugins/dsa-check-packages > "$tmp" ++/usr/lib/nagios/plugins/check_packages > "$tmp" + result="$?" + case "$result" in + 0) diff --git a/debian/patches/dsa/epn b/debian/patches/dsa/epn new file mode 100644 index 0000000..7f31e58 --- /dev/null +++ b/debian/patches/dsa/epn @@ -0,0 +1,8 @@ +--- a/dsa/checks/dsa-check-packages ++++ b/dsa/checks/dsa-check-packages +@@ -1,4 +1,5 @@ + #!/usr/bin/perl ++# nagios: -epn + + # dsa-check-packages + diff --git a/debian/patches/dsa/security_updates_critical b/debian/patches/dsa/security_updates_critical new file mode 100644 index 0000000..1236d5e --- /dev/null +++ b/debian/patches/dsa/security_updates_critical @@ -0,0 +1,73 @@ +--- a/dsa/checks/dsa-check-packages ++++ b/dsa/checks/dsa-check-packages +@@ -94,6 +94,7 @@ sub get_packages { + chomp(@lines); + + my $pkgname = undef; ++ my $candidate_found = 0; + while (defined($line = shift @lines)) { + if ($line =~ /^([^ ]*):$/) { + # when we have multi-arch capable fu, we require that +@@ -132,8 +133,19 @@ sub get_packages { + } elsif ($line =~ /^ +Installed: (.*)$/) { + # etch dpkg -l does not print epochs, so use this info, it's better + $installed->{$pkgname}{'installed'} = $1; ++ # initialize security-update ++ $installed->{$pkgname}{'security-update'} = 0; + } elsif ($line =~ /^ +Candidate: (.*)$/) { + $installed->{$pkgname}{'candidate'} = $1; ++ } elsif ($line =~ / ([^ ]+) [0-9]+/) { ++ # check if the next lines show the sources of our candidate ++ if ($1 eq $installed->{$pkgname}{'candidate'}) { ++ $candidate_found = 1; ++ } else { ++ $candidate_found = 0; ++ } ++ } elsif (($line =~ / +[0-9]+ [^ ]+\/(security\.([^ ]+\.)?debian\.org|debian-security).*\/updates\//) && $candidate_found ) { ++ $installed->{$pkgname}{'security-update'} = 1; + } elsif ($line =~ /^ +\*\*\*/) { + $line = shift @lines; + my @l = split(/ +/, $line); +@@ -141,7 +153,7 @@ sub get_packages { + } + } + +- my (%current, %obsolete, %outofdate); ++ my (%current, %obsolete, %outofdate, %security_outofdate); + for my $pkgname (keys %$installed) { + my $pkg = $installed->{$pkgname}; + +@@ -151,7 +163,11 @@ sub get_packages { + } + + if ($pkg->{'candidate'} ne $pkg->{'installed'}) { +- $outofdate{$pkgname} = $pkg; ++ if ($pkg->{'security-update'}) { ++ $security_outofdate{$pkgname} = $pkg; ++ } else { ++ $outofdate{$pkgname} = $pkg; ++ } + next; + }; + if ($pkg->{'origin'} eq '/var/lib/dpkg/status') { +@@ -163,6 +179,7 @@ sub get_packages { + + $pkgs{'current'} = \%current; + $pkgs{'outofdate'} = \%outofdate; ++ $pkgs{'security_outofdate'} = \%security_outofdate; + $pkgs{'obsolete'} = \%obsolete; + return \%pkgs; + } +@@ -298,6 +315,12 @@ my @reportform = ( + 'short' => "%d pc", + 'perf' => "prg_conf=%d;1;;0", + 'status' => 'WARNING' }, ++ { 'key' => 'security_outofdate', ++ 'listpackages' => 1, ++ 'long' => "%d packages with outstanding security updates: %s", ++ 'short' => "%d security-updates", ++ 'perf' => "security_outdated=%d;;1;0", ++ 'status' => 'CRITICAL' }, + ); + + my @longout; diff --git a/debian/patches/dsa/status_directory b/debian/patches/dsa/status_directory new file mode 100644 index 0000000..f3987db --- /dev/null +++ b/debian/patches/dsa/status_directory @@ -0,0 +1,40 @@ +--- a/dsa/sbin/dsa-update-apt-status ++++ b/dsa/sbin/dsa-update-apt-status +@@ -22,7 +22,8 @@ + # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + UPDATE_RUNS=3 +-STATUS=/var/cache/dsa/nagios/apt ++STATUSDIR=/var/cache/nagios_status ++STATUS=${STATUSDIR}/apt + SLEEP_MAX=$(( 15 * 60 )) + MAX_AGE=$(( 23 * 60 * 60 )) + +@@ -50,6 +51,10 @@ run_required() { + return $norun + } + ++if [ ! -d ${STATUSDIR} ]; then ++ mkdir -p ${STATUSDIR} ++fi ++ + # do stuff only when required, or when asked to + if [ "${1:-""}" != "-f" ] ; then + run_required || exit 0 +--- a/dsa/sbin/dsa-update-unowned-file-status ++++ b/dsa/sbin/dsa-update-unowned-file-status +@@ -22,7 +22,13 @@ + # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + CUTOFF=40 +-STATUS=/var/cache/dsa/nagios/nouser ++STATUSDIR=/var/cache/nagios_status ++STATUS=${STATUSDIR}/nouser ++ ++ ++if [ ! -d ${STATUSDIR} ]; then ++ mkdir -p ${STATUSDIR} ++fi + + tmp=`tempfile` + trap "rm -f '$tmp'" exit diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..bb31166 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,30 @@ +check_rbl/pod_encoding_fix +check_ajp/return_critical_on_failed_connection +check_raid/prefer_cciss_vol_status_over_hpacucli +check_clamav/clamav_locations +check_nfsmounts/perl_module +check_nfsmounts/nfs_write_location +dsa/security_updates_critical +dsa/check_packages_location +check_libs/config_location +check_libs/config_path +dsa/status_directory +dsa/check_packages-inifile +check_email_delivery/epn +check_email_delivery/paths +check_printer/use_data_dumper_if_needed +check_printer/use_nagios_plugin +check_printer/debian_bts +check_lm_sensors/manpage_whatis_fix +check_lm_sensors/spelling_errors +check_lm_sensors/interpreter +check_rbl/interpreter +check_rbl/spelling_errors +check_rbl/disable_solid.net +check_haproxy/epn +check_httpd_status/epn +check_backuppc/use_nagios_plugins +dsa/epn +check_cups/epn +check_webinject/epn +check_snmp_time/epn diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..a703534 --- /dev/null +++ b/debian/rules @@ -0,0 +1,105 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +PLUGINS := $(shell find $(CURDIR) -mindepth 1 -maxdepth 1 -name .git -prune -o -name .pc -prune -o -name debian -prune -o -type d -printf '%f\n' | sort) +PKGNAME = monitoring-plugins-cyconet + +%: + dh $@ --with quilt,python2,autotools_dev --parallel + +# Here follows a small shell snipped to call dh_auto_* for all plugins +# Currently +# - if a Makefile exists in the plugin directory +# we run dh_auto_$(1) with -O--sourcedirectory="$$plugin" +# - if $${plugin}/src exists, we run dh_auto_$(1) on that directory +# - else: fail :) +DH_AUTO_CALL = if [ "$$auto_command" == "dh_auto_configure" ]; then \ + export options="$$options -- --enable-stack-protector" ;\ + fi ;\ + if [ -f $(CURDIR)/$$plugin/Makefile ]; then \ + $$auto_command -O--sourcedirectory="$${plugin}" $$options; \ + elif [ -d $(CURDIR)/$$plugin/src ]; then \ + $$auto_command -O--sourcedirectory="$${plugin}/src" $$options; \ + else \ + echo failed to build $$plugin; exit 255 ; \ + fi + +PACKAGING_HELPER = /usr/bin/python $(CURDIR)/debian/packaging-helper.py + + +clean: $(PLUGINS:%=clean-%) debian/copyright debian/control + dh $@ --with quilt,python2,autotools_dev --parallel + rm -f debian/$(PKGNAME).install + rm -f debian/README.Debian.plugins + +clean-%: + rm -rf debian/$* + +dh_auto_install-%: + # run dh_auto_install to debian/$plugin + set -e ;\ + export auto_command="dh_auto_install" ;\ + export plugin="$*" ;\ + export options="--destdir=debian/$*" ;\ + $(DH_AUTO_CALL) + if [ -d debian/$*/usr/lib/$(PKGNAME) ]; then \ + mkdir -p debian/$*/usr/lib/nagios ;\ + mv debian/$*/usr/lib/$(PKGNAME) debian/$*/usr/lib/nagios/plugins ;\ + fi + # add files to debian/$(PKGNAME).install + set -e; find debian/$* -type f -printf '%h\n' | sort -u |\ + while read dir; do \ + echo "$$dir/* `echo $$dir | sed 's,debian/$*/,,'`" ;\ + done >> debian/$(PKGNAME).install + # create shlibdeps for the plugin into a temp file + set -e; \ + opts=`find debian/$* -type f -exec file {} \; |\ + grep -E ' ELF ' |\ + sed 's,:.*,,;s,^,-e,' |\ + tr '\n' ' '` ;\ + if [ -n "$$opts" ]; then \ + dpkg-shlibdeps -O $$opts | grep shlibs:Depends > debian/$*/substvars ;\ + fi + +dh_auto_%: + set -e; \ + export auto_command=`echo $* | sed 's,-.*,,;s,^,dh_auto_,'` ;\ + export plugin=`echo $* | sed 's,.*-,,'` ;\ + $(DH_AUTO_CALL) + + +override_dh_auto_build: $(PLUGINS:%=dh_auto_build-%) + +override_dh_auto_clean: $(PLUGINS:%=dh_auto_clean-%) + +override_dh_auto_configure: $(PLUGINS:%=dh_auto_configure-%) + +override_dh_auto_install: $(PLUGINS:%=dh_auto_install-%) + $(PACKAGING_HELPER) --generate-readme + +#override_dh_auto_test: $(PLUGINS:%=dh_auto_test-%) +override_dh_auto_test: + # nothign to do right now. + +override_dh_python2: + dh_python2 + dh_python2 usr/lib/nagios/plugins usr/lib/nagios/cronjobs + +CONTROL_FILES := $(shell for p in $(PLUGINS); do echo $$p/control; done) +COPYRIGHT_FILES := $(shell for p in $(PLUGINS); do echo $$p/copyright; done) +debian/copyright: debian/copyright.in debian/packaging-helper.py $(CONTROL_FILES) $(COPYRIGHT_FILES) + $(PACKAGING_HELPER) --copyright + -if [ -d .git ]; then git add $@; git commit -m 'Auto update of $@' $@; fi + +debian/control: debian/control.in debian/packaging-helper.py $(CONTROL_FILES) + $(PACKAGING_HELPER) --control + -if [ -d .git ]; then git add $@; git commit -m 'Auto update of $@' $@; fi + + +watch: + @$(PACKAGING_HELPER) --watch + +.PHONY: watch override_dh_auto_build override_dh_auto_clean override_dh_auto_configure override_dh_auto_install override_dh_auto_test diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debian/sync.sh b/debian/sync.sh new file mode 100755 index 0000000..b9898f5 --- /dev/null +++ b/debian/sync.sh @@ -0,0 +1,20 @@ +#!/bin/sh +set -e + +PKGNAME="monitoring-plugins-cyconet" +FILES="debian/control.in debian/rules debian/README.source debian/README.Debian.plugins.in debian/packaging-helper.py" +TDIR="$(mktemp -d -t ${PKGNAME}.XXXXXX)" +trap '[ ! -d "${TDIR}" ] || rm -rf "${TDIR}"' EXIT + +git clone https://github.com/bzed/pkg-nagios-plugins-contrib.git "${TDIR}"/pkg-nagios-plugins-contrib +for FILE in ${FILES}; do + if [ "${FILE}" = "debian/README.source" ]; then + sed -i "s/pkg-nagios-plugins-contrib/${PKGNAME}/g" ${TDIR}/pkg-nagios-plugins-contrib/${FILE} + fi + if [ "${FILE}" = "debian/control.in" ]; then + sed -i "s#^Vcs-Git:.*#Vcs-Git: git://github.com/waja/blah#" ${TDIR}/pkg-nagios-plugins-contrib/${FILE} + sed -i "s#^Vcs-Browser:.*#Vcs-Browser: http://github.com/waja/blah#" ${TDIR}/pkg-nagios-plugins-contrib/${FILE} + fi + sed -i "s/nagios-plugins-contrib/${PKGNAME}/g" ${TDIR}/pkg-nagios-plugins-contrib/${FILE} + cp ${TDIR}/pkg-nagios-plugins-contrib/${FILE} ./${FILE} +done