From 1e2387474a449452b78520b9ad96a8b4b5e99722 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Wed, 17 Apr 2019 19:07:19 +0200 Subject: initial commit of source fetch --- .gitignore | 1 + .../.travis.yml | 25 + nagios-plugins-contrib-24.20190301~bpo9+1/Makefile | 27 + nagios-plugins-contrib-24.20190301~bpo9+1/README | 1 + .../check_ajp/Makefile | 5 + .../check_ajp/ajp.cfg | 6 + .../check_ajp/check_ajp | 103 + .../check_ajp/control | 8 + .../check_ajp/copyright | 17 + .../check_backuppc/Makefile | 15 + .../check_backuppc/check_backuppc-1.1.0/COPYING | 340 + .../check_backuppc/check_backuppc-1.1.0/INSTALL | 19 + .../check_backuppc/check_backuppc-1.1.0/Makefile | 23 + .../check_backuppc/check_backuppc-1.1.0/README | 14 + .../check_backuppc/check_backuppc-1.1.0/TODO | 1 + .../check_backuppc/check_backuppc-1.1.0/changelog | 33 + .../check_backuppc-1.1.0/check_backuppc | 265 + .../check_backuppc-1.1.0/check_backuppc.8 | 61 + .../check_backuppc/control | 8 + .../check_backuppc/copyright | 6 + .../check_backuppc/src | 1 + .../check_bgpstate/Makefile | 4 + .../check_bgpstate/bgpstate.cfg | 5 + .../check_bgpstate/check_bgpstate | 215 + .../check_bgpstate/control | 5 + .../check_bgpstate/copyright | 6 + .../check_checksums/Makefile | 8 + .../check_checksums/check_checksums | 110 + .../check_checksums/control | 5 + .../check_checksums/copyright | 15 + .../check_checksums/tests | 2 + .../check_checksums/update_checksums | 47 + .../check_clamav/Makefile | 1 + .../check_clamav/check_clamav | 190 + .../check_clamav/control | 10 + .../check_clamav/copyright | 14 + .../check_cups/Makefile | 3 + .../check_cups/check_cups | 617 + .../check_cups/control | 8 + .../check_cups/copyright | 6 + .../check_cups/cups.cfg | 5 + .../check_cups/tests | 3 + .../check_debsecan/Makefile | 7 + .../check_debsecan/control | 5 + .../check_debsecan/copyright | 15 + .../check_debsecan/debsecan.cfg | 5 + .../check_debsecan/src/LICENSE | 674 + .../check_debsecan/src/README.md | 39 + .../check_debsecan/src/check_debsecan | 306 + .../check_debsecan/tests | 2 + .../check_drbd/Makefile | 3 + .../check_drbd/check_drbd | 456 + .../check_drbd/control | 7 + .../check_drbd/copyright | 7 + .../check_email_delivery/Makefile | 14 + .../check_email_delivery-0.7.1b/CHANGES.txt | 15 + .../check_email_delivery-0.7.1b/LICENSE.txt | 674 + .../check_email_delivery-0.7.1b/README.txt | 77 + .../check_email_delivery | 970 ++ .../check_email_delivery_epn | 498 + .../check_email_delivery-0.7.1b/check_imap_quota | 431 + .../check_imap_quota_epn | 235 + .../check_email_delivery-0.7.1b/check_imap_receive | 999 ++ .../check_imap_receive_epn | 492 + .../check_email_delivery-0.7.1b/check_smtp_send | 782 + .../check_smtp_send_epn | 458 + .../How to connect to IMAP server manually.txt | 69 + .../docs/How to test plugin.txt | 15 + .../docs/check_email_delivery.html | 522 + .../docs/check_email_delivery.pod | 472 + .../docs/check_imap_quota.html | 258 + .../docs/check_imap_quota.pod | 196 + .../docs/check_imap_receive.html | 551 + .../docs/check_imap_receive.pod | 507 + .../docs/check_smtp_send.html | 375 + .../docs/check_smtp_send.pod | 324 + .../docs/imap_ssl_cert.html | 178 + .../docs/imap_ssl_cert.pod | 122 + .../check_email_delivery-0.7.1b/imap_ssl_cert | 236 + .../check_email_delivery-0.7.1b/imap_ssl_cert_epn | 114 + .../nagios-plugins-check_email_delivery.spec | 63 + .../check_email_delivery/control | 15 + .../check_email_delivery/copyright | 15 + .../check_email_delivery/email_delivery.cfg | 4 + .../check_email_delivery/src | 1 + .../check_etc_hosts/Makefile | 5 + .../check_etc_hosts/check_etc_hosts | 249 + .../check_etc_hosts/control | 8 + .../check_etc_hosts/copyright | 14 + .../check_etc_hosts/tests | 3 + .../check_etc_resolv/Makefile | 5 + .../check_etc_resolv/check_etc_resolv | 139 + .../check_etc_resolv/control | 5 + .../check_etc_resolv/copyright | 14 + .../check_etc_resolv/tests | 2 + .../check_graphite/Makefile | 10 + .../check_graphite/README.md | 34 + .../check_graphite/check_graphite.py | 286 + .../check_graphite/control | 4 + .../check_graphite/copyright | 5 + .../check_haproxy/Makefile | 4 + .../check_haproxy/check_haproxy | 321 + .../check_haproxy/control | 6 + .../check_haproxy/copyright | 8 + .../check_haproxy/haproxy.cfg | 5 + .../check_haproxy_stats/Makefile | 12 + .../check_haproxy_stats/check_haproxy_stats.pl | 225 + .../check_haproxy_stats/control | 7 + .../check_haproxy_stats/copyright | 13 + .../check_hp_bladechassis/Makefile | 11 + .../check_hp_bladechassis-1.0.1/CHANGES | 15 + .../check_hp_bladechassis-1.0.1/COPYING | 674 + .../check_hp_bladechassis-1.0.1/INSTALL | 23 + .../check_hp_bladechassis-1.0.1/README | 16 + .../check_hp_bladechassis | 1004 ++ .../check_hp_bladechassis.8 | 325 + .../check_hp_bladechassis.php | 42 + .../check_hp_bladechassis.pod | 245 + .../check_hp_bladechassis.spec | 52 + .../check_hp_bladechassis-1.0.1/install.sh | 50 + .../check_hp_bladechassis.cfg | 6 + .../check_hp_bladechassis/control | 8 + .../check_hp_bladechassis/copyright | 15 + .../check_hp_bladechassis/src | 1 + .../check_hpasm/Makefile | 15 + .../check_hpasm/check_hpasm-4.8/AUTHORS | 1 + .../check_hpasm/check_hpasm-4.8/COPYING | 340 + .../check_hpasm/check_hpasm-4.8/ChangeLog | 226 + .../check_hpasm/check_hpasm-4.8/INSTALL | 229 + .../check_hpasm/check_hpasm-4.8/Makefile.am | 6 + .../check_hpasm/check_hpasm-4.8/Makefile.in | 764 + .../check_hpasm/check_hpasm-4.8/NEWS | 0 .../check_hpasm/check_hpasm-4.8/README | 346 + .../check_hpasm/check_hpasm-4.8/TODO | 71 + .../check_hpasm/check_hpasm-4.8/acinclude.m4 | 78 + .../check_hpasm/check_hpasm-4.8/aclocal.m4 | 758 + .../check_hpasm/check_hpasm-4.8/config.guess | 1558 ++ .../check_hpasm/check_hpasm-4.8/config.sub | 1788 ++ .../check_hpasm/check_hpasm-4.8/configure | 4028 +++++ .../check_hpasm/check_hpasm-4.8/configure.in | 133 + .../check_hpasm/check_hpasm-4.8/install-sh | 527 + .../check_hpasm/check_hpasm-4.8/missing | 215 + .../plugins-scripts/HP/BladeSystem.pm | 240 + .../plugins-scripts/HP/BladeSystem/Component.pm | 7 + .../Component/CommonEnclosureSubsystem.pm | 176 + .../CommonEnclosureSubsystem/FanSubsystem.pm | 139 + .../CommonEnclosureSubsystem/FuseSubsystem.pm | 121 + .../CommonEnclosureSubsystem/ManagerSubsystem.pm | 154 + .../CommonEnclosureSubsystem/TempSubsystem.pm | 177 + .../BladeSystem/Component/NetConnectorSubsystem.pm | 134 + .../Component/PowerEnclosureSubsystem.pm | 136 + .../BladeSystem/Component/PowerSupplySubsystem.pm | 238 + .../BladeSystem/Component/ServerBladeSubsystem.pm | 158 + .../check_hpasm-4.8/plugins-scripts/HP/Proliant.pm | 771 + .../plugins-scripts/HP/Proliant/Component.pm | 5 + .../HP/Proliant/Component/AsrSubsystem.pm | 45 + .../HP/Proliant/Component/AsrSubsystem/CLI.pm | 32 + .../HP/Proliant/Component/AsrSubsystem/SNMP.pm | 68 + .../HP/Proliant/Component/BatterySubsystem.pm | 124 + .../HP/Proliant/Component/BatterySubsystem/CLI.pm | 27 + .../HP/Proliant/Component/BatterySubsystem/SNMP.pm | 78 + .../HP/Proliant/Component/CpuSubsystem.pm | 112 + .../HP/Proliant/Component/CpuSubsystem/CLI.pm | 57 + .../HP/Proliant/Component/CpuSubsystem/SNMP.pm | 50 + .../HP/Proliant/Component/DiskSubsystem.pm | 159 + .../HP/Proliant/Component/DiskSubsystem/Da.pm | 407 + .../HP/Proliant/Component/DiskSubsystem/Da/CLI.pm | 239 + .../HP/Proliant/Component/DiskSubsystem/Da/SNMP.pm | 232 + .../HP/Proliant/Component/DiskSubsystem/Fca.pm | 433 + .../HP/Proliant/Component/DiskSubsystem/Fca/CLI.pm | 34 + .../Proliant/Component/DiskSubsystem/Fca/SNMP.pm | 303 + .../HP/Proliant/Component/DiskSubsystem/Ide.pm | 256 + .../HP/Proliant/Component/DiskSubsystem/Ide/CLI.pm | 27 + .../Proliant/Component/DiskSubsystem/Ide/SNMP.pm | 115 + .../HP/Proliant/Component/DiskSubsystem/Sas.pm | 251 + .../HP/Proliant/Component/DiskSubsystem/Sas/CLI.pm | 27 + .../Proliant/Component/DiskSubsystem/Sas/SNMP.pm | 126 + .../HP/Proliant/Component/DiskSubsystem/Scsi.pm | 227 + .../Proliant/Component/DiskSubsystem/Scsi/CLI.pm | 27 + .../Proliant/Component/DiskSubsystem/Scsi/SNMP.pm | 134 + .../HP/Proliant/Component/EventSubsystem.pm | 236 + .../HP/Proliant/Component/EventSubsystem/CLI.pm | 78 + .../HP/Proliant/Component/EventSubsystem/SNMP.pm | 221 + .../HP/Proliant/Component/FanSubsystem.pm | 263 + .../HP/Proliant/Component/FanSubsystem/CLI.pm | 101 + .../HP/Proliant/Component/FanSubsystem/SNMP.pm | 231 + .../HP/Proliant/Component/MemorySubsystem.pm | 197 + .../HP/Proliant/Component/MemorySubsystem/CLI.pm | 87 + .../HP/Proliant/Component/MemorySubsystem/SNMP.pm | 746 + .../HP/Proliant/Component/NicSubsystem.pm | 202 + .../HP/Proliant/Component/NicSubsystem/SNMP.pm | 189 + .../HP/Proliant/Component/PowersupplySubsystem.pm | 214 + .../Proliant/Component/PowersupplySubsystem/CLI.pm | 81 + .../Component/PowersupplySubsystem/SNMP.pm | 96 + .../plugins-scripts/HP/Proliant/Component/SNMP.pm | 67 + .../HP/Proliant/Component/TemperatureSubsystem.pm | 205 + .../Proliant/Component/TemperatureSubsystem/CLI.pm | 56 + .../Component/TemperatureSubsystem/SNMP.pm | 119 + .../plugins-scripts/HP/SNMP/Utils.pm | 103 + .../check_hpasm-4.8/plugins-scripts/HP/Server.pm | 447 + .../check_hpasm-4.8/plugins-scripts/HP/Storage.pm | 308 + .../plugins-scripts/HP/StorageWorks.pm | 157 + .../check_hpasm-4.8/plugins-scripts/Makefile.am | 104 + .../check_hpasm-4.8/plugins-scripts/Makefile.in | 574 + .../plugins-scripts/Nagios/MiniPlugin.pm | 333 + .../check_hpasm-4.8/plugins-scripts/check_hpasm.pl | 215 + .../check_hpasm-4.8/plugins-scripts/subst.in | 64 + .../check_hpasm/control | 18 + .../check_hpasm/copyright | 19 + .../check_hpasm/src | 1 + .../check_httpd_status/Makefile | 4 + .../check_httpd_status/check_httpd_status | 444 + .../check_httpd_status/control | 7 + .../check_httpd_status/copyright | 14 + .../check_httpd_status/httpd_status.cfg | 5 + .../check_httpd_status/tests | 3 + .../check_ipmi_sensor/COPYING | 674 + .../check_ipmi_sensor/Makefile | 6 + .../check_ipmi_sensor/README.md | 67 + .../check_ipmi_sensor/changelog | 129 + .../check_ipmi_sensor/check_ipmi_sensor | 1074 ++ .../contrib/default-combinedgraph.template | 37 + .../check_ipmi_sensor/control | 8 + .../check_ipmi_sensor/copyright | 34 + .../check_ipmi_sensor/ipmi_sensor.cfg | 18 + .../check_libs/Makefile | 16 + .../check_libs/control | 7 + .../check_libs/copyright | 52 + .../check_libs/nagios-check-libs | 199 + .../check_libs/nagios-check-libs.conf | 21 + .../check_libs/tests | 2 + .../check_libs/update-check_libs-status | 90 + .../check_libs/update_files.sh | 10 + .../check_libs_ng/Makefile | 5 + .../check_libs_ng/check_libs_ng | 90 + .../check_libs_ng/control | 4 + .../check_libs_ng/copyright | 23 + .../check_libs_ng/tests | 2 + .../check_libvirt/Makefile | 4 + .../check_libvirt/check_libvirt | 526 + .../check_libvirt/control | 6 + .../check_libvirt/copyright | 22 + .../check_lm_sensors/Makefile | 14 + .../check_lm_sensors-4.1.1/AUTHORS | 7 + .../check_lm_sensors-4.1.1/COPYING | 674 + .../check_lm_sensors-4.1.1/COPYRIGHT | 15 + .../check_lm_sensors-4.1.1/Changes | 57 + .../check_lm_sensors-4.1.1/INSTALL | 66 + .../check_lm_sensors-4.1.1/MANIFEST | 29 + .../check_lm_sensors-4.1.1/MANIFEST.SKIP | 17 + .../check_lm_sensors-4.1.1/META.yml | 32 + .../check_lm_sensors-4.1.1/MYMETA.json | 53 + .../check_lm_sensors-4.1.1/MYMETA.yml | 31 + .../check_lm_sensors-4.1.1/Makefile.PL | 55 + .../check_lm_sensors/check_lm_sensors-4.1.1/NAME | 1 + .../check_lm_sensors/check_lm_sensors-4.1.1/NEWS | 31 + .../check_lm_sensors/check_lm_sensors-4.1.1/README | 96 + .../check_lm_sensors/check_lm_sensors-4.1.1/TODO | 3 + .../check_lm_sensors-4.1.1/VERSION | 1 + .../check_lm_sensors-4.1.1/check_lm_sensors | 721 + .../check_lm_sensors-4.1.1/check_lm_sensors.pod | 129 + .../check_lm_sensors-4.1.1/check_lm_sensors.spec | 90 + .../check_lm_sensors/control | 7 + .../check_lm_sensors/copyright | 6 + .../check_lm_sensors/lm_sensors.cfg | 16 + .../check_lm_sensors/src | 1 + .../check_memcached/Makefile | 9 + .../check_memcached/check_memcached.l | 613 + .../check_memcached/control | 12 + .../check_memcached/copyright | 16 + .../check_memcached/memcached.cfg | 5 + .../check_memory/Makefile | 1 + .../check_memory/check_memory | 154 + .../check_memory/control | 9 + .../check_memory/copyright | 16 + .../check_mongodb/Makefile | 14 + .../check_mongodb/README.md | 325 + .../check_mongodb/check_mongodb.py | 1651 ++ .../check_mongodb/control | 6 + .../check_mongodb/copyright | 21 + .../check_mongodb/mongodb.cfg | 29 + .../check_multipath/Makefile | 9 + .../check_multipath/check-multipath.pl | 1556 ++ .../check_multipath/control | 6 + .../check_multipath/copyright | 16 + .../check_multipath/multipath.cfg | 5 + .../check_multipath/version | 1 + .../check_mysql_health/Makefile | 16 + .../check_mysql_health-2.2.2/AUTHORS | 1 + .../check_mysql_health-2.2.2/COPYING | 340 + .../check_mysql_health-2.2.2/ChangeLog | 83 + .../check_mysql_health-2.2.2/INSTALL | 233 + .../check_mysql_health-2.2.2/Makefile.am | 13 + .../check_mysql_health-2.2.2/Makefile.in | 761 + .../check_mysql_health-2.2.2/NEWS | 1 + .../check_mysql_health-2.2.2/README | 140 + .../check_mysql_health-2.2.2/TODO | 3 + .../check_mysql_health-2.2.2/acinclude.m4 | 734 + .../check_mysql_health-2.2.2/aclocal.m4 | 128 + .../check_mysql_health-2.2.2/config.guess | 1558 ++ .../check_mysql_health-2.2.2/config.sub | 1788 ++ .../check_mysql_health-2.2.2/configure | 4190 +++++ .../check_mysql_health-2.2.2/configure.ac | 103 + .../contrib/CheckMySQLHealthExt1.pm | 68 + .../contrib/README.my-extensions | 139 + .../contrib/check_mysql_health.php | 370 + .../check_mysql_health-2.2.2/install-sh | 527 + .../check_mysql_health-2.2.2/missing | 215 + .../plugins-scripts/Makefile.am | 53 + .../plugins-scripts/Makefile.in | 516 + .../plugins-scripts/Nagios/DBD/MySQL/Cluster.pm | 620 + .../plugins-scripts/Nagios/DBD/MySQL/Server.pm | 1652 ++ .../Nagios/DBD/MySQL/Server/Instance.pm | 512 + .../Nagios/DBD/MySQL/Server/Instance/Innodb.pm | 190 + .../Nagios/DBD/MySQL/Server/Instance/Myisam.pm | 119 + .../DBD/MySQL/Server/Instance/Replication.pm | 144 + .../plugins-scripts/Nagios/Extraopts.pm | 103 + .../plugins-scripts/check_mysql_health.pl | 613 + .../plugins-scripts/subst.in | 61 + .../check_mysql_health-2.2.2/t/Makefile.am | 21 + .../check_mysql_health-2.2.2/t/Makefile.in | 412 + .../t/check_mysql_health.t | 159 + .../check_mysql_health/control | 8 + .../check_mysql_health/copyright | 19 + .../check_mysql_health/src | 1 + .../check_nfsmounts/Makefile | 1 + .../check_nfsmounts/check_nfsmounts | 150 + .../check_nfsmounts/control | 4 + .../check_nfsmounts/copyright | 17 + .../check_printer/Makefile | 1 + .../check_printer/check_printer | 375 + .../check_printer/control | 7 + .../check_printer/copyright | 27 + .../check_printer/printer.cfg | 5 + .../check_raid/Makefile | 4 + .../check_raid/check_raid | 6664 ++++++++ .../check_raid/control | 30 + .../check_raid/copyright | 9 + .../check_rbl/Makefile | 16 + .../check_rbl/check_rbl-1.4.4/.travis.yml | 11 + .../check_rbl/check_rbl-1.4.4/AUTHORS | 12 + .../check_rbl/check_rbl-1.4.4/COPYING | 674 + .../check_rbl/check_rbl-1.4.4/COPYRIGHT | 17 + .../check_rbl/check_rbl-1.4.4/Changes | 127 + .../check_rbl/check_rbl-1.4.4/INSTALL | 74 + .../check_rbl/check_rbl-1.4.4/MANIFEST | 32 + .../check_rbl/check_rbl-1.4.4/MANIFEST.SKIP | 18 + .../check_rbl/check_rbl-1.4.4/META.yml | 29 + .../check_rbl/check_rbl-1.4.4/MYMETA.json | 51 + .../check_rbl/check_rbl-1.4.4/MYMETA.yml | 32 + .../check_rbl/check_rbl-1.4.4/Makefile.PL | 65 + .../check_rbl/check_rbl-1.4.4/NEWS | 22 + .../check_rbl/check_rbl-1.4.4/README.md | 31 + .../check_rbl/check_rbl-1.4.4/TODO | 2 + .../check_rbl/check_rbl-1.4.4/VERSION | 1 + .../check_rbl/check_rbl-1.4.4/check_rbl | 642 + .../check_rbl/check_rbl-1.4.4/check_rbl.ini | 104 + .../check_rbl/check_rbl-1.4.4/check_rbl.pod | 144 + .../check_rbl/check_rbl-1.4.4/check_rbl.spec | 116 + .../check_rbl-1.4.4/inc/Module/AutoInstall.pm | 934 ++ .../check_rbl-1.4.4/inc/Module/Install.pm | 451 + .../inc/Module/Install/AutoInstall.pm | 93 + .../check_rbl-1.4.4/inc/Module/Install/Base.pm | 83 + .../check_rbl-1.4.4/inc/Module/Install/Include.pm | 34 + .../inc/Module/Install/MakeMaker.pm | 56 + .../check_rbl-1.4.4/inc/Module/Install/Makefile.pm | 418 + .../check_rbl-1.4.4/inc/Module/Install/Metadata.pm | 722 + .../check_rbl-1.4.4/inc/Module/Install/Scripts.pm | 29 + .../check_rbl/check_rbl-1.4.4/t/00_modules.t | 61 + .../check_rbl/check_rbl-1.4.4/t/01_validation.t | 20 + .../check_rbl/check_rbl-1.4.4/test.sh | 23 + .../check_rbl/control | 6 + .../check_rbl/copyright | 17 + .../check_rbl/rbl.cfg | 5 + .../check_rbl/src | 1 + .../check_redis/Makefile | 9 + .../check_redis/check_redis.php | 300 + .../check_redis/check_redis.pl | 2914 ++++ .../check_redis/control | 13 + .../check_redis/copyright | 17 + .../check_redis/redis.cfg | 5 + .../check_smstools/Makefile | 11 + .../check_smstools/README.check_smstools | 45 + .../check_smstools/bin/check_smstools | 241 + .../check_smstools/control | 7 + .../check_smstools/copyright | 2 + .../check_snmp_environment/Makefile | 9 + .../check_snmp_environment.pl | 2744 ++++ .../check_snmp_environment/control | 12 + .../check_snmp_environment/copyright | 17 + .../check_snmp_time/Makefile | 4 + .../check_snmp_time/check_snmp_time | 333 + .../check_snmp_time/control | 12 + .../check_snmp_time/copyright | 7 + .../check_snmp_time/snmp_time.cfg | 11 + .../check_ssl_cert/Makefile | 8 + .../check_ssl_cert-1.83.0/._COPYRIGHT | Bin 0 -> 176 bytes .../check_ssl_cert-1.83.0/._Makefile | Bin 0 -> 176 bytes .../check_ssl_cert/check_ssl_cert-1.83.0/._NEWS | Bin 0 -> 176 bytes .../check_ssl_cert-1.83.0/._check_ssl_cert | Bin 0 -> 176 bytes .../check_ssl_cert/check_ssl_cert-1.83.0/AUTHORS | 82 + .../check_ssl_cert/check_ssl_cert-1.83.0/COPYING | 674 + .../check_ssl_cert/check_ssl_cert-1.83.0/COPYRIGHT | 75 + .../check_ssl_cert/check_ssl_cert-1.83.0/ChangeLog | 593 + .../check_ssl_cert/check_ssl_cert-1.83.0/INSTALL | 21 + .../check_ssl_cert/check_ssl_cert-1.83.0/Makefile | 53 + .../check_ssl_cert/check_ssl_cert-1.83.0/NEWS | 161 + .../check_ssl_cert/check_ssl_cert-1.83.0/README.md | 167 + .../check_ssl_cert/check_ssl_cert-1.83.0/TODO | 5 + .../check_ssl_cert/check_ssl_cert-1.83.0/VERSION | 1 + .../check_ssl_cert-1.83.0/check_ssl_cert | 2483 +++ .../check_ssl_cert-1.83.0/check_ssl_cert.1 | 222 + .../check_ssl_cert-1.83.0/check_ssl_cert.spec | 395 + .../check_ssl_cert-1.83.0/test/cabundle.crt | 3893 +++++ .../check_ssl_cert-1.83.0/test/cacert.crt | 42 + .../check_ssl_cert-1.83.0/test/unit_tests.sh | 417 + .../check_ssl_cert/control | 8 + .../check_ssl_cert/copyright | 19 + .../check_ssl_cert/src | 1 + .../check_ssl_cert/ssl_cert.cfg | 5 + .../check_ssl_cert/tests | 2 + .../check_uptime/Makefile | 4 + .../check_uptime/check_uptime | 722 + .../check_uptime/check_uptime.cfg | 15 + .../check_uptime/control | 10 + .../check_uptime/copyright | 19 + .../check_uptime/tests | 2 + .../check_v46/Makefile | 6 + .../check_v46/check_v46 | 318 + .../check_v46/control | 10 + .../check_v46/copyright | 16 + .../check_varnish/Makefile | 15 + .../check_varnish/control | 6 + .../check_varnish/copyright | 24 + .../check_varnish/src | 1 + .../check_varnish/tests | 3 + .../check_varnish/varnish-nagios/LICENSE | 23 + .../check_varnish/varnish-nagios/Makefile.am | 11 + .../check_varnish/varnish-nagios/Makefile.in | 848 + .../check_varnish/varnish-nagios/README.md | 12 + .../check_varnish/varnish-nagios/aclocal.m4 | 10504 ++++++++++++ .../check_varnish/varnish-nagios/autogen.des | 20 + .../check_varnish/varnish-nagios/autogen.sh | 46 + .../check_varnish/varnish-nagios/check_varnish.c | 383 + .../check_varnish/varnish-nagios/compile | 347 + .../check_varnish/varnish-nagios/config.guess | 1462 ++ .../check_varnish/varnish-nagios/config.h.in | 114 + .../check_varnish/varnish-nagios/config.sub | 1825 +++ .../check_varnish/varnish-nagios/configure | 16364 +++++++++++++++++++ .../check_varnish/varnish-nagios/configure.ac | 77 + .../check_varnish/varnish-nagios/depcomp | 791 + .../check_varnish/varnish-nagios/install-sh | 508 + .../check_varnish/varnish-nagios/ltmain.sh | 11156 +++++++++++++ .../check_varnish/varnish-nagios/missing | 215 + .../check_webinject/Makefile | 13 + .../check_webinject/check_webinject | 1979 +++ .../check_webinject/control | 11 + .../check_webinject/copyright | 15 + .../check_webinject/webinject.cfg | 12 + .../check_whois/Makefile | 1 + .../check_whois/check_whois | 301 + .../check_whois/control | 9 + .../check_whois/copyright | 27 + .../check_whois/whois.cfg | 4 + .../check_zone_auth/Makefile | 1 + .../check_zone_auth/check_zone_auth | 324 + .../check_zone_auth/control | 7 + .../check_zone_auth/copyright | 27 + .../check_zone_auth/zone_auth.cfg | 4 + .../check_zone_rrsig_expiration/Makefile | 1 + .../check_zone_rrsig_expiration | 313 + .../check_zone_rrsig_expiration/control | 7 + .../check_zone_rrsig_expiration/copyright | 27 + .../check_zone_rrsig_expiration/zone-rrsig.cfg | 4 + .../common.mk | 71 + .../debian/README.Debian.plugins.in | 20 + .../debian/README.source | 66 + .../debian/autoreconf | 3 + .../debian/changelog | 997 ++ .../debian/compat | 1 + .../debian/control | 223 + .../debian/control.in | 33 + .../debian/copyright | 1209 ++ .../debian/copyright.in | 35 + .../debian/gbp.conf | 4 + .../debian/nagios-plugins-contrib.docs | 1 + .../nagios-plugins-contrib.lintian-overrides | 3 + .../debian/packaging-helper.py | 330 + .../check_ajp/return_critical_on_failed_connection | 79 + .../patches/check_backuppc/use_nagios_plugins | 34 + .../debian/patches/check_bgpstate/epn | 10 + .../debian/patches/check_clamav/clamav_locations | 73 + .../debian/patches/check_cups/ParseDateDelta | 11 + .../debian/patches/check_cups/epn | 8 + .../debian/patches/check_cups/monitoring-plugin | 46 + .../patches/check_drbd/fix_for_oos_and_cosmetic | 62 + .../debian/patches/check_email_delivery/epn | 45 + .../debian/patches/check_email_delivery/paths | 27 + .../debian/patches/check_haproxy/epn | 8 + .../debian/patches/check_haproxy/monitoring-plugin | 48 + .../debian/patches/check_haproxy_stats/interpreter | 16 + .../debian/patches/check_httpd_status/epn | 9 + .../patches/check_httpd_status/htdigest_auth | 17 + .../patches/check_httpd_status/monitoring-plugin | 49 + .../patches/check_imap_quota/syntax_error_fix | 17 + .../debian/patches/check_libs/config_path | 11 + .../debian/patches/check_libs/lsof-speedup | 27 + .../debian/patches/check_libs/space_before_deleted | 12 + .../debian/patches/check_libvirt/fix_uom | 26 + .../debian/patches/check_libvirt/monitoring-plugin | 48 + .../debian/patches/check_lm_sensors/interpreter | 8 + .../patches/check_lm_sensors/manpage_whatis_fix | 12 + .../patches/check_lm_sensors/spelling_errors | 11 + .../debian/patches/check_memory/monitoring-plugin | 43 + .../debian/patches/check_memory/new_free | 53 + .../debian/patches/check_nfsmounts/nfs4_support | 11 + .../patches/check_nfsmounts/nfs_write_location | 20 + .../debian/patches/check_nfsmounts/perl_module | 43 + .../debian/patches/check_printer/debian_bts | 17 + .../debian/patches/check_printer/epn | 8 + .../check_printer/use_data_dumper_if_needed | 18 + .../debian/patches/check_printer/use_nagios_plugin | 38 + .../debian/patches/check_raid/no_epn | 8 + .../prefer_cciss_vol_status_over_hpacucli | 15 + .../debian/patches/check_rbl/additional_rbls | 45 + .../debian/patches/check_rbl/interpreter | 8 + .../patches/check_smstools/monitoring-plugin | 46 + .../debian/patches/check_smstools/operator_siglvl | 30 + .../debian/patches/check_snmp_environment/epn | 10 + .../debian/patches/check_snmp_time/epn | 8 + .../debian/patches/check_uptime/missing_backslash | 16 + .../debian/patches/check_v46/no_epn | 9 + .../debian/patches/check_varnish/fix_for_v56 | 186 + .../debian/patches/check_webinject/epn | 9 + .../dsa/check_cert_expire_dir_check_name_fix | 14 + .../debian/patches/dsa/check_packages-inifile | 13 + .../debian/patches/dsa/check_packages_,_fix | 30 + .../debian/patches/dsa/check_packages_location | 11 + .../dsa/check_running_kernel_jessie_centos_fix | 42 + .../debian/patches/dsa/epn | 8 + .../debian/patches/dsa/status_directory | 22 + .../patches/percona-nagios-plugins/fix_bashism | 8 + .../debian/patches/series | 54 + .../debian/rules | 43 + .../debian/source/format | 1 + .../debian/tests/control | 37 + .../debian/tests/test_check_varnish | 35 + .../dsa/Makefile | 23 + .../dsa/checks/dsa-check-cert-expire | 77 + .../dsa/checks/dsa-check-cert-expire-dir | 90 + .../dsa/checks/dsa-check-dnssec-delegation | 301 + .../dsa/checks/dsa-check-entropy | 82 + .../dsa/checks/dsa-check-packages | 362 + .../dsa/checks/dsa-check-running-kernel | 255 + .../dsa/checks/dsa-check-soas | 218 + .../dsa/checks/dsa-check-statusfile | 90 + .../dsa/control | 20 + .../dsa/copyright | 33 + .../dsa/etc/obsolete-packages-ignore | 4 + .../dsa/sbin/dsa-update-apt-status | 100 + .../dsa/sbin/dsa-update-unowned-file-status | 53 + .../dsa/update-files.sh | 13 + .../extras/Makefile | 16 + .../extras/check_apt.cmd | 25 + .../extras/control | 7 + .../extras/copyright | 20 + .../extras/send_nsca_host_or_service_check_result | 86 + .../percona-nagios-plugins/Changelog | 115 + .../percona-nagios-plugins/Makefile | 13 + .../percona-nagios-plugins/control | 7 + .../percona-nagios-plugins/copyright | 12 + .../nagios/bin/pmp-check-aws-rds.py | 562 + .../nagios/bin/pmp-check-lvm-snapshots | 187 + .../nagios/bin/pmp-check-mongo.py | 594 + .../nagios/bin/pmp-check-mysql-deadlocks | 189 + .../nagios/bin/pmp-check-mysql-deleted-files | 286 + .../nagios/bin/pmp-check-mysql-file-privs | 289 + .../nagios/bin/pmp-check-mysql-innodb | 368 + .../nagios/bin/pmp-check-mysql-pidfile | 291 + .../nagios/bin/pmp-check-mysql-processlist | 323 + .../nagios/bin/pmp-check-mysql-replication-delay | 280 + .../nagios/bin/pmp-check-mysql-replication-running | 242 + .../nagios/bin/pmp-check-mysql-status | 482 + .../nagios/bin/pmp-check-mysql-ts-count | 210 + .../nagios/bin/pmp-check-pt-table-checksum | 239 + .../nagios/bin/pmp-check-unix-memory | 207 + nagios-plugins-contrib_24.20190301~bpo9+1.dsc | 41 + 587 files changed, 155993 insertions(+) create mode 100644 .gitignore create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/.travis.yml create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/Makefile create mode 120000 nagios-plugins-contrib-24.20190301~bpo9+1/README create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/ajp.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/check_ajp create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/COPYING create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/INSTALL create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/README create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/TODO create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/changelog create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/check_backuppc create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/check_backuppc.8 create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/copyright create mode 120000 nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/src create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/bgpstate.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/check_bgpstate create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/Makefile create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/check_checksums create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/tests create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/update_checksums create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/check_clamav create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/check_cups create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/cups.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/tests create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/debsecan.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/src/LICENSE create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/src/README.md create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/src/check_debsecan create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/tests create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/check_drbd create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/CHANGES.txt create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/LICENSE.txt create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/README.txt create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_email_delivery create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_email_delivery_epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_quota create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_quota_epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_receive create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_receive_epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_smtp_send create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_smtp_send_epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/How to connect to IMAP server manually.txt create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/How to test plugin.txt create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_email_delivery.html create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_email_delivery.pod create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_quota.html create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_quota.pod create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_receive.html create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_receive.pod create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_smtp_send.html create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_smtp_send.pod create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/imap_ssl_cert.html create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/imap_ssl_cert.pod create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/imap_ssl_cert create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/imap_ssl_cert_epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/nagios-plugins-check_email_delivery.spec create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/email_delivery.cfg create mode 120000 nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/src create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/Makefile create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/check_etc_hosts create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/tests create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/Makefile create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/check_etc_resolv create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/tests create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/README.md create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/check_graphite.py create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/check_haproxy create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/haproxy.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/check_haproxy_stats.pl create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/CHANGES create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/COPYING create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/INSTALL create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/README create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.8 create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.php create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.pod create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.spec create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/install.sh create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/copyright create mode 120000 nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/src create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/Makefile create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/AUTHORS create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/COPYING create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/ChangeLog create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/INSTALL create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/Makefile.am create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/Makefile.in create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/NEWS create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/README create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/TODO create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/acinclude.m4 create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/aclocal.m4 create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/config.guess create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/config.sub create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/configure create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/configure.in create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/install-sh create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/missing create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/BladeSystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/BladeSystem/Component.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/BladeSystem/Component/CommonEnclosureSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/BladeSystem/Component/CommonEnclosureSubsystem/FanSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/BladeSystem/Component/CommonEnclosureSubsystem/FuseSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/BladeSystem/Component/CommonEnclosureSubsystem/ManagerSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/BladeSystem/Component/CommonEnclosureSubsystem/TempSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/BladeSystem/Component/NetConnectorSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/BladeSystem/Component/PowerEnclosureSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/BladeSystem/Component/PowerSupplySubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/BladeSystem/Component/ServerBladeSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/AsrSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/AsrSubsystem/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/AsrSubsystem/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/BatterySubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/BatterySubsystem/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/BatterySubsystem/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/CpuSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/CpuSubsystem/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/CpuSubsystem/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Da.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Da/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Da/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Fca.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Fca/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Fca/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Ide.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Ide/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Ide/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Sas.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Sas/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Sas/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Scsi.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Scsi/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/DiskSubsystem/Scsi/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/EventSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/EventSubsystem/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/EventSubsystem/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/FanSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/FanSubsystem/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/FanSubsystem/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/MemorySubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/MemorySubsystem/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/MemorySubsystem/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/NicSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/NicSubsystem/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/PowersupplySubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/PowersupplySubsystem/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/PowersupplySubsystem/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/TemperatureSubsystem.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/TemperatureSubsystem/CLI.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Proliant/Component/TemperatureSubsystem/SNMP.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/SNMP/Utils.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Server.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/Storage.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/HP/StorageWorks.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/Makefile.am create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/Makefile.in create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/Nagios/MiniPlugin.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/check_hpasm.pl create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/check_hpasm-4.8/plugins-scripts/subst.in create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/copyright create mode 120000 nagios-plugins-contrib-24.20190301~bpo9+1/check_hpasm/src create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_httpd_status/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_httpd_status/check_httpd_status create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_httpd_status/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_httpd_status/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_httpd_status/httpd_status.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_httpd_status/tests create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ipmi_sensor/COPYING create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ipmi_sensor/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ipmi_sensor/README.md create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ipmi_sensor/changelog create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_ipmi_sensor/check_ipmi_sensor create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ipmi_sensor/contrib/default-combinedgraph.template create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ipmi_sensor/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ipmi_sensor/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ipmi_sensor/ipmi_sensor.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs/nagios-check-libs create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs/nagios-check-libs.conf create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs/tests create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs/update-check_libs-status create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs/update_files.sh create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs_ng/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs_ng/check_libs_ng create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs_ng/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs_ng/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libs_ng/tests create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libvirt/Makefile create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_libvirt/check_libvirt create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libvirt/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_libvirt/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/AUTHORS create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/COPYING create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/COPYRIGHT create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/Changes create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/INSTALL create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/MANIFEST create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/MANIFEST.SKIP create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/META.yml create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/MYMETA.json create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/MYMETA.yml create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/Makefile.PL create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/NAME create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/NEWS create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/README create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/TODO create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/VERSION create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/check_lm_sensors create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/check_lm_sensors.pod create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/check_lm_sensors-4.1.1/check_lm_sensors.spec create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/lm_sensors.cfg create mode 120000 nagios-plugins-contrib-24.20190301~bpo9+1/check_lm_sensors/src create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_memcached/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_memcached/check_memcached.l create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_memcached/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_memcached/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_memcached/memcached.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_memory/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_memory/check_memory create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_memory/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_memory/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mongodb/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mongodb/README.md create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mongodb/check_mongodb.py create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mongodb/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mongodb/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mongodb/mongodb.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_multipath/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_multipath/check-multipath.pl create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_multipath/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_multipath/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_multipath/multipath.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_multipath/version create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/Makefile create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/AUTHORS create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/COPYING create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/ChangeLog create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/INSTALL create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/Makefile.am create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/Makefile.in create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/NEWS create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/README create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/TODO create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/acinclude.m4 create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/aclocal.m4 create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/config.guess create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/config.sub create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/configure create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/configure.ac create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/contrib/CheckMySQLHealthExt1.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/contrib/README.my-extensions create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/contrib/check_mysql_health.php create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/install-sh create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/missing create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/plugins-scripts/Makefile.am create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/plugins-scripts/Makefile.in create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/plugins-scripts/Nagios/DBD/MySQL/Cluster.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/plugins-scripts/Nagios/DBD/MySQL/Server.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/plugins-scripts/Nagios/DBD/MySQL/Server/Instance.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/plugins-scripts/Nagios/DBD/MySQL/Server/Instance/Innodb.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/plugins-scripts/Nagios/DBD/MySQL/Server/Instance/Myisam.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/plugins-scripts/Nagios/DBD/MySQL/Server/Instance/Replication.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/plugins-scripts/Nagios/Extraopts.pm create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/plugins-scripts/check_mysql_health.pl create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/plugins-scripts/subst.in create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/t/Makefile.am create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/t/Makefile.in create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/check_mysql_health-2.2.2/t/check_mysql_health.t create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/copyright create mode 120000 nagios-plugins-contrib-24.20190301~bpo9+1/check_mysql_health/src create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_nfsmounts/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_nfsmounts/check_nfsmounts create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_nfsmounts/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_nfsmounts/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_printer/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_printer/check_printer create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_printer/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_printer/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_printer/printer.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_raid/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_raid/check_raid create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_raid/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_raid/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/.travis.yml create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/AUTHORS create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/COPYING create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/COPYRIGHT create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/Changes create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/INSTALL create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/MANIFEST create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/MANIFEST.SKIP create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/META.yml create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/MYMETA.json create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/MYMETA.yml create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/Makefile.PL create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/NEWS create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/README.md create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/TODO create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/VERSION create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/check_rbl create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/check_rbl.ini create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/check_rbl.pod create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/check_rbl.spec create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/inc/Module/AutoInstall.pm create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/inc/Module/Install.pm create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/inc/Module/Install/AutoInstall.pm create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/inc/Module/Install/Base.pm create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/inc/Module/Install/Include.pm create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/inc/Module/Install/MakeMaker.pm create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/inc/Module/Install/Makefile.pm create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/inc/Module/Install/Metadata.pm create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/inc/Module/Install/Scripts.pm create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/t/00_modules.t create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/t/01_validation.t create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/test.sh create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/rbl.cfg create mode 120000 nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/src create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_redis/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_redis/check_redis.php create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_redis/check_redis.pl create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_redis/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_redis/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_redis/redis.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_smstools/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_smstools/README.check_smstools create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_smstools/bin/check_smstools create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_smstools/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_smstools/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_snmp_environment/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_snmp_environment/check_snmp_environment.pl create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_snmp_environment/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_snmp_environment/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_snmp_time/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_snmp_time/check_snmp_time create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_snmp_time/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_snmp_time/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_snmp_time/snmp_time.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/._COPYRIGHT create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/._Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/._NEWS create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/._check_ssl_cert create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/AUTHORS create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/COPYING create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/COPYRIGHT create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/ChangeLog create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/INSTALL create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/NEWS create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/README.md create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/TODO create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/VERSION create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/check_ssl_cert create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/check_ssl_cert.1 create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/check_ssl_cert.spec create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/test/cabundle.crt create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/test/cacert.crt create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/check_ssl_cert-1.83.0/test/unit_tests.sh create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/copyright create mode 120000 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/src create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/ssl_cert.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_ssl_cert/tests create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_uptime/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_uptime/check_uptime create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_uptime/check_uptime.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_uptime/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_uptime/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_uptime/tests create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_v46/Makefile create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_v46/check_v46 create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_v46/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_v46/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/copyright create mode 120000 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/src create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/tests create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/LICENSE create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/Makefile.am create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/Makefile.in create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/README.md create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/aclocal.m4 create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/autogen.des create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/autogen.sh create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/check_varnish.c create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/compile create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/config.guess create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/config.h.in create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/config.sub create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/configure create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/configure.ac create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/depcomp create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/install-sh create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/ltmain.sh create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_varnish/varnish-nagios/missing create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_webinject/Makefile create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/check_webinject/check_webinject create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_webinject/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_webinject/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_webinject/webinject.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_whois/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_whois/check_whois create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_whois/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_whois/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_whois/whois.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_zone_auth/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_zone_auth/check_zone_auth create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_zone_auth/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_zone_auth/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_zone_auth/zone_auth.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_zone_rrsig_expiration/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_zone_rrsig_expiration/check_zone_rrsig_expiration create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_zone_rrsig_expiration/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_zone_rrsig_expiration/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/check_zone_rrsig_expiration/zone-rrsig.cfg create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/common.mk create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/README.Debian.plugins.in create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/README.source create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/autoreconf create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/changelog create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/compat create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/control.in create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/copyright.in create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/gbp.conf create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/nagios-plugins-contrib.docs create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/nagios-plugins-contrib.lintian-overrides create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/debian/packaging-helper.py create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_ajp/return_critical_on_failed_connection create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_backuppc/use_nagios_plugins create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_bgpstate/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_clamav/clamav_locations create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/ParseDateDelta create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/monitoring-plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_drbd/fix_for_oos_and_cosmetic create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_email_delivery/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_email_delivery/paths create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy/monitoring-plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy_stats/interpreter create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/htdigest_auth create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_imap_quota/syntax_error_fix create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/config_path create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/lsof-speedup create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/space_before_deleted create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libvirt/fix_uom create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libvirt/monitoring-plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/interpreter create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/manpage_whatis_fix create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/spelling_errors create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_memory/monitoring-plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_memory/new_free create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/nfs4_support create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/nfs_write_location create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/perl_module create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/debian_bts create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/use_data_dumper_if_needed create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/use_nagios_plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_raid/no_epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_raid/prefer_cciss_vol_status_over_hpacucli create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_rbl/additional_rbls create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_rbl/interpreter create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_smstools/monitoring-plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_smstools/operator_siglvl create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_snmp_environment/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_snmp_time/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_uptime/missing_backslash create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_v46/no_epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_varnish/fix_for_v56 create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_webinject/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_cert_expire_dir_check_name_fix create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages-inifile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages_,_fix create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages_location create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_running_kernel_jessie_centos_fix create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/status_directory create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/percona-nagios-plugins/fix_bashism create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/series create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/debian/rules create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/source/format create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/tests/control create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/debian/tests/test_check_varnish create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/checks/dsa-check-cert-expire create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/checks/dsa-check-cert-expire-dir create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/checks/dsa-check-dnssec-delegation create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/checks/dsa-check-entropy create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/checks/dsa-check-packages create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/checks/dsa-check-running-kernel create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/checks/dsa-check-soas create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/checks/dsa-check-statusfile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/copyright create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/etc/obsolete-packages-ignore create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/sbin/dsa-update-apt-status create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/sbin/dsa-update-unowned-file-status create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/dsa/update-files.sh create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/extras/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/extras/check_apt.cmd create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/extras/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/extras/copyright create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/extras/send_nsca_host_or_service_check_result create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/Changelog create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/Makefile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/control create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/copyright create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-aws-rds.py create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-lvm-snapshots create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-mongo.py create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deadlocks create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deleted-files create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-mysql-file-privs create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-mysql-innodb create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-mysql-pidfile create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-mysql-processlist create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-mysql-replication-delay create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-mysql-replication-running create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-mysql-status create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-mysql-ts-count create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-pt-table-checksum create mode 100755 nagios-plugins-contrib-24.20190301~bpo9+1/percona-nagios-plugins/nagios/bin/pmp-check-unix-memory create mode 100644 nagios-plugins-contrib_24.20190301~bpo9+1.dsc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..629617f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +nagios-plugins-contrib*tar.xz diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/.travis.yml b/nagios-plugins-contrib-24.20190301~bpo9+1/.travis.yml new file mode 100644 index 0000000..f5aa710 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/.travis.yml @@ -0,0 +1,25 @@ +sudo: required + +env: + - TRAVIS_DEBIAN_DISTRIBUTION=unstable + - TRAVIS_DEBIAN_DISTRIBUTION=testing + - TRAVIS_DEBIAN_DISTRIBUTION=stable + +matrix: + allow_failures: + - env: TRAVIS_DEBIAN_DISTRIBUTION=unstable + - env: TRAVIS_DEBIAN_DISTRIBUTION=testing + +services: + - docker + +script: + # build the debian package + - wget -O- http://travis.debian.net/script.sh | sh - + +#notifications: +# email: false + +branches: + except: + - /^debian\/\d/ diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/Makefile new file mode 100644 index 0000000..55e8807 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/Makefile @@ -0,0 +1,27 @@ +PLUGINS := $(strip $(shell find . -mindepth 2 -maxdepth 2 -name Makefile -printf '%h ')) + +ifeq ($(wildcard /etc/debian_version),/etc/debian_version) +HOST_ARCH := $(strip $(shell dpkg-architecture -q DEB_HOST_ARCH)) +else +ifeq ($(wildcard /usr/bin/rpm),/usr/bin/rpm) +HOST_ARCH := $(strip $(shell rpm --eval '%{_arch}')) +endif +endif + +ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH),hurd-i386)) + PLUGINS := $(filter-out check_memcached check_varnish,$(PLUGINS)) +endif +ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH),arm64)) + PLUGINS := $(filter-out check_memcached,$(PLUGINS)) +endif +ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH),m68k)) + PLUGINS := $(filter-out check_varnish,$(PLUGINS)) +endif + + +default: all + +$(PLUGINS):: + $(MAKE) -C $@ $(MAKECMDGOALS) + +all clean install : $(PLUGINS) diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/README b/nagios-plugins-contrib-24.20190301~bpo9+1/README new file mode 120000 index 0000000..71839fd --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/README @@ -0,0 +1 @@ +debian/README.source \ No newline at end of file diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/Makefile new file mode 100644 index 0000000..e301afc --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/Makefile @@ -0,0 +1,5 @@ +PLUGIN := check_ajp + +include ../common.mk + + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/ajp.cfg b/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/ajp.cfg new file mode 100644 index 0000000..89221e0 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/ajp.cfg @@ -0,0 +1,6 @@ +# 'check_ajp' command definition +define command{ + command_name check_ajp + command_line /usr/lib/nagios/plugins/check_ajp --app '$HOSTADDRESS$' + } + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/check_ajp b/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/check_ajp new file mode 100644 index 0000000..68aa243 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/check_ajp @@ -0,0 +1,103 @@ +#!/usr/bin/perl -w +# +# History: +# 2010-11-05 First release (v1) +# +# 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 . +# +# +# Usage: ./check_ajp --app ip.of.the.app [--port 8009 --warn 1 --crit 2 --timeout 5] +# + +use warnings; +use strict; +use Getopt::Long; +use Socket; +use Time::HiRes 'time'; + +my $app = ''; +my $port = '8009'; +my $warntime = '1.5'; +my $crittime = '3'; +my $timeout = '10'; + +my ($iaddr, $paddr, $proto, $sock, $time1, $time2); +my $pong = 'null'; + +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"; + printf STDERR "ERROR: $msg\n"; + exit 3; +} + +GetOptions("app=s" => \$app, "port=s" => \$port, "warn=f" => \$warntime, "crit=f" => \$crittime, "timeout=f" => \$timeout); + +my $ping = pack 'C5' # Format template. + , 0x12, 0x34 # Magic number for server->container packets. + , 0x00, 0x01 # 2 byte int length of payload. + , 0x0A # Type of packet. 10 = CPing. +; + +my $expected = pack 'C5' # Format template. + , 0x41, 0x42 # Magic number for container->server packets. + , 0x00, 0x01 # 2 byte int length of payload. + , 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 !"); + alarm(0); +}; + +if ($@) { + die unless $@ eq "alarm\n"; + $time2 = (time() - $time1); + printf "CRITICAL - AJP - Timeout after %1.0fs\n",$time2; + exit 2; +} else { + $time2 = (time() - $time1); + + if ($pong eq $expected) { + if ($time2 >= $crittime) { + printf "CRITICAL - AJP - %3.5f seconds response time|time=%3.6fs;;;0.000000;%2.6f\n",$time2,$time2,$timeout; + exit 2; + } elsif ($time2 >= $warntime) { + printf "WARNING - AJP - %3.5f seconds response time|time=%3.6fs;;;0.000000;%2.6f\n",$time2,$time2,$timeout; + exit 1; + } else { + printf "OK - AJP - %3.5f seconds response time|time=%3.6fs;;;0.000000;%2.6f\n",$time2,$time2,$timeout; + exit 0; + } + } else { + printf "UNKNOWN - AJP - %3.5f seconds response time|time=%3.6fs;;;0.000000;%2.6f\n",$time2,$time2,$timeout; + exit 3; + } +} diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/control new file mode 100644 index 0000000..3b586cf --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/control @@ -0,0 +1,8 @@ +Version: 1 +Uploaders: Bernd Zeimetz +Description: plugin to monitor the AJP ping response time + Should work with all application servers (Tomcat, JBoss,....) + which provide an AJPv13 connector. +Homepage: http://blog.devnu11.net/projects/ +Watch: http://blog.devnu11.net/projects/

v([0-9]*) – md5: +Recommends: libsocket-perl diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/copyright new file mode 100644 index 0000000..cc3b682 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_ajp/copyright @@ -0,0 +1,17 @@ +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 . diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/Makefile new file mode 100644 index 0000000..8881513 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/Makefile @@ -0,0 +1,15 @@ +#/usr/bin/make -f + +PLUGIN = check_backuppc +MANPAGES = src/check_backuppc.8 +DOCFILES = src/README +NAGIOS_LIB = /usr/lib/nagios/plugins +BACKUPPC_LIB = /usr/share/backuppc/lib +CLEANFILES = $(PLUGIN) + +include ../common.mk + +$(PLUGIN): + sed -e "s|NAGIOS_LIB|$(NAGIOS_LIB)|g" -e \ + "s|BACKUPPC_LIB|${BACKUPPC_LIB}|g" src/check_backuppc > $@ + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/COPYING b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/COPYING new file mode 100644 index 0000000..b7b5f53 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/INSTALL b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/INSTALL new file mode 100644 index 0000000..c025a04 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/INSTALL @@ -0,0 +1,19 @@ +Automated Install Steps: +------------------------ +1) Set NAGIOS_LIB to the directory containing Nagios's util.pm +2) Set BACKUPPC_LIB to the directory containing BackupPC's Perl libraries +3) Set PREFIX to the desired installation location +4) make install + +Manual Install Steps: +--------------------- +1) Edit check_backuppc and adjust the two "use lib" lines to refer to the + correct location for Nagios's utils.pm and BackupPC's Perl libraries. +2) Copy check_backuppc into where you want this plugin. + +Configuration: +-------------- +1) Add a sudoers entry to allow Nagios to run this plugin as the BackupPC user. +2) Configure Nagios to run this plugin through sudo as the BackupPC user. +3) Test +4) Add to Nagios service checks diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/Makefile new file mode 100644 index 0000000..fec0526 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/Makefile @@ -0,0 +1,23 @@ +ifndef PREFIX + PREFIX=/usr/local +endif +ifndef NAGIOS_LIB + NAGIOS_LIB=/usr/lib/nagios/plugins +endif +ifndef BACKUPPC_LIB + BACKUPPC_LIB=/usr/share/backuppc/lib +endif + +install: + sed -e "s|NAGIOS_LIB|$(NAGIOS_LIB)|g" -e \ + "s|BACKUPPC_LIB|${BACKUPPC_LIB}|g" check_backuppc \ + > check_backuppc.processed + install -d ${PREFIX}/lib/nagios/plugins + install -m 755 check_backuppc.processed ${PREFIX}/lib/nagios/plugins + mv ${PREFIX}/lib/nagios/plugins/check_backuppc.processed \ + ${PREFIX}/lib/nagios/plugins/check_backuppc + install -m 644 check_backuppc.8 ${PREFIX}/man/man8 + +uninstall: + rm -f ${PREFIX}/lib/nagios/plugins/check_backuppc + rm -f ${PREFIX}/man/man8/check_backuppc.8 diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/README b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/README new file mode 100644 index 0000000..191e8c4 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/README @@ -0,0 +1,14 @@ +This plugin must be run as the same user that BackupPC runs under. For a host +to be considered an archive host by the --backup-only and --archive-only options +at least one archive must be run by the host. + +Sample configuration for NRPE with Ubuntu hosts: +1) Add the following line to /etc/sudoers on the backup host + nagios ALL = (backuppc) NOPASSWD: /usr/local/lib/nagios/plugins/check_backuppc + +2) Add the following line to /etc/nagios/nrpe.cfg + command[check_backuppc]=/usr/bin/sudo -u backuppc \ + /usr/local/lib/nagios/plugins/check_backuppc + +3) Add the appropriate stanza to your Nagios configuration to use this check + with NRPE. diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/TODO b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/TODO new file mode 100644 index 0000000..155e902 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/TODO @@ -0,0 +1 @@ +Test with Nagios2 diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/changelog b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/changelog new file mode 100644 index 0000000..47cb42f --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/changelog @@ -0,0 +1,33 @@ +Mar. 18 2007 - 1.1.0 + - Added --status-only option + - Fixed logic of --warning option + - Adjusted default warning age to 0 and critical age to 7 days + +Sep. 16 2006 - 1.0 + - Added manpage + - Adjusted spacing in debug messages + - Adjusted behaviour of when an initial backup fails + - Code cleanup + +Aug. 31 2006 - 0.9.0 + - Added Makefile + - Increased verbosity level + - Added host exclusion option + - Added --archive-only and --backup-only options + +Aug. 23 2006 - 0.8.0 + - Added hostname option + - Added warning threshold + - Added severity reduction count + - Code cleanup + +Aug. 22 2006 - 0.2.0 + - First public release + - Code cleanup + - Added command-line arguments + +Aug. 16 2006 - 0.1.1 + - Change error detection to checking for 'error' in hashes + +Aug. 15 2006 - 0.1.0 + - First technically working version of plugin, still needs options diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/check_backuppc b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/check_backuppc new file mode 100755 index 0000000..d8ea383 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/check_backuppc @@ -0,0 +1,265 @@ +#!/usr/bin/perl +# +# check_backuppc: a Nagios plugin to check the status of BackupPC +# +# Tested against BackupPC 2.1.2 and Nagios 1.3 +# +# +# +# AUTHORS +# Seneca Cunningham +# +# COPYRIGHT +# Copyright (C) 2006,2007 Seneca Cunningham +# +# 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 +# + +use strict; +no utf8; + +# Nagios +use lib "NAGIOS_LIB"; +use utils qw(%ERRORS $TIMEOUT); +use POSIX qw(strftime difftime); +use Getopt::Long; +Getopt::Long::Configure('bundling'); + +# BackupPC +use lib "BACKUPPC_LIB"; +use BackupPC::Lib; + +my $version = '1.1.0'; +my $warnLevel = 0; +my $daysOld = 7; +my $verbose = 0; +my $opt_V = 0; +my $opt_h = 0; +my $goodOpt = 0; +my $reduce = 0; +my $backupOnly = 0; +my $archiveOnly = 0; +my $statusOnly = 0; +my @hostsDesired; +my @hostsExcluded; + +# Process options +$goodOpt = GetOptions( + 'v+' => \$verbose, 'verbose+' => \$verbose, + 'c=f' => \$daysOld, 'critical=f' => \$daysOld, + 'w=f' => \$warnLevel, 'warning=f' => \$warnLevel, + 'V' => \$opt_V, 'version' => \$opt_V, + 'h' => \$opt_h, 'help' => \$opt_h, + 'r=i' => \$reduce, 'reduce' => \$reduce, + 'b' => \$backupOnly, 'backup-only' => \$backupOnly, + 'a' => \$archiveOnly, 'archive-only' => \$archiveOnly, + 's' => \$statusOnly, 'status-only' => \$statusOnly, + 'H=s' => \@hostsDesired, 'hostname=s' => \@hostsDesired, + 'x=s' => \@hostsExcluded, 'exclude=s' => \@hostsExcluded); + +@hostsDesired = () if $#hostsDesired < 0; +@hostsExcluded = () if $#hostsExcluded < 0; + +if ($opt_V) +{ + print "check_backuppc - " . $version . "\n"; + exit $ERRORS{'OK'}; +} +if ($backupOnly and $archiveOnly) +{ + $goodOpt = 0; + print "Cannot apply both --backup-only and --archive-only, contradictory\n\n"; +} +if ($opt_h or not $goodOpt) +{ + print "check_backuppc - " . $version . "\n"; + print "A Nagios plugin to check on BackupPC backup status.\n\n"; + print "Options:\n"; + print " --hostname,-H only check the specified host\n"; + print " --exclude,-x do not check the specified host\n"; + print " --archive-only,-a only check the archive hosts\n"; + print " --backup-only,-b only check the backup hosts\n"; + print " --status-only,-s only check backup status, omit connection failures that are\n"; + print " less than \$Conf{FullPeriod} old\n"; + print " --warning,-w days old an errored host must be to cause a warning\n"; + print " --critical,-c number of days old an errored backup must be to be critical\n"; + print " --reduce,-r maximum number of failed hosts for severity reduction\n"; + print " --verbose,-v increase verbosity\n"; + print " --version,-V display plugin version\n"; + print " --help,-h display this message\n\n"; + exit $ERRORS{'OK'} if $goodOpt; + exit $ERRORS{'UNKNOWN'}; +} +if ($warnLevel > $daysOld) +{ + print("BACKUPPC UNKNOWN - Warning threshold must be <= critical\n"); + exit $ERRORS{'UNKNOWN'}; +} + +# Connect to BackupPC +my $server; +if (!($server = BackupPC::Lib->new)) +{ + print "BACKUPPC CRITICAL - Couldn't connect to BackupPC\n"; + exit $ERRORS{'CRITICAL'}; +} +my %Conf = $server->Conf(); + +$server->ChildInit(); + +my $err = $server->ServerConnect($Conf{ServerHost}, $Conf{ServerPort}); +if ($err) +{ + print("BACKUPPC UNKNOWN - Can't connect to server ($err)\n"); + exit $ERRORS{'UNKNOWN'}; +} + +# hashes that BackupPC uses for varios status info +my %Status; +my %Jobs; +my %Info; + +# query the BackupPC server for host, job, and server info +my $info_raw = $server->ServerMesg('status info'); +my $jobs_raw = $server->ServerMesg('status jobs'); +my $status_raw = $server->ServerMesg('status hosts'); + +# undump the output... BackupPC uses Data::Dumper +eval $info_raw; +eval $jobs_raw; +eval $status_raw; + +# check the dumped output +my $hostCount = 0; +my @goodHost; +my @badHost; +my @tooOld; +my @notTooOld; + +foreach my $host (@hostsDesired, @hostsExcluded) +{ + if (not grep {/$host/} keys(%Status)) + { + print("BACKUPPC UNKNOWN - Unknown host ($host)\n"); + exit $ERRORS{'UNKNOWN'}; + } +} + +# host status checks +foreach my $host (sort(keys(%Status))) +{ + next if $host =~ /^ /; + next if (@hostsDesired and not grep {/$host/} @hostsDesired); + next if (@hostsExcluded and grep {/$host/} @hostsExcluded); + next if ($backupOnly and $Status{$host}{'type'} eq 'archive'); + next if ($archiveOnly and $Status{$host}{'type'} ne 'archive'); + $hostCount++; + # Debug + if ($verbose == 3) + { + print "Host $host state " . $Status{$host}{'state'}; + print " with error: " . $Status{$host}{'error'} . "\n"; + } + if ($Status{$host}{'error'}) + { + # Check connectivity errors with greater care + if ($statusOnly && ( + $Status{$host}{'error'} eq 'ping too slow' || + $Status{$host}{'error'} eq 'no ping response' || + $Status{$host}{'error'} eq 'host not found')) { + if ($Status{$host}{'lastGoodBackupTime'} - $Status{$host}{'startTime'} <= $Conf{FullPeriod} * 3600 * 24) { + push @goodHost, $host; + next; + } + } + push @badHost, $host; + # Check bad host ages + $Status{$host}{'lastGoodBackupTime'} = $Status{$host}{'startTime'} if (not $Status{$host}{'lastGoodBackupTime'}); + if (difftime(time(), $Status{$host}{'lastGoodBackupTime'}) > ($daysOld * 3600 * 24)) + { + push @tooOld, $host; + } + elsif (difftime(time(), $Status{$host}{'lastGoodBackupTime'}) > ($warnLevel * 3600 * 24)) + { + push @notTooOld, $host; + } + else + { + push @goodHost, $host; + pop @badHost; + } + # Debug + if ($verbose == 2) + { + print "Host $host state " . $Status{$host}{'state'}; + print " with error: " . $Status{$host}{'error'} . "\n"; + } + } + else + { + push @goodHost, $host; + } +} + +if ($hostCount == @goodHost or $#badHost < $reduce and not @tooOld) +{ + print "BACKUPPC OK - (" . @badHost . "/" . $hostCount . ") failures\n"; + exit $ERRORS{'OK'}; +} + +# Only failures reach this far +# WARNING +if ($#tooOld < 0 or $#badHost < $reduce) +{ + print "BACKUPPC WARNING - ("; + if ($verbose) + { + foreach my $host (@badHost) + { + print $host . " (" . $Status{$host}{'error'} . "), "; + } + print ")\n"; + } + else + { + print $#badHost + 1 . "/" . $hostCount . ") failures\n"; + } + exit $ERRORS{'WARNING'}; +} + +# CRITICAL +print "BACKUPPC CRITICAL - ("; +if ($#notTooOld >= 0 and $verbose) +{ + foreach my $host (@notTooOld) + { + print $host . " (" . $Status{$host}{'error'} . "), "; + } + print "), ("; +} +if ($verbose) +{ + foreach my $host (@tooOld) + { + print $host . " (" . $Status{$host}{'error'} . "), " if $verbose; + } + print ") critical\n"; +} +else +{ + print $#badHost + 1 . "/" . $hostCount . ") failures, "; + print $#tooOld + 1 . " critical\n"; +} +exit $ERRORS{'CRITICAL'}; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/check_backuppc.8 b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/check_backuppc.8 new file mode 100644 index 0000000..372afdc --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/check_backuppc-1.1.0/check_backuppc.8 @@ -0,0 +1,61 @@ +.TH check_backuppc 8 +.SH NAME +check_backuppc \- A Nagios plugin to monitor BackupPC +.SH SYNOPSIS +.B check_backuppc +.I [options] +.SH DESCRIPTION +.B check_backuppc +is a nagios plugin that reports on the status of BackupPC. By default, it +monitors both archive and backup hosts for errors. +.SH OPTIONS +.TP +.B \-a, \-\-archive\-only +Only check the status of archive hosts. +.TP +.B \-b, \-\-backup\-only +Only check the status of non-archive hosts. +.TP +.B \-s, \-\-status\-only +Only check the status of the backups, omit connection failures that are less +than $Conf{FullPeriod} old. +.TP +.B \-H, \-\-hostname hostname +Only check the specified host. Uses hostnames that BackupPC is configured to +use, can be specified multiple times. +.TP +.B \-x, \-\-exclude hostname +Do not check the specified host. Uses hostnames that BackupPC is configured to +use, can be specified multiple times. +.TP +.B \-w, \-\-warning age +The days old at which a failure is considered a warning, default 1. +.TP +.B \-c, \-\-critical age +The days old at which a failure is considered critical, default 8. +.TP +.B \-r, \-\-reduce count +The maximum number of failed hosts for which to reduce reported severity, +default 0. +.TP +.B \-h, \-\-help +Show summary of options. +.SH NOTES +This plugin must be run on the same host and as the same user as BackupPC. +An archive host only takes on a reported type of archive after its first archive +run. +.SH EXAMPLES +.TP +.EX +/usr/local/lib/nagios/plugins/check_backuppc -r1 -w3 -c8 -b -x otter +.EE +Check the status of all backup hosts except "otter". Warn if a failed backup +is older than three days old, return critical if a failure is older than eight +days old unless there is only a single failure. In that case, warn if the +single failed backup is older than eight days. +.SH AUTHOR +Seneca Cunningham +.SH "SEE ALSO" +.\" Always quote multiple words for .SH +.BR sudo (8). +.BR backuppc (8). diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/control new file mode 100644 index 0000000..6897900 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/control @@ -0,0 +1,8 @@ +Uploaders: Jan Wagner +Recommends: libmonitoring-plugin-perl | libnagios-plugin-perl +Suggests: backuppc +Version: 1.1.0 +Homepage: http://n-backuppc.sourceforge.net/ +Watch: http://sourceforge.net/projects/n-backuppc/files/ check_backuppc-([0-9.]+)\.tar\.gz +Description: plugin for checking on the status of + BackupPC backups diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/copyright new file mode 100644 index 0000000..b7b58f8 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/copyright @@ -0,0 +1,6 @@ +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". diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/src b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/src new file mode 120000 index 0000000..127d37d --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_backuppc/src @@ -0,0 +1 @@ +check_backuppc-1.1.0 \ No newline at end of file diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/Makefile new file mode 100644 index 0000000..52de70c --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/Makefile @@ -0,0 +1,4 @@ +#/usr/bin/make -f + +include ../common.mk + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/bgpstate.cfg b/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/bgpstate.cfg new file mode 100644 index 0000000..76a7343 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/bgpstate.cfg @@ -0,0 +1,5 @@ +# 'check_snmp_bgpstate' command definition +define command{ + command_name check_snmp_bgpstate + command_line /usr/lib/nagios/plugins/check_bgpstate '$HOSTADDRESS$' -c '$ARG1$' + } diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/check_bgpstate b/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/check_bgpstate new file mode 100644 index 0000000..645d750 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/check_bgpstate @@ -0,0 +1,215 @@ +#!/usr/bin/perl -w +# +# check_bgpstate.pl - nagios plugin +# +# Copyright (C) 2000 Christoph Kron +# +# 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. +# +# +# Report bugs to: ck@zet.net +# +# 11.01.2000 Version 1.0 + + + +use strict; + +use Net::SNMP; +use Getopt::Long; +&Getopt::Long::config('auto_abbrev'); + + +# whois programm for RIPE database queries +my $whois = '/usr/bin/whois'; +my $status; +my $TIMEOUT = 30; + +# critical bgp sessions +my %uplinks = ( 1273, 'Uplink ECRC', + 1755, 'Uplink EBONE', + 3300, 'Uplink AUCS' + ); + +my %ERRORS = ('UNKNOWN' , '-1', + 'OK' , '0', + 'WARNING', '1', + 'CRITICAL', '2'); + + +my %bgpPeerState = ( + '1',"idle", + '2',"connect", + '3',"active", + '4',"opensent", + '5',"openconfirm", + '6',"established" + ); +my $state = "UNKNOWN"; +my $answer = ""; +my $snmpkey; +my $snmpoid; +my $key; +my $community = "public"; +my $port = 161; +my @snmpoids; +my $snmpbgpPeerState = '1.3.6.1.2.1.15.3.1.2'; +my $snmpbgpPeerLocalAddr = '1.3.6.1.2.1.15.3.1.5'; +my $snmpbgpPeerRemoteAddr = '1.3.6.1.2.1.15.3.1.7'; +my $snmpbgpPeerRemoteAs = '1.3.6.1.2.1.15.3.1.9'; +my $hostname; +my $session; +my $error; +my $response; +my %bgpStatus; +my $bgpestablished =0 ; +my $bgpcritical =0; +my $bgpdown =0; +my $bgpidle =0; +my $bgpmessage; +my $asname; +my $remoteas; +my @output; + +sub usage { + printf "\nMissing arguments!\n"; + printf "\n"; + printf "Perl bgpstate plugin for Nagios\n"; + printf "monitors all BGP sessions\n"; + printf "usage: \n"; + printf "check_bgpstate.pl -c -p \n"; + printf "Copyright (C) 2000 Christoph Kron\n"; + printf "check_bgpstate.pl comes with ABSOLUTELY NO WARRANTY\n"; + printf "This programm is licensed under the terms of the "; + printf "GNU General Public License\n(check source code for details)\n"; + printf "\n\n"; + exit $ERRORS{"UNKNOWN"}; +} + +# Just in case of problems, let's not hang Nagios +$SIG{'ALRM'} = sub { + print ("ERROR: No snmp response from $hostname (alarm)\n"); + exit $ERRORS{"UNKNOWN"}; +}; +alarm($TIMEOUT); + + +$status = GetOptions("community=s",\$community, + "port=i",\$port); +if ($status == 0) +{ + &usage; +} + + #shift; + $hostname = shift || &usage; + + +push(@snmpoids, $snmpbgpPeerState); +push(@snmpoids, $snmpbgpPeerLocalAddr); +push(@snmpoids, $snmpbgpPeerRemoteAddr); +push(@snmpoids, $snmpbgpPeerRemoteAs); + +foreach $snmpoid (@snmpoids) { + + ($session, $error) = Net::SNMP->session( + -hostname => $hostname, + -community => $community, + -port => $port + ); + + if (!defined($session)) { + $state='UNKNOWN'; + $answer=$error; + print ("$state: $answer"); + exit $ERRORS{$state}; + } + + if (!defined($response = $session->get_table($snmpoid))) { + $answer=$session->error; + $session->close; + $state = 'CRITICAL'; + print ("$state: $answer,$snmpkey"); + exit $ERRORS{$state}; + } + + foreach $snmpkey (keys %{$response}) { + $snmpkey =~ m/.*\.(\d+\.\d+\.\d+\.\d+$)/; + $key = $1; +# printf "debug: $snmpkey: $key -> $response->{$snmpkey}\n"; + $bgpStatus{$key}{$snmpoid} = $response->{$snmpkey}; + } + $session->close; +} + +foreach $key (keys %bgpStatus) { + if ($bgpStatus{$key}{$snmpbgpPeerState} == 6 ) { + $bgpestablished++; + } + elsif ($bgpStatus{$key}{$snmpbgpPeerState} == 1 ) { + $bgpidle++; + } + else { + $bgpdown++ ; + if (exists($uplinks{$bgpStatus{$key}{$snmpbgpPeerRemoteAs}}) ) { + $bgpcritical++; + } + @output = `$whois -T aut-num AS$bgpStatus{$key}{$snmpbgpPeerRemoteAs}`; + + $asname = ""; + foreach (@output) { + if (m/as-name/) { + $asname = $_; + $asname =~ s/as-name://; + last; + } + if ( $asname =~ "" && m/descr/ ) { + $asname = $_; + $asname =~ s/descr://; + } + } + $asname =~ s/^\s*//; + $asname =~ s/\s*$//; + $bgpmessage .= sprintf("Peering with AS%s not established -> %s
", + $bgpStatus{$key}{$snmpbgpPeerRemoteAs}, + $asname); + } +} + + + if ($bgpdown > 0) { + if ($bgpcritical > 0) { + $state = 'CRITICAL'; + } + else { + $state = 'WARNING'; + } + $answer = sprintf("host '%s', sessions up: %d, down: %d, shutdown: %d
", + $hostname, + $bgpestablished, + $bgpdown, $bgpidle); + $answer = $answer . $bgpmessage . "\n"; + } + else { + $state = 'OK'; + $answer = sprintf("host '%s', sessions up: %d, down: %d, shutdown: %d\n", + $hostname, + $bgpestablished, + $bgpdown,$bgpidle); + } + +print ("$state: $answer"); +exit $ERRORS{$state}; + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/control new file mode 100644 index 0000000..77609f5 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/control @@ -0,0 +1,5 @@ +Homepage: https://raw.github.com/nagios-plugins/nagios-plugins/ba7615631add0b610ada6a819d6c8f8c46a2d36d/contrib/check_bgpstate.pl +Recommends: libnet-snmp-perl, whois +Version: 1.0 +Uploaders: Jan Wagner +Description: plugin to check all BGP session on Cisco routers diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/copyright new file mode 100644 index 0000000..f42c74a --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_bgpstate/copyright @@ -0,0 +1,6 @@ +C) 2000 Christoph Kron + +License: GPL-2 + + On Debian systems, the complete text of the GNU General + Public License version 1 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/Makefile new file mode 100644 index 0000000..6d064e3 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/Makefile @@ -0,0 +1,8 @@ +PLUGIN := check_checksums + +include ../common.mk + +install:: + install -d $(DESTDIR)/usr/lib/nagios + install -m 755 -o root -g root update_checksums $(DESTDIR)/usr/lib/nagios + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/check_checksums b/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/check_checksums new file mode 100755 index 0000000..74a97c2 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/check_checksums @@ -0,0 +1,110 @@ +#!/bin/bash +# +# check_checksums - Nagios plugin to check file checksums +# against (local, not 100% secure) lists. +# Supports md5 sha1 sha224 sha256 sha384 sha512 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 . + +umask 077 + +if [ $# -gt 0 ]; then + case $1 in + -h|--help|help) + cat << __EOH__ +$0 - Nagios plugin to check file checksums +------------------------------------------ +The plugin supports md5 sha1 sha224 sha256 sha384 sha512 checksums. +As the lists are stored local it is not 100% secure. + +Usage: + For each file you want to monitor write the current checksum + into the stored file list. Use the checksum tool you prefer, + probably depending on your CPU power. + + sha512sum /path/to/the/file >> /etc/nagios/check_checksums.sha512 + sha384sum /path/to/the/file >> /etc/nagios/check_checksums.sha384 + sha256sum /path/to/the/file >> /etc/nagios/check_checksums.sha256 + sha224sum /path/to/the/file >> /etc/nagios/check_checksums.sha224 + sha1sum /path/to/the/file >> /etc/nagios/check_checksums.sha1 + md5sum /path/to/the/file >> /etc/nagios/check_checksums.md5 + + Set useful file permissions: + chown root:nagios /etc/nagios/check_checksums.* + chmod 0640 /etc/nagios/check_checksums.* + + Run + $0 + in nrpe or nagios to check if the checksums are still the same. + It will return UNKNOWN if there is no checksum file at all. + + To update *ALL* stored checksums please run + /usr/lib/nagios/update_checksums + and all checksum files will be updated. A copy of the original file will + be stored in /etc/nagios. + +__EOH__ + exit 3 + ;; + esac +fi + +if dpkg --compare-versions `dpkg-query -W coreutils | awk '{print $2}'` ge 8.13; then + STRICT="--strict" +else + STRICT="" +fi + +RET=3 +OUT="UNKNOWN" +tmp_out=`mktemp` +tmp_err=`mktemp` +trap "rm -f ${tmp_out} ${tmp_err}" EXIT + +for t in md5 sha1 sha224 sha256 sha384 sha512; do + fname="/etc/nagios/check_checksums.${t}" + tool="${t}sum" + if [ -f ${fname} ]; then + if [ ${RET} -eq 3 ]; then + RET=0 + OUT="OK" + fi + ${tool} --quiet ${STRICT} --check ${fname} 1>>${tmp_out} 2>>${tmp_err} + err=$? + + if [ ${err} -gt 0 ]; then + RET=2 + OUT="CRITICAL" + fi + fi +done + +if [ $RET -eq 0 ]; then + echo "OK - all checksums verified | failed=0;1;1;0;" +else + echo -n "${OUT} - " + sed 's,WARNING: ,,' ${tmp_err} | tr '\n' '/' | sed 's,/$,,' + echo + cat ${tmp_out} + count=`wc -l ${tmp_out} | awk '{print $1}'` + echo "| failed=${count};1;1;0;" + /usr/bin/logger -p user.err -t check_checksums -f ${tmp_out} +fi +rm -f ${tmp_out} ${tmp_err} + +exit ${RET} + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/control new file mode 100644 index 0000000..73b015c --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/control @@ -0,0 +1,5 @@ +Version: 20130611 +Uploaders: Bernd Zeimetz +Description: plugin to verify file checksums + against (local, not 100% secure) lists. + Supports md5 sha1 sha224 sha256 sha384 sha512 checksums. diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/copyright new file mode 100644 index 0000000..8faae12 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/copyright @@ -0,0 +1,15 @@ +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 . + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/tests b/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/tests new file mode 100644 index 0000000..2c651c8 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/tests @@ -0,0 +1,2 @@ +Test-Command: mkdir -p /etc/nagios/ && sha256sum /bin/true > /etc/nagios/check_checksums.sha256 && /usr/lib/nagios/plugins/check_checksums +Restrictions: needs-root, breaks-testbed diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/update_checksums b/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/update_checksums new file mode 100755 index 0000000..2ef376b --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_checksums/update_checksums @@ -0,0 +1,47 @@ +#!/bin/bash +# +# Tool to rebuild all checksums for 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 . + +set -e +umask 027 + +for t in md5 sha1 sha224 sha256 sha384 sha512; do + fname="/etc/nagios/check_checksums.${t}" + tool="${t}sum" + if [ -f ${fname} ]; then + tmp=`mktemp` + chown root:nagios ${tmp} + chmod 640 ${tmp} + + trap "rm -f ${tmp}" EXIT + + sed 's,^[^ ]* ,,' ${fname} | while read f; do + if [ -f "${f}" ]; then + ${tool} "${f}" >> ${tmp} + else + echo "${f} went missing, ignoring!" + fi + done + + ln "${fname}" "${fname}_`date '+%s'`" + mv "${tmp}" "${fname}" + fi +done + + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/Makefile new file mode 100644 index 0000000..23f8a8f --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/Makefile @@ -0,0 +1 @@ +include ../common.mk diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/check_clamav b/nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/check_clamav new file mode 100644 index 0000000..af92211 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/check_clamav @@ -0,0 +1,190 @@ +#!/usr/bin/perl -w +# +# 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. +# +################################################################################ +# 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. +# +# 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. +# +# This plugin requires the Net::DNS Perl module. +################################################################################ + +# Plugin directory / home of utils.pm. +use lib "/usr/local/libexec/nagios"; +use utils qw(%ERRORS &print_revision &support &usage); +use Getopt::Long qw(:config no_ignore_case bundling); +use File::Basename; +use Net::DNS; + +use strict; + +# Path to installed clamd binary. +my $clamd_cmd = "/usr/local/sbin/clamd"; + +# Leave the rest of this alone: +my $prog_name = basename $0; +my $prog_ver = "1.2"; + +my $warn_val = 1; # Default - override with -w arg +my $crit_val = 2; # Default - override with -c arg +my $help_val = 0; # Off unless -h arg +my $verb_val = 0; # Off unless -v arg +my $vers_val = 0; # Off unless -V arg + +my ($msg, $rev_word, $rr, $status, $status_print); + +# Gives us a way to print out verbose debug information to the screen when user +# passes in a -v argument. +# print_debug() should receive one parameter: a text string to print out. +sub print_debug() { + my $message = shift; + if ($verb_val == 1) { + print "DEBUG: " . $message . "\n"; + } +} + +# Looks up and returns the current CVD version information from +# clamav.net. +sub lookup_current() { + my $res = Net::DNS::Resolver->new; + my $query = $res->search("current.cvd.clamav.net", "TXT"); + if ($query) { + foreach $rr (grep { $_->type eq 'TXT' } $query->answer) { + &print_debug("Net::DNS found result: (TXT) " . $rr->txtdata); + return $rr->txtdata; + } + } else { + warn "query failed: ", $res->errorstring, "\n"; + } +} + +# comp_sig_ver() should receive three parameters: remote signature database +# version, local signature database version, and build date of local +# signatures database. +sub comp_sig_ver() { + my $sig_rem = shift; + my $sig_local = shift; + my $sig_date = shift; + my $diff = 0; + my $msg = ""; + + if ($sig_local != $sig_rem) { + $diff = $sig_rem - $sig_local; + $rev_word = ($diff == 1) ? "revision" : "revisions"; + if ($diff >= $crit_val) { + &print_debug("Installed daily.cvd is behind clamav.net"); + $status = $ERRORS{'CRITICAL'}; # Will exit with CRITICAL status + $status_print = "CRITICAL"; + } elsif ($diff >= $warn_val) { + &print_debug("Installed daily.cvd is behind clamav.net"); + $status = $ERRORS{'WARNING'}; # Will exit with WARNING status + $status_print = "WARNING"; + } else { + &print_debug("Installed daily.cvd is behind clamav.net"); + $status = $ERRORS{'OK'}; # Will exit with OK status + $status_print = "OK"; + } + $msg = "ClamAV " . $status_print . ": daily.cvd " . $sig_local . + " out of date by " . $diff . " " . $rev_word; + } else { + &print_debug("Installed daily.cvd matches latest from clamav.net"); + $status = $ERRORS{'OK'}; # Will exit with OK status + $msg = "ClamAV OK: daily.cvd " . $sig_local . " (" . $sig_date . + ") is up to date"; + } + return $msg, $status; +} + +# Show usage information +sub show_help() { + print < + +Perl Check ClamAV daily.cvd plugin for Nagios + +Usage: $prog_name [-w ] [-c ] [-V] [-v] [-h] + +-w, --warning=INTEGER + Number of revisions behind current daily.cvd to generate a warning state (Default: 1) +-c, --critical=INTEGER + Number of revisions behind current daily.cvd to generate a critical state (Default: 2) +-V, --version + Output version information for the plugin +-v, --verbose + Enable verbose output +-h, --help + Show this help +END +} + +GetOptions ( + "w=i" => \$warn_val, "warning=i" => \$warn_val, + "c=i" => \$crit_val, "critical=i" => \$crit_val, + "h" => \$help_val, "help" => \$help_val, + "V" => \$vers_val, "version" => \$vers_val, + "v" => \$verb_val, "verbose" => \$verb_val, +); + +if ($help_val != 0) { + &show_help; + exit $ERRORS{'OK'}; +} + +if ($vers_val != 0) { + &print_revision($prog_name,$prog_ver); + exit $ERRORS{'OK'}; +} + +# Make sure the binary exists. +if (-x $clamd_cmd) { + &print_debug("Found clamd at $clamd_cmd"); +} else { + &print_debug("Can't execute clamd at $clamd_cmd"); + die("FATAL: Unable to execute $clamd_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`); + +# 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); +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]; + +&print_debug("Local daily.cvd dated $local_latest_date"); +&print_debug("Local daily.cvd version = $local_latest_daily"); + +# Get the latest ClamAV daily signatures version out of this +my $clamav_latest_daily = $txtresults[2]; +&print_debug("Latest daily.cvd version = $clamav_latest_daily"); + +my @prog_sig_res = &comp_sig_ver($clamav_latest_daily, $local_latest_daily, + $local_latest_date); + +print $prog_sig_res[0] . "\n"; +exit $prog_sig_res[1]; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/control new file mode 100644 index 0000000..8f706c8 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/control @@ -0,0 +1,10 @@ +Homepage: http://exchange.nagios.org/directory/Plugins/Anti-2DVirus/ClamAV/ClamAV-check-plugin/details +Watch: http://exchange.nagios.org/directory/Plugins/Anti-2DVirus/ClamAV/ClamAV-check-plugin/details check_clamav plugin v([0-9.]+) +Uploaders: Bernd Zeimetz +Description: 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. +Recommends: nagios-plugins-basic, libnet-dns-perl +Version: 1.2 diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/copyright new file mode 100644 index 0000000..dcd354d --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_clamav/copyright @@ -0,0 +1,14 @@ +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. + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/Makefile new file mode 100644 index 0000000..cf9673d --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/Makefile @@ -0,0 +1,3 @@ +#/usr/bin/make -f + +include ../common.mk diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/check_cups b/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/check_cups new file mode 100644 index 0000000..b202fbc --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/check_cups @@ -0,0 +1,617 @@ +#!/usr/bin/perl + +=head1 NAME + +check_cups - monitor CUPS queues + +=head1 AUTHOR + +Steve Huff + +=head1 SYNOPSIS + +Polls a CUPS server to discover queues, then reports on queue status. + +=head1 REQUIRES + +Perl5.004, strict, warnings, Data::Dumper, Nagios::Plugin, Net::CUPS, Date::Manip, POSIX + +=head1 EXPORTS + +Nothing + +=head1 DESCRIPTION + +C polls the specified CUPS server and discovers print queues. It tests against a queue length threshold and an age of the oldest job in the queue threshold. + +Performance data (queue length and maximum queue age) is provided. + +Future development plans include the option to specify the number of expected print queues. + +=cut + +# these need to be outside the BEGIN +use strict; +use warnings; + +# see this page for an explanation regarding the levels of warnings: +# http://search.cpan.org/~rgarcia/perl-5.6.2/pod/perllexwarn.pod +no warnings qw( redefine prototype ); + +BEGIN { + + # use Opsview libs + use lib '/usr/local/nagios/perl/lib'; + use lib '/usr/local/nagios/lib'; + + use Nagios::Plugin; + + use Data::Dumper; + + use Date::Manip; + use POSIX qw( strftime ); + + use Net::CUPS; + + # reregister interrupt + $SIG{INT} = \&DoInterrupt; + +} ## end BEGIN + +######################################################################## +# IMPORTANT VARIABLES +# +# default values +my( $timeout, $verbose ); +my $WARNINGJOBS = 6; +my $CRITICALJOBS = 10; +my $WARNINGAGE = '20 minutes'; +my $CRITICALAGE = '1 hour'; + +# +######################################################################## + +# +# MAIN +# + +# instantiate the Nagios::Plugin object +my( $usagemsg ) = < [-w ] [-c ] [-W ] [-C ] [-t timeout] [-v|d] [-h] +USAGE +my( $blurb ) = <). +LICENSE +my( $plugin ) = Nagios::Plugin->new( + shortname => 'check_cups', + usage => $usagemsg, + version => '0.2', + blurb => $blurb, + license => $license, + ); + +=head2 Plugin Metadata + +Metadata is documented in L and L. + +Other available options of interest include C, C, and C. + +=cut + +# add the additional options +$plugin->add_arg( + spec => 'hostname|H=s', + help => [ + "Hostname to query", + "IP address to query", + ], + label => [ 'HOSTNAME', 'IP' ], + required => 1, + ); + +# queued jobs +$plugin->add_arg( + spec => 'warning|w=i', + help => "Warning threshold in number of queued jobs (default $WARNINGJOBS)", + default => $WARNINGJOBS, + label => [ 'QUEUED JOBS' ], + required => 0, + ); + +$plugin->add_arg( + spec => 'critical|c=i', + help => "Critical threshold in number of queued jobs (default $CRITICALJOBS)", + default => $CRITICALJOBS, + label => [ 'QUEUED JOBS' ], + required => 0, + ); + +# job age +$plugin->add_arg( + spec => 'warningage|W=s', + help => "Warning threshold of job age (default '$WARNINGAGE')", + default => $WARNINGAGE, + label => [ 'TIME SPECIFICATION' ], + required => 0, + ); + +$plugin->add_arg( + spec => 'criticalage|C=s', + help => "Critical threshold of job age (default '$CRITICALAGE')", + default => $CRITICALAGE, + label => [ 'TIME SPECIFICATION' ], + required => 0, + ); + +=head2 Plugin Options + +Refer to L for option specifications - they differ slightly from pure L-style option specifications. + +A number of standard options (C<--help>, C<--version>, C<--usage>, C<--timeout>, and C<--verbose>) are implemented by default, thanks to the arguments passed to Cnew()>, and do not need to be specified. Moreover, if you attempt to override them, you will simply create two such options, which produces confusing C<--help> output and unexpected behavior. + +=cut + +# parse options +$plugin->getopts; + +my( $opts ) = $plugin->opts; + +# declare variables +my( $server, $queues, $warningjobs, $criticaljobs, $warningage, $criticalage ); + +# every variable must have a value +$server = $opts->get( 'hostname' ); +$timeout = $opts->get( 'timeout' ); # See above: option provided by default +$verbose = $opts->get( 'verbose' ); # See above: option provided by default +$warningjobs = $opts->get( 'warning' ); +$criticaljobs = $opts->get( 'critical' ); +$warningage = $opts->get( 'warningage' ); +$criticalage = $opts->get( 'criticalage' ); + +# sanity check +defined( $server ) + or $plugin->nagios_die( "No value provided for --hostname!" ); + +# parse time differentials +my( $nowdate ) = ParseDate( 'now' ); + +my( $warningdelta ) = ParseDateDelta( $warningage ); +unless( defined( $warningdelta ) ) { + + $plugin->nagios_die( "'$warningage' is not a valid time specification!" ); +} + +my( $criticaldelta ) = ParseDateDelta( $criticalage ); +unless( defined( $criticaldelta ) ) { + + $plugin->nagios_die( "'$criticalage' is not a valid time specification!" ); +} + +my( $warningminutes ) = sprintf( '%d', Delta_Format( $warningdelta, 'approx', 0, '%mt' ) ); +my( $criticalminutes ) = sprintf( '%d', Delta_Format( $criticaldelta, 'approx', 0, '%mt' ) ); + +# critical thresholds must be greater than warning thresholds +if ( $warningjobs >= $criticaljobs ) { + + $plugin->nagios_die( "Job number warning threshold ($warningjobs) must be less than critical threshold ($criticaljobs)." ); +} + +if ( $warningminutes >= $criticalminutes ) { + + $plugin->nagios_die( "Job age warning threshold ($warningage) must be less than critical threshold ($criticalage)." ); +} + +=head2 Testing and Exit Status + +The basic methodology of a Nagios plugin is as follows: + +=over + +=item 1. + +Run some sort of test. + +=item 2. + +Validate the result against provided (or default) thresholds. + +=item 3. + +Exit with the appropriate error code, optionally outputting text. + +=back + +Running the test is up to you. + +The function to use for validating the result is C (see L and L for details and specifications), which returns a value appropriate for use as an exit code. + +The functions to use for exiting are C and C. C is the general-purpose exit function, while C should be used for any unexpected exits and indicates that something went wrong with the plugin's operation. + +=head3 Return String + +The plugin return string performs two functions: + +=over + +=item 1. + +It communicates in human-readable format more details about what exactly has gone wrong (e.g. "Disk usage on '/var' is at 92% (threshold 90%)"). + +=item 2. + +It (optionally) communicates in machine-readable format performance data which can be aggregated by tools such as Nagiosgraph (e.g. '| time=0.042745s;5.000000;10.000000;0.000000 size=2162B;;;0'). See L for details and specifications; the function to use is C. + +=back + +The plugin string will automatically be populated with the plugin name and the exit status (e.g. "check_snmp_disk OK - "); everything after the "- " is what you provide with the message arguments to C or C. C takes care of appending the "|" and properly formatting performance data. + +=cut + +# begin tracking status and message +my( $status, $message ) = ( OK, '' ); + +# do some test, with a timeout +alarm $timeout; # the heavy lifting is done in Nagios::Plugin::Getopt +my( $result ) = doTest( $server ); +alarm 0; + +# validate the result, queue by queue +my( %ok, %warning, %critical, %unknown ); + +debug( "Analyzing results..." ); +foreach my $queuename ( keys( %{$result} ) ) { + + # FIXME - allow per-queue overrides + + my( $queue ) = $result->{$queuename}; + + my( $age, $jobs ) = ( $queue->{delta}, $queue->{numjobs} ); + # sanitize values + defined( $age ) or $age = 0; + defined( $jobs ) or $jobs = 0; + + my( $agestatus ) = $plugin->check_threshold( + check => $age, + warning => $warningminutes, + critical => $criticalminutes, + ); + + my( $jobsstatus ) = $plugin->check_threshold( + check => $jobs, + warning => $warningjobs, + critical => $criticaljobs, + ); + + # sort the queue appropriately + if ( $agestatus == CRITICAL or $jobsstatus == CRITICAL ) { + + $critical{$queuename} = { age => $age, jobs => $jobs }; + } + elsif ( $agestatus == WARNING or $jobsstatus == WARNING ) { + + $warning{$queuename} = { age => $age, jobs => $jobs }; + } + elsif ( $agestatus == UNKNOWN or $jobsstatus == UNKNOWN ) { + + $unknown{$queuename} = { age => $age, jobs => $jobs }; + } + else { + + $ok{$queuename} = { age => $age, jobs => $jobs }; + } + + # add performance data + $plugin->add_perfdata( + label => $queuename . "_jobs", + value => $jobs, + uom => undef, + warning => $warningjobs, + critical => $criticaljobs, + ); + + # add performance data + $plugin->add_perfdata( + label => $queuename . "_age", + value => $age, + uom => undef, + warning => $warningminutes, + critical => $criticalminutes, + ); +} + +# figure out our status +if ( scalar( keys( %critical ) ) ) { + + debug( Data::Dumper->Dump( [\%critical], [qw(*critical)] ), 3 ); + + $status = CRITICAL; + + foreach my $queue ( sort( keys( %critical ) ) ) { + + $message .= "$queue ( "; + + my( $age, $jobs ) = ( $critical{$queue}->{age}, $critical{$queue}->{jobs} ); + + my( $prettyage ) = prettyDelta( ParseDateDelta( "$age minutes" ) ); + + my( @messages ); + + if ( $age > $criticalminutes ) { + + push( @messages, "job $prettyage old" ); + } + if ( $jobs > $criticaljobs ) { + + push( @messages, "$jobs queued jobs" ); + } + + $message .= join( ',', @messages ); + + $message .= ' ) '; + } +} +elsif ( scalar( keys( %warning ) ) ) { + + debug( Data::Dumper->Dump( [\%warning], [qw(*warning)] ), 3 ); + + $status = WARNING; + + foreach my $queue ( sort( keys( %warning ) ) ) { + + $message .= "$queue ( "; + + my( $age, $jobs ) = ( $warning{$queue}->{age}, $warning{$queue}->{jobs} ); + + my( $prettyage ) = prettyDelta( parseDateDelta( "$age minutes" ) ); + + my( @messages ); + + if ( $age > $warningminutes ) { + + push( @messages, "job $prettyage old" ); + } + if ( $jobs > $warningjobs ) { + + push( @messages, "$jobs queued jobs" ); + } + + $message .= join( ',', @messages ); + + $message .= ' ) '; + } +} +elsif ( scalar( keys( %unknown ) ) ) { + + debug( Data::Dumper->Dump( [\%unknown], [qw(*unknown)] ), 3 ); + + $status = UNKNOWN; + + $message .= 'Unable to determine status: '; + + $message .= join( ',', sort( keys( %unknown ) ) ); +} +else { + + debug( Data::Dumper->Dump( [\%ok], [qw(*ok)] ), 3 ); + + $message .= 'All queues within parameters.'; +} + +# exit with appropriate return values +$plugin->nagios_exit( $status, $message ); + +################################################################################ +# # +# doTest - poll server for printers +# # +################################################################################ +sub doTest( $ ) { + + my( $host ) = @_; + + my( %queues ); + + debug( "Creating Net::CUPS object...", 2 ); + my( $cups ) = Net::CUPS->new(); + + unless ( defined( $cups ) ) { + + debug( "Unable to create Net::CUPS object: $!" ); + return( undef ); + } + + debug( "Setting server to '$host'...", 2 ); + $cups->setServer( $host ); + + debug( "Polling for queues...", 1 ); + foreach my $queue ( $cups->getDestinations() ) { + + my( $name ) = $queue->getName(); + + if ( defined( $name ) ) { + + $queues{$name} = { destination => $queue }; + debug( "Found queue '$name'.", 3 ); + } + else { + + debug( "Unable to determine queue name!" ); + } + } + + debug( "Parsing queues...", 1 ); + my( $now ) = strftime( '%s', localtime() ); + + foreach my $queue ( keys( %queues ) ) { + + my( $destination ) = $queues{$queue}->{destination}; + + my( @jobs ) = $destination->getJobs( 0, 0 ); + ( @jobs ) or ( @jobs ) = (); + + foreach my $jobid ( @jobs ) { + + my( $job ) = \%{$destination->getJob( $jobid )}; + $queues{$queue}->{jobs}->{$jobid} = $job; + + my( $delta ) = deltaMinutes( $job->{creation_time}, $now ); + + # track the largest delta in the queue + if ( ( ! exists( $queues{$queue}->{delta} ) ) || + ( $delta > $queues{$queue}->{delta} ) ) { + + $queues{$queue}->{delta} = $delta; + } + } + $queues{$queue}->{numjobs} = keys( %{$queues{$queue}->{jobs}} ); + } + debug( Data::Dumper->Dump( [\%queues], [qw(*queues)] ), 3 ); + + return( \%queues ); +} + +################################################################################ +# # +# deltaMinutes - determine the delta in days between two datestamps +# # +################################################################################ +sub deltaMinutes( $$ ) { + + my( $lesser, $greater ) = sort( @_ ); + debug( "Received '$lesser', '$greater'.", 3 ); + + my( $lesserdate ) = ParseDateString( "epoch $lesser" ); + my( $greaterdate ) = ParseDateString( "epoch $greater" ); + + my( $delta ) = DateCalc( $lesserdate, $greaterdate ); + + my( $deltaminutes ) = sprintf( '%d', Delta_Format( $delta, 'approx', 0, '%mt' ) ); + defined( $deltaminutes ) or $deltaminutes = 0; + + debug( "Delta: $deltaminutes minutes.", 3 ); + return( $deltaminutes ); +} + +################################################################################ +# # +# prettyDelta - display time delta in sensible format +# # +################################################################################ +sub prettyDelta( $ ) { + + my( $delta ) = @_; + + debug( "Delta: '$delta'", 3 ); + + # parse the delta + my( $days, $hours, $minutes ) = Delta_Format( + $delta, 'approx', 0, ( qw( + %dh + %hv + %mv + ) ) + ); + + debug( "\$days: $days\n\$hours: $hours\n\$minutes: $minutes", 3 ); + + # assemble the string + my( $pretty ); + + # a day or more? + if ( $days ) { + + $pretty .= "$days day"; + + if ( $days > 1 ) { + + $pretty .= "s"; + } + } + + # hours? + if ( $hours ) { + + if ( $days ) { + + if ( $minutes ) { + + $pretty .= ", "; + } + else { + + $pretty .= " and "; + } + } + + $pretty .= "$hours hour"; + + if ( $hours > 1 ) { + + $pretty .= "s"; + } + } + + # minutes? + if ( $minutes ) { + + if ( $days && $hours ) { + + $pretty .= ","; + } + + if ( $days || $hours ) { + + $pretty .= " and "; + } + + $pretty .= "$minutes minute"; + + if ( $minutes > 1 ) { + + $pretty .= "s"; + } + } + + debug( "\$pretty: '$pretty'", 3 ); + return( $pretty ); +} + +################################################################################ +# # +# debug - print debug info +# # +################################################################################ +sub debug( $;$ ) { + + my( $message, $level ) = @_; + + defined( $level ) or $level = 1; + + if ( $verbose >= $level ) { + + chomp $message; + print "$message\n"; + } +} + +################################################################################ +# # +# DoInterrupt - handle SIGINT and clean up +# # +################################################################################ +sub DoInterrupt { + + $plugin->nagios_die( "Interrupt received" ); +} diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/control new file mode 100644 index 0000000..0dfbf33 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/control @@ -0,0 +1,8 @@ +Homepage: https://exchange.icinga.org/oldmonex/1867-check_cups/ +Uploaders: Jan Wagner +Description: 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. +Recommends: libdate-manip-perl, libmonitoring-plugin-perl | libnagios-plugin-perl (>= 0.31), libnet-cups-perl +Version: 0.2 diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/copyright new file mode 100644 index 0000000..ee2c18e --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/copyright @@ -0,0 +1,6 @@ +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). + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/cups.cfg b/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/cups.cfg new file mode 100644 index 0000000..0a302f3 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/cups.cfg @@ -0,0 +1,5 @@ +# 'check_cups_queue' command definition +define command{ + command_name check_cups_queue + command_line /usr/lib/nagios/plugins/check_cups -H '$HOSTADDRESS$' '$ARG1$' + } diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/tests b/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/tests new file mode 100644 index 0000000..0ecd0e6 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_cups/tests @@ -0,0 +1,3 @@ +Depends: cups, libdate-manip-perl, libmonitoring-plugin-perl | libnagios-plugin-perl, libnet-cups-perl +Test-Command: /usr/lib/nagios/plugins/check_cups -H localhost +Restrictions: needs-root, isolation-container diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/Makefile new file mode 100644 index 0000000..33faddd --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/Makefile @@ -0,0 +1,7 @@ +#/usr/bin/make -f + +PLUGIN = src/check_debsecan +DOCFILES = src/README.md + +include ../common.mk + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/control new file mode 100644 index 0000000..ce4361b --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/control @@ -0,0 +1,5 @@ +Uploaders: Stefan Schoerghofer +Recommends: debsecan +Version: 1.0.0 +Homepage: https://github.com/AMD1212/check_debsecan +Description: plugin to check the Debian CVE lists against your installed packages diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/copyright new file mode 100644 index 0000000..1e81685 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/copyright @@ -0,0 +1,15 @@ +Copyright (C) 2017 Stefan Schörghofer + +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 . + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/debsecan.cfg b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/debsecan.cfg new file mode 100644 index 0000000..b34ef0c --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/debsecan.cfg @@ -0,0 +1,5 @@ +# 'check_debsecan' command definition +define command{ + command_name check_debsecan + command_line /usr/lib/nagios/plugins/check_debsecan +} diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/src/LICENSE b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/src/LICENSE new file mode 100644 index 0000000..9cecc1d --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/src/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + 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 . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/src/README.md b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/src/README.md new file mode 100644 index 0000000..153431b --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/src/README.md @@ -0,0 +1,39 @@ +# check_debsecan +Monitoring/Nagios plugin for Debian - Checks the Debian CVE database against all installed packages on your system + +Usage: check_debsecan [OPTIONS] + +Arguments: + -f warning value for fixed packages | default = 20 + -F critical value for fixed packages | default = 30 + -o warning value for obsolete packages | default = 1 + -O critical value for obsolete packages | default = 1 + -l warning value for "low urgency" fixes | default = 10 + -L critical value for "low urgency" fixes | default = 20 + -m warning value for "medium urgency" fixes | default = 5 + -M critical value for "medium urgency" fixes | default = 10 + -u warning value for urgent "high urgency" fixes | default = 1 + -U critical value for urgent "high urgency" fixes | default = 1 + -s set the suite parameter manually + -P "[proxy-url]" set the proxy manually + +Options: + -d produces debugging output + -r disables the cve/packages report + -h print this help + +Result: +OK: (F:7;O:0;H:0;M:3;L:1) - 7 security fixes ready to install found! +CVE-2016-8864 libdns-export100 (fixed, remotely exploitable, medium urgency) +CVE-2017-3135 libdns-export100 (fixed) +CVE-2017-5848 gstreamer1.0-plugins-bad (fixed, remotely exploitable, low urgency) +TEMP-0000000-1E5903 libgraphicsmagick-q16-3 (fixed) +CVE-2016-7444 libgnutls-deb0-28 (fixed, remotely exploitable, medium urgency) +CVE-2017-5334 libgnutls-deb0-28 (fixed) +CVE-2017-5027 chromium (fixed, remotely exploitable, medium urgency) +| 'fixed'=7;20;30;0;30 'obsolete'=0;1;1;0;1 'high-urgency'=0;1;1;0;1 'medium-urgency'=3;5;10;0;10 'low-urgency'=1;10;20;0;20 + + +The default thresholds of the check are relatively high, so if you want to check for all CVE's just set -f 1 -F 1 so every CVE popping up will force the check to CRITICAL. + + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/src/check_debsecan b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/src/check_debsecan new file mode 100755 index 0000000..25c56fe --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/src/check_debsecan @@ -0,0 +1,306 @@ +#!/bin/sh +# +# check_debsecan +# +# Check uses debsecan to query a list of vulnerabilies which affect a particular +# Debian installation. +# +# Copyright (c) 2017 Stefan Schörghofer +# +# This module is free software; you can redistribute it and/or modify it +# under the terms of GNU general public license (gpl) version 3. +# See the LICENSE file for details. + +# Functions +debug() { + if ${debug} ; then + echo "DEBUG: ${1}" + fi +} + +error() { + echo "ERROR: ${1}" + exit 3 +} + +print_help() { + #### The following line is 80 characters long (helps to fit the help text in a standard terminal) + ######-------------------------------------------------------------------------------- + + echo + echo "Usage: check_debsecan [OPTIONS]" + echo + echo "Arguments:" + echo " -f warning value for fixed packages | default = 20" + echo " -F critical value for fixed packages | default = 30" + echo " -o warning value for obsolete packages | default = 1" + echo " -O critical value for obsolete packages | default = 1" + echo " -l warning value for \"low urgency\" fixes | default = 10" + echo " -L critical value for \"low urgency\" fixes | default = 20" + echo " -m warning value for \"medium urgency\" fixes | default = 5" + echo " -M critical value for \"medium urgency\" fixes | default = 10" + echo " -u warning value for urgent \"high urgency\" fixes | default = 1" + echo " -U critical value for urgent \"high urgency\" fixes | default = 1" + echo " -s set the suite parameter manually" + echo " -P \"[proxy-url]\" set the proxy manually" + echo + echo "Options:" + echo " -d produces debugging output" + echo " -r disables the cve/packages report" + echo " -h print this help" + echo + + exit 3 +} + +argument_check() { + debug "Runnig argument check" + debug "fixed_warn is set to ${fixed_warn}, fixed_crit is set to ${fixed_crit}" + if [ ${fixed_warn} -gt ${fixed_crit} ] ; then + error "Value of -F needs to be bigger or equal than value of -f (Warning can't be bigger than critical)" + fi + debug "obsolete_warn is set to ${obsolete_warn}, obsolete_crit is set to ${obsolete_crit}" + if [ ${obsolete_warn} -gt ${obsolete_crit} ] ; then + error "Value of -O needs to be bigger or equal than value of -o (Warning can't be bigger than critical)" + fi + debug "low_urgency_warn is set to ${low_urgency_warn}, low_urgency_crit is set to ${low_urgency_crit}" + if [ ${low_urgency_warn} -gt ${low_urgency_crit} ] ; then + error "Value of -L needs to be bigger or equal than value of -l (Warning can't be bigger than critical)" + fi + debug "medium_urgency_warn is set to ${medium_urgency_warn}, medium_urgency_crit is set to ${medium_urgency_crit}" + if [ ${medium_urgency_warn} -gt ${medium_urgency_crit} ] ; then + error "Value of -M needs to be bigger or equal than value of -m (Warning can't be bigger than critical)" + fi + debug "high_urgency_warn is set to ${high_urgency_warn}, high_urgency_crit is set to ${high_urgency_crit}" + if [ ${high_urgency_warn} -gt ${high_urgency_crit} ] ; then + error "Value of -U needs to be bigger or equal than value of -u (Warning can't be bigger than critical)" + fi +} + +check_if_numeric() { + case $1 in + ''|*[!0-9]*) + debug "Argument ${1} is not numeric but has to be" + echo "ERROR: Argument ${1} has to be numeric" + print_help + exit 3 + ;; + *) + debug "Argument ${1} checked and is numeric" + ;; + esac +} + +print_perfdata() { + echo "| 'fixed'=${fixed_num};${fixed_warn};${fixed_crit};0;${fixed_crit} 'obsolete'=${obsolete_num};${obsolete_warn};${obsolete_crit};0;${obsolete_crit} 'high-urgency'=${high_urgency_num};${high_urgency_warn};${high_urgency_crit};0;${high_urgency_crit} 'medium-urgency'=${medium_urgency_num};${medium_urgency_warn};${medium_urgency_crit};0;${medium_urgency_crit} 'low-urgency'=${low_urgency_num};${low_urgency_warn};${low_urgency_crit};0;${low_urgency_crit}" +} + +print_numbers() { + echo -n "(F:${fixed_num};O:${obsolete_num};H:${high_urgency_num};M:${medium_urgency_num};L:${low_urgency_num})" +} + +print_report() { + if ${critical} || ${warning} ; then + if ${report} ; then + cat ${debsecan_report} + fi + fi +} + +cleanup() { + rm ${debsecan_report} +} + +myexit() { + if ${critical} ; then + cleanup + exit 2 + elif ${warning} ; then + cleanup + exit 1 + else + cleanup + exit 0 + fi +} + +# Checks to execute before wasting CPU-Cycles +# Checking for needed debsecan binary +if ! [ -x /usr/bin/debsecan ] ; then + echo "ERROR: debsecan not found" + exit 3 +fi + +# Vars +suite=$(grep "PRETTY_NAME" /etc/os-release | cut -d "(" -f 2 | cut -d ")" -f 1) +fixed_warn=20 +fixed_crit=30 +obsolete_warn=1 +obsolete_crit=1 +low_urgency_warn=10 +low_urgency_crit=20 +medium_urgency_warn=5 +medium_urgency_crit=10 +high_urgency_warn=1 +high_urgency_crit=1 +debug=false +report=true +critical=false +warning=false + +case ${suite} in + buzz|rex|bo|hamm|slink|potato) + echo "ERROR: The suite you are using is to old. Please upgrade to something newer, like Woody" + exit 3 + ;; + stretch) + debug "Stretch is not supported at the moment. Switching suite to sid." + suite="sid" + ;; +esac + +while getopts "dP:hf:F:o:O:l:L:m:M:u:U:s:r" opt; do + case ${opt} in + h) + print_help + ;; + d) + debug=true + debug "-d given, enabling debug" + ;; + f) + debug "Warning parameter for fixed triggered - setting to ${OPTARG}" + check_if_numeric ${OPTARG} + fixed_warn=${OPTARG} + ;; + F) + debug "Critical parameter for fixed triggered - setting to ${OPTARG}" + check_if_numeric ${OPTARG} + fixed_crit=${OPTARG} + ;; + o) + debug "Warning parameter for obsolete triggered - setting to ${OPTARG}" + check_if_numeric ${OPTARG} + obsolete_warn=${OPTARG} + ;; + O) + debug "Critical parameter for obsolete triggered - setting to ${OPTARG}" + check_if_numeric ${OPTARG} + obsolete_crit=${OPTARG} + ;; + l) + debug "Warning parameter for low urgency fixes triggered - setting to ${OPTARG}" + check_if_numeric ${OPTARG} + low_urgency_warn=${OPTARG} + ;; + L) + debug "Critical parameter for low urgency fixes triggered - setting to ${OPTARG}" + check_if_numeric ${OPTARG} + low_urgency_crit=${OPTARG} + ;; + m) + debug "Warning parameter for medium urgency fixes triggered - setting to ${OPTARG}" + check_if_numeric ${OPTARG} + medium_urgency_warn=${OPTARG} + ;; + M) + debug "Critical parameter for medium urgency fixes triggered - setting to ${OPTARG}" + check_if_numeric ${OPTARG} + medium_urgency_crit=${OPTARG} + ;; + u) + debug "Warning parameter for high urgency fixes triggered - setting to ${OPTARG}" + check_if_numeric ${OPTARG} + high_urgency_warn=${OPTARG} + ;; + U) + debug "Critical parameter for high urgency fixes triggered - setting to ${OPTARG}" + check_if_numeric ${OPTARG} + high_urgency_crit=${OPTARG} + ;; + r) + report=false + debug "-r given, disabling report" + ;; + s) + debug "Forcing suite to ${OPTARG} because parameter was given" + suite=${OPTARG} + ;; + P) + debug "Forcing proxy-setting to ${OPTARG}" + export http_proxy="${OPTARG}" + export https_proxy="${OPTARG}" + ;; + \?) + echo "ERROR: Invalid option ${OPTARG}" + exit 3 + ;; + :) + echo "ERROR: Option -${OPTARG} requires an argument." + exit 3 + ;; + esac +done +argument_check + +# Creating tempfile to store data +debsecan_report=$(mktemp) + +# Execute debsecan +debsecan --suite ${suite} --only-fixed >> ${debsecan_report} +# Checking results +if [ $? -ne 0 ] ; then + echo "ERROR: Problem executing debsecan. Check if your host is allowed to connect to the internet." + echo " If a proxy server should be used please export the http_proxy variable." + exit 3 +fi + +# Counting, printing and checking +fixed_num=$(grep -E '[(, ]fixed[), ]' ${debsecan_report} | wc -l) +obsolete_num=$(grep '[( ]obsolete[), ]' ${debsecan_report} | wc -l) +low_urgency_num=$(grep '[( ]low urgency[), ]' ${debsecan_report} | wc -l) +medium_urgency_num=$(grep '[( ]medium urgency[), ]' ${debsecan_report} | wc -l) +high_urgency_num=$(grep '[( ]high urgency[), ]' ${debsecan_report} | wc -l) + +# Check for criticals +if [ ${fixed_num} -ge ${fixed_crit} ] ; then + echo "CRITICAL: $(print_numbers) - ${fixed_num} security fixes ready to install found!" + critical=true +elif [ ${obsolete_num} -ge ${obsolete_crit} ] ; then + echo "CRITICAL: $(print_numbers) - ${obsolete_num} obsolete package(s) found!" + critical=true +elif [ ${high_urgency_num} -ge ${high_urgency_crit} ] ; then + echo "CRITICAL: $(print_numbers) - ${high_urgency_num} high urgency fixes ready to install found!" + critical=true +elif [ ${medium_urgency_num} -ge ${medium_urgency_crit} ] ; then + echo "CRITICAL: $(print_numbers) - ${medium_urgency_num} medium urgency fixes ready to install found!" + critical=true +elif [ ${low_urgency_num} -ge ${low_urgency_crit} ] ; then + echo "CRITICAL: $(print_numbers) - ${low_urgency_num} low urgency fixes ready to install found!" + critical=true + +# Check for warnings +elif [ ${fixed_num} -ge ${fixed_warn} ] ; then + echo "WARNING: $(print_numbers) - ${fixed_num} security fixes ready to install found!" + warning=true +elif [ ${obsolete_num} -ge ${obsolete_warn} ] ; then + echo "WARNING: $(print_numbers) - ${obsolete_num} obsolete package(s) found!" + warning=true +elif [ ${high_urgency_num} -ge ${high_urgency_warn} ] ; then + echo "WARNING: $(print_numbers) - ${high_urgency_num} high urgency fixes ready to install found!" + warning=true +elif [ ${medium_urgency_num} -ge ${medium_urgency_warn} ] ; then + echo "WARNING: $(print_numbers) - ${medium_urgency_num} medium urgency fixes ready to install found!" + warning=true +elif [ ${low_urgency_num} -ge ${low_urgency_warn} ] ; then + echo "WARNING: $(print_numbers) - ${low_urgency_num} low urgency fixes ready to install found!" + warning=true +else + # Everything OK + echo "OK: $(print_numbers) - There are ${fixed_num} security fixes to install and ${obsolete_num} obsolete packages to remove" +fi + +print_report +print_perfdata +myexit + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/tests b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/tests new file mode 100644 index 0000000..57e7020 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_debsecan/tests @@ -0,0 +1,2 @@ +Depends: debsecan +Test-Command: /usr/lib/nagios/plugins/check_debsecan -f 9998 -F 9999 -o 9998 -O 9999 -l 9998 -L 9999 -m 9998 -M 9999 -u 9998 -U 9999 -r diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/Makefile new file mode 100644 index 0000000..cf9673d --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/Makefile @@ -0,0 +1,3 @@ +#/usr/bin/make -f + +include ../common.mk diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/check_drbd b/nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/check_drbd new file mode 100644 index 0000000..aeda397 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/check_drbd @@ -0,0 +1,456 @@ +#!/usr/bin/perl -w + +#################################################### +# check_drbd v0.5.3 # +# by Brandon Lee Poyner bpoyner / CCAC.edu # +#################################################### + +use strict; +use File::Basename; +use Getopt::Long; + +my $drbd_proc='/proc/drbd'; +my $drbd_devices=0; +my ($drbd_expect, $drbd_role, $drbd_version, $debug_mode); +my (%options, %cs, %st, %ld, %ds, %check, %warning, %critical); + +my $prog_name=basename($0); +my $prog_revision='0.5.3'; + +my %errorcodes = ( + 'OK' => { 'retvalue' => 0 }, + 'WARNING' => { 'retvalue' => 1 }, + 'CRITICAL' => { 'retvalue' => 2 }, + 'UNKNOWN' => { 'retvalue' => 3 } +); + +# +# Define various states and default alarm values +# +my %state = ( + 'Primary' => { 'value' => 'OK', 'type' => 'st' }, + 'Secondary' => { 'value' => 'OK', 'type' => 'st' }, + 'Unknown' => { 'value' => 'CRITICAL', 'type' => 'st' }, + 'StandAlone' => { 'value' => 'WARNING', 'type' => 'cs' }, + 'Unconnected' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'Timeout' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'BrokenPipe' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'WFConnection' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'WFReportParams' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'Connected' => { 'value' => 'OK', 'type' => 'cs' }, + 'Unconfigured' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + # DRBD 0.6 + 'SyncingAll' => { 'value' => 'WARNING', 'type' => 'cs' }, + 'SyncingQuick' => { 'value' => 'WARNING', 'type' => 'cs' }, + 'SyncPaused' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + # DRBD 0.7 + 'WFBitMapS' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'WFBitMapT' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'SyncSource' => { 'value' => 'WARNING', 'type' => 'cs' }, + 'SyncTarget' => { 'value' => 'WARNING', 'type' => 'cs' }, + 'PausedSyncS' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'PausedSyncT' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'NetworkFailure' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'SkippedSyncS' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'SkippedSyncT' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'Consistent' => { 'value' => 'OK', 'type' => 'ld' }, + 'Inconsistent' => { 'value' => 'CRITICAL', 'type' => 'ld' }, + # DRBD 8.0 + 'UpToDate' => { 'value' => 'OK', 'type' => 'ds' }, + 'Consistent' => { 'value' => 'OK', 'type' => 'ds' }, + 'Negotiating' => { 'value' => 'WARNING', 'type' => 'ds' }, + 'Attaching' => { 'value' => 'WARNING', 'type' => 'ds' }, + 'Diskless' => { 'value' => 'CRITICAL', 'type' => 'ds' }, + 'Failed' => { 'value' => 'CRITICAL', 'type' => 'ds' }, + 'Outdated' => { 'value' => 'CRITICAL', 'type' => 'ds' }, + 'Inconsistent' => { 'value' => 'CRITICAL', 'type' => 'ds' }, + 'DUnknown' => { 'value' => 'CRITICAL', 'type' => 'ds' }, + # DRBD 8.2 + 'VerifyS' => { 'value' => 'WARNING', 'type' => 'cs' }, + 'VerifyT' => { 'value' => 'WARNING', 'type' => 'cs' }, + # DRBD 8.3 + 'Disconnecting' => { 'value' => 'WARNING', 'type' => 'cs' }, + 'ProtocolError' => { 'value' => 'CRITICAL', 'type' => 'cs' }, + 'TearDown' => { 'value' => 'WARNING', 'type' => 'cs' }, + 'StartingSyncS' => { 'value' => 'WARNING', 'type' => 'cs' }, + 'StartingSyncT' => { 'value' => 'WARNING', 'type' => 'cs' }, + 'WFSyncUUID' => { 'value' => 'WARNING', 'type' => 'cs' } +); + +&parse_options; +&parse_proc; +&parse_drbd_devices; +&check_drbd_state; +&report_status; +&myexit('UNKNOWN',"$prog_name should never reach here"); + +sub print_usage { + print <] [-e expect] [-p proc] [-r role] [-o states] [-w states] [-c states] [--debug] + Options: + -d STRING [default: $drbd_devices. Example: 0,1,2 ] + -p STRING [default: $drbd_proc. Use '-' for stdin] + -e STRING [Must be this connected state. Example: Connected] + -r STRING [Must be this node state. Example: Primary] + -o STRING [Change value to OK. Example: StandAlone] + -w STRING [Change value to WARNING. Example: SyncingAll] + -c STRING [Change value to CRITICAL. Example: Inconsistent,WFConnection] +EOF +} + +sub print_revision { + print <{'retvalue'}; +} + +sub parse_options { + my ($help, $version, $debug, $ok_string, $warning_string, + $critical_string); + # + # Get command line options + # + GetOptions("h|help" => \$help, + "V|version" => \$version, + "d|device|devices=s" => \$drbd_devices, + "e|expect=s" => \$drbd_expect, + "p|proc=s" => \$drbd_proc, + "r|role=s" => \$drbd_role, + "o|ok=s" => \$ok_string, + "w|warning=s" => \$warning_string, + "c|critical=s" => \$critical_string, + "debug" => \$debug); + if (defined($help) && ($help ne "")) { + &print_help; + exit $errorcodes{'UNKNOWN'}->{'retvalue'}; + } + if (defined($version) && ($version ne "")) { + &print_revision; + exit $errorcodes{'UNKNOWN'}->{'retvalue'}; + } + if (defined($drbd_expect) && ($drbd_expect ne "")) { + # User requested the connected state to be very specific + &change_values($drbd_expect,'cs','expect','connected state'); + } + if (defined($drbd_role) && ($drbd_role ne "")) { + # User requested the node state to be very specific + &change_values($drbd_role,'st','role','node state'); + } + if (defined($ok_string) && ($ok_string ne "")) { + # User requested certain values to be OK + &set_values($ok_string,'OK'); + } + if (defined($warning_string) && ($warning_string ne "")) { + # User requested certain values to be WARNING + &set_values($warning_string,'WARNING'); + } + if (defined($critical_string) && ($critical_string ne "")) { + # User requested certain values to be CRITICAL + &set_values($critical_string,'CRITICAL'); + } + if (defined($debug) && ($debug ne "")) { + # + # Debugging information + # + $debug_mode=1; + print STDERR "<$prog_name settings>\n"; + print STDERR "DRBD Devices: $drbd_devices\n"; + printf STDERR "DRBD Proc: %s\n", defined($drbd_proc)?$drbd_proc:""; + printf STDERR "DRBD Expect: %s\n", defined($drbd_expect)?$drbd_expect:""; + printf STDERR "DRBD Role: %s\n", defined($drbd_role)?$drbd_role:""; + my (@ok, @critical, @warning); + for my $key ( keys %state ) { + if ($state{$key}->{'value'} eq 'OK') { + push(@ok,$key); + } + if ($state{$key}->{'value'} eq 'WARNING') { + push(@warning,$key); + } + if ($state{$key}->{'value'} eq 'CRITICAL') { + push(@critical,$key); + } + } + printf STDERR "DRBD OK: %s\n", join(" ",sort(@ok)); + printf STDERR "DRBD WARNING: %s\n", join(" ",sort(@warning)); + printf STDERR "DRBD CRITICAL: %s\n", join(" ",sort(@critical)); + print STDERR "\n"; + } +} + +sub parse_proc { + # + # Read in contents of proc file, feed results into hashes + # + my $input; + if ( $drbd_proc ne "-" ) { + $input = "DRBD"; + if ( ! -e $drbd_proc ) { + &myexit('UNKNOWN',"No such file $drbd_proc"); + } + open(DRBD, "$drbd_proc") || + &myexit('UNKNOWN',"Could not open $drbd_proc"); + } else { + $input = "STDIN"; + } + while(<$input>) { + if (/^version: (\d+).(\d+)/) { + $drbd_version = "$1.$2"; + } + if (/^\s?(\d+):.* cs:(\w+)/) { + $cs{$1} = $2; + } + if (/^\s?(\d+):.* st:(\w+)\//) { + $st{$1} = $2; + } + if (/^\s?(\d+):.* ld:(\w+)/) { + $ld{$1} = $2; + } + if (/^\s?(\d+):.* ds:(\w+)/) { + $ds{$1} = $2; + } + } + if ( $drbd_proc ne "-" ) { + close(DRBD); + } + if (defined($debug_mode) && ($debug_mode == 1)) { + # + # Debugging information + # + print STDERR "<$prog_name devices found>\n"; + for my $key ( sort keys %cs ) { + printf STDERR "Found Device $key $cs{$key}%s%s%s\n", defined($st{$key})?" $st{$key}":"", defined($ld{$key})?" $ld{$key}":"", defined($ds{$key})?" $ds{$key}":""; + } + print STDERR "\n"; + } +} + +sub parse_drbd_devices { + # + # Determine which DRBD devices to monitor + # + my @devices; + if ($drbd_devices =~ /^all$/i) { + for my $device ( keys %cs ) { + push(@devices,$device); + } + } elsif ($drbd_devices =~ /^configured$/i) { + for my $device ( keys %cs ) { + next if ($cs{$device} eq "Unconfigured"); + push(@devices,$device); + } + } else { + @devices = split(/,/,$drbd_devices); + } + foreach my $device (@devices) { + if (!(defined($cs{$device}))) { + &myexit('UNKNOWN',"Could not find device $device"); + } + $check{$device} = 1; + } + if (int(keys %check) == 0) { + &myexit('UNKNOWN',"No configured devices found"); + } + if (defined($debug_mode) && ($debug_mode == 1)) { + # + # Debugging information + # + print STDERR "<$prog_name devices to check>\n"; + for my $key ( sort keys %check ) { + printf STDERR "Checking enabled for device $key\n"; + } + print STDERR "\n"; + } +} + +sub check_drbd_state { + for my $drbd_device ( sort keys %check ) { + if ((defined($drbd_version)) && ($drbd_version >= '8.0')) { + # + # We're dealing with version 8.0 or greater + # Set data state + # + if ((defined($ds{$drbd_device})) && + (defined($state{$ds{$drbd_device}}))) { + $state{$ds{$drbd_device}}->{$drbd_device}->{'level'} = 1; + } elsif (defined($ds{$drbd_device})) { + &myexit('CRITICAL',"Data state unknown value '$ds{$drbd_device}' for device $drbd_device"); + } + } + if ((defined($drbd_version)) && ($drbd_version == '0.7')) { + # + # We're dealing with version 0.7 + # Set local data consistency + # + if ((defined($ld{$drbd_device})) && + (defined($state{$ld{$drbd_device}}))) { + $state{$ld{$drbd_device}}->{$drbd_device}->{'level'} = 1; + } elsif (defined($ld{$drbd_device})) { + &myexit('CRITICAL',"Local data consistency unknown value '$ld{$drbd_device}' for device $drbd_device"); + } + } + # + # Check for a state value (Primary, Secondary, etc) + # + if ((defined($st{$drbd_device})) && + (defined($state{$st{$drbd_device}}))) { + $state{$st{$drbd_device}}->{$drbd_device}->{'level'} = 1; + } elsif (defined($st{$drbd_device})) { + &myexit('CRITICAL',"Node state unknown value '$st{$drbd_device}' for device $drbd_device"); + } + # + # Check for a connected state value (Connected, StandAlone, etc) + # + if (defined($state{$cs{$drbd_device}})) { + $state{$cs{$drbd_device}}->{$drbd_device}->{'level'} = 1; + } else { + &myexit('CRITICAL',"Connection state unknown value '$cs{$drbd_device}' for device $drbd_device"); + } + # + # Debugging information + # + if (defined($debug_mode) && ($debug_mode == 1)) { + print STDERR "<$prog_name device $drbd_device status>\n"; + for my $key ( keys %state ) { + if (defined($state{$key}->{$drbd_device}->{'level'})) { + print STDERR "$key $state{$key}->{'value'}\n"; + } + } + print STDERR "\n"; + } + # + # Determine if any values are CRITICAL or WARNING + # + for my $key ( keys %state ) { + if (defined($state{$key}->{$drbd_device}->{'level'})) { + if ($state{$key}->{'value'} eq "CRITICAL") { + $critical{$drbd_device} = 1; + } + if ($state{$key}->{'value'} eq "WARNING") { + $warning{$drbd_device} = 1; + } + } + } + } +} + +sub report_status { + my $message; + my $critical_count=int(keys %critical); + my $warning_count=int(keys %warning); + if ($critical_count > 0) { + # + # We found a CRITICAL situation + # + my $i = 0; + for my $device (sort keys %critical) { + $message.=sprintf("Device %d%s $cs{$device}%s%s", $device,defined($st{$device})?" $st{$device}":"",defined($ld{$device})?" $ld{$device}":"",defined($ds{$device})?" $ds{$device}":""); + $i++; + if ($i != $critical_count) { + $message.=", "; + } + } + &myexit('CRITICAL',$message); + } elsif ($warning_count > 0) { + # + # We found a WARNING situation + # + my $i = 0; + for my $device (sort keys %warning) { + $message.=sprintf("Device %d%s $cs{$device}%s%s", $device,defined($st{$device})?" $st{$device}":"",defined($ld{$device})?" $ld{$device}":"",defined($ds{$device})?" $ds{$device}":""); + $i++; + if ($i != $warning_count) { + $message.=", "; + } + } + &myexit('WARNING',$message); + } else { + # + # Everything checks out OK + # + my $device_count=int(keys %check); + if ($device_count == 1) { + for my $device ( sort keys %check ) { + $message=sprintf("Device %d%s $cs{$device}%s%s", $device,defined($st{$device})?" $st{$device}":"",defined($ld{$device})?" $ld{$device}":"",defined($ds{$device})?" $ds{$device}":""); + } + } else { + my $i = 0; + for my $device ( sort keys %check ) { + $message.=sprintf("Dev %d %0.3s%0.3s%0.3s%0.3s", $device,defined($st{$device})?"$st{$device}":"",$cs{$device},defined($ld{$device})?"$ld{$device}":"",defined($ds{$device})?"$ds{$device}":""); + $i++; + if ($i != $device_count) { + $message.=", "; + } + } + } + &myexit('OK',$message); + } +} + +sub set_values { + # + # Set item to value requested + # + my ($items,$value) = @_; + my @items = split(/,/,$items); + foreach my $item (@items) { + if (defined($state{$item})) { + $state{$item}->{'value'} = "$value"; + } else { + print STDERR "State '$item' not found\n"; + } + } +} + +sub change_values { + # + # Look for all values of a given type, set requested value to OK + # and all other values to CRITICAL + # + my ($argument,$type,$error1,$error2) = @_; + if ((defined($state{$argument})) && + ($state{$argument}->{'type'} eq "$type")) { + for my $key ( keys %state ) { + if ($state{$key}->{'type'} eq "$type") { + if ($key eq $argument) { + &set_values($argument,'OK'); + } else { + &set_values($key,'CRITICAL'); + } + } + } + } else { + &myexit('UNKNOWN',"$error1 option only works for $error2"); + } +} + +sub myexit { + # + # Print error message and exit + # + my ($error, $message) = @_; + if (!(defined($errorcodes{$error}))) { + printf STDERR "Error code $error not known\n"; + print "DRBD UNKNOWN: $message\n"; + exit $errorcodes{'UNKNOWN'}->{'retvalue'}; + } + print "DRBD $error: $message\n"; + exit $errorcodes{$error}->{'retvalue'}; +} diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/control new file mode 100644 index 0000000..89f93c1 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/control @@ -0,0 +1,7 @@ +Homepage: https://exchange.icinga.org/oldmonex/512-check_drbd/ +Watch: https://exchange.icinga.org/oldmonex/512-check_drbd/check_drbd prog_revision='([0-9.]+)'; +Uploaders: Jan Wagner +Description: plugin to check DRBD device states + This plugin is for checking DRBD device states. It parses the + /proc/drbd device and analyses the output. +Version: 0.5.3 diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/copyright new file mode 100644 index 0000000..6e32738 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_drbd/copyright @@ -0,0 +1,7 @@ +Copyright (C) Brandon Lee Poyner + +The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute +copies of the plugins under the terms of the GNU General Public License. + +On Debian systems, the complete text of the GNU General +Public License version 1 can be found in "/usr/share/common-licenses/GPL-1". diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/Makefile new file mode 100644 index 0000000..54fe593 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/Makefile @@ -0,0 +1,14 @@ +#/usr/bin/make -f + +PLUGIN = $(wildcard src/check_*) $(wildcard src/imap_ssl_*) +MANPAGES = $(shell find src/docs -regex '[^ ]*.pod' -printf '%f\n' | sed 's,pod$$,7,') +DOCFILES = src/docs/*.html src/docs/*.txt src/README.txt +CLEANFILES = $(MANPAGES) + +include ../common.mk + + +%.7: src/docs/%.pod + pod2man -s 7 $< > $@ + + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/CHANGES.txt b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/CHANGES.txt new file mode 100644 index 0000000..05626d6 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/CHANGES.txt @@ -0,0 +1,15 @@ +2005-11-10 +* published +2005-05-10 +* received patches from Johan Nilsson +2006-07-20 +* received patches from Geoff Crompton +2007-04-24 +* packaged ePN version of the plugins -- the __END__ block for embedded documentation was causing an error because of the way ePN wraps the perl scripts. see http://nagios.sourceforge.net/docs/2_0/embeddedperl.html +* added SSL support using patch from Benjamin Ritcey +2007-10-21 +* added TLS support for SMTP using Net::SMTP::TLS +* added SSL support for SMTP using Net::SMTP::SSL, but NOTE that I don't have access to an SMTPS server so I cannot test this. +2007-12-04 +* small fix with SSL support for IMAP related to bugfix in Mail::IMAPClient 3.00 over 2.2.9 thanks to Seth P. Low +* added --usage option to all three plugins for familiarity with the official nagios plugins diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/LICENSE.txt b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/LICENSE.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/README.txt b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/README.txt new file mode 100644 index 0000000..6367b93 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/README.txt @@ -0,0 +1,77 @@ +This file was updated on Sun Oct 21 21:32:12 PDT 2007. + +Developer guidelines: +http://nagiosplug.sourceforge.net/developer-guidelines.html + +Nagios Plugins: +http://nagiosplugins.org/ + Nagios: http://nagios.org and http://nagiosplug.sourceforge.net + +Perl library: http://search.cpan.org/dist/Nagios-Plugin/lib/Nagios/Plugin.pm + +The email delivery plugin I wrote uses two other plugins +(smtp send and imap receive), also included, to send a message +to an email account and then check that account for the message +and delete it. The plugin times how long it takes for the +message to be delivered and the warning and critical thresholds +are for this elapsed time. + +A few notes: + +1. I tried to use the check_smtp plugin for sending mail. I +can do it on the command line but I can't get the newlines to +happen from the nagios config file (\n doesn't seem to work so smtp +server waits for the '.' but doesn't get it like it does when I +use single quote and newlines from the command line). So if +you know how to get the check_smtp plugin to send a message from +the nagios config, that one could be used instead of the +check_smtp_send plugin included here (and please let me know) + + +2. I looked at check_mail.pl by bledi51 and its pretty good, +and also conforms better to nagios perl plugin guidelnes than +mine does. So I'm going to be revising my plugins to conform +more. + + + + + + +Finally, usage example from my own nagios config: + +define command{ + command_name check_email_delivery + command_line $USER1$/check_email_delivery -H $HOSTADDRESS$ --mailfrom $ARG3$ --mailto $ARG4$ --username $ARG5$ --password $ARG6$ --libexec $USER1$ -w $ARG1$ -c $ARG2$ + } + +define service{ + use generic-service + host_name mail.your.net + service_description EMAIL DELIVERY + check_command check_email_delivery!5!120!sender@your.net!recipient@your.net!recipient@your.net!password + } + + +A new usage example equivalent to the old one but using the new --plugins and --token options: + +define command{ + command_name check_email_delivery + command_line $USER1$/check_email_delivery -p '$USER1$/check_smtp_send -H $HOSTADDRESS$ --mailfrom $ARG3$ --mailto $ARG4$ -U $ARG5$ -P $ARG6$ --subject "Nagios %TOKEN1%" -w $ARG1$ -c $ARG2$' -p '$USER1$/check_imap_receive -H $HOSTADDRESS$ -U $ARG5$ -P $ARG6$ -s SUBJECT -s "Nagios %TOKEN1%" -w $ARG1$ -c $ARG2$' -w $ARG1$,$ARG1$ -c $ARG2$,$ARG2$ + } + +define service{ + use generic-service + host_name mail.your.net + service_description EMAIL DELIVERY + check_command check_email_delivery!5!120!sender@your.net!recipient@your.net!recipient@your.net!password + } + + +References to similar plugins: + +pop3(s) email matching plugin by kkvenkit +check_mail.pl by bledi51 +check_email_loop.pl by ryanwilliams +check_pop.pl and check_imap.pl by http://www.jhweiss.de/software/nagios.html + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_email_delivery b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_email_delivery new file mode 100644 index 0000000..689d619 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_email_delivery @@ -0,0 +1,970 @@ +#!/usr/bin/perl +use strict; +my $VERSION = '0.7.1'; +my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +my $LICENSE = 'http://www.gnu.org/licenses/gpl.txt'; +my %status = ( 'OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3 ); + +# look for required modules +exit $status{UNKNOWN} unless load_modules(qw/Getopt::Long/); + +BEGIN { + if( grep { /^--hires$/ } @ARGV ) { + eval "use Time::HiRes qw(time);"; + warn "Time::HiRes not installed\n" if $@; + } +} + +# get options from command line +Getopt::Long::Configure("bundling"); +my $verbose = 0; +my $help = ""; +my $help_usage = ""; +my $show_version = ""; +my $host = ""; +my $smtp_server = ""; +my $smtp_port = ""; +my $imap_server = ""; +my $smtp_username = ""; +my $smtp_password = ""; +my $smtp_tls = ""; +my $imap_port = ""; +my $imap_username = ""; +my $imap_password = ""; +my $imap_mailbox = ""; +my $username = ""; +my $password = ""; +my $ssl = ""; +my $imap_ssl = ""; +my $mailto = ""; +my $mailfrom = ""; +my @header = (); +my $body = ""; +my $warnstr = ""; +my $critstr = ""; +my $waitstr = ""; +my $delay_warn = 95; +my $delay_crit = 300; +my $smtp_warn = 15; +my $smtp_crit = 30; +my $imap_warn = 15; +my $imap_crit = 30; +my $timeout = ""; +my @alert_plugins = (); +my $imap_interval = 5; +my $imap_retries = 5; +my @plugins = (); +my @token_formats = (); +my $tokenfile = ""; +my $default_crit = 30; +my $default_warn = 15; +my $default_wait = 5; +my $default_timeout = 60; +my $time_hires = ""; +my $libexec = "/usr/local/nagios/libexec"; +my $ok; +$ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, + "v|verbose+"=>\$verbose,"h|help"=>\$help,"usage"=>\$help_usage, + "w|warning=s"=>\$warnstr,"c|critical=s"=>\$critstr, "t|timeout=s"=>\$timeout, + "libexec=s"=>\$libexec, + # plugin settings + "p|plugin=s"=>\@plugins, "T|token=s"=>\@token_formats, + "A|alert=i"=>\@alert_plugins, + "F|file=s"=>\$tokenfile, + # common settings + "H|hostname=s"=>\$host, + "U|username=s"=>\$username,"P|password=s"=>\$password, + "ssl!"=>\$ssl, + # smtp settings + "smtp-server=s"=>\$smtp_server,"smtp-port=i"=>\$smtp_port, + "mailto=s"=>\$mailto, "mailfrom=s",\$mailfrom, + "header=s"=>\@header, "body=s"=>\$body, + # smtp-tls settings + "smtptls!"=>\$smtp_tls, + "smtp-username=s"=>\$smtp_username,"smtp-password=s"=>\$smtp_password, + # delay settings + "wait=s"=>\$waitstr, + # imap settings + "imap-server=s"=>\$imap_server,"imap-port=i"=>\$imap_port, + "imap-username=s"=>\$imap_username,"imap-password=s"=>\$imap_password, + "imap-mailbox=s"=>\$imap_mailbox, + "imap-check-interval=i"=>\$imap_interval,"imap-retries=i"=>\$imap_retries, + "imapssl!"=>\$imap_ssl, + # Time + "hires"=>\$time_hires, + ); + +if( $show_version ) { + print "$VERSION\n"; + if( $verbose ) { + print "Warning threshold: $delay_warn seconds\n"; + print "Critical threshold: $delay_crit seconds\n"; + print "Default wait: $default_wait seconds\n"; + print "Default timeout: $default_timeout seconds\n"; + } + exit $status{UNKNOWN}; +} + +if( $help ) { + exec "perldoc", $0 or print "Try `perldoc $0`\n"; + exit $status{UNKNOWN}; +} + +if( $host ) { + $smtp_server = $host if $smtp_server eq ""; + $imap_server = $host if $imap_server eq ""; +} + +if( $username ) { + $smtp_username = $username if $smtp_username eq ""; + $imap_username = $username if $imap_username eq ""; +} + +if( $password ) { + $smtp_password = $password if $smtp_password eq ""; + $imap_password = $password if $imap_password eq ""; +} + +if( $ssl ) { + $imap_ssl = $ssl if $imap_ssl eq ""; + $smtp_tls = $ssl if $smtp_tls eq ""; +} + +if( $help_usage + || + ( + scalar(@plugins) == 0 + && + ( + $smtp_server eq "" || $mailto eq "" || $mailfrom eq "" + || $imap_server eq "" || $username eq "" || $password eq "" + ) + ) + ) { + print "Usage 1: $0 -H host \n\t". + "--mailto recipient\@your.net --mailfrom sender\@your.net --body 'message' \n\t". + "--username username --password password \n\t". + "[-w ] [-c ]\n\t" . + "[--imap-check-interval ] [--imap-retries ]\n"; + print "Usage 2: $0 \n\t". + "-p 'first plugin command with %TOKEN1% embedded' \n\t". + "-p 'second plugin command with %TOKEN1% embedded' \n\t". + "[-w ,] [-c ,] \n"; + exit $status{UNKNOWN}; +} + +# determine thresholds +my @warning_times = split(",", $warnstr); +my @critical_times = split(",", $critstr); +my @alarm_times = split(",", $timeout); +my @wait_times = split(",", $waitstr); +my ($dw,$sw,$rw) = split(",", $warnstr); +my ($dc,$sc,$rc) = split(",", $critstr); +my ($wait) = split(",", $waitstr); +$delay_warn = $dw if defined $dw and $dw ne ""; +$smtp_warn = $sw if defined $sw and $sw ne ""; +$imap_warn = $rw if defined $rw and $rw ne ""; +$delay_crit = $dc if defined $dc and $dc ne ""; +$smtp_crit = $sc if defined $sc and $sc ne ""; +$imap_crit = $rc if defined $rc and $rc ne ""; +my $smtp_thresholds = ""; +$smtp_thresholds .= "-w $smtp_warn " if defined $smtp_warn and $smtp_warn ne ""; +$smtp_thresholds .= "-c $smtp_crit " if defined $smtp_crit and $smtp_crit ne ""; +my $imap_thresholds = ""; +$imap_thresholds .= "-w $imap_warn " if defined $imap_warn and $imap_warn ne ""; +$imap_thresholds .= "-c $imap_crit " if defined $imap_crit and $imap_crit ne ""; +$imap_thresholds .= "--imap-check-interval $imap_interval " if defined $imap_interval and $imap_interval ne ""; +$imap_thresholds .= "--imap-retries $imap_retries " if defined $imap_retries and $imap_retries ne ""; +if( scalar(@alarm_times) == 1 ) { + $default_timeout = shift(@alarm_times); +} + +# determine which other options to include +my $smtp_options = ""; +$smtp_options .= "-H $smtp_server " if defined $smtp_server and $smtp_server ne ""; +$smtp_options .= "-p $smtp_port " if defined $smtp_port and $smtp_port ne ""; +$smtp_options .= "--tls " if defined $smtp_tls and $smtp_tls; +$smtp_options .= "-U ".shellquote($smtp_username)." " if defined $smtp_username and $smtp_username ne ""; +$smtp_options .= "-P ".shellquote($smtp_password)." " if defined $smtp_password and $smtp_password ne ""; +$smtp_options .= "--mailto ".shellquote($mailto)." " if defined $mailto and $mailto ne ""; +$smtp_options .= "--mailfrom ".shellquote($mailfrom)." " if defined $mailfrom and $mailfrom ne ""; +foreach my $h( @header ) { + $smtp_options .= "--header ".shellquote($h)." "; +} +my $imap_options = ""; +$imap_options .= "-H $imap_server " if defined $imap_server and $imap_server ne ""; +$imap_options .= "-p $imap_port " if defined $imap_port and $imap_port ne ""; +$imap_options .= "-U ".shellquote($imap_username)." " if defined $imap_username and $imap_username ne ""; +$imap_options .= "-P ".shellquote($imap_password)." " if defined $imap_password and $imap_password ne ""; +$imap_options .= "--mailbox ".shellquote($imap_mailbox)." " if defined $imap_mailbox and $imap_mailbox ne ""; +$imap_options .= "--ssl " if defined $imap_ssl and $imap_ssl; + + +# create the report object +my $report = new PluginReport; +my @report_plugins = (); # populated later with either (smtp,imap) or (plugin1,plugin2,...) +my $time_start; # initialized later with time the work actually starts + +# create token formats for use with the plugins +my @alpha = qw/a b c d e f g h i j k l m n o p q r s t u v w x y z/; +my @numeric = qw/0 1 2 3 4 5 6 7 8 9/; +my @hex = qw/0 1 2 3 4 5 6 7 8 9 a b c d e f/; +my @pgp_even = qw/aardvark absurd accrue acme adrift adult afflict ahead aimless Algol allow alone ammo ancient apple artist assume Athens atlas Aztec baboon backfield backward banjo beaming bedlamp beehive beeswax befriend Belfast berserk billiard bison blackjack blockade blowtorch bluebird bombast bookshelf brackish breadline breakup brickyard briefcase Burbank button buzzard cement chairlift chatter checkup chisel choking chopper Christmas clamshell classic classroom cleanup clockwork cobra commence concert cowbell crackdown cranky crowfoot crucial crumpled crusade cubic dashboard deadbolt deckhand dogsled dragnet drainage dreadful drifter dropper drumbeat drunken Dupont dwelling eating edict egghead eightball endorse endow enlist erase escape exceed eyeglass eyetooth facial fallout flagpole flatfoot flytrap fracture framework freedom frighten gazelle Geiger glitter glucose goggles goldfish gremlin guidance hamlet highchair hockey indoors indulge inverse involve island jawbone keyboard kickoff kiwi klaxon locale lockup merit minnow miser Mohawk mural music necklace Neptune newborn nightbird Oakland obtuse offload optic orca payday peachy pheasant physique playhouse Pluto preclude prefer preshrunk printer prowler pupil puppy python quadrant quiver quota ragtime ratchet rebirth reform regain reindeer rematch repay retouch revenge reward rhythm ribcage ringbolt robust rocker ruffled sailboat sawdust scallion scenic scorecard Scotland seabird select sentence shadow shamrock showgirl skullcap skydive slingshot slowdown snapline snapshot snowcap snowslide solo southward soybean spaniel spearhead spellbind spheroid spigot spindle spyglass stagehand stagnate stairway standard stapler steamship sterling stockman stopwatch stormy sugar surmount suspense sweatband swelter tactics talon tapeworm tempest tiger tissue tonic topmost tracker transit trauma treadmill Trojan trouble tumor tunnel tycoon uncut unearth unwind uproot upset upshot vapor village virus Vulcan waffle wallet watchword wayside willow woodlark Zulu/; +my @pgp_odd = qw/adroitness adviser aftermath aggregate alkali almighty amulet amusement antenna applicant Apollo armistice article asteroid Atlantic atmosphere autopsy Babylon backwater barbecue belowground bifocals bodyguard bookseller borderline bottomless Bradbury bravado Brazilian breakaway Burlington businessman butterfat Camelot candidate cannonball Capricorn caravan caretaker celebrate cellulose certify chambermaid Cherokee Chicago clergyman coherence combustion commando company component concurrent confidence conformist congregate consensus consulting corporate corrosion councilman crossover crucifix cumbersome customer Dakota decadence December decimal designing detector detergent determine dictator dinosaur direction disable disbelief disruptive distortion document embezzle enchanting enrollment enterprise equation equipment escapade Eskimo everyday examine existence exodus fascinate filament finicky forever fortitude frequency gadgetry Galveston getaway glossary gossamer graduate gravity guitarist hamburger Hamilton handiwork hazardous headwaters hemisphere hesitate hideaway holiness hurricane hydraulic impartial impetus inception indigo inertia infancy inferno informant insincere insurgent integrate intention inventive Istanbul Jamaica Jupiter leprosy letterhead liberty maritime matchmaker maverick Medusa megaton microscope microwave midsummer millionaire miracle misnomer molasses molecule Montana monument mosquito narrative nebula newsletter Norwegian October Ohio onlooker opulent Orlando outfielder Pacific pandemic Pandora paperweight paragon paragraph paramount passenger pedigree Pegasus penetrate perceptive performance pharmacy phonetic photograph pioneer pocketful politeness positive potato processor provincial proximate puberty publisher pyramid quantity racketeer rebellion recipe recover repellent replica reproduce resistor responsive retraction retrieval retrospect revenue revival revolver sandalwood sardonic Saturday savagery scavenger sensation sociable souvenir specialist speculate stethoscope stupendous supportive surrender suspicious sympathy tambourine telephone therapist tobacco tolerance tomorrow torpedo tradition travesty trombonist truncated typewriter ultimate undaunted underfoot unicorn unify universe unravel upcoming vacancy vagabond vertigo Virginia visitor vocalist voyager warranty Waterloo whimsical Wichita Wilmington Wyoming yesteryear Yucatan/; +my %formats = ( + 'a' => sub { pick_random(@alpha) }, + 'n' => sub { pick_random(@numeric) }, + 'c' => sub { pick_random(@alpha,@numeric) }, + 'h' => sub { pick_random(@hex) }, + 'U' => sub { time }, + 'X' => sub { pick_random(@pgp_even) }, + 'Y' => sub { pick_random(@pgp_odd) }, +); +if( scalar(@plugins) ) { + # scan the plugin commands for use of tokens to count how many we need + my $token_count = 0; + foreach my $p (@plugins) { + my @matches = sort ($p =~ m/%TOKEN(\d+)%/g); + my $max = pop @matches; + $token_count = $max if defined($max) && $max > $token_count; + } + # create the tokens + my @tokens = (); + foreach my $t (1..$token_count) { + my $format = shift @token_formats; + $format = "U-X-Y" unless $format; + my @format_characters = split(//, $format); + my $token = ""; + foreach my $c (@format_characters) { + if( defined $formats{$c} ) { + $token .= &{$formats{$c}}; + } + else { + $token .= $c; + } + } + push @tokens, $token; + } + # substitute the tokens into each plugin command + foreach my $p (@plugins) { + foreach my $t (1..$token_count) { + my $token = $tokens[$t-1]; + $p =~ s/%TOKEN$t%/$token/g; + } + } + # mark plugins that are allowed to generate alerts. default behavior is to alert for all plugins. + my %alert_plugins = (); + if( scalar(@alert_plugins) > 0 ) { + %alert_plugins = map { $_ => 1 } @alert_plugins; + } + else { + %alert_plugins = map { $_ => 1 } (1..scalar(@plugins)); + } + # run each plugin and store its output in a report + $time_start = time; + my $i = 0; + foreach my $p( @plugins ) { + $i++; + my $plugin_timeout = shift(@alarm_times) || $default_timeout; + # run the plugin + eval { + local $SIG{ALRM} = sub { die "exceeded timeout $plugin_timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm` + alarm $plugin_timeout; + my $output = `$p`; + chomp $output; + if( $output !~ m/OK|WARNING|CRITICAL/ ) { + print "EMAIL DELIVERY UNKNOWN - plugin $i error: $output\n"; + print "Plugin $i: $p\n" if $verbose; + # record tokens in a file if option is enabled + record_tokens($tokenfile,\@tokens,$time_start,undef,'UNKNOWN',$i,$output) if $tokenfile; + exit $status{UNKNOWN}; + } + if( $output =~ m/CRITICAL/ && $alert_plugins{$i} ) { + print "EMAIL DELIVERY CRITICAL - plugin $i failed: $output\n"; + print "Plugin $i: $p" if $verbose; + # record tokens in a file if option is enabled + record_tokens($tokenfile,\@tokens,$time_start,undef,'CRITICAL',$i,$output) if $tokenfile; + exit $status{CRITICAL}; + } + if( $output =~ m/WARNING/ && $alert_plugins{$i} ) { + print "EMAIL DELIVERY WARNING - plugin $i warning: $output\n"; + print "Plugin $i: $p\n" if $verbose; + # record tokens in a file if option is enabled + record_tokens($tokenfile,\@tokens,$time_start,undef,'WARNING',$i,$output) if $tokenfile; + exit $status{WARNING}; + } + $report->{"plugin".$i} = $output; + alarm 0; + }; + if( $@ && $alert_plugins{$i} ) { + print "EMAIL DELIVERY CRITICAL - Could not run plugin $i: $@\n"; + print "Plugin $i: $p\n" if $verbose; + exit $status{CRITICAL}; + } + # if this wasn't the last plugin, wait before continuing + if( $i < scalar(@plugins) ) { + my $wait = shift(@wait_times) || $default_wait; + sleep $wait; + } + # compatibility with the "not using plugins" method... pretend to calculate the total round trip time (the delay) using data from the plugins ... + $report->{max} = 0; + $report->{delay} = 0; + } + # register the list of reports + foreach my $r ( 1..scalar(@plugins)) { + push @report_plugins, "plugin".$r; + } + # record tokens in a file if option is enabled + my $tmp_long_report = join(", ", map { "$_: $report->{$_}" } @report_plugins ) if $tokenfile; + record_tokens($tokenfile,\@tokens,$time_start,time,'OK',scalar(@plugins),$tmp_long_report) if $tokenfile; +} +else { + # not using plugins. + $time_start = time; + + # send email via SMTP + my $id = $time_start; # XXX should include localhost name maybe or some random number in case the same mailbox is used for multiple delivery tests + + my $smtp_plugin = "$libexec/check_smtp_send"; + $smtp_plugin = "$libexec/check_smtp_send.pl" unless -e $smtp_plugin; + my $smtp_timeout = shift(@alarm_times) || $default_timeout; + eval { + local $SIG{ALRM} = sub { die "exceeded timeout $smtp_timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm` + alarm $smtp_timeout; + my $smtp = `$smtp_plugin $smtp_options --header 'Subject: Nagios Message SMTP $smtp_server ID $id.' --body 'Nagios Email Delivery Plugin\n$body' $smtp_thresholds`; + if( $smtp !~ m/OK|WARNING|CRITICAL/ ) { + print "EMAIL DELIVERY UNKNOWN - smtp unknown: $smtp\n"; + exit $status{UNKNOWN}; + } + if( $smtp =~ m/CRITICAL/ ) { + print "EMAIL DELIVERY CRITICAL - smtp failed: $smtp\n"; + exit $status{CRITICAL}; + } + chomp $smtp; + $report->{smtp} = $smtp; + alarm 0; + }; + if( $@ ) { + print "EMAIL DELIVERY CRITICAL - Could not connect to SMTP server $smtp_server: $@\n"; + exit $status{CRITICAL}; + } + + # wait before checking the delivery + $wait = shift(@wait_times) || $default_wait; + sleep $wait; + + # check email via IMAP + my $imap_plugin = "$libexec/check_imap_receive"; + $imap_plugin = "$libexec/check_imap_receive.pl" unless -e $imap_plugin; + my $imap_timeout = shift(@alarm_times) || $default_timeout; + eval { + local $SIG{ALRM} = sub { die "exceeded timeout $imap_timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm` + alarm $imap_timeout; + my $imap = `$imap_plugin $imap_options -s SUBJECT -s 'Nagios Message SMTP $smtp_server ID' --capture-max 'Nagios Message SMTP $smtp_server ID (\\d+)' --nodelete-captured $imap_thresholds`; + if( $imap !~ m/OK|WARNING|CRITICAL/ ) { + print "EMAIL DELIVERY UNKNOWN - imap unknown: $imap\n"; + exit $status{UNKNOWN}; + } + if( $imap =~ m/CRITICAL/ ) { + print "EMAIL DELIVERY CRITICAL - imap failed: $imap\n"; + exit $status{CRITICAL}; + } + if( $imap =~ m/ (\d+) max/ ) { + my $last_received = $1; + $report->{max} = $1; + my $delay = time - $last_received; + $report->{delay} = $delay; + } + chomp $imap; + $report->{imap} = $imap; + alarm 0; + }; + if( $@ ) { + print "EMAIL DELIVERY CRITICAL - Could not connect to IMAP server $imap_server: $@\n"; + exit $status{CRITICAL}; + } + # register the list of reports + push @report_plugins, ("smtp","imap"); +} + + +# calculate elapsed time and issue warnings +my $time_end = time; +my $elapsedtime = $time_end - $time_start; +$report->{seconds} = $elapsedtime; + +my @warning = (); +my @critical = (); + +push @warning, "most recent received $report->{delay} seconds ago" if( defined($report->{delay}) && $report->{delay} > $delay_warn ); +push @critical, "most recent received $report->{delay} seconds ago" if( defined($report->{delay}) && $report->{delay} > $delay_crit ); +push @warning, "no emails found" if( !defined($report->{delay}) ); + +# print report and exit with known status +my $perf_data = "delay=".$report->{delay}."s;$delay_warn;$delay_crit;0 elapsed=".$report->{seconds}."s"; # TODO: need a component for safely generating valid perf data format. for notes on the format, see http://www.perfparse.de/tiki-view_faq.php?faqId=6 +my $short_report = $report->text(qw/seconds delay/) . " | $perf_data"; +my $long_report = join("", map { "$_: $report->{$_}\n" } @report_plugins ); +if( scalar @critical ) { + my $alerts = join(", ", @critical); + print "EMAIL DELIVERY CRITICAL - $alerts; $short_report\n"; + print $long_report if $verbose; + exit $status{CRITICAL}; +} +if( scalar @warning ) { + my $alerts = join(", ", @warning); + print "EMAIL DELIVERY WARNING - $alerts; $short_report\n"; + print $long_report if $verbose; + exit $status{WARNING}; +} +print "EMAIL DELIVERY OK - $short_report\n"; +print $long_report if $verbose; +exit $status{OK}; + +# utility to load required modules. exits if unable to load one or more of the modules. +sub load_modules { + my @missing_modules = (); + foreach( @_ ) { + eval "require $_"; + push @missing_modules, $_ if $@; + } + if( @missing_modules ) { + print "Missing perl modules: @missing_modules\n"; + return 0; + } + return 1; +} + +# returns one random character from a set of characters +sub pick_random { + my @set = @_; + my $size = scalar @set; + my $string = $set[int(rand($size))]; + return $string; +} + +# appens tokens and times to a tab-separated value file +sub record_tokens { + my ($tokenfile,$tokens,$time_start,$time_end,$status,$plugin_num,$output) = @_; + if( $tokenfile ) { + my @tokens = @$tokens; + $time_end = "" unless defined $time_end; + $status = "" unless defined $status; + $plugin_num = "" unless defined $plugin_num; + $output = "" unless defined $output; + print "saving ".scalar(@tokens)." tokens into $tokenfile\n" if $verbose; + open(TOKENFILE,">>$tokenfile"); + foreach(@tokens) { + print TOKENFILE "$_\t$time_start\t$time_end\t$status\t$plugin_num\t$output\n"; + } + close(TOKENFILE); + } +} + +# wraps argument in single-quotes and escapes any single-quotes in the argument +sub shellquote { + my $str = shift || ""; + $str =~ s/\'/\'\\\'\'/g; + return "'$str'"; +} + + +# NAME +# PluginReport +# SYNOPSIS +# $report = new PluginReport; +# $report->{label1} = "value1"; +# $report->{label2} = "value2"; +# print $report->text(qw/label1 label2/); +package PluginReport; + +sub new { + my ($proto,%p) = @_; + my $class = ref($proto) || $proto; + my $self = bless {}, $class; + $self->{$_} = $p{$_} foreach keys %p; + return $self; +} + +sub text { + my ($self,@labels) = @_; + my @report = map { "$self->{$_} $_" } grep { defined $self->{$_} } @labels; + my $text = join(", ", @report); + return $text; +} + +package main; +1; + +__END__ + +=pod + +=head1 NAME + +check_email_delivery - sends email and verifies delivery + +=head1 SYNOPSIS + + check_email_delivery -vV + check_email_delivery --usage + check_email_delivery --help + +=head1 OPTIONS + +=over + +=item --warning [,,] + +Exit with WARNING if the most recent email found is older than . The +optional and parameters will be passed on to the +included plugins that are used for those tasks. If they are not +given then they will not be passed on and the default for that plugin will apply. +Also known as: -w [,[,]] + +When using the --plugin option, only one parameter is supported (-w ) and it will apply +to the entire process. You can specify a warning threshold specific to each plugin in the +plugin command line. + +When using the --plugin option, no measuring of "most recent email" is done because we would +not know how to read this information from receive plugins. This may be addressed in future versions. + +=item --critical [,,] + +Exit with CRITICAL if the most recent email found is older than . The +optional and parameters will be passed on to the +included plugins that are used for those tasks. If they are not +given then they will not be passed on and the default for that plugin will apply. +Also known as: -c [,[,]] + +When using the --plugin option, only one parameter is supported (-c ) and it will apply +to the entire process. You can specify a critical threshold specific to each plugin in the +plugin command line. + +When using the --plugin option, no measuring of "most recent email" is done because we would +not know how to read this information from receive plugins. This may be addressed in future versions. + +=item --timeout + +=item --timeout , + +=item --timeout ,,... + +Exit with CRITICAL if the plugins do not return a status within the specified number of seconds. +When only one parameter is used, it applies to each plugin. When multiple parameters are used +(separated by commas) they apply to plugins in the same order the plugins were specified on the +command line. When using --timeout but not the --plugin option, the first parameter is for +check_smtp_send and the second is for check_imap_receive. + +=item --alert + +Exit with WARNING or CRITICAL only if a warning or error (--warning, --critical, or --timeout) +occurs for specified plugins. If a warning or error occurs for non-specified plugins that run +BEFORE the specified plugins, the exit status will be UNKNOWN. If a warning of error occurs +for non-specified plugins that run AFTER the specified plugins, the exit status will not be +affected. + +You would use this option if you are using check_email_delivery with the --plugin option and +the plugins you configure each use different servers, for example different SMTP and IMAP servers. +By default, if you do not use the --alert option, if anything goes wrong during the email delivery +check, a WARNING or CRITICAL alert will be issued. This means that if you define check_email_delivery +for the SMTP server only and the IMAP server fails, Nagios will alert you for the SMTP server which +would be misleading. If you define it for both the SMTP server and IMAP server and just one of them +fails, Nagios will alert you for both servers, which would still be misleading. If you have this +situation, you may want to use the --alert option. You define the check_email_delivery check for +both servers: for the SMTP server (first plugin) you use --alert 1, and for for the IMAP server +(second plugin) you use --alert 2. When check_email_delivery runs with --alert 1 and the SMTP +server fails, you will get the appropriate alert. If the IMAP server fails it will not affect the +status. When check_email_delivery runs with --alert 2 and the SMTP server fails, you will get the +UNKNOWN return code. If the IMAP server generates an alert you will get a WARNING or CRITICAL as +appropriate. + +You can repeat this option to specify multiple plugins that should cause an alert. +Do this if you have multiple plugins on the command line but some of them involve the same server. + +See also: --plugin. +Also known as: -A + + +=item --wait [,,...] + +How long to wait between sending the message and checking that it was received. View default with +the -vV option. + +When using the --plugin option, you can specify as many wait-between times as you have plugins +(minus the last plugin, because it makes no sense to wait after running the last one). For +example, if you use the --plugin option twice to specify an SMTP plugin and an IMAP plugin, and +you want to wait 5 seconds between sending and receiving, then you would specify --wait 5. A second +example, if you are using the --plugin option three times, then specifying -w 5 will wait 5 seconds +between the second and third plugins also. You can specify a different wait time +of 10 seconds between the second and third plugins, like this: -w 5,10. + +=item --hostname + +Address or name of the SMTP and IMAP server. Examples: mail.server.com, localhost, 192.168.1.100. +Also known as: -H + +=item --smtp-server + +Address or name of the SMTP server. Examples: smtp.server.com, localhost, 192.168.1.100. +Using this option overrides the hostname option. + +=item --smtp-port + +Service port on the SMTP server. Default is 25. + +=item --smtp-username + +=item --smtp-password + +Username and password to use when connecting to the SMTP server with the TLS option. +Use these options if the SMTP account has a different username/password than the +IMAP account you are testing. These options take precendence over the --username and +the --password options. + +These are shell-escaped; special characters are ok. + +=item --imap-server + +Address or name of the IMAP server. Examples: imap.server.com, localhost, 192.168.1.100. +Using this option overrides the hostname option. + +=item --imap-port + +Service port on the IMAP server. Default is 143. If you use SSL the default is 993. + +=item --imap-username + +=item --imap-password + +Username and password to use when connecting to the IMAP server. +Use these options if the IMAP account has a different username/password than the +SMTP account you are testing. These options take precendence over the --username and +the --password options. + +These are shell-escaped; special characters are ok. + +=item --username + +=item --password + +Username and password to use when connecting to IMAP server. +Also known as: -U -P + +Also used as the username and password for SMTP when the TLS option is enabled. +To specify a separate set of credentials for SMTP authentication, see the +options --smtp-username and --smtp-password. + +=item --imap-check-interval + +How long to wait between polls of the imap-server for the specified mail. Default is 5 seconds. + +=item --imap-retries + +How many times to poll the imap-server for the mail, before we give up. Default is 10. + +=item --body + +Use this option to specify the body of the email message. + +=item --header

+ +Use this option to set an arbitrary header in the message. You can use it multiple times. + +=item --mailto recipient@your.net + +You can send a message to multiple recipients by repeating this option or by separating +the email addresses with commas (no whitespace allowed): + +$ check_email_delivery ... --mailto recipient@your.net,recipient2@your.net --mailfrom sender@your.net + +This argument is shell-escaped; special characters or angle brackets around the address are ok. + +=item --mailfrom sender@your.net + +Use this option to set the "from" address in the email. + +=item --imapssl +=item --noimapssl + +Use this to enable or disable SSL for the IMAP plugin. + +This argument is shell-escaped; special characters or angle brackets around the address are ok. + +=item --smtptls +=item --nosmtptls + +Use this to enable or disable TLS/AUTH for the SMTP plugin. + +=item --libexec + +Use this option to set the path of the Nagios libexec directory. The default is +/usr/local/nagios/libexec. This is where this plugin looks for the SMTP and IMAP +plugins that it depends on. + +=item --plugin + +This is a new option introduced in version 0.5 of the check_email_delivery plugin. +It frees the plugin from depending on specific external plugins and generalizes the +work done to determine that the email loop is operational. When using the --plugin +option, the following options are ignored: libexec, imapssl, smtptls, hostname, +username, password, smtp*, imap*, mailto, mailfrom, body, header, search. + +Use this option multiple times to specify the complete trip. Typically, you would use +this twice to specify plugins for SMTP and IMAP, or SMTP and POP3. + +The output will be success if all the plugins return success. Each plugin should be a +standard Nagios plugin. + +A random token will be automatically generated and passed to each plugin specified on +the command line by substituting the string %TOKEN1%. + +Example usage: + + command_name check_email_delivery + command_line check_email_delivery + --plugin "$USER1$/check_smtp_send -H $ARG1$ --mailto recipient@your.net --mailfrom sender@your.net --header 'Subject: Nagios Test %TOKEN1%.'" + --plugin "$USER1$/check_imap_receive -H $ARG1$ -U $ARG1$ -P $ARG2$ -s SUBJECT -s 'Nagios Test %TOKEN1%.'" + +This technique allows for a lot of flexibility in configuring the plugins that test +each part of your email delivery loop. + +See also: --token. +Also known as: -p + +=item --token + +This is a new option introduced in version 0.5 of the check_email_delivery plugin. +It can be used in conjunction with --plugin to control the tokens that are generated +and passed to the plugins, like %TOKEN1%. + +Use this option multiple times to specify formats for different tokens. For example, +if you want %TOKEN1% to consist of only alphabetical characters but want %TOKEN2% to +consist of only digits, then you might use these options: --token aaaaaa --token nnnnn + +Any tokens used in your plugin commands that have not been specified by --token +will default to --token U-X-Y + +Token formats: +a - alpha character (a-z) +n - numeric character (0-9) +c - alphanumeric character (a-z0-9) +h - hexadecimal character (0-9a-f) +U - unix time, seconds from epoch. eg 1193012441 +X - a word from the pgp even list. eg aardvark +Y - a word from the pgp odd list. eg adroitness + +Caution: It has been observed that some IMAP servers do not handle underscores well in the +search criteria. For best results, avoid using underscores in your tokens. Use hyphens or commas instead. + +See also: --plugin. +Also known as: -T + +The PGP word list was obtained from http://en.wikipedia.org/wiki/PGP_word_list + +=item --file + +Save (append) status information into the given tab-delimited file. Format used: + + token start-time end-time status plugin-num output + +Note: format may change in future versions and may become configurable. + +This option available as of version 0.6.2. + +Also known as: -F + +=item --hires + +Use the Time::HiRes module to measure time, if available. + +=item --verbose + +Display additional information. Useful for troubleshooting. Use together with --version to see the default +warning and critical timeout values. +Also known as: -v + +=item --version + +Display plugin version and exit. +Also known as: -V + +=item --help + +Display this documentation and exit. Does not work in the ePN version. +Also known as: -h + +=item --usage + +Display a short usage instruction and exit. + +=back + +=head1 EXAMPLES + +=head2 Send a message with custom headers + +$ check_email_delivery -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net +--username recipient --password secret + +EMAIL DELIVERY OK - 1 seconds + +=head2 Set warning and critical timeouts for receive plugin only: + +$ check_email_delivery -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net +--username recipient --password secret -w ,,5 -c ,,15 + +EMAIL DELIVERY OK - 1 seconds + +=head1 EXIT CODES + +Complies with the Nagios plug-in specification: + 0 OK The plugin was able to check the service and it appeared to be functioning properly + 1 Warning The plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly + 2 Critical The plugin detected that either the service was not running or it was above some "critical" threshold + 3 Unknown Invalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service + +=head1 NAGIOS PLUGIN NOTES + +Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html + +This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because +the path to utils.pm must be specified completely in this program and forces users to edit the source +code if their install location is different (if they realize this is the problem). You can view +the default timeout for this module by using the --verbose and --version options together. The +short form is -vV. + +Other than that, it attempts to follow published guidelines for Nagios plugins. + +=head1 CHANGES + + Wed Oct 29 13:08:00 PST 2005 + + version 0.1 + + Wed Nov 9 17:16:09 PST 2005 + + updated arguments to check_smtp_send and check_imap_receive + + added eval/alarm block to implement -c option + + added wait option to adjust sleep time between smtp and imap calls + + added delay-warn and delay-crit options to adjust email delivery warning thresholds + + now using an inline PluginReport package to generate the report + + copyright notice and GNU GPL + + version 0.2 + + Thu Apr 20 14:00:00 CET 2006 (by Johan Nilsson ) + + version 0.2.1 + + corrected bug in getoptions ($imap_server would never ever be set from command-line...) + + will not make $smtp_server and $imap_server == $host if they're defined on commandline + + added support for multiple polls of imap-server, with specified intervals + + changed default behaviour in check_imap_server (searches for the specific id in subject and deletes mails found) + + increased default delay_warn from 65 seconds to 95 seconds + + Thu Apr 20 16:00:00 PST 2006 (by Geoff Crompton ) + + fixed a bug in getoptions + + version 0.2.2 + + Tue Apr 24 21:17:53 PDT 2007 + + now there is an alternate version (same but without embedded perl POD) that is compatible with the new new embedded-perl Nagios feature + + version 0.2.3 + + Fri Apr 27 20:32:53 PDT 2007 + + documentation now mentions every command-line option accepted by the plugin, including abbreviations + + changed connection error to display timeout only if timeout was the error + + default IMAP plugin is libexec/check_imap_receive (also checking for same but with .pl extension) + + default SMTP plugin is libexec/check_smtp_send (also checking for same but with .pl extension) + + removed default values for SMTP port and IMAP port to allow those plugins to set the defaults; so current behavior stays the same and will continue to make sense with SSL + + version 0.3 + + Thu Oct 11 10:00:00 EET 2007 (by Timo Virtaneva + + Changed the header and the search criteria so that the same email-box can be used for all smtp-servers + + version 0.3.1 + + Sun Oct 21 11:01:03 PDT 2007 + + added support for TLS options to the SMTP plugin + + version 0.4 + + Sun Oct 21 16:17:14 PDT 2007 + + added support for arbitrary plugins to send and receive mail (or anthing else!). see the --plugin option. + + version 0.5 + + Tue Dec 4 07:36:20 PST 2007 + + added --usage option because the official nagios plugins have both --help and --usage + + added --timeout option to match the official nagios plugins + + shortcut option for --token is now -T to avoid clash with standard shortcut -t for --timeout + + fixed some minor pod formatting issues for perldoc + + version 0.5.1 + + Sat Dec 15 07:39:59 PST 2007 + + improved compatibility with Nagios embedded perl (ePN) + + version 0.5.2 + + Thu Jan 17 20:27:36 PST 2008 (by Timo Virtaneva on Thu Oct 11 10:00:00 EET 2007) + + Changed the header and the search criteria so that the same email-box can be used for all smtp-servers + + version 0.5.3 + + Mon Jan 28 22:11:02 PST 2008 + + fixed a bug, smtp-password and imap-password are now string parameters + + added --alert option to allow selection of which plugin(s) should cause a WARNING or CRITICAL alert + + version 0.6 + + Mon Feb 11 19:09:37 PST 2008 + + fixed a bug for embedded perl version, variable "%status" will not stay shared in load_modules + + version 0.6.1 + + Mon May 26 10:39:19 PDT 2008 + + added --file option to allow plugin to record status information into a tab-delimited file + + changed default token from U_X_Y to U-X-Y + + version 0.6.2 + + Wed Jan 14 08:29:35 PST 2009 + + fixed a bug that the --header parameter was not being passed to the smtp plugin. + + version 0.6.3 + + Mon Jun 8 15:43:48 PDT 2009 + + added performance data for use with PNP4Nagios! (thanks to Ben Ritcey for the patch) + + version 0.6.4 + + Wed Sep 16 07:10:10 PDT 2009 + + added elapsed time in seconds to performance data + + version 0.6.5 + + Fri Oct 8 19:48:44 PDT 2010 + + fixed uniform IMAP and SMTP username and password bug (thanks to Micle Moerenhout for pointing it out) + + version 0.6.6 + + Mon Jan 3 08:24:23 PST 2011 + + added shell escaping for smtp-username, smtp-password, mailto, mailfrom, imap-username, and imap-password arguments + + version 0.7.0 + + Fri May 6 08:35:09 AST 2011 + + added --hires option to enable use of Time::Hires if available + + version 0.7.1 + + Sun Jun 12 17:17:06 AST 2011 + + added --imap-mailbox option to pass through to check_imap_receive --mailbox option + + added --ssl option to conveniently enable both --smtp-tls and --imap-ssl + + version 0.7.2 + +=head1 AUTHOR + +Jonathan Buhacoff + +=head1 COPYRIGHT AND LICENSE + + 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 . + + http://www.gnu.org/licenses/gpl.txt + +=cut diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_email_delivery_epn b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_email_delivery_epn new file mode 100644 index 0000000..b0cc304 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_email_delivery_epn @@ -0,0 +1,498 @@ +#!/usr/bin/perl +use strict; +my $VERSION = '0.7.1'; +my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +my $LICENSE = 'http://www.gnu.org/licenses/gpl.txt'; +my %status = ( 'OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3 ); + +# look for required modules +exit $status{UNKNOWN} unless load_modules(qw/Getopt::Long/); + +BEGIN { + if( grep { /^--hires$/ } @ARGV ) { + eval "use Time::HiRes qw(time);"; + warn "Time::HiRes not installed\n" if $@; + } +} + +# get options from command line +Getopt::Long::Configure("bundling"); +my $verbose = 0; +my $help = ""; +my $help_usage = ""; +my $show_version = ""; +my $host = ""; +my $smtp_server = ""; +my $smtp_port = ""; +my $imap_server = ""; +my $smtp_username = ""; +my $smtp_password = ""; +my $smtp_tls = ""; +my $imap_port = ""; +my $imap_username = ""; +my $imap_password = ""; +my $imap_mailbox = ""; +my $username = ""; +my $password = ""; +my $ssl = ""; +my $imap_ssl = ""; +my $mailto = ""; +my $mailfrom = ""; +my @header = (); +my $body = ""; +my $warnstr = ""; +my $critstr = ""; +my $waitstr = ""; +my $delay_warn = 95; +my $delay_crit = 300; +my $smtp_warn = 15; +my $smtp_crit = 30; +my $imap_warn = 15; +my $imap_crit = 30; +my $timeout = ""; +my @alert_plugins = (); +my $imap_interval = 5; +my $imap_retries = 5; +my @plugins = (); +my @token_formats = (); +my $tokenfile = ""; +my $default_crit = 30; +my $default_warn = 15; +my $default_wait = 5; +my $default_timeout = 60; +my $time_hires = ""; +my $libexec = "/usr/local/nagios/libexec"; +my $ok; +$ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, + "v|verbose+"=>\$verbose,"h|help"=>\$help,"usage"=>\$help_usage, + "w|warning=s"=>\$warnstr,"c|critical=s"=>\$critstr, "t|timeout=s"=>\$timeout, + "libexec=s"=>\$libexec, + # plugin settings + "p|plugin=s"=>\@plugins, "T|token=s"=>\@token_formats, + "A|alert=i"=>\@alert_plugins, + "F|file=s"=>\$tokenfile, + # common settings + "H|hostname=s"=>\$host, + "U|username=s"=>\$username,"P|password=s"=>\$password, + "ssl!"=>\$ssl, + # smtp settings + "smtp-server=s"=>\$smtp_server,"smtp-port=i"=>\$smtp_port, + "mailto=s"=>\$mailto, "mailfrom=s",\$mailfrom, + "header=s"=>\@header, "body=s"=>\$body, + # smtp-tls settings + "smtptls!"=>\$smtp_tls, + "smtp-username=s"=>\$smtp_username,"smtp-password=s"=>\$smtp_password, + # delay settings + "wait=s"=>\$waitstr, + # imap settings + "imap-server=s"=>\$imap_server,"imap-port=i"=>\$imap_port, + "imap-username=s"=>\$imap_username,"imap-password=s"=>\$imap_password, + "imap-mailbox=s"=>\$imap_mailbox, + "imap-check-interval=i"=>\$imap_interval,"imap-retries=i"=>\$imap_retries, + "imapssl!"=>\$imap_ssl, + # Time + "hires"=>\$time_hires, + ); + +if( $show_version ) { + print "$VERSION\n"; + if( $verbose ) { + print "Warning threshold: $delay_warn seconds\n"; + print "Critical threshold: $delay_crit seconds\n"; + print "Default wait: $default_wait seconds\n"; + print "Default timeout: $default_timeout seconds\n"; + } + exit $status{UNKNOWN}; +} + +if( $help ) { + exec "perldoc", $0 or print "Try `perldoc $0`\n"; + exit $status{UNKNOWN}; +} + +if( $host ) { + $smtp_server = $host if $smtp_server eq ""; + $imap_server = $host if $imap_server eq ""; +} + +if( $username ) { + $smtp_username = $username if $smtp_username eq ""; + $imap_username = $username if $imap_username eq ""; +} + +if( $password ) { + $smtp_password = $password if $smtp_password eq ""; + $imap_password = $password if $imap_password eq ""; +} + +if( $ssl ) { + $imap_ssl = $ssl if $imap_ssl eq ""; + $smtp_tls = $ssl if $smtp_tls eq ""; +} + +if( $help_usage + || + ( + scalar(@plugins) == 0 + && + ( + $smtp_server eq "" || $mailto eq "" || $mailfrom eq "" + || $imap_server eq "" || $username eq "" || $password eq "" + ) + ) + ) { + print "Usage 1: $0 -H host \n\t". + "--mailto recipient\@your.net --mailfrom sender\@your.net --body 'message' \n\t". + "--username username --password password \n\t". + "[-w ] [-c ]\n\t" . + "[--imap-check-interval ] [--imap-retries ]\n"; + print "Usage 2: $0 \n\t". + "-p 'first plugin command with %TOKEN1% embedded' \n\t". + "-p 'second plugin command with %TOKEN1% embedded' \n\t". + "[-w ,] [-c ,] \n"; + exit $status{UNKNOWN}; +} + +# determine thresholds +my @warning_times = split(",", $warnstr); +my @critical_times = split(",", $critstr); +my @alarm_times = split(",", $timeout); +my @wait_times = split(",", $waitstr); +my ($dw,$sw,$rw) = split(",", $warnstr); +my ($dc,$sc,$rc) = split(",", $critstr); +my ($wait) = split(",", $waitstr); +$delay_warn = $dw if defined $dw and $dw ne ""; +$smtp_warn = $sw if defined $sw and $sw ne ""; +$imap_warn = $rw if defined $rw and $rw ne ""; +$delay_crit = $dc if defined $dc and $dc ne ""; +$smtp_crit = $sc if defined $sc and $sc ne ""; +$imap_crit = $rc if defined $rc and $rc ne ""; +my $smtp_thresholds = ""; +$smtp_thresholds .= "-w $smtp_warn " if defined $smtp_warn and $smtp_warn ne ""; +$smtp_thresholds .= "-c $smtp_crit " if defined $smtp_crit and $smtp_crit ne ""; +my $imap_thresholds = ""; +$imap_thresholds .= "-w $imap_warn " if defined $imap_warn and $imap_warn ne ""; +$imap_thresholds .= "-c $imap_crit " if defined $imap_crit and $imap_crit ne ""; +$imap_thresholds .= "--imap-check-interval $imap_interval " if defined $imap_interval and $imap_interval ne ""; +$imap_thresholds .= "--imap-retries $imap_retries " if defined $imap_retries and $imap_retries ne ""; +if( scalar(@alarm_times) == 1 ) { + $default_timeout = shift(@alarm_times); +} + +# determine which other options to include +my $smtp_options = ""; +$smtp_options .= "-H $smtp_server " if defined $smtp_server and $smtp_server ne ""; +$smtp_options .= "-p $smtp_port " if defined $smtp_port and $smtp_port ne ""; +$smtp_options .= "--tls " if defined $smtp_tls and $smtp_tls; +$smtp_options .= "-U ".shellquote($smtp_username)." " if defined $smtp_username and $smtp_username ne ""; +$smtp_options .= "-P ".shellquote($smtp_password)." " if defined $smtp_password and $smtp_password ne ""; +$smtp_options .= "--mailto ".shellquote($mailto)." " if defined $mailto and $mailto ne ""; +$smtp_options .= "--mailfrom ".shellquote($mailfrom)." " if defined $mailfrom and $mailfrom ne ""; +foreach my $h( @header ) { + $smtp_options .= "--header ".shellquote($h)." "; +} +my $imap_options = ""; +$imap_options .= "-H $imap_server " if defined $imap_server and $imap_server ne ""; +$imap_options .= "-p $imap_port " if defined $imap_port and $imap_port ne ""; +$imap_options .= "-U ".shellquote($imap_username)." " if defined $imap_username and $imap_username ne ""; +$imap_options .= "-P ".shellquote($imap_password)." " if defined $imap_password and $imap_password ne ""; +$imap_options .= "--mailbox ".shellquote($imap_mailbox)." " if defined $imap_mailbox and $imap_mailbox ne ""; +$imap_options .= "--ssl " if defined $imap_ssl and $imap_ssl; + + +# create the report object +my $report = new PluginReport; +my @report_plugins = (); # populated later with either (smtp,imap) or (plugin1,plugin2,...) +my $time_start; # initialized later with time the work actually starts + +# create token formats for use with the plugins +my @alpha = qw/a b c d e f g h i j k l m n o p q r s t u v w x y z/; +my @numeric = qw/0 1 2 3 4 5 6 7 8 9/; +my @hex = qw/0 1 2 3 4 5 6 7 8 9 a b c d e f/; +my @pgp_even = qw/aardvark absurd accrue acme adrift adult afflict ahead aimless Algol allow alone ammo ancient apple artist assume Athens atlas Aztec baboon backfield backward banjo beaming bedlamp beehive beeswax befriend Belfast berserk billiard bison blackjack blockade blowtorch bluebird bombast bookshelf brackish breadline breakup brickyard briefcase Burbank button buzzard cement chairlift chatter checkup chisel choking chopper Christmas clamshell classic classroom cleanup clockwork cobra commence concert cowbell crackdown cranky crowfoot crucial crumpled crusade cubic dashboard deadbolt deckhand dogsled dragnet drainage dreadful drifter dropper drumbeat drunken Dupont dwelling eating edict egghead eightball endorse endow enlist erase escape exceed eyeglass eyetooth facial fallout flagpole flatfoot flytrap fracture framework freedom frighten gazelle Geiger glitter glucose goggles goldfish gremlin guidance hamlet highchair hockey indoors indulge inverse involve island jawbone keyboard kickoff kiwi klaxon locale lockup merit minnow miser Mohawk mural music necklace Neptune newborn nightbird Oakland obtuse offload optic orca payday peachy pheasant physique playhouse Pluto preclude prefer preshrunk printer prowler pupil puppy python quadrant quiver quota ragtime ratchet rebirth reform regain reindeer rematch repay retouch revenge reward rhythm ribcage ringbolt robust rocker ruffled sailboat sawdust scallion scenic scorecard Scotland seabird select sentence shadow shamrock showgirl skullcap skydive slingshot slowdown snapline snapshot snowcap snowslide solo southward soybean spaniel spearhead spellbind spheroid spigot spindle spyglass stagehand stagnate stairway standard stapler steamship sterling stockman stopwatch stormy sugar surmount suspense sweatband swelter tactics talon tapeworm tempest tiger tissue tonic topmost tracker transit trauma treadmill Trojan trouble tumor tunnel tycoon uncut unearth unwind uproot upset upshot vapor village virus Vulcan waffle wallet watchword wayside willow woodlark Zulu/; +my @pgp_odd = qw/adroitness adviser aftermath aggregate alkali almighty amulet amusement antenna applicant Apollo armistice article asteroid Atlantic atmosphere autopsy Babylon backwater barbecue belowground bifocals bodyguard bookseller borderline bottomless Bradbury bravado Brazilian breakaway Burlington businessman butterfat Camelot candidate cannonball Capricorn caravan caretaker celebrate cellulose certify chambermaid Cherokee Chicago clergyman coherence combustion commando company component concurrent confidence conformist congregate consensus consulting corporate corrosion councilman crossover crucifix cumbersome customer Dakota decadence December decimal designing detector detergent determine dictator dinosaur direction disable disbelief disruptive distortion document embezzle enchanting enrollment enterprise equation equipment escapade Eskimo everyday examine existence exodus fascinate filament finicky forever fortitude frequency gadgetry Galveston getaway glossary gossamer graduate gravity guitarist hamburger Hamilton handiwork hazardous headwaters hemisphere hesitate hideaway holiness hurricane hydraulic impartial impetus inception indigo inertia infancy inferno informant insincere insurgent integrate intention inventive Istanbul Jamaica Jupiter leprosy letterhead liberty maritime matchmaker maverick Medusa megaton microscope microwave midsummer millionaire miracle misnomer molasses molecule Montana monument mosquito narrative nebula newsletter Norwegian October Ohio onlooker opulent Orlando outfielder Pacific pandemic Pandora paperweight paragon paragraph paramount passenger pedigree Pegasus penetrate perceptive performance pharmacy phonetic photograph pioneer pocketful politeness positive potato processor provincial proximate puberty publisher pyramid quantity racketeer rebellion recipe recover repellent replica reproduce resistor responsive retraction retrieval retrospect revenue revival revolver sandalwood sardonic Saturday savagery scavenger sensation sociable souvenir specialist speculate stethoscope stupendous supportive surrender suspicious sympathy tambourine telephone therapist tobacco tolerance tomorrow torpedo tradition travesty trombonist truncated typewriter ultimate undaunted underfoot unicorn unify universe unravel upcoming vacancy vagabond vertigo Virginia visitor vocalist voyager warranty Waterloo whimsical Wichita Wilmington Wyoming yesteryear Yucatan/; +my %formats = ( + 'a' => sub { pick_random(@alpha) }, + 'n' => sub { pick_random(@numeric) }, + 'c' => sub { pick_random(@alpha,@numeric) }, + 'h' => sub { pick_random(@hex) }, + 'U' => sub { time }, + 'X' => sub { pick_random(@pgp_even) }, + 'Y' => sub { pick_random(@pgp_odd) }, +); +if( scalar(@plugins) ) { + # scan the plugin commands for use of tokens to count how many we need + my $token_count = 0; + foreach my $p (@plugins) { + my @matches = sort ($p =~ m/%TOKEN(\d+)%/g); + my $max = pop @matches; + $token_count = $max if defined($max) && $max > $token_count; + } + # create the tokens + my @tokens = (); + foreach my $t (1..$token_count) { + my $format = shift @token_formats; + $format = "U-X-Y" unless $format; + my @format_characters = split(//, $format); + my $token = ""; + foreach my $c (@format_characters) { + if( defined $formats{$c} ) { + $token .= &{$formats{$c}}; + } + else { + $token .= $c; + } + } + push @tokens, $token; + } + # substitute the tokens into each plugin command + foreach my $p (@plugins) { + foreach my $t (1..$token_count) { + my $token = $tokens[$t-1]; + $p =~ s/%TOKEN$t%/$token/g; + } + } + # mark plugins that are allowed to generate alerts. default behavior is to alert for all plugins. + my %alert_plugins = (); + if( scalar(@alert_plugins) > 0 ) { + %alert_plugins = map { $_ => 1 } @alert_plugins; + } + else { + %alert_plugins = map { $_ => 1 } (1..scalar(@plugins)); + } + # run each plugin and store its output in a report + $time_start = time; + my $i = 0; + foreach my $p( @plugins ) { + $i++; + my $plugin_timeout = shift(@alarm_times) || $default_timeout; + # run the plugin + eval { + local $SIG{ALRM} = sub { die "exceeded timeout $plugin_timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm` + alarm $plugin_timeout; + my $output = `$p`; + chomp $output; + if( $output !~ m/OK|WARNING|CRITICAL/ ) { + print "EMAIL DELIVERY UNKNOWN - plugin $i error: $output\n"; + print "Plugin $i: $p\n" if $verbose; + # record tokens in a file if option is enabled + record_tokens($tokenfile,\@tokens,$time_start,undef,'UNKNOWN',$i,$output) if $tokenfile; + exit $status{UNKNOWN}; + } + if( $output =~ m/CRITICAL/ && $alert_plugins{$i} ) { + print "EMAIL DELIVERY CRITICAL - plugin $i failed: $output\n"; + print "Plugin $i: $p" if $verbose; + # record tokens in a file if option is enabled + record_tokens($tokenfile,\@tokens,$time_start,undef,'CRITICAL',$i,$output) if $tokenfile; + exit $status{CRITICAL}; + } + if( $output =~ m/WARNING/ && $alert_plugins{$i} ) { + print "EMAIL DELIVERY WARNING - plugin $i warning: $output\n"; + print "Plugin $i: $p\n" if $verbose; + # record tokens in a file if option is enabled + record_tokens($tokenfile,\@tokens,$time_start,undef,'WARNING',$i,$output) if $tokenfile; + exit $status{WARNING}; + } + $report->{"plugin".$i} = $output; + alarm 0; + }; + if( $@ && $alert_plugins{$i} ) { + print "EMAIL DELIVERY CRITICAL - Could not run plugin $i: $@\n"; + print "Plugin $i: $p\n" if $verbose; + exit $status{CRITICAL}; + } + # if this wasn't the last plugin, wait before continuing + if( $i < scalar(@plugins) ) { + my $wait = shift(@wait_times) || $default_wait; + sleep $wait; + } + # compatibility with the "not using plugins" method... pretend to calculate the total round trip time (the delay) using data from the plugins ... + $report->{max} = 0; + $report->{delay} = 0; + } + # register the list of reports + foreach my $r ( 1..scalar(@plugins)) { + push @report_plugins, "plugin".$r; + } + # record tokens in a file if option is enabled + my $tmp_long_report = join(", ", map { "$_: $report->{$_}" } @report_plugins ) if $tokenfile; + record_tokens($tokenfile,\@tokens,$time_start,time,'OK',scalar(@plugins),$tmp_long_report) if $tokenfile; +} +else { + # not using plugins. + $time_start = time; + + # send email via SMTP + my $id = $time_start; # XXX should include localhost name maybe or some random number in case the same mailbox is used for multiple delivery tests + + my $smtp_plugin = "$libexec/check_smtp_send"; + $smtp_plugin = "$libexec/check_smtp_send.pl" unless -e $smtp_plugin; + my $smtp_timeout = shift(@alarm_times) || $default_timeout; + eval { + local $SIG{ALRM} = sub { die "exceeded timeout $smtp_timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm` + alarm $smtp_timeout; + my $smtp = `$smtp_plugin $smtp_options --header 'Subject: Nagios Message SMTP $smtp_server ID $id.' --body 'Nagios Email Delivery Plugin\n$body' $smtp_thresholds`; + if( $smtp !~ m/OK|WARNING|CRITICAL/ ) { + print "EMAIL DELIVERY UNKNOWN - smtp unknown: $smtp\n"; + exit $status{UNKNOWN}; + } + if( $smtp =~ m/CRITICAL/ ) { + print "EMAIL DELIVERY CRITICAL - smtp failed: $smtp\n"; + exit $status{CRITICAL}; + } + chomp $smtp; + $report->{smtp} = $smtp; + alarm 0; + }; + if( $@ ) { + print "EMAIL DELIVERY CRITICAL - Could not connect to SMTP server $smtp_server: $@\n"; + exit $status{CRITICAL}; + } + + # wait before checking the delivery + $wait = shift(@wait_times) || $default_wait; + sleep $wait; + + # check email via IMAP + my $imap_plugin = "$libexec/check_imap_receive"; + $imap_plugin = "$libexec/check_imap_receive.pl" unless -e $imap_plugin; + my $imap_timeout = shift(@alarm_times) || $default_timeout; + eval { + local $SIG{ALRM} = sub { die "exceeded timeout $imap_timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm` + alarm $imap_timeout; + my $imap = `$imap_plugin $imap_options -s SUBJECT -s 'Nagios Message SMTP $smtp_server ID' --capture-max 'Nagios Message SMTP $smtp_server ID (\\d+)' --nodelete-captured $imap_thresholds`; + if( $imap !~ m/OK|WARNING|CRITICAL/ ) { + print "EMAIL DELIVERY UNKNOWN - imap unknown: $imap\n"; + exit $status{UNKNOWN}; + } + if( $imap =~ m/CRITICAL/ ) { + print "EMAIL DELIVERY CRITICAL - imap failed: $imap\n"; + exit $status{CRITICAL}; + } + if( $imap =~ m/ (\d+) max/ ) { + my $last_received = $1; + $report->{max} = $1; + my $delay = time - $last_received; + $report->{delay} = $delay; + } + chomp $imap; + $report->{imap} = $imap; + alarm 0; + }; + if( $@ ) { + print "EMAIL DELIVERY CRITICAL - Could not connect to IMAP server $imap_server: $@\n"; + exit $status{CRITICAL}; + } + # register the list of reports + push @report_plugins, ("smtp","imap"); +} + + +# calculate elapsed time and issue warnings +my $time_end = time; +my $elapsedtime = $time_end - $time_start; +$report->{seconds} = $elapsedtime; + +my @warning = (); +my @critical = (); + +push @warning, "most recent received $report->{delay} seconds ago" if( defined($report->{delay}) && $report->{delay} > $delay_warn ); +push @critical, "most recent received $report->{delay} seconds ago" if( defined($report->{delay}) && $report->{delay} > $delay_crit ); +push @warning, "no emails found" if( !defined($report->{delay}) ); + +# print report and exit with known status +my $perf_data = "delay=".$report->{delay}."s;$delay_warn;$delay_crit;0 elapsed=".$report->{seconds}."s"; # TODO: need a component for safely generating valid perf data format. for notes on the format, see http://www.perfparse.de/tiki-view_faq.php?faqId=6 +my $short_report = $report->text(qw/seconds delay/) . " | $perf_data"; +my $long_report = join("", map { "$_: $report->{$_}\n" } @report_plugins ); +if( scalar @critical ) { + my $alerts = join(", ", @critical); + print "EMAIL DELIVERY CRITICAL - $alerts; $short_report\n"; + print $long_report if $verbose; + exit $status{CRITICAL}; +} +if( scalar @warning ) { + my $alerts = join(", ", @warning); + print "EMAIL DELIVERY WARNING - $alerts; $short_report\n"; + print $long_report if $verbose; + exit $status{WARNING}; +} +print "EMAIL DELIVERY OK - $short_report\n"; +print $long_report if $verbose; +exit $status{OK}; + +# utility to load required modules. exits if unable to load one or more of the modules. +sub load_modules { + my @missing_modules = (); + foreach( @_ ) { + eval "require $_"; + push @missing_modules, $_ if $@; + } + if( @missing_modules ) { + print "Missing perl modules: @missing_modules\n"; + return 0; + } + return 1; +} + +# returns one random character from a set of characters +sub pick_random { + my @set = @_; + my $size = scalar @set; + my $string = $set[int(rand($size))]; + return $string; +} + +# appens tokens and times to a tab-separated value file +sub record_tokens { + my ($tokenfile,$tokens,$time_start,$time_end,$status,$plugin_num,$output) = @_; + if( $tokenfile ) { + my @tokens = @$tokens; + $time_end = "" unless defined $time_end; + $status = "" unless defined $status; + $plugin_num = "" unless defined $plugin_num; + $output = "" unless defined $output; + print "saving ".scalar(@tokens)." tokens into $tokenfile\n" if $verbose; + open(TOKENFILE,">>$tokenfile"); + foreach(@tokens) { + print TOKENFILE "$_\t$time_start\t$time_end\t$status\t$plugin_num\t$output\n"; + } + close(TOKENFILE); + } +} + +# wraps argument in single-quotes and escapes any single-quotes in the argument +sub shellquote { + my $str = shift || ""; + $str =~ s/\'/\'\\\'\'/g; + return "'$str'"; +} + + +# NAME +# PluginReport +# SYNOPSIS +# $report = new PluginReport; +# $report->{label1} = "value1"; +# $report->{label2} = "value2"; +# print $report->text(qw/label1 label2/); +package PluginReport; + +sub new { + my ($proto,%p) = @_; + my $class = ref($proto) || $proto; + my $self = bless {}, $class; + $self->{$_} = $p{$_} foreach keys %p; + return $self; +} + +sub text { + my ($self,@labels) = @_; + my @report = map { "$self->{$_} $_" } grep { defined $self->{$_} } @labels; + my $text = join(", ", @report); + return $text; +} + +package main; +1; + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_quota b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_quota new file mode 100644 index 0000000..13f3504 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_quota @@ -0,0 +1,431 @@ +#!/usr/bin/perl +use strict; +my $VERSION = '0.2'; +my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +my $LICENSE = 'http://www.gnu.org/licenses/gpl.txt'; +my %status = ( 'OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3 ); + +#### IDEA AND INITIAL IMPLEMENTATION BASED ON CHECK_IMAP_RECEIVE WAS CONTRIBUTED BY JOHAN ROMME from THE NETHERLANDS 14 Oct 2011 + +# look for required modules +exit $status{UNKNOWN} unless load_modules(qw/Getopt::Long Mail::IMAPClient/); + +BEGIN { + if( grep { /^--hires$/ } @ARGV ) { + eval "use Time::HiRes qw(time);"; + warn "Time::HiRes not installed\n" if $@; + } +} + +# get options from command line +Getopt::Long::Configure("bundling"); +my $verbose = 0; +my $help = ""; +my $help_usage = ""; +my $show_version = ""; +my $imap_server = ""; +my $default_imap_port = "143"; +my $default_imap_ssl_port = "993"; +my $imap_port = ""; +my $username = ""; +my $password = ""; +my $mailbox = "INBOX"; +my $warntime = 15; +my $criticaltime = 30; +my $timeout = 60; +my $peek = ""; +my $ssl = 0; +my $tls = 0; +my $time_hires = ""; +my $ok; +$ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, + "v|verbose+"=>\$verbose,"h|help"=>\$help,"usage"=>\$help_usage, + "w|warning=i"=>\$warntime,"c|critical=i"=>\$criticaltime,"t|timeout=i"=>\$timeout, + # imap settings + "H|hostname=s"=>\$imap_server,"p|port=i"=>\$imap_port, + "U|username=s"=>\$username,"P|password=s"=>\$password, "m|mailbox=s"=>\$mailbox, + "ssl!"=>\$ssl, "tls!"=>\$tls, + # search settings + "peek!"=>\$peek, + # Time + "hires"=>\$time_hires, + ); + +if( $show_version ) { + print "$VERSION\n"; + if( $verbose ) { + print "Default warning threshold: $warntime seconds\n"; + print "Default critical threshold: $criticaltime seconds\n"; + print "Default timeout: $timeout seconds\n"; + } + exit $status{UNKNOWN}; +} + +if( $help ) { + exec "perldoc", $0 or print "Try `perldoc $0`\n"; + exit $status{UNKNOWN}; +} + +my @required_module = (); +push @required_module, 'IO::Socket::SSL' if $ssl || $tls; +exit $status{UNKNOWN} unless load_modules(@required_module); + +if( $help_usage + || + ( $imap_server eq "" || $username eq "" || $password eq "" ) + ) { + print "Usage: $0 -H host [-p port] -U username -P password [--imap-retries ]\n"; + exit $status{UNKNOWN}; +} + + +# initialize +my $report = new PluginReport; +my $time_start = time; + +# connect to IMAP server +print "connecting to server $imap_server\n" if $verbose > 2; +my $imap; +eval { + local $SIG{ALRM} = sub { die "exceeded timeout $timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm` + alarm $timeout; + + if( $ssl || $tls ) { + $imap_port = $default_imap_ssl_port unless $imap_port; + my $socket = IO::Socket::SSL->new("$imap_server:$imap_port"); + die IO::Socket::SSL::errstr() unless $socket; + $socket->autoflush(1); + $imap = Mail::IMAPClient->new(Socket=>$socket, Debug => 0 ); + $imap->State(Mail::IMAPClient->Connected); + $imap->_read_line() if "$Mail::IMAPClient::VERSION" le "2.2.9"; # necessary to remove the server's "ready" line from the input buffer for old versions of Mail::IMAPClient. Using string comparison for the version check because the numeric didn't work on Darwin and for Mail::IMAPClient the next version is 2.3.0 and then 3.00 so string comparison works + $imap->User($username); + $imap->Password($password); + $imap->login() or die "$@"; + } + else { + $imap_port = $default_imap_port unless $imap_port; + $imap = Mail::IMAPClient->new(Debug => 0 ); + $imap->Server("$imap_server:$imap_port"); + $imap->User($username); + $imap->Password($password); + $imap->connect() or die "$@"; + } + + $imap->Peek(1) if $peek; + $imap->Ignoresizeerrors(1); + + alarm 0; +}; +if( $@ ) { + chomp $@; + print "IMAP QUOTA CRITICAL - Could not connect to $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} +unless( $imap ) { + print "IMAP QUOTA CRITICAL - Could not connect to $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} +my $time_connected = time; + +my $quotaUsed; +my $quotaLimit; +my $quotaPercentage; +my $quotaPercentageWarning = 80; +my $quotaPercentageCritical = 90; +my $quotaMessage; + +# look for the quota limits +my $tries = 0; +my @msgs; + +eval { + my $k; + my @l = $imap->getquotaroot(); + foreach $k (@l) { + print "$k\n" if $verbose > 2; + if ($k =~ /STORAGE +(\d+) +(\d+)/) { + $quotaUsed = $1; + $quotaLimit = $2; + } + } + if (!length($quotaUsed) && !length($quotaLimit)) { + print "no answer from imap host\n" if $verbose > 2; + } elsif (!length($quotaUsed) || !length($quotaLimit) { + print "incorrect answer from imap host\n"; + $imap->close(); + exit $status{UNKNOWN}; + } else { + $quotaPercentage = sprintf("%.1f", (100 * $quotaUsed) / $quotaLimit); + $quotaMessage = "$quotaUsed $quotaLimit - $quotaPercentage%"; + } +}; +if( $@ ) { + chomp $@; + print "IMAP QUOTA CRITICAL - Could not check quota at $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} + + +# disconnect from IMAP server +print "disconnecting from server\n" if $verbose > 2; +$imap->logout(); + +# calculate elapsed time and issue warnings +my $time_end = time; +my $elapsedtime = $time_end - $time_start; +$report->{seconds} = $elapsedtime; + +# print report and exit with known status + +if($quotaPercentage >= $quotaPercentageCritical) { + print "IMAP QUOTA CRITICAL - $quotaMessage\n"; + exit $status{CRITICAL}; +} +if($quotaPercentage >= $quotaPercentageWarning) { + print "IMAP QUOTA WARNING - $quotaMessage\n"; + exit $status{WARNING}; +} +print "IMAP QUOTA OK - $quotaMessage\n"; +exit $status{OK}; + + +# utility to load required modules. exits if unable to load one or more of the modules. +sub load_modules { + my @missing_modules = (); + foreach( @_ ) { + eval "require $_"; + push @missing_modules, $_ if $@; + } + if( @missing_modules ) { + print "Missing perl modules: @missing_modules\n"; + return 0; + } + return 1; +} + + +# NAME +# PluginReport +# SYNOPSIS +# $report = new PluginReport; +# $report->{label1} = "value1"; +# $report->{label2} = "value2"; +# print $report->text(qw/label1 label2/); +package PluginReport; + +sub new { + my ($proto,%p) = @_; + my $class = ref($proto) || $proto; + my $self = bless {}, $class; + $self->{$_} = $p{$_} foreach keys %p; + return $self; +} + +sub text { + my ($self,@labels) = @_; + my @report = map { "$self->{$_} $_" } grep { defined $self->{$_} } @labels; + my $text = join(", ", @report); + return $text; +} + + +package main; +1; + +__END__ + + +=pod + +=head1 NAME + +check_imap_quota - connects to an IMAP account and checks the quota + +=head1 SYNOPSIS + + check_imap_quota -vV + check_imap_quota -? + check_imap_quota --help + +=head1 OPTIONS + +=over + +=item --warning + +Warn if it takes longer than to connect to the IMAP server. Default is 15 seconds. +Also known as: -w + +=item --critical + +Return a critical status if it takes longer than to connect to the IMAP server. Default is 30 seconds. +See also: --capture-critical +Also known as: -c + +=item --timeout + +Abort with critical status if it takes longer than to connect to the IMAP server. Default is 60 seconds. +The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to +connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer +than 30 seconds. +Also known as: -t + +=item --hostname + +Address or name of the IMAP server. Examples: mail.server.com, localhost, 192.168.1.100 +Also known as: -H + +=item --port + +Service port on the IMAP server. Default is 143. If you use SSL, default is 993. +Also known as: -p + +=item --username + +=item --password + +Username and password to use when connecting to IMAP server. +Also known as: -U -P + +=item --mailbox + +Use this option to specify the mailbox to search for messages. Default is INBOX. +Also known as: -m + +=item --ssl + +=item --nossl + +Enable SSL protocol. Requires IO::Socket::SSL. + +Using this option automatically changes the default port from 143 to 993. You can still +override this from the command line using the --port option. + +Use the nossl option to turn off the ssl option. + +=item --hires + +Use the Time::HiRes module to measure time, if available. + +=item --verbose + +Display additional information. Useful for troubleshooting. Use together with --version to see the default +warning and critical timeout values. + +If the selected mailbox was not found, you can use verbosity level 3 (-vvv) to display a list of all +available mailboxes on the server. + +Also known as: -v + +=item --version + +Display plugin version and exit. +Also known as: -V + +=item --help + +Display this documentation and exit. Does not work in the ePN version. +Also known as: -h + +=item --usage + +Display a short usage instruction and exit. + +=back + +=head1 EXAMPLES + +=head2 Report how many emails are in the mailbox + + $ check_imap_receive -H mail.server.net --username mailuser --password mailpass + -s ALL --nodelete + + IMAP RECEIVE OK - 1 seconds, 7 found + +=head2 Report the email with the highest value + +Suppose your mailbox has some emails from an automated script and that a message +from this script typically looks like this (abbreviated): + + To: mailuser@server.net + From: autoscript@server.net + Subject: Results of Autoscript + Date: Wed, 09 Nov 2005 08:30:40 -0800 + Message-ID: + + Homeruns 5 + +And further suppose that you are interested in reporting the message that has the +highest number of home runs, and also to leave this message in the mailbox for future +checks, but remove the other matching messages with lesser values: + + $ check_imap_receive -H mail.server.net --username mailuser --password mailpass + -s SUBJECT -s "Results of Autoscript" --capture-max "Homeruns (\d+)" --nodelete-captured + + IMAP RECEIVE OK - 1 seconds, 3 found, 1 captured, 5 max, 2 deleted + +=head2 Troubleshoot your search parameters + +Add the --nodelete and --imap-retries=1 parameters to your command line. + +=head1 EXIT CODES + +Complies with the Nagios plug-in specification: + 0 OK The plugin was able to check the service and it appeared to be functioning properly + 1 Warning The plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly + 2 Critical The plugin detected that either the service was not running or it was above some "critical" threshold + 3 Unknown Invalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service + +=head1 NAGIOS PLUGIN NOTES + +Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html + +This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because +the path to utils.pm must be specified completely in this program and forces users to edit the source +code if their install location is different (if they realize this is the problem). You can view +the default timeout for this module by using the --verbose and --version options together. The +short form is -vV. + +Other than that, it attempts to follow published guidelines for Nagios plugins. + +=head1 SEE ALSO + +http://nagios.org/ +http://search.cpan.org/~djkernen/Mail-IMAPClient-2.2.9/IMAPClient.pod +http://search.cpan.org/~markov/Mail-IMAPClient-3.00/lib/Mail/IMAPClient.pod + +=head1 CHANGES + + Fri Nov 11 04:53:09 AST 2011 + + version 0.1 created with quota code contributed by Johan Romme + + Tue Dec 20 17:38:04 PST 2011 + + fixed bug where a quota of 0 was reported as an incorrect response from the server, thanks to Eike Arndt + + version 0.2 + +=head1 AUTHOR + +Jonathan Buhacoff + +=head1 COPYRIGHT AND LICENSE + + Copyright (C) 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 . + + http://www.gnu.org/licenses/gpl.txt + +=cut + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_quota_epn b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_quota_epn new file mode 100644 index 0000000..d43877f --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_quota_epn @@ -0,0 +1,235 @@ +#!/usr/bin/perl +use strict; +my $VERSION = '0.2'; +my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +my $LICENSE = 'http://www.gnu.org/licenses/gpl.txt'; +my %status = ( 'OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3 ); + +#### IDEA AND INITIAL IMPLEMENTATION BASED ON CHECK_IMAP_RECEIVE WAS CONTRIBUTED BY JOHAN ROMME from THE NETHERLANDS 14 Oct 2011 + +# look for required modules +exit $status{UNKNOWN} unless load_modules(qw/Getopt::Long Mail::IMAPClient/); + +BEGIN { + if( grep { /^--hires$/ } @ARGV ) { + eval "use Time::HiRes qw(time);"; + warn "Time::HiRes not installed\n" if $@; + } +} + +# get options from command line +Getopt::Long::Configure("bundling"); +my $verbose = 0; +my $help = ""; +my $help_usage = ""; +my $show_version = ""; +my $imap_server = ""; +my $default_imap_port = "143"; +my $default_imap_ssl_port = "993"; +my $imap_port = ""; +my $username = ""; +my $password = ""; +my $mailbox = "INBOX"; +my $warntime = 15; +my $criticaltime = 30; +my $timeout = 60; +my $peek = ""; +my $ssl = 0; +my $tls = 0; +my $time_hires = ""; +my $ok; +$ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, + "v|verbose+"=>\$verbose,"h|help"=>\$help,"usage"=>\$help_usage, + "w|warning=i"=>\$warntime,"c|critical=i"=>\$criticaltime,"t|timeout=i"=>\$timeout, + # imap settings + "H|hostname=s"=>\$imap_server,"p|port=i"=>\$imap_port, + "U|username=s"=>\$username,"P|password=s"=>\$password, "m|mailbox=s"=>\$mailbox, + "ssl!"=>\$ssl, "tls!"=>\$tls, + # search settings + "peek!"=>\$peek, + # Time + "hires"=>\$time_hires, + ); + +if( $show_version ) { + print "$VERSION\n"; + if( $verbose ) { + print "Default warning threshold: $warntime seconds\n"; + print "Default critical threshold: $criticaltime seconds\n"; + print "Default timeout: $timeout seconds\n"; + } + exit $status{UNKNOWN}; +} + +if( $help ) { + exec "perldoc", $0 or print "Try `perldoc $0`\n"; + exit $status{UNKNOWN}; +} + +my @required_module = (); +push @required_module, 'IO::Socket::SSL' if $ssl || $tls; +exit $status{UNKNOWN} unless load_modules(@required_module); + +if( $help_usage + || + ( $imap_server eq "" || $username eq "" || $password eq "" ) + ) { + print "Usage: $0 -H host [-p port] -U username -P password [--imap-retries ]\n"; + exit $status{UNKNOWN}; +} + + +# initialize +my $report = new PluginReport; +my $time_start = time; + +# connect to IMAP server +print "connecting to server $imap_server\n" if $verbose > 2; +my $imap; +eval { + local $SIG{ALRM} = sub { die "exceeded timeout $timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm` + alarm $timeout; + + if( $ssl || $tls ) { + $imap_port = $default_imap_ssl_port unless $imap_port; + my $socket = IO::Socket::SSL->new("$imap_server:$imap_port"); + die IO::Socket::SSL::errstr() unless $socket; + $socket->autoflush(1); + $imap = Mail::IMAPClient->new(Socket=>$socket, Debug => 0 ); + $imap->State(Mail::IMAPClient->Connected); + $imap->_read_line() if "$Mail::IMAPClient::VERSION" le "2.2.9"; # necessary to remove the server's "ready" line from the input buffer for old versions of Mail::IMAPClient. Using string comparison for the version check because the numeric didn't work on Darwin and for Mail::IMAPClient the next version is 2.3.0 and then 3.00 so string comparison works + $imap->User($username); + $imap->Password($password); + $imap->login() or die "$@"; + } + else { + $imap_port = $default_imap_port unless $imap_port; + $imap = Mail::IMAPClient->new(Debug => 0 ); + $imap->Server("$imap_server:$imap_port"); + $imap->User($username); + $imap->Password($password); + $imap->connect() or die "$@"; + } + + $imap->Peek(1) if $peek; + $imap->Ignoresizeerrors(1); + + alarm 0; +}; +if( $@ ) { + chomp $@; + print "IMAP QUOTA CRITICAL - Could not connect to $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} +unless( $imap ) { + print "IMAP QUOTA CRITICAL - Could not connect to $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} +my $time_connected = time; + +my $quotaUsed; +my $quotaLimit; +my $quotaPercentage; +my $quotaPercentageWarning = 80; +my $quotaPercentageCritical = 90; +my $quotaMessage; + +# look for the quota limits +my $tries = 0; +my @msgs; + +eval { + my $k; + my @l = $imap->getquotaroot(); + foreach $k (@l) { + print "$k\n" if $verbose > 2; + if ($k =~ /STORAGE +(\d+) +(\d+)/) { + $quotaUsed = $1; + $quotaLimit = $2; + } + } + if (!length($quotaUsed) && !length($quotaLimit)) { + print "no answer from imap host\n" if $verbose > 2; + } elsif (!length($quotaUsed) || !length($quotaLimit) { + print "incorrect answer from imap host\n"; + $imap->close(); + exit $status{UNKNOWN}; + } else { + $quotaPercentage = sprintf("%.1f", (100 * $quotaUsed) / $quotaLimit); + $quotaMessage = "$quotaUsed $quotaLimit - $quotaPercentage%"; + } +}; +if( $@ ) { + chomp $@; + print "IMAP QUOTA CRITICAL - Could not check quota at $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} + + +# disconnect from IMAP server +print "disconnecting from server\n" if $verbose > 2; +$imap->logout(); + +# calculate elapsed time and issue warnings +my $time_end = time; +my $elapsedtime = $time_end - $time_start; +$report->{seconds} = $elapsedtime; + +# print report and exit with known status + +if($quotaPercentage >= $quotaPercentageCritical) { + print "IMAP QUOTA CRITICAL - $quotaMessage\n"; + exit $status{CRITICAL}; +} +if($quotaPercentage >= $quotaPercentageWarning) { + print "IMAP QUOTA WARNING - $quotaMessage\n"; + exit $status{WARNING}; +} +print "IMAP QUOTA OK - $quotaMessage\n"; +exit $status{OK}; + + +# utility to load required modules. exits if unable to load one or more of the modules. +sub load_modules { + my @missing_modules = (); + foreach( @_ ) { + eval "require $_"; + push @missing_modules, $_ if $@; + } + if( @missing_modules ) { + print "Missing perl modules: @missing_modules\n"; + return 0; + } + return 1; +} + + +# NAME +# PluginReport +# SYNOPSIS +# $report = new PluginReport; +# $report->{label1} = "value1"; +# $report->{label2} = "value2"; +# print $report->text(qw/label1 label2/); +package PluginReport; + +sub new { + my ($proto,%p) = @_; + my $class = ref($proto) || $proto; + my $self = bless {}, $class; + $self->{$_} = $p{$_} foreach keys %p; + return $self; +} + +sub text { + my ($self,@labels) = @_; + my @report = map { "$self->{$_} $_" } grep { defined $self->{$_} } @labels; + my $text = join(", ", @report); + return $text; +} + + +package main; +1; + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_receive b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_receive new file mode 100644 index 0000000..6b4fd86 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_receive @@ -0,0 +1,999 @@ +#!/usr/bin/perl +use strict; +my $VERSION = '0.7.5'; +my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +my $LICENSE = 'http://www.gnu.org/licenses/gpl.txt'; +my %status = ( 'OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3 ); + +# look for required modules +exit $status{UNKNOWN} unless load_modules(qw/Getopt::Long Mail::IMAPClient/); + +BEGIN { + if( grep { /^--hires$/ } @ARGV ) { + eval "use Time::HiRes qw(time);"; + warn "Time::HiRes not installed\n" if $@; + } +} + +# get options from command line +Getopt::Long::Configure("bundling"); +my $verbose = 0; +my $help = ""; +my $help_usage = ""; +my $show_version = ""; +my $imap_server = ""; +my $default_imap_port = "143"; +my $default_imap_ssl_port = "993"; +my $imap_port = ""; +my $username = ""; +my $password = ""; +my $mailbox = "INBOX"; +my @search = (); +my $search_critical_min = 1; +my $search_critical_max = -1; # -1 means disabled for this option +my $search_warning_min = 1; +my $search_warning_max = -1; # -1 means disabled for this option +my $capture_max = ""; +my $capture_min = ""; +my $delete = 1; +my $no_delete_captured = ""; +my $warntime = 15; +my $criticaltime = 30; +my $timeout = 60; +my $interval = 5; +my $max_retries = 10; +my $download = ""; +my $download_max = ""; +my $peek = ""; +my $template = ""; +my $ssl = 0; +my $ssl_ca_file = ""; +my $tls = 0; +my $time_hires = ""; +my $ok; +$ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, + "v|verbose+"=>\$verbose,"h|help"=>\$help,"usage"=>\$help_usage, + "w|warning=i"=>\$warntime,"c|critical=i"=>\$criticaltime,"t|timeout=i"=>\$timeout, + # imap settings + "H|hostname=s"=>\$imap_server,"p|port=i"=>\$imap_port, + "U|username=s"=>\$username,"P|password=s"=>\$password, "m|mailbox=s"=>\$mailbox, + "imap-check-interval=i"=>\$interval,"imap-retries=i"=>\$max_retries, + "ssl!"=>\$ssl, "ssl-ca-file=s"=>\$ssl_ca_file, "tls!"=>\$tls, + # search settings + "s|search=s"=>\@search, + "search-critical-min=i"=>\$search_critical_min, "search-critical-max=i"=>\$search_critical_max, + "search-warning-min=i"=>\$search_warning_min, "search-warning-max=i"=>\$search_warning_max, + "capture-max=s"=>\$capture_max, "capture-min=s"=>\$capture_min, + "delete!"=>\$delete, "nodelete-captured"=>\$no_delete_captured, + "download!"=>\$download, "download_max=i"=>\$download_max, "download-max=i"=>\$download_max, + "peek!"=>\$peek, + "template!"=>\$template, + # Time + "hires"=>\$time_hires, + ); + +if( $show_version ) { + print "$VERSION\n"; + if( $verbose ) { + print "Default warning threshold: $warntime seconds\n"; + print "Default critical threshold: $criticaltime seconds\n"; + print "Default timeout: $timeout seconds\n"; + } + exit $status{UNKNOWN}; +} + +if( $help ) { + exec "perldoc", $0 or print "Try `perldoc $0`\n"; + exit $status{UNKNOWN}; +} + +my @required_module = (); +push @required_module, 'IO::Socket::SSL' if $ssl || $tls; +push @required_module, 'Email::Simple' if $download; +push @required_module, ('Text::Template','Date::Manip') if $template; +exit $status{UNKNOWN} unless load_modules(@required_module); + +if( $help_usage + || + ( $imap_server eq "" || $username eq "" || $password eq "" || scalar(@search)==0 ) + ) { + print "Usage: $0 -H host [-p port] -U username -P password -s HEADER -s X-Nagios -s 'ID: 1234.' [-w ] [-c ] [--imap-check-interval ] [--imap-retries ]\n"; + exit $status{UNKNOWN}; +} + +# before attempting to connect to the server, check if any of the search parameters +# use substitution functions and make sure we can parse them first. if we can't we +# need to abort since the search will be meaningless. +if( $template ) { + foreach my $token (@search) { + my $t = Text::Template->new(TYPE=>'STRING',SOURCE=>$token,PACKAGE=>'ImapSearchTemplate'); + $token = $t->fill_in(PREPEND=>q{package ImapSearchTemplate;}); + #print "token: $token\n"; + } +} + + +# initialize +my $report = new PluginReport; +my $time_start = time; + +# connect to IMAP server +print "connecting to server $imap_server\n" if $verbose > 2; +my $imap; +eval { + local $SIG{ALRM} = sub { die "exceeded timeout $timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm` + alarm $timeout; + + if( $ssl || $tls ) { + $imap_port = $default_imap_ssl_port unless $imap_port; + my %ssl_args = (); + if( length($ssl_ca_file) > 0 ) { + $ssl_args{SSL_verify_mode} = 1; + $ssl_args{SSL_ca_file} = $ssl_ca_file; + $ssl_args{SSL_verifycn_scheme} = 'imap'; + $ssl_args{SSL_verifycn_name} = $imap_server; + } + my $socket = IO::Socket::SSL->new(PeerAddr=>"$imap_server:$imap_port", %ssl_args); + die IO::Socket::SSL::errstr() . " (if you get this only when using both --ssl and --ssl-ca-file, but not when using just --ssl, the server SSL certificate failed validation)" unless $socket; + $socket->autoflush(1); + $imap = Mail::IMAPClient->new(Socket=>$socket, Debug => 0 ); + $imap->State(Mail::IMAPClient->Connected); + $imap->_read_line() if "$Mail::IMAPClient::VERSION" le "2.2.9"; # necessary to remove the server's "ready" line from the input buffer for old versions of Mail::IMAPClient. Using string comparison for the version check because the numeric didn't work on Darwin and for Mail::IMAPClient the next version is 2.3.0 and then 3.00 so string comparison works + $imap->User($username); + $imap->Password($password); + $imap->login() or die "Cannot login: $@"; + } + else { + $imap_port = $default_imap_port unless $imap_port; + $imap = Mail::IMAPClient->new(Debug => 0 ); + $imap->Server("$imap_server:$imap_port"); + $imap->User($username); + $imap->Password($password); + $imap->connect() or die "$@"; + } + + $imap->Peek(1) if $peek; + $imap->Ignoresizeerrors(1); + + alarm 0; +}; +if( $@ ) { + chomp $@; + print "IMAP RECEIVE CRITICAL - Could not connect to $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} +unless( $imap ) { + print "IMAP RECEIVE CRITICAL - Could not connect to $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} +my $time_connected = time; + +# select a mailbox +print "selecting mailbox $mailbox\n" if $verbose > 2; +unless( $imap->select($mailbox) ) { + print "IMAP RECEIVE CRITICAL - Could not select $mailbox: $@ $!\n"; + if( $verbose > 2 ) { + print "Mailbox list:\n" . join("\n", $imap->folders) . "\n"; + print "Mailbox separator: " . $imap->separator . "\n"; + ##print "Special mailboxes:\n" . join("\n", map { "$_ => ". + } + $imap->logout(); + exit $status{CRITICAL}; +} + + +# search for messages +my $tries = 0; +my @msgs; +until( scalar(@msgs) != 0 || $tries >= $max_retries ) { + eval { + $imap->select( $mailbox ); + # if download flag is on, we download recent messages and search ourselves + if( $download ) { + print "downloading messages to search\n" if $verbose > 2; + @msgs = download_and_search($imap,@search); + } + else { + print "searching on server\n" if $verbose > 2; + @msgs = $imap->search(@search); + die "Invalid search parameters: $@" if $@; + } + }; + if( $@ ) { + chomp $@; + print "Cannot search messages: $@\n"; + $imap->close(); + $imap->logout(); + exit $status{UNKNOWN}; + } + $report->{found} = scalar(@msgs); + $tries++; + sleep $interval unless (scalar(@msgs) != 0 || $tries >= $max_retries); +} + +sub download_and_search { + my ($imap,@search) = @_; + my $ims = new ImapMessageSearch; + $ims->querytokens(@search); + my @found = (); + @msgs = reverse $imap->messages or (); # die "Cannot list messages: $@\n"; # reversing to get descending order, which is most recent messages first! (at least on my mail servers) + @msgs = @msgs[0..$download_max-1] if $download_max && scalar(@msgs) > $download_max; + foreach my $m (@msgs) { + my $message = $imap->message_string($m); + push @found, $m if $ims->match($message); + } + return @found; +} + + + +# capture data in messages +my $captured_max_id = ""; +my $captured_min_id = ""; +if( $capture_max || $capture_min ) { + my $max = undef; + my $min = undef; + my %captured = (); + for (my $i=0;$i < scalar(@msgs); $i++) { + my $message = $imap->message_string($msgs[$i]); + if( $message =~ m/$capture_max/ ) { + if( !defined($max) || $1 > $max ) { + $captured{ $i } = 1; + $max = $1; + $captured_max_id = $msgs[$i]; + } + } + if( $message =~ m/$capture_min/ ) { + if( !defined($min) || $1 < $min ) { + $captured{ $i } = 1; + $min = $1; + $captured_min_id = $msgs[$i]; + } + } + print $message if $verbose > 1; + } + $report->{captured} = scalar keys %captured; + $report->{max} = $max if defined $max; + $report->{min} = $min if defined $min; +} + +# delete messages +if( $delete ) { + print "deleting matching messages\n" if $verbose > 2; + my $deleted = 0; + for (my $i=0;$i < scalar(@msgs); $i++) { + next if ($no_delete_captured && ($captured_max_id eq $msgs[$i])); + next if ($no_delete_captured && ($captured_min_id eq $msgs[$i])); + $imap->delete_message($msgs[$i]); + $deleted++; + } + $report->{deleted} = $deleted; + $imap->expunge() if $deleted; +} + +# deselect the mailbox +$imap->close(); + +# disconnect from IMAP server +print "disconnecting from server\n" if $verbose > 2; +$imap->logout(); + +# calculate elapsed time and issue warnings +my $time_end = time; +my $elapsedtime = $time_end - $time_start; +$report->{seconds} = $elapsedtime; +$report->{found} = 0 unless defined $report->{found}; +$report->{captured} = 0 unless defined $report->{captured}; + +my @warning = (); +my @critical = (); + +push @warning, "found less than $search_warning_min" if( scalar(@msgs) < $search_warning_min ); +push @warning, "found more than $search_warning_max" if ( $search_warning_max > -1 && scalar(@msgs) > $search_warning_max ); +push @critical, "found less than $search_critical_min" if ( scalar(@msgs) < $search_critical_min ); +push @critical, "found more than $search_critical_max" if ( $search_critical_max > -1 && scalar(@msgs) > $search_critical_max ); +push @warning, "connection time more than $warntime" if( $time_connected - $time_start > $warntime ); +push @critical, "connection time more than $criticaltime" if( $time_connected - $time_start > $criticaltime ); + +# print report and exit with known status +my $perf_data = "elapsed=".$report->{seconds}."s found=".$report->{found}."messages captured=".$report->{captured}."messages"; # TODO: need a component for safely generating valid perf data format. for notes on the format, see http://www.perfparse.de/tiki-view_faq.php?faqId=6 and http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN185 +my $short_report = $report->text(qw/seconds found captured max min deleted/) . " | $perf_data"; +if( scalar @critical ) { + my $crit_alerts = join(", ", @critical); + print "IMAP RECEIVE CRITICAL - $crit_alerts; $short_report\n"; + exit $status{CRITICAL}; +} +if( scalar @warning ) { + my $warn_alerts = join(", ", @warning); + print "IMAP RECEIVE WARNING - $warn_alerts; $short_report\n"; + exit $status{WARNING}; +} +print "IMAP RECEIVE OK - $short_report\n"; +exit $status{OK}; + + +# utility to load required modules. exits if unable to load one or more of the modules. +sub load_modules { + my @missing_modules = (); + foreach( @_ ) { + eval "require $_"; + push @missing_modules, $_ if $@; + } + if( @missing_modules ) { + print "Missing perl modules: @missing_modules\n"; + return 0; + } + return 1; +} + + +# NAME +# PluginReport +# SYNOPSIS +# $report = new PluginReport; +# $report->{label1} = "value1"; +# $report->{label2} = "value2"; +# print $report->text(qw/label1 label2/); +package PluginReport; + +sub new { + my ($proto,%p) = @_; + my $class = ref($proto) || $proto; + my $self = bless {}, $class; + $self->{$_} = $p{$_} foreach keys %p; + return $self; +} + +sub text { + my ($self,@labels) = @_; + my @report = map { "$self->{$_} $_" } grep { defined $self->{$_} } @labels; + my $text = join(", ", @report); + return $text; +} + +package ImapMessageSearch; + +require Email::Simple; + +sub new { + my ($proto,%p) = @_; + my $class = ref($proto) || $proto; + my $self = bless {}, $class; + $self->{querystring} = []; + $self->{querytokens} = []; + $self->{queryfnlist} = []; + $self->{mimemessage} = undef; + $self->{$_} = $p{$_} foreach keys %p; + return $self; +} + +sub querystring { + my ($self,$string) = @_; + $self->{querystring} = $string; + return $self->querytokens( parseimapsearch($string) ); +} + +sub querytokens { + my ($self,@tokens) = @_; + $self->{querytokens} = [@tokens]; + $self->{queryfnlist} = [create_search_expressions(@tokens)]; + return $self; +} + +sub match { + my ($self,$message_string) = @_; + return 0 unless defined $message_string; + my $message_mime = Email::Simple->new($message_string); + return $self->matchmime($message_mime); +} + +sub matchmime { + my ($self,$message_mime) = @_; + my $match = 1; + foreach my $x (@{$self->{queryfnlist}}) { + $match = $match && $x->($message_mime); + } + return $match; +} + +# this should probably become its own Perl module... see also Net::IMAP::Server::Command::Search +sub create_search_expressions { + my (@search) = @_; + return () unless scalar(@search); + my $token = shift @search; + if( $token eq 'TEXT' ) { + my $value = shift @search; + return (sub {shift->as_string =~ /\Q$value\E/i},create_search_expressions(@search)); + } + if( $token eq 'BODY' ) { + my $value = shift @search; + return (sub {shift->body =~ /\Q$value\E/i},create_search_expressions(@search)); + } + if( $token eq 'SUBJECT' ) { + my $value = shift @search; + return (sub {shift->header('Subject') =~ /\Q$value\E/i},create_search_expressions(@search)); + } + if( $token eq 'HEADER' ) { + my $name = shift @search; + my $value = shift @search; + return (sub {shift->header($name) =~ /\Q$value\E/i},create_search_expressions(@search)); + } + if( $token eq 'NOT' ) { + my @exp = create_search_expressions(@search); + my $next = shift @exp; + return (sub { ! $next->(@_) }, @exp); + } + if( $token eq 'OR' ) { + my @exp = create_search_expressions(@search); + my $next1 = shift @exp; + my $next2 = shift @exp; + return (sub { $next1->(@_) or $next2->(@_) }, @exp); + } + if( $token eq 'SENTBEFORE' ) { + my $value = shift @search; + return (sub {datecmp(shift->header('Date'),$value) < 0},create_search_expressions(@search)); + } + if( $token eq 'SENTON' ) { + my $value = shift @search; + return (sub {datecmp(shift->header('Date'),$value) == 0},create_search_expressions(@search)); + } + if( $token eq 'SENTSINCE' ) { + my $value = shift @search; + return (sub {datecmp(shift->header('Date'),$value) > 0},create_search_expressions(@search)); + } + return sub { die "invalid search parameter: $token" }; +} + +sub datecmp { + my ($date1,$date2) = @_; + my $parsed1 = Date::Manip::ParseDate($date1); + my $parsed2 = Date::Manip::ParseDate($date2); + my $cmp = Date::Manip::Date_Cmp($parsed1,$parsed2); + print " $date1 <=> $date2 -> $cmp\n"; + return $cmp <=> 0; +} + +package ImapSearchTemplate; + +# Takes an English date specification ("now", etc) and an optional offset ("-4 hours") +# and returns an RFC 2822 formatted date string. +# see http://search.cpan.org/dist/Date-Manip/lib/Date/Manip.pod +sub rfc2822dateHeader { + my ($when,$delta) = @_; + $when = Date::Manip::ParseDate($when); + $delta = Date::Manip::ParseDateDelta($delta) if $delta; + my $d = $delta ? Date::Manip::DateCalc($when,$delta) : $when; + return Date::Manip::UnixDate($d, "%a, %d %b %Y %H:%M:%S %z"); +} + +sub rfc2822date { + my ($when,$delta) = @_; + $when = Date::Manip::ParseDate($when); + $delta = Date::Manip::ParseDateDelta($delta) if $delta; + my $d = $delta ? Date::Manip::DateCalc($when,$delta) : $when; + return Date::Manip::UnixDate($d, "%d-%b-%Y"); +} + +# alias for 2822 ... RFC 822 is an older version and specifies 2-digit years, but we ignore that for now. +sub rfc822dateHeader { return rfc2822dateHeader(@_); } +sub rfc822date { return rfc2822date(@_); } + +sub date { + my ($format,$when,$delta) = @_; + $when = Date::Manip::ParseDate($when); + $delta = Date::Manip::ParseDateDelta($delta) if $delta; + my $d = $delta ? Date::Manip::DateCalc($when,$delta) : $when; + return Date::Manip::UnixDate($d, $format); +} + +package main; +1; + +__END__ + + +=pod + +=head1 NAME + +check_imap_receive - connects to and searches an IMAP account for messages + +=head1 SYNOPSIS + + check_imap_receive -vV + check_imap_receive -? + check_imap_receive --help + +=head1 OPTIONS + +=over + +=item --warning + +Warn if it takes longer than to connect to the IMAP server. Default is 15 seconds. +Also known as: -w + +=item --critical + +Return a critical status if it takes longer than to connect to the IMAP server. Default is 30 seconds. +See also: --capture-critical +Also known as: -c + +=item --timeout + +Abort with critical status if it takes longer than to connect to the IMAP server. Default is 60 seconds. +The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to +connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer +than 30 seconds. +Also known as: -t + +=item --imap-check-interval + +How long to wait after searching for a matching message before searching again. Only takes effect +if no messages were found. Default is 5 seconds. + +=item --imap-retries + +How many times to try searching for a matching message before giving up. If you set this to 0 then +messages will not be searched at all. Setting this to 1 means the plugin only tries once. Etc. +Default is 10 times. + +=item --hostname + +Address or name of the IMAP server. Examples: mail.server.com, localhost, 192.168.1.100 +Also known as: -H + +=item --port + +Service port on the IMAP server. Default is 143. If you use SSL, default is 993. +Also known as: -p + +=item --username + +=item --password + +Username and password to use when connecting to IMAP server. +Also known as: -U -P + +=item --mailbox + +Use this option to specify the mailbox to search for messages. Default is INBOX. +Also known as: -m + +=item --search + +Use this option to filter the messages. Default is not to filter. You may (must) use this option +multiple times in order to create any valid IMAP search criteria. See the examples and see also +http://www.ietf.org/rfc/rfc2060.txt (look for section 6.4.4, the SEARCH command) + +This is the way to find messages matching a given subject: + -s SUBJECT -s "a given subject" + +You can use the following technique for any header, including Subject. To find "Header-Name: some value": + -s HEADER -s Header-Name -s "some value" + +Modern IMAP servers that support rfc5032 extensions allow you to search for messages +older or younger than a number of seconds. So to find messages received in the past hour, +you can do: + + -s YOUNGER -s 3600 + +Or to find messages received more than 5 minutes ago, you can do: + + -s OLDER -s 300 + +Also known as: -s + +=item --download + +=item --nodownload + +This option causes all messages in the specified mailbox to be downloaded from the server +and searched locally. See --download-max if you only want to download a few messages. +Currently only the following RFC 2060 search criteria are supported: +TEXT, BODY, SUBJECT, HEADER, NOT, OR, SENTBEFORE, SENTON, SENTSINCE. + +Requires Email::Simple to be installed. It is available on CPAN. + +This option may be particularly useful to you if your mail server is slow to index +messages (like Exchange 2003), causing the plugin not to find them with IMAP SEARCH +even though they are in the inbox. + +It's also useful if you're searching for messages that have been on the server for a +specified amount of time, like some minutes or hours, because the standard IMAP search +function only allows whole dates. For this, use the standard search keywords but you +can specify either just a date like in RFC 2060 or a date and a time. + +If you use SENTBEFORE, SENTON, or SENTSINCE, you must have Date::Manip installed +on your system. + + +=item --download-max + +Limits the number of messages downloaded from the server when the --download option is used. +Default is to download and search all messages. + +=item --search-critical-min + +This option will trigger a CRITICAL status if the number of messages found by the search criteria +is below the given number. Use in conjunction with --search. + +This parameter defaults to 1 so that if no messages are found, the plugin will exit with a CRITICAL status. + +If you want the original behavior where the plugin exits with a WARNING status when no messages are found, +set this parameter to 0. + +=item --search-critical-max + +This option will trigger a CRITICAL status if the number of messages found by the search criteria +is above the given number. Use in conjunction with --search. + +This parameter defaults to -1 meaning it's disabled. If you set it to 10, the plugin will exit with +CRITICAL if it finds 11 messages. If you set it to 1, the plugin will exit with CRITICAL if it finds +any more than 1 message. If you set it to 0, the plugin will exit with CRITICAL if it finds any messages +at all. If you set it to -1 it will be disabled. + +=item --search-warning-min + +This option will trigger a WARNING status if the number of messages found by the search criteria +is below the given number. Use in conjunction with --search. + +This parameter defaults to 1 so that if no messages are found, the plugin will exit with a WARNING status. + +If you want to suppress the original behavior where the plugin exits with a WARNING status when no messages are found, +set this parameter to 0. When this parameter is 0, it means that you expect the mailbox not to have any messages. + +=item --search-warning-max + +This option will trigger a WARNING status if the number of messages found by the search criteria +is above the given number. Use in conjunction with --search. + +This parameter defaults to -1 meaning it's disabled. If you set it to 10, the plugin will exit with +WARNING if it finds 11 messages. If you set it to 1, the plugin will exit with WARNING if it finds +any more than 1 message. If you set it to 0, the plugin will exit with WARNING if it finds any messages +at all. If you set it to -1 it will be disabled. + +=item --capture-max + +In addition to specifying search arguments to filter the emails in the IMAP account, you can specify +a "capture-max" regexp argument and the eligible emails (found with search arguments) +will be compared to each other and the OK line will have the highest captured value. + +The regexp is expected to capture a numeric value. + +=item --capture-min + +In addition to specifying search arguments to filter the emails in the IMAP account, you can specify +a "capture-min" regexp argument and the eligible emails (found with search arguments) +will be compared to each other and the OK line will have the lowest captured value. + +The regexp is expected to capture a numeric value. + +=item --delete + +=item --nodelete + +Use the delete option to delete messages that matched the search criteria. This is useful for +preventing the mailbox from filling up with automated messages (from the check_smtp_send plugin, for example). +THE DELETE OPTION IS TURNED *ON* BY DEFAULT, in order to preserve compatibility with an earlier version. + +Use the nodelete option to turn off the delete option. + +=item --nodelete-captured + +If you use both the capture-max and delete arguments, you can also use the nodelete-captured argument to specify that the email +with the highest captured value should not be deleted. This leaves it available for comparison the next time this plugin runs. + +If you do not use the delete option, this option has no effect. + +=item --ssl + +=item --nossl + +Enable SSL protocol. Requires IO::Socket::SSL. + +Using this option automatically changes the default port from 143 to 993. You can still +override this from the command line using the --port option. + +Use the nossl option to turn off the ssl option. + +=item --ssl-ca-file + +Use this to verify the server SSL certificate against a local .pem file. You'll need to +specify the path to the .pem file as the parameter. + +You can use the imap_ssl_cert utility included in this distribution to connect to your IMAP +server and save its SSL certificates into your .pem file. Usage is like this: + + imap_ssl_cert -H imap.server.com > ca_file.pem + +Only applicable when --ssl option is enabled. + +=item --template + +=item --notemplate + +Enable (or disable) processing of IMAP search parameters. Requires Text::Template and Date::Manip. + +Use this option to apply special processing to IMAP search parameters that allows you to use the +results of arbitrary computations as the parameter values. For example, you can use this feature +to search for message received up to 4 hours ago. + +Modern IMAP servers that support rfc5032 extensions allow searching with the YOUNGER and OLDER +criteria so a message received up to 4 hours ago is -s YOUNGER -s 14400. But if your mail server +doesn't support that, you could use the --template option to get similar functionality. + +When you enable the --template option, each parameter you pass to the -s option is parsed by +Text::Template. See the Text::Template manual for more information, but in general any expression +written in Perl will work. + +A convenience function called rfc2822dateHeader is provided to you so you can easily compute properly +formatted dates for use as search parameters. The rfc2822date function can take one or two +parameters itself: the date to format and an optional offset. To use the current time as a +search parameter, you can write this: + + $ check_imap_receive ... --template -s HEADER -s Delivery-Date -s '{rfc2822dateHeader("now")}' + +The output of {rfc2822dateHeader("now")} looks like this: Wed, 30 Sep 2009 22:44:03 -0700 and +is suitable for use with a date header, like HEADER Delivery-Date. + +To use a time in the past relative to the current time or day, you can use a second convenience function +called rfc2822date and write this: + + $ check_imap_receive ... --template -s SENTSINCE -s '{rfc2822date("now","-1 day")}' + +The output of {rfc2822date("now","-1 day")} looks like this: 29-Sep-2009 and is suitable for use +with BEFORE, ON, SENTBEFORE, SENTON, SENTSINCE, and SINCE. + +I have seen some email clients use a different format in the Date field, +like September 17, 2009 9:46:51 AM PDT. To specify an arbitrary format like this one, write this: + + $ check_imap_receive ... --template -s HEADER -s Delivery-Date -s '{date("%B %e, %Y %i:%M:%S %p %Z","now","-4 hours")}' + +You can use BEFORE, ON, SENTBEFORE, SENTON, SENTSINCE, or SINCE to search for messages that arrived +on, before, or after a given day but not on, before, or after a specific time on that day. + +To search for messages that arrived on, before, or after a specific time you have to use the +Delivery-Date or another date field, like with -s HEADER -s Delivery-Date in the example above. + +See the Date::Manip manual for more information on the allowed expressions for date and delta strings. + +=item --hires + +Use the Time::HiRes module to measure time, if available. + +=item --verbose + +Display additional information. Useful for troubleshooting. Use together with --version to see the default +warning and critical timeout values. + +If the selected mailbox was not found, you can use verbosity level 3 (-vvv) to display a list of all +available mailboxes on the server. + +Also known as: -v + +=item --version + +Display plugin version and exit. +Also known as: -V + +=item --help + +Display this documentation and exit. Does not work in the ePN version. +Also known as: -h + +=item --usage + +Display a short usage instruction and exit. + +=back + +=head1 EXAMPLES + +=head2 Report how many emails are in the mailbox + + $ check_imap_receive -H mail.server.net --username mailuser --password mailpass + -s ALL --nodelete + + IMAP RECEIVE OK - 1 seconds, 7 found + +=head2 Report the email with the highest value + +Suppose your mailbox has some emails from an automated script and that a message +from this script typically looks like this (abbreviated): + + To: mailuser@server.net + From: autoscript@server.net + Subject: Results of Autoscript + Date: Wed, 09 Nov 2005 08:30:40 -0800 + Message-ID: + + Homeruns 5 + +And further suppose that you are interested in reporting the message that has the +highest number of home runs, and also to leave this message in the mailbox for future +checks, but remove the other matching messages with lesser values: + + $ check_imap_receive -H mail.server.net --username mailuser --password mailpass + -s SUBJECT -s "Results of Autoscript" --capture-max "Homeruns (\d+)" --nodelete-captured + + IMAP RECEIVE OK - 1 seconds, 3 found, 1 captured, 5 max, 2 deleted + +=head2 Troubleshoot your search parameters + +Add the --nodelete and --imap-retries=1 parameters to your command line. + +=head1 EXIT CODES + +Complies with the Nagios plug-in specification: + 0 OK The plugin was able to check the service and it appeared to be functioning properly + 1 Warning The plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly + 2 Critical The plugin detected that either the service was not running or it was above some "critical" threshold + 3 Unknown Invalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service + +=head1 NAGIOS PLUGIN NOTES + +Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html + +This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because +the path to utils.pm must be specified completely in this program and forces users to edit the source +code if their install location is different (if they realize this is the problem). You can view +the default timeout for this module by using the --verbose and --version options together. The +short form is -vV. + +Other than that, it attempts to follow published guidelines for Nagios plugins. + +=head1 SEE ALSO + +http://nagios.org/ +http://search.cpan.org/~djkernen/Mail-IMAPClient-2.2.9/IMAPClient.pod +http://search.cpan.org/~markov/Mail-IMAPClient-3.00/lib/Mail/IMAPClient.pod + +=head1 CHANGES + + Wed Oct 29 11:00:00 PST 2005 + + version 0.1 + + Wed Nov 9 09:53:32 PST 2005 + + added delete/nodelete option. deleting found messages is still default behavior. + + added capture-max option + + added nodelete-captured option + + added mailbox option + + added eval/alarm block to implement -c option + + now using an inline PluginReport package to generate the report + + copyright notice and GNU GPL + + version 0.2 + + Thu Apr 20 14:00:00 CET 2006 (by Johan Nilsson ) + + version 0.2.1 + + added support for multiple polls of imap-server, with specified intervals + + Tue Apr 24 21:17:53 PDT 2007 + + now there is an alternate version (same but without embedded perl POD) that is compatible with the new new embedded-perl Nagios feature + + added patch from Benjamin Ritcey for SSL support on machines that have an SSL-enabled + + version 0.2.3 + + Fri Apr 27 18:56:50 PDT 2007 + + fixed problem that "Invalid search parameters" was not printed because of missing newline to flush it + + warnings and critical errors now try to append error messages received from the IMAP client + + changed connection error to display timeout only if timeout was the error + + documentation now mentions every command-line option accepted by the plugin, including abbreviations + + added abbreviations U for username, P for password, m for mailbox + + fixed bug that imap-check-interval applied even after the last try (imap-retries) when it was not necessary + + the IMAP expunge command is not sent unless at least one message is deleted + + fixed bug that the "no messages" warning was printed even if some messages were found + + version 0.3 + + Sun Oct 21 14:08:07 PDT 2007 + + added port info to the "could not connect" error message + + fixed bug that occurred when using --ssl --port 143 which caused port to remain at the default 993 imap/ssl port + + added clarity shortcuts --search-subject and --search-header + + port is no longer a required option. defaults to 143 for regular IMAP and 993 for IMAP/SSL + + version 0.3.1 + + Sun Oct 21 20:41:56 PDT 2007 + + reworked ssl support to use IO::Socket::SSL instead of the convenience method Mail::IMAPClient->Ssl (which is not included in the standard Mail::IMAPClient package) + + removed clarity shortcuts (bad idea, code bloat) + + version 0.4 + + Tue Dec 4 07:05:27 PST 2007 + + added version check to _read_line workaround for SSL-related bug in Mail::IMAPClient version 2.2.9 ; newer versions fixed the bug + + added --usage option because the official nagios plugins have both --help and --usage + + added --timeout option to match the official nagios plugins + + fixed some minor pod formatting issues for perldoc + + version 0.4.1 + + Sat Dec 15 07:39:59 PST 2007 + + improved compatibility with Nagios embedded perl (ePN) + + version 0.4.2 + + Mon Jan 7 21:35:23 PST 2008 + + changed version check for Mail::IMAPClient version 2.2.9 to use string comparison le "2.2.9" + + fixed bug where script was dying on socket->autoflush when socket does not exist because autoflush was being called before checking the socket object + + version 0.4.3 + + Mon Feb 11 19:13:38 PST 2008 + + fixed a bug for embedded perl version, variable "%status" will not stay shared in load_modules + + version 0.4.4 + + Mon May 26 08:33:27 PDT 2008 + + fixed a bug for number captured, it now reflects number of messages captured instead of always returning "1" + + added --capture-min option to complement --capture-max + + added --search-critical-min to trigger a CRITICAL alert if number of messages found is less than argument, with default 1. + + fixed warning and critical messages to use "more than" or "less than" instead of the angle brackets, to make them more web friendly + + version 0.5 + + Wed Jul 2 14:59:05 PDT 2008 + + fixed a bug for not finding a message after the first try, by reselecting the mailbox before each search + + version 0.5.1 + + Sat Dec 13 08:57:29 PST 2008 + + added --download option to allow local searching of messages (useful if your server has an index that handles searching but it takes a while before new emails show up and you want immediate results), supports only the TEXT, BODY, SUBJECT, and HEADER search keys + + added --download-max option to set a limit on number of messages downloaded with --download + + version 0.6.0 + + Wed Sep 30 23:25:33 PDT 2009 + + fixed --download-max option (was incorrectly looking for --download_max). currently both will work, in the future only --download-max will work + + added --template option to allow arbitrary substitutions for search parameters, and provided three convenience functions for working with dates + + added date search criteria to the --download option: SENTBEFORE, SENTON, and SENTSINCE which check the Date header and allow hours and minutes in addition to dates (whereas the IMAP standard only allows dates) + + added --search-critical-max to trigger a CRITICAL alert if number of messages found is more than argument, disabled by default. + + fixed a bug in --download --search where messages would match even though they failed the search criteria + + changed behavior of --download-max to look at the most recent messages first (hopefully); the IMAP protocol doesn't guarantee the order that the messages are returned but I observed that many mail servers return them in chronological order; so now --download-max reverses the order to look at the newer messages first + + added performance data for use with PNP4Nagios! + + version 0.7.0 + + Fri Oct 2 15:22:00 PDT 2009 + + added --search-warning-max and --search-warning-min to trigger a WARNING alert if number of messages is more than or less than the specified number. + + fixed --download option not to fail with CRITICAL if mailbox is empty; now this can be configured with --search-warning-min or --search-critical-min + + version 0.7.1 + + Sat Nov 21 18:27:17 PST 2009 + + fixed problem with using --download option on certain mail servers by turning on the IgnoreSizeErrors feature in IMAPClient + + added --peek option to prevent marking messages as seen + + version 0.7.2 + + Tue Jan 5 12:13:53 PST 2010 + + added error message and exit with unknown status when an unrecognized IMAP search criteria is encountered by the --download --search option + + Wed May 5 11:14:51 PDT 2010 + + added mailbox list when mailbox is not found and verbose level 3 is on (-vvv) + + version 0.7.3 + + Tue Mar 8 18:58:14 AST 2011 + + updated documentation for --search and --template to mention rfc5032 extensions (thanks to Stuart Henderson) + + Fri May 6 08:35:09 AST 2011 + + added --hires option to enable use of Time::Hires if available + + version 0.7.4 + + Fri Nov 11 01:51:40 AST 2011 + + added --ssl-ca-file option to allow verifying the server certificate against a local .pem file (thanks to Alexandre Bezroutchko) + + added imap_ssl_cert.pl utility (not in this file) to conveniently save the server's SSL certificates into a local .pem file + + version 0.7.5 + +=head1 AUTHOR + +Jonathan Buhacoff + +=head1 COPYRIGHT AND LICENSE + + 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 . + + http://www.gnu.org/licenses/gpl.txt + +=cut + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_receive_epn b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_receive_epn new file mode 100644 index 0000000..f1c0fc4 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_imap_receive_epn @@ -0,0 +1,492 @@ +#!/usr/bin/perl +use strict; +my $VERSION = '0.7.5'; +my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +my $LICENSE = 'http://www.gnu.org/licenses/gpl.txt'; +my %status = ( 'OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3 ); + +# look for required modules +exit $status{UNKNOWN} unless load_modules(qw/Getopt::Long Mail::IMAPClient/); + +BEGIN { + if( grep { /^--hires$/ } @ARGV ) { + eval "use Time::HiRes qw(time);"; + warn "Time::HiRes not installed\n" if $@; + } +} + +# get options from command line +Getopt::Long::Configure("bundling"); +my $verbose = 0; +my $help = ""; +my $help_usage = ""; +my $show_version = ""; +my $imap_server = ""; +my $default_imap_port = "143"; +my $default_imap_ssl_port = "993"; +my $imap_port = ""; +my $username = ""; +my $password = ""; +my $mailbox = "INBOX"; +my @search = (); +my $search_critical_min = 1; +my $search_critical_max = -1; # -1 means disabled for this option +my $search_warning_min = 1; +my $search_warning_max = -1; # -1 means disabled for this option +my $capture_max = ""; +my $capture_min = ""; +my $delete = 1; +my $no_delete_captured = ""; +my $warntime = 15; +my $criticaltime = 30; +my $timeout = 60; +my $interval = 5; +my $max_retries = 10; +my $download = ""; +my $download_max = ""; +my $peek = ""; +my $template = ""; +my $ssl = 0; +my $ssl_ca_file = ""; +my $tls = 0; +my $time_hires = ""; +my $ok; +$ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, + "v|verbose+"=>\$verbose,"h|help"=>\$help,"usage"=>\$help_usage, + "w|warning=i"=>\$warntime,"c|critical=i"=>\$criticaltime,"t|timeout=i"=>\$timeout, + # imap settings + "H|hostname=s"=>\$imap_server,"p|port=i"=>\$imap_port, + "U|username=s"=>\$username,"P|password=s"=>\$password, "m|mailbox=s"=>\$mailbox, + "imap-check-interval=i"=>\$interval,"imap-retries=i"=>\$max_retries, + "ssl!"=>\$ssl, "ssl-ca-file=s"=>\$ssl_ca_file, "tls!"=>\$tls, + # search settings + "s|search=s"=>\@search, + "search-critical-min=i"=>\$search_critical_min, "search-critical-max=i"=>\$search_critical_max, + "search-warning-min=i"=>\$search_warning_min, "search-warning-max=i"=>\$search_warning_max, + "capture-max=s"=>\$capture_max, "capture-min=s"=>\$capture_min, + "delete!"=>\$delete, "nodelete-captured"=>\$no_delete_captured, + "download!"=>\$download, "download_max=i"=>\$download_max, "download-max=i"=>\$download_max, + "peek!"=>\$peek, + "template!"=>\$template, + # Time + "hires"=>\$time_hires, + ); + +if( $show_version ) { + print "$VERSION\n"; + if( $verbose ) { + print "Default warning threshold: $warntime seconds\n"; + print "Default critical threshold: $criticaltime seconds\n"; + print "Default timeout: $timeout seconds\n"; + } + exit $status{UNKNOWN}; +} + +if( $help ) { + exec "perldoc", $0 or print "Try `perldoc $0`\n"; + exit $status{UNKNOWN}; +} + +my @required_module = (); +push @required_module, 'IO::Socket::SSL' if $ssl || $tls; +push @required_module, 'Email::Simple' if $download; +push @required_module, ('Text::Template','Date::Manip') if $template; +exit $status{UNKNOWN} unless load_modules(@required_module); + +if( $help_usage + || + ( $imap_server eq "" || $username eq "" || $password eq "" || scalar(@search)==0 ) + ) { + print "Usage: $0 -H host [-p port] -U username -P password -s HEADER -s X-Nagios -s 'ID: 1234.' [-w ] [-c ] [--imap-check-interval ] [--imap-retries ]\n"; + exit $status{UNKNOWN}; +} + +# before attempting to connect to the server, check if any of the search parameters +# use substitution functions and make sure we can parse them first. if we can't we +# need to abort since the search will be meaningless. +if( $template ) { + foreach my $token (@search) { + my $t = Text::Template->new(TYPE=>'STRING',SOURCE=>$token,PACKAGE=>'ImapSearchTemplate'); + $token = $t->fill_in(PREPEND=>q{package ImapSearchTemplate;}); + #print "token: $token\n"; + } +} + + +# initialize +my $report = new PluginReport; +my $time_start = time; + +# connect to IMAP server +print "connecting to server $imap_server\n" if $verbose > 2; +my $imap; +eval { + local $SIG{ALRM} = sub { die "exceeded timeout $timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm` + alarm $timeout; + + if( $ssl || $tls ) { + $imap_port = $default_imap_ssl_port unless $imap_port; + my %ssl_args = (); + if( length($ssl_ca_file) > 0 ) { + $ssl_args{SSL_verify_mode} = 1; + $ssl_args{SSL_ca_file} = $ssl_ca_file; + $ssl_args{SSL_verifycn_scheme} = 'imap'; + $ssl_args{SSL_verifycn_name} = $imap_server; + } + my $socket = IO::Socket::SSL->new(PeerAddr=>"$imap_server:$imap_port", %ssl_args); + die IO::Socket::SSL::errstr() . " (if you get this only when using both --ssl and --ssl-ca-file, but not when using just --ssl, the server SSL certificate failed validation)" unless $socket; + $socket->autoflush(1); + $imap = Mail::IMAPClient->new(Socket=>$socket, Debug => 0 ); + $imap->State(Mail::IMAPClient->Connected); + $imap->_read_line() if "$Mail::IMAPClient::VERSION" le "2.2.9"; # necessary to remove the server's "ready" line from the input buffer for old versions of Mail::IMAPClient. Using string comparison for the version check because the numeric didn't work on Darwin and for Mail::IMAPClient the next version is 2.3.0 and then 3.00 so string comparison works + $imap->User($username); + $imap->Password($password); + $imap->login() or die "Cannot login: $@"; + } + else { + $imap_port = $default_imap_port unless $imap_port; + $imap = Mail::IMAPClient->new(Debug => 0 ); + $imap->Server("$imap_server:$imap_port"); + $imap->User($username); + $imap->Password($password); + $imap->connect() or die "$@"; + } + + $imap->Peek(1) if $peek; + $imap->Ignoresizeerrors(1); + + alarm 0; +}; +if( $@ ) { + chomp $@; + print "IMAP RECEIVE CRITICAL - Could not connect to $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} +unless( $imap ) { + print "IMAP RECEIVE CRITICAL - Could not connect to $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} +my $time_connected = time; + +# select a mailbox +print "selecting mailbox $mailbox\n" if $verbose > 2; +unless( $imap->select($mailbox) ) { + print "IMAP RECEIVE CRITICAL - Could not select $mailbox: $@ $!\n"; + if( $verbose > 2 ) { + print "Mailbox list:\n" . join("\n", $imap->folders) . "\n"; + print "Mailbox separator: " . $imap->separator . "\n"; + ##print "Special mailboxes:\n" . join("\n", map { "$_ => ". + } + $imap->logout(); + exit $status{CRITICAL}; +} + + +# search for messages +my $tries = 0; +my @msgs; +until( scalar(@msgs) != 0 || $tries >= $max_retries ) { + eval { + $imap->select( $mailbox ); + # if download flag is on, we download recent messages and search ourselves + if( $download ) { + print "downloading messages to search\n" if $verbose > 2; + @msgs = download_and_search($imap,@search); + } + else { + print "searching on server\n" if $verbose > 2; + @msgs = $imap->search(@search); + die "Invalid search parameters: $@" if $@; + } + }; + if( $@ ) { + chomp $@; + print "Cannot search messages: $@\n"; + $imap->close(); + $imap->logout(); + exit $status{UNKNOWN}; + } + $report->{found} = scalar(@msgs); + $tries++; + sleep $interval unless (scalar(@msgs) != 0 || $tries >= $max_retries); +} + +sub download_and_search { + my ($imap,@search) = @_; + my $ims = new ImapMessageSearch; + $ims->querytokens(@search); + my @found = (); + @msgs = reverse $imap->messages or (); # die "Cannot list messages: $@\n"; # reversing to get descending order, which is most recent messages first! (at least on my mail servers) + @msgs = @msgs[0..$download_max-1] if $download_max && scalar(@msgs) > $download_max; + foreach my $m (@msgs) { + my $message = $imap->message_string($m); + push @found, $m if $ims->match($message); + } + return @found; +} + + + +# capture data in messages +my $captured_max_id = ""; +my $captured_min_id = ""; +if( $capture_max || $capture_min ) { + my $max = undef; + my $min = undef; + my %captured = (); + for (my $i=0;$i < scalar(@msgs); $i++) { + my $message = $imap->message_string($msgs[$i]); + if( $message =~ m/$capture_max/ ) { + if( !defined($max) || $1 > $max ) { + $captured{ $i } = 1; + $max = $1; + $captured_max_id = $msgs[$i]; + } + } + if( $message =~ m/$capture_min/ ) { + if( !defined($min) || $1 < $min ) { + $captured{ $i } = 1; + $min = $1; + $captured_min_id = $msgs[$i]; + } + } + print $message if $verbose > 1; + } + $report->{captured} = scalar keys %captured; + $report->{max} = $max if defined $max; + $report->{min} = $min if defined $min; +} + +# delete messages +if( $delete ) { + print "deleting matching messages\n" if $verbose > 2; + my $deleted = 0; + for (my $i=0;$i < scalar(@msgs); $i++) { + next if ($no_delete_captured && ($captured_max_id eq $msgs[$i])); + next if ($no_delete_captured && ($captured_min_id eq $msgs[$i])); + $imap->delete_message($msgs[$i]); + $deleted++; + } + $report->{deleted} = $deleted; + $imap->expunge() if $deleted; +} + +# deselect the mailbox +$imap->close(); + +# disconnect from IMAP server +print "disconnecting from server\n" if $verbose > 2; +$imap->logout(); + +# calculate elapsed time and issue warnings +my $time_end = time; +my $elapsedtime = $time_end - $time_start; +$report->{seconds} = $elapsedtime; +$report->{found} = 0 unless defined $report->{found}; +$report->{captured} = 0 unless defined $report->{captured}; + +my @warning = (); +my @critical = (); + +push @warning, "found less than $search_warning_min" if( scalar(@msgs) < $search_warning_min ); +push @warning, "found more than $search_warning_max" if ( $search_warning_max > -1 && scalar(@msgs) > $search_warning_max ); +push @critical, "found less than $search_critical_min" if ( scalar(@msgs) < $search_critical_min ); +push @critical, "found more than $search_critical_max" if ( $search_critical_max > -1 && scalar(@msgs) > $search_critical_max ); +push @warning, "connection time more than $warntime" if( $time_connected - $time_start > $warntime ); +push @critical, "connection time more than $criticaltime" if( $time_connected - $time_start > $criticaltime ); + +# print report and exit with known status +my $perf_data = "elapsed=".$report->{seconds}."s found=".$report->{found}."messages captured=".$report->{captured}."messages"; # TODO: need a component for safely generating valid perf data format. for notes on the format, see http://www.perfparse.de/tiki-view_faq.php?faqId=6 and http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN185 +my $short_report = $report->text(qw/seconds found captured max min deleted/) . " | $perf_data"; +if( scalar @critical ) { + my $crit_alerts = join(", ", @critical); + print "IMAP RECEIVE CRITICAL - $crit_alerts; $short_report\n"; + exit $status{CRITICAL}; +} +if( scalar @warning ) { + my $warn_alerts = join(", ", @warning); + print "IMAP RECEIVE WARNING - $warn_alerts; $short_report\n"; + exit $status{WARNING}; +} +print "IMAP RECEIVE OK - $short_report\n"; +exit $status{OK}; + + +# utility to load required modules. exits if unable to load one or more of the modules. +sub load_modules { + my @missing_modules = (); + foreach( @_ ) { + eval "require $_"; + push @missing_modules, $_ if $@; + } + if( @missing_modules ) { + print "Missing perl modules: @missing_modules\n"; + return 0; + } + return 1; +} + + +# NAME +# PluginReport +# SYNOPSIS +# $report = new PluginReport; +# $report->{label1} = "value1"; +# $report->{label2} = "value2"; +# print $report->text(qw/label1 label2/); +package PluginReport; + +sub new { + my ($proto,%p) = @_; + my $class = ref($proto) || $proto; + my $self = bless {}, $class; + $self->{$_} = $p{$_} foreach keys %p; + return $self; +} + +sub text { + my ($self,@labels) = @_; + my @report = map { "$self->{$_} $_" } grep { defined $self->{$_} } @labels; + my $text = join(", ", @report); + return $text; +} + +package ImapMessageSearch; + +require Email::Simple; + +sub new { + my ($proto,%p) = @_; + my $class = ref($proto) || $proto; + my $self = bless {}, $class; + $self->{querystring} = []; + $self->{querytokens} = []; + $self->{queryfnlist} = []; + $self->{mimemessage} = undef; + $self->{$_} = $p{$_} foreach keys %p; + return $self; +} + +sub querystring { + my ($self,$string) = @_; + $self->{querystring} = $string; + return $self->querytokens( parseimapsearch($string) ); +} + +sub querytokens { + my ($self,@tokens) = @_; + $self->{querytokens} = [@tokens]; + $self->{queryfnlist} = [create_search_expressions(@tokens)]; + return $self; +} + +sub match { + my ($self,$message_string) = @_; + return 0 unless defined $message_string; + my $message_mime = Email::Simple->new($message_string); + return $self->matchmime($message_mime); +} + +sub matchmime { + my ($self,$message_mime) = @_; + my $match = 1; + foreach my $x (@{$self->{queryfnlist}}) { + $match = $match && $x->($message_mime); + } + return $match; +} + +# this should probably become its own Perl module... see also Net::IMAP::Server::Command::Search +sub create_search_expressions { + my (@search) = @_; + return () unless scalar(@search); + my $token = shift @search; + if( $token eq 'TEXT' ) { + my $value = shift @search; + return (sub {shift->as_string =~ /\Q$value\E/i},create_search_expressions(@search)); + } + if( $token eq 'BODY' ) { + my $value = shift @search; + return (sub {shift->body =~ /\Q$value\E/i},create_search_expressions(@search)); + } + if( $token eq 'SUBJECT' ) { + my $value = shift @search; + return (sub {shift->header('Subject') =~ /\Q$value\E/i},create_search_expressions(@search)); + } + if( $token eq 'HEADER' ) { + my $name = shift @search; + my $value = shift @search; + return (sub {shift->header($name) =~ /\Q$value\E/i},create_search_expressions(@search)); + } + if( $token eq 'NOT' ) { + my @exp = create_search_expressions(@search); + my $next = shift @exp; + return (sub { ! $next->(@_) }, @exp); + } + if( $token eq 'OR' ) { + my @exp = create_search_expressions(@search); + my $next1 = shift @exp; + my $next2 = shift @exp; + return (sub { $next1->(@_) or $next2->(@_) }, @exp); + } + if( $token eq 'SENTBEFORE' ) { + my $value = shift @search; + return (sub {datecmp(shift->header('Date'),$value) < 0},create_search_expressions(@search)); + } + if( $token eq 'SENTON' ) { + my $value = shift @search; + return (sub {datecmp(shift->header('Date'),$value) == 0},create_search_expressions(@search)); + } + if( $token eq 'SENTSINCE' ) { + my $value = shift @search; + return (sub {datecmp(shift->header('Date'),$value) > 0},create_search_expressions(@search)); + } + return sub { die "invalid search parameter: $token" }; +} + +sub datecmp { + my ($date1,$date2) = @_; + my $parsed1 = Date::Manip::ParseDate($date1); + my $parsed2 = Date::Manip::ParseDate($date2); + my $cmp = Date::Manip::Date_Cmp($parsed1,$parsed2); + print " $date1 <=> $date2 -> $cmp\n"; + return $cmp <=> 0; +} + +package ImapSearchTemplate; + +# Takes an English date specification ("now", etc) and an optional offset ("-4 hours") +# and returns an RFC 2822 formatted date string. +# see http://search.cpan.org/dist/Date-Manip/lib/Date/Manip.pod +sub rfc2822dateHeader { + my ($when,$delta) = @_; + $when = Date::Manip::ParseDate($when); + $delta = Date::Manip::ParseDateDelta($delta) if $delta; + my $d = $delta ? Date::Manip::DateCalc($when,$delta) : $when; + return Date::Manip::UnixDate($d, "%a, %d %b %Y %H:%M:%S %z"); +} + +sub rfc2822date { + my ($when,$delta) = @_; + $when = Date::Manip::ParseDate($when); + $delta = Date::Manip::ParseDateDelta($delta) if $delta; + my $d = $delta ? Date::Manip::DateCalc($when,$delta) : $when; + return Date::Manip::UnixDate($d, "%d-%b-%Y"); +} + +# alias for 2822 ... RFC 822 is an older version and specifies 2-digit years, but we ignore that for now. +sub rfc822dateHeader { return rfc2822dateHeader(@_); } +sub rfc822date { return rfc2822date(@_); } + +sub date { + my ($format,$when,$delta) = @_; + $when = Date::Manip::ParseDate($when); + $delta = Date::Manip::ParseDateDelta($delta) if $delta; + my $d = $delta ? Date::Manip::DateCalc($when,$delta) : $when; + return Date::Manip::UnixDate($d, $format); +} + +package main; +1; + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_smtp_send b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_smtp_send new file mode 100644 index 0000000..ade0fe3 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_smtp_send @@ -0,0 +1,782 @@ +#!/usr/bin/perl +use strict; +use POSIX qw(strftime); +my $VERSION = '0.7.3'; +my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +my $LICENSE = 'http://www.gnu.org/licenses/gpl.txt'; +my %status = ( 'OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3 ); + +# look for required modules +exit $status{UNKNOWN} unless load_modules(qw/Getopt::Long Net::SMTP/); + +BEGIN { + if( grep { /^--hires$/ } @ARGV ) { + eval "use Time::HiRes qw(time);"; + warn "Time::HiRes not installed\n" if $@; + } +} + +Getopt::Long::Configure("bundling"); +my $verbose = 0; +my $help = ""; +my $help_usage = ""; +my $show_version = ""; +my $smtp_server = ""; +my $default_smtp_port = "25"; +my $default_smtp_ssl_port = "465"; +my $default_smtp_tls_port = "587"; +my $smtp_port = ""; +my @mailto = (); +my $mailfrom = ""; +my @header = (); +my $body = ""; +my $stdin = ""; +my $template = ""; +my $expect_response = "250"; +my $warntime = 15; +my $criticaltime = 30; +my $timeout = 60; +my $tls = 0; +my $ssl = 0; +my $auth_method = undef; +my $username = ""; +my $password = ""; +my $time_hires = ""; +my $mx_lookup = 0; +my $ok; +$ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, + "v|verbose+"=>\$verbose,"h|help"=>\$help,"usage"=>\$help_usage, + "w|warning=i"=>\$warntime,"c|critical=i"=>\$criticaltime,"t|timeout=i"=>\$timeout, + # smtp settings + "H|hostname=s"=>\$smtp_server,"p|port=i"=>\$smtp_port, + "mailto=s"=>\@mailto, "mailfrom=s",\$mailfrom, + "header=s"=>\@header, "body=s"=>\$body, "stdin"=>\$stdin, + "template!"=>\$template, + # SSL/TLS/auth options + "tls!"=>\$tls, "ssl!"=>\$ssl, "auth=s"=>\$auth_method, + "U|username=s"=>\$username,"P|password=s"=>\$password, + # Server response + "E|expect-response=s"=>\$expect_response, + # Time + "hires"=>\$time_hires, + ); + +if( $show_version ) { + print "$VERSION\n"; + if( $verbose ) { + print "Default warning threshold: $warntime seconds\n"; + print "Default critical threshold: $criticaltime seconds\n"; + print "Default timeout: $timeout seconds\n"; + } + exit $status{UNKNOWN}; +} + +if( $help ) { + exec "perldoc", $0 or print "Try `perldoc $0`\n"; + exit $status{UNKNOWN}; +} + +if( $smtp_server eq "" && scalar(@mailto) == 1 ) { + # no SMTP server specified but one mailto address given means we can look up the MX record + $mx_lookup = 1; +} + +my @required_module = (); +push @required_module, 'Net::SMTP::SSL' if $ssl; +push @required_module, ('MIME::Base64','Authen::SASL') if $ssl && $username; +push @required_module, 'Net::SMTP::TLS' if $tls; +push @required_module, 'Net::SMTP_auth' if $auth_method and not $tls; # whereas if auth_method and tls we use TLS_auth, which is included in this script! +push @required_module, 'Text::Template' if $template; +push @required_module, 'Net::DNS' if $mx_lookup; +push @required_module, 'Email::Address' if $mx_lookup; +exit $status{UNKNOWN} unless load_modules(@required_module); + + +# split up @mailto if commas were used instead of multiple options +@mailto = split(/,/,join(',',@mailto)); + +if( $help_usage || + ( + ($smtp_server eq "" && !$mx_lookup) || scalar(@mailto)==0 || $mailfrom eq "" + ) + ) { + print "Usage: $0 [-H host [-p port]] --mailto recipient\@your.net [--mailto recipient2\@your.net ...] --mailfrom sender\@your.net --body 'some text' [-w ] [-c ]\n"; + exit $status{UNKNOWN}; +} + +# initialize +my $report = new PluginReport; +my $time_start = time; +my $actual_response = undef; +my @warning = (); +my @critical = (); + +my $smtp_debug = 0; +$smtp_debug = 1 if $verbose >= 3; + +# default date and message id headers +push @header, default_date_header() unless find_header("Date",@header); +push @header, default_messageid_header() unless find_header("Message-ID",@header); + +# look up MX server if necessary +if( $mx_lookup ) { + my $addr = Email::Address->new( undef, $mailto[0] ); + my $mx_domain = $addr->host; + print "MX lookup " . $mx_domain . "\n" if $verbose > 1; + my $res = Net::DNS::Resolver->new; + my @mx = Net::DNS::mx($res, $mx_domain); + if( @mx ) { + # use the first server + foreach my $rr (@mx) { + print "pref : " . $rr->preference . " exchange: " . $rr->exchange . "\n" if $verbose > 2; + } + $smtp_server = $mx[0]->exchange; + print "smtp server: $smtp_server\n" if $verbose; + } + else { + print "SMTP SEND CRITICAL - Cannot find MX records for $mx_domain\n"; + exit $status{CRITICAL}; + } +} + +# connect to SMTP server +# create the smtp handle using Net::SMTP, Net::SMTP::SSL, Net::SMTP::TLS, or an authentication variant +my $smtp; +eval { + if( $tls and $auth_method ) { + $smtp_port = $default_smtp_tls_port unless $smtp_port; + $smtp = TLS_auth->new($smtp_server, Timeout=>$timeout, Port=>$smtp_port, User=>$username, Password=>$password, Auth_Method=>$auth_method); + if( $smtp ) { + my $message = oneline($smtp->message()); + die "cannot connect with TLS/$auth_method: $message" if $smtp->code() =~ m/53\d/; + } + } + elsif( $tls ) { + $smtp_port = $default_smtp_tls_port unless $smtp_port; + $smtp = Net::SMTP::TLS->new($smtp_server, Timeout=>$timeout, Port=>$smtp_port, User=>$username, Password=>$password); + if( $smtp ) { + my $message = oneline($smtp->message()); + die "cannot connect with TLS: $message" if $smtp->code() =~ m/53\d/; + } + } + elsif( $ssl ) { + $smtp_port = $default_smtp_ssl_port unless $smtp_port; + $smtp = Net::SMTP::SSL->new($smtp_server, Port => $smtp_port, Timeout=>$timeout,Debug=>$smtp_debug); + if( $smtp && $username ) { + $smtp->auth($username, $password); + my $message = oneline($smtp->message()); + die "cannot connect with SSL/password: $message" if $smtp->code() =~ m/53\d/; + } + } + elsif( $auth_method ) { + $smtp_port = $default_smtp_port unless $smtp_port; + $smtp = Net::SMTP_auth->new($smtp_server, Port=>$smtp_port, Timeout=>$timeout,Debug=>$smtp_debug); + if( $smtp ) { + $smtp->auth($auth_method, $username, $password); + my $message = oneline($smtp->message()); + die "cannot connect with SSL/$auth_method: $message" if $smtp->code() =~ m/53\d/; + } + } + else { + $smtp_port = $default_smtp_port unless $smtp_port; + $smtp = Net::SMTP->new($smtp_server, Port=>$smtp_port, Timeout=>$timeout,Debug=>$smtp_debug); + if( $smtp && $username ) { + $smtp->auth($username, $password); + my $message = oneline($smtp->message()); + die "cannot connect with password: $message" if $smtp->code() =~ m/53\d/; + } + } +}; +if( $@ ) { + $@ =~ s/\n/ /g; # the error message can be multiline but we want our output to be just one line + print "SMTP SEND CRITICAL - $@\n"; + exit $status{CRITICAL}; +} +unless( $smtp ) { + print "SMTP SEND CRITICAL - Could not connect to $smtp_server port $smtp_port\n"; + exit $status{CRITICAL}; +} +my $time_connected = time; + +# add the monitored server's banner to the report +if( $tls ) { + $report->{banner} = ""; +} +elsif( $ssl ) { + $report->{banner} = $smtp->banner || ""; + chomp $report->{banner}; +} +else { + $report->{banner} = $smtp->banner || ""; + chomp $report->{banner}; +} + + +# send email +if( $stdin ) { + $body = ""; + while() { + $body .= $_; + } +} + +# if user wants to use template substitutions, this is the place to process body and headers +if( $template ) { + foreach my $item (@header,$body) { + my $t = Text::Template->new(TYPE=>'STRING',SOURCE=>$item,PACKAGE=>'SmtpMessageTemplate'); + $item = $t->fill_in(PREPEND=>q{package SmtpMessageTemplate;}); +# print "item: $item\n"; + } +} + + +$smtp->mail($mailfrom); +foreach( @mailto ) { + # the two SMTP modules have different error reporting mechanisms: + if( $tls ) { + # Net::SMTP::TLS croaks when the recipient is rejected + eval { + $smtp->to($_); + }; + if( $@ ) { + print "SMTP SEND CRITICAL - Could not send to $_\n"; + print "Reason: $@\n" if $verbose; + exit $status{CRITICAL}; + } + } + else { + # Net::SMTP returns false when the recipient is rejected + my $to_returned = $smtp->to($_); + if( !$to_returned ) { + print "SMTP SEND CRITICAL - Could not send to $_\n"; + print "Reason: Recipient rejected or authentication failed\n" if $verbose; + exit $status{CRITICAL}; + } + } +} + +# Net::SMTP::TLS doesn't implement code() so we need to wrap calls in eval to get our error messages + + # start data transfer (expect response 354) + $smtp->data(); + + # send data + $smtp->datasend("To: ".join(", ",@mailto)."\n"); + $smtp->datasend("From: $mailfrom\n"); + foreach( @header ) { + $smtp->datasend("$_\n"); + } + $smtp->datasend("\n"); + $smtp->datasend($body); + $smtp->datasend("\n"); + +eval { + # end data transfer (expect response 250) + $smtp->dataend(); +}; +if( $@ ) { + $actual_response = $tls ? get_tls_error($@) : $smtp->code(); +} +else { + $actual_response = $tls ? "250" : $smtp->code(); # no error means we got 250 +} + +eval { + # disconnect from SMTP server (expect response 221) + $smtp->quit(); +}; +if( $@ ) { + push @warning, "Error while disconnecting from $smtp_server"; +} + +# calculate elapsed time and issue warnings +my $time_end = time; +my $elapsedtime = $time_end - $time_start; +$report->{seconds} = $elapsedtime; + +push @warning, "connection time more than $warntime" if( $time_connected - $time_start > $warntime ); +push @critical, "connection time more than $criticaltime" if( $time_connected - $time_start > $criticaltime ); +push @critical, "response was $actual_response but expected $expect_response" if ( $actual_response ne $expect_response ); + +# print report and exit with known status +my $perf_data = "elapsed=".$report->{seconds}."s;$warntime;$criticaltime"; # TODO: need a component for safely generating valid perf data format. for notes on the format, see http://www.perfparse.de/tiki-view_faq.php?faqId=6 and http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN185 +my $short_report = $report->text(qw/seconds/) . " | $perf_data"; +my $long_report = join("", map { "$_: $report->{$_}\n" } qw/banner/ ); +if( scalar @critical ) { + my $crit_alerts = join(", ", @critical); + print "SMTP SEND CRITICAL - $crit_alerts; $short_report\n"; + print $long_report if $verbose; + exit $status{CRITICAL}; +} +if( scalar @warning ) { + my $warn_alerts = join(", ", @warning); + print "SMTP SEND WARNING - $warn_alerts; $short_report\n"; + print $long_report if $verbose; + exit $status{WARNING}; +} +print "SMTP SEND OK - $short_report\n"; +print $long_report if $verbose; +exit $status{OK}; + + +# utility to load required modules. exits if unable to load one or more of the modules. +sub load_modules { + my @missing_modules = (); + foreach( @_ ) { + eval "require $_"; + push @missing_modules, $_ if $@; + } + if( @missing_modules ) { + print "Missing perl modules: @missing_modules\n"; + return 0; + } + return 1; +} + +# utility to extract error codes out of Net::SMTP::TLS croak messages +sub get_tls_error { + my ($errormsg) = @_; + $errormsg =~ m/: (\d+) (.+)/; + my $code = $1; + return $code; +} + +# looks for a specific header in a list of headers; returns true if found +sub find_header { + my ($name, @list) = @_; + return scalar grep { m/^$name: /i } @list; +} + +# RFC 2822 date header +sub default_date_header { + return strftime "Date: %a, %e %b %Y %H:%M:%S %z (%Z)", gmtime; +} + +# RFC 2822 message id header +sub default_messageid_header { + my $random = randomstring(16,qw/0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z/); + my $hostname = `hostname`; + chomp $hostname; + return "Message-ID: <".time.".".$random.".checksmtpsend@".$hostname.">"; +} + +# returns a random string of specified length using characters from specified set +sub randomstring { + my ($length,@set) = @_; + my $size = scalar @set; + my $string = ""; + while($length--) { + $string .= $set[int(rand($size))]; + } + return $string; +} + +# replaces all newlines in the input string with spaces +sub oneline { + my ($input) = @_; + $input =~ s/[\r\n]+/ /g; + return $input; +} + +# NAME +# PluginReport +# SYNOPSIS +# $report = new PluginReport; +# $report->{label1} = "value1"; +# $report->{label2} = "value2"; +# print $report->text(qw/label1 label2/); +package PluginReport; + +sub new { + my ($proto,%p) = @_; + my $class = ref($proto) || $proto; + my $self = bless {}, $class; + $self->{$_} = $p{$_} foreach keys %p; + return $self; +} + +sub text { + my ($self,@labels) = @_; + my @report = map { "$self->{$_} $_" } grep { defined $self->{$_} } @labels; + my $text = join(", ", @report); + return $text; +} + +package SmtpMessageTemplate; + +sub trim { + my ($text) = @_; + $text =~ s/^\s*//; + $text =~ s/\s*$//; + return $text; +} + +# NAME +# TLS_auth +# SYNOPSYS +# +# Based on contribution by Brad Guillory +package TLS_auth; +#use Net::SMTP::TLS; +our @ISA = qw(Net::SMTP::TLS); +use Carp; +sub new { + my ($proto,$server,%p) = @_; + my $class = ref($proto) || $proto; + #my $self = bless {}, $class; + no strict 'refs'; + no warnings 'once'; + *Net::SMTP::TLS::login = *TLS_auth::login; # override parent's login with ours so when it's called in the constructor, our overriden version will be used + my $self = Net::SMTP::TLS->new($server,%p); + return $self; +} + + +sub login { + my ($self) = @_; + my $type = $self->{features}->{AUTH}; + if(not $type){ + die "Server did not return AUTH in capabilities\n"; # croak + } +# print "Feature: $type\nAuth Method: $self->{Auth_Method}\n"; + if($type =~ /CRAM\-MD5/ and $self->{Auth_Method} =~ /CRAM\-MD5/i){ + $self->auth_MD5(); + }elsif($type =~ /LOGIN/ and $self->{Auth_Method} =~ /LOGIN/i){ + $self->auth_LOGIN(); + }elsif($type =~ /PLAIN/ and $self->{Auth_Method} =~ /PLAIN/i){ + #print "Calling auth_PLAIN\n"; + $self->auth_PLAIN(); + }else{ + die "Unsupported Authentication mechanism: $self->{Auth_Method}\n"; # croak + } +} + + +package main; +1; + +__END__ + +=pod + +=head1 NAME + +check_smtp_send - connects to an SMTP server and sends a message + +=head1 SYNOPSIS + + check_smtp_send -vV + check_smtp_send -? + check_smtp_send --help + +=head1 OPTIONS + +=over + +=item --warning + +Warn if it takes longer than to connect to the SMTP server. Default is 15 seconds. +Also known as: -w + +=item --critical + +Return a critical status if it takes longer than to connect to the SMTP server. Default is 30 seconds. +Also known as: -c + +=item --timeout + +Abort with critical status if it takes longer than to connect to the SMTP server. Default is 60 seconds. +The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to +connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer +than 30 seconds. +Also known as: -t + +=item --hostname + +Address or name of the SMTP server. Examples: mail.server.com, localhost, 192.168.1.100 + +If not provided, and if there is only one --mailto address, the script will automatically look up the MX record +for the --mailto address and use that as the hostname. You can use this to check that your MX records are correct. +When omitting the --hostname option, it doesn't really make sense to specify --port, --username, or --password +but you can still do so and they will have their normal effect. To look up the MX records you need to have the +module Net::DNS and Email::Address installed. + +Also known as: -H + +=item --port + +Service port on the SMTP server. Default is 25 for regular SMTP, 465 for SSL, and 587 for TLS. +Also known as: -p + +=item --tls + +=item --notls + +Enable TLS/AUTH protocol. Requires Net::SMTP::TLS, availble on CPAN. + +When using this option, the default port is 587. +You can specify a port from the command line using the --port option. + +Use the notls option to turn off the tls option. + +Also, you may need to fix your copy of Net::SMTP::TLS. Here is the diff against version 0.12: + + 254c254 + < $me->_command(sprintf("AUTH PLAIN %S", + --- + > $me->_command(sprintf("AUTH PLAIN %s", + + +=item --ssl + +=item --nossl + +Enable SSL protocol. Requires Net::SMTP::SSL and Authen::SASL, availble on CPAN. + +When using this option, the default port is 465. You can override with the --port option. + +Use the nossl option to turn off the ssl option. + +=item --auth + +Enable authentication with Net::SMTP_auth (sold separately). +For example, try using --auth PLAIN or --auth CRAM-MD5. + +=item --username + +=item --password + +Username and password to use when connecting to SMTP server. +Also known as: -U -P + +=item --body + +Use this option to specify the body of the email message. If you need newlines in your message, +you might need to use the --stdin option instead. + +=item --header
+ +Use this option to set an arbitrary header in the message. You can use it multiple times. + +=item --stdin + +Grab the body of the email message from stdin. + +=item --mailto recipient@your.net + +You can send a message to multiple recipients by repeating this option or by separating +the email addresses with commas (no whitespace allowed): + +$ check_smtp_send -H mail.server.net --mailto recipient@your.net,recipient2@your.net --mailfrom sender@your.net + +SMTP SEND OK - 1 seconds + +=item --mailfrom sender@your.net + +Use this option to set the "from" address in the email. + +=item --template + +=item --notemplate + +Enable (or disable) processing of message body and headers. Requires Text::Template. + +Use this option to apply special processing to your message body and headers that allows you to use the +results of arbitrary computations in the text. For example, you can use this feature to send a message +containing the hostname of the machine that sent the message without customizing the plugin configuration +on each machine. + +When you enable the --template option, the message body and headers are parsed by +Text::Template. Even a message body provided using the --stdin option will be parsed. +See the Text::Template manual for more information, but in general any expression +written in Perl will work. + +There is one convenience function provided to you, trim, which will remove leading and trailing whitespace +from its parameter. Here's an example: + + check_smtp_send -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net + --template --body 'hello, this message is from {use Sys::Hostname; hostname}' + --header 'Subject: test message from {trim(`whoami`)}' + + +=item --expect-response + +Use this option to specify which SMTP response code should be expected from the server +after the SMTP dialog is complete. The default is 250 (message accepted). + +Also known as: -E + +=item --hires + +Use the Time::HiRes module to measure time, if available. + +=item --verbose + +Display additional information. Useful for troubleshooting. + +One --verbose will show extra information for OK, WARNING, and CRITICAL status. + +Use one --verbose together with --version to see the default warning and critical timeout values. + +Three --verbose (or -vvv) will show debug information, unless you're using --tls because Net::SMTP::TLS +does not have a Debug feature. + +Also known as: -v + +=item --version + +Display plugin version and exit. +Also known as: -V + +=item --help + +Display this documentation and exit. Does not work in the ePN version. +Also known as: -h + +=item --usage + +Display a short usage instruction and exit. + +=back + +=head1 EXAMPLES + +=head2 Send a message with custom headers + +$ check_smtp_send -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net +--body 'Homeruns 5' --header 'Subject: Hello, world!' --header 'X-Your-Header: Yes' + +SMTP SEND OK - 1 seconds + +=head1 EXIT CODES + +Complies with the Nagios plug-in specification: + 0 OK The plugin was able to check the service and it appeared to be functioning properly + 1 Warning The plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly + 2 Critical The plugin detected that either the service was not running or it was above some "critical" threshold + 3 Unknown Invalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service + +=head1 NAGIOS PLUGIN NOTES + +Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html + +This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because +the path to utils.pm must be specified completely in this program and forces users to edit the source +code if their install location is different (if they realize this is the problem). You can view +the default timeout for this module by using the --verbose and --version options together. The +short form is -vV. + +Other than that, it attempts to follow published guidelines for Nagios plugins. + +=head1 CHANGES + + Wed Oct 29 14:05:00 PST 2005 + + version 0.1 + + Wed Nov 9 15:01:48 PST 2005 + + now using an inline PluginReport package to generate the report + + added stdin option + + copyright notice and GNU GPL + + version 0.2 + + Thu Apr 20 16:00:00 PST 2006 (by Geoff Crompton ) + + added bailing if the $smtp->to() call fails + + added support for mailto recipients separated by commas + + version 0.2.1 + + Tue Apr 24 21:17:53 PDT 2007 + + moved POD text to separate file in order to accomodate the new embedded-perl Nagios feature + + version 0.2.3 + + Fri Apr 27 20:26:42 PDT 2007 + + documentation now mentions every command-line option accepted by the plugin, including abbreviations + + version 0.3 + + Sun Oct 21 10:34:14 PDT 2007 + + added support for TLS and authentication via the Net::SMTP::TLS module. see --tls option. + + version 0.4 + + Sun Oct 21 13:54:26 PDT 2007 + + added support for SSL via the Net::SMTP::SSL module. see --ssl option. + + port is no longer a required option. defaults to 25 for regular smtp, 465 for ssl, and 587 for tls. + + added port info to the "could not connect" error message + + version 0.4.1 + + Tue Dec 4 07:42:32 PST 2007 + + added --usage option because the official nagios plugins have both --help and --usage + + added --timeout option to match the official nagios plugins + + fixed some minor pod formatting issues for perldoc + + version 0.4.2 + + Mon Feb 11 19:09:37 PST 2008 + + fixed a bug for embedded perl version, variable "%status" will not stay shared in load_modules + + version 0.4.3 + + Mon May 26 09:12:14 PDT 2008 + + fixed warning and critical messages to use "more than" or "less than" instead of the angle brackets, to make them more web friendly + + version 0.4.4 + + Wed Jul 2 07:12:35 PDT 2008 + + added --expect-response option submitted by Christian Kauhaus + + added support for authentication via Net::SMTP_auth. see --auth option. + + version 0.4.5 + + Sun Oct 5 15:18:23 PDT 2008 + + added error handling for smtp server disconnects ungracefully during QUIT (gmail.com does) + + version 0.4.6 + + Thu Oct 1 12:09:35 PDT 2009 + + added --template option to allow arbitrary substitutions for body and headers, and provided one convenience function for trimming strings + + added performance data for use with PNP4Nagios! + + version 0.5.0 + + Thu Oct 8 11:17:04 PDT 2009 + + added more detailed error messages when using --verbose + + version 0.5.1 + + Tue Feb 9 12:14:49 PST 2010 + + added support for combining --auth with --tls using a subclass of Net::SMTP::TLS submitted by Brad Guillory; please note that to use the "PLAIN" authentication type you need to patch your Net::SMTP:TLS because it has a bug in sub auth_PLAIN (sprintf %S instead of %s) + + version 0.5.2 + + Mon Jan 3 10:39:42 PST 2011 + + added default Date and Message-ID headers; Date header uses POSIX strftime and Message-ID header uses hostname command to get localhost name + + version 0.7.0 + + Fri May 6 08:35:09 AST 2011 + + added --hires option to enable use of Time::Hires if available + + version 0.7.1 + + Wed Jul 6 19:18:26 AST 2011 + + the --hostname is now optional; if not provided the plugin will lookup the MX record for the --mailto address (requires Net::DNS) + + version 0.7.2 + + Tue Dec 13 09:24:04 PST 2011 + + separated authentication errors from connection errors + + version 0.7.3 + +=head1 AUTHOR + +Jonathan Buhacoff + +=head1 COPYRIGHT AND LICENSE + + 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 . + + http://www.gnu.org/licenses/gpl.txt + +=cut + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_smtp_send_epn b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_smtp_send_epn new file mode 100644 index 0000000..9648ec8 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/check_smtp_send_epn @@ -0,0 +1,458 @@ +#!/usr/bin/perl +use strict; +use POSIX qw(strftime); +my $VERSION = '0.7.3'; +my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +my $LICENSE = 'http://www.gnu.org/licenses/gpl.txt'; +my %status = ( 'OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3 ); + +# look for required modules +exit $status{UNKNOWN} unless load_modules(qw/Getopt::Long Net::SMTP/); + +BEGIN { + if( grep { /^--hires$/ } @ARGV ) { + eval "use Time::HiRes qw(time);"; + warn "Time::HiRes not installed\n" if $@; + } +} + +Getopt::Long::Configure("bundling"); +my $verbose = 0; +my $help = ""; +my $help_usage = ""; +my $show_version = ""; +my $smtp_server = ""; +my $default_smtp_port = "25"; +my $default_smtp_ssl_port = "465"; +my $default_smtp_tls_port = "587"; +my $smtp_port = ""; +my @mailto = (); +my $mailfrom = ""; +my @header = (); +my $body = ""; +my $stdin = ""; +my $template = ""; +my $expect_response = "250"; +my $warntime = 15; +my $criticaltime = 30; +my $timeout = 60; +my $tls = 0; +my $ssl = 0; +my $auth_method = undef; +my $username = ""; +my $password = ""; +my $time_hires = ""; +my $mx_lookup = 0; +my $ok; +$ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, + "v|verbose+"=>\$verbose,"h|help"=>\$help,"usage"=>\$help_usage, + "w|warning=i"=>\$warntime,"c|critical=i"=>\$criticaltime,"t|timeout=i"=>\$timeout, + # smtp settings + "H|hostname=s"=>\$smtp_server,"p|port=i"=>\$smtp_port, + "mailto=s"=>\@mailto, "mailfrom=s",\$mailfrom, + "header=s"=>\@header, "body=s"=>\$body, "stdin"=>\$stdin, + "template!"=>\$template, + # SSL/TLS/auth options + "tls!"=>\$tls, "ssl!"=>\$ssl, "auth=s"=>\$auth_method, + "U|username=s"=>\$username,"P|password=s"=>\$password, + # Server response + "E|expect-response=s"=>\$expect_response, + # Time + "hires"=>\$time_hires, + ); + +if( $show_version ) { + print "$VERSION\n"; + if( $verbose ) { + print "Default warning threshold: $warntime seconds\n"; + print "Default critical threshold: $criticaltime seconds\n"; + print "Default timeout: $timeout seconds\n"; + } + exit $status{UNKNOWN}; +} + +if( $help ) { + exec "perldoc", $0 or print "Try `perldoc $0`\n"; + exit $status{UNKNOWN}; +} + +if( $smtp_server eq "" && scalar(@mailto) == 1 ) { + # no SMTP server specified but one mailto address given means we can look up the MX record + $mx_lookup = 1; +} + +my @required_module = (); +push @required_module, 'Net::SMTP::SSL' if $ssl; +push @required_module, ('MIME::Base64','Authen::SASL') if $ssl && $username; +push @required_module, 'Net::SMTP::TLS' if $tls; +push @required_module, 'Net::SMTP_auth' if $auth_method and not $tls; # whereas if auth_method and tls we use TLS_auth, which is included in this script! +push @required_module, 'Text::Template' if $template; +push @required_module, 'Net::DNS' if $mx_lookup; +push @required_module, 'Email::Address' if $mx_lookup; +exit $status{UNKNOWN} unless load_modules(@required_module); + + +# split up @mailto if commas were used instead of multiple options +@mailto = split(/,/,join(',',@mailto)); + +if( $help_usage || + ( + ($smtp_server eq "" && !$mx_lookup) || scalar(@mailto)==0 || $mailfrom eq "" + ) + ) { + print "Usage: $0 [-H host [-p port]] --mailto recipient\@your.net [--mailto recipient2\@your.net ...] --mailfrom sender\@your.net --body 'some text' [-w ] [-c ]\n"; + exit $status{UNKNOWN}; +} + +# initialize +my $report = new PluginReport; +my $time_start = time; +my $actual_response = undef; +my @warning = (); +my @critical = (); + +my $smtp_debug = 0; +$smtp_debug = 1 if $verbose >= 3; + +# default date and message id headers +push @header, default_date_header() unless find_header("Date",@header); +push @header, default_messageid_header() unless find_header("Message-ID",@header); + +# look up MX server if necessary +if( $mx_lookup ) { + my $addr = Email::Address->new( undef, $mailto[0] ); + my $mx_domain = $addr->host; + print "MX lookup " . $mx_domain . "\n" if $verbose > 1; + my $res = Net::DNS::Resolver->new; + my @mx = Net::DNS::mx($res, $mx_domain); + if( @mx ) { + # use the first server + foreach my $rr (@mx) { + print "pref : " . $rr->preference . " exchange: " . $rr->exchange . "\n" if $verbose > 2; + } + $smtp_server = $mx[0]->exchange; + print "smtp server: $smtp_server\n" if $verbose; + } + else { + print "SMTP SEND CRITICAL - Cannot find MX records for $mx_domain\n"; + exit $status{CRITICAL}; + } +} + +# connect to SMTP server +# create the smtp handle using Net::SMTP, Net::SMTP::SSL, Net::SMTP::TLS, or an authentication variant +my $smtp; +eval { + if( $tls and $auth_method ) { + $smtp_port = $default_smtp_tls_port unless $smtp_port; + $smtp = TLS_auth->new($smtp_server, Timeout=>$timeout, Port=>$smtp_port, User=>$username, Password=>$password, Auth_Method=>$auth_method); + if( $smtp ) { + my $message = oneline($smtp->message()); + die "cannot connect with TLS/$auth_method: $message" if $smtp->code() =~ m/53\d/; + } + } + elsif( $tls ) { + $smtp_port = $default_smtp_tls_port unless $smtp_port; + $smtp = Net::SMTP::TLS->new($smtp_server, Timeout=>$timeout, Port=>$smtp_port, User=>$username, Password=>$password); + if( $smtp ) { + my $message = oneline($smtp->message()); + die "cannot connect with TLS: $message" if $smtp->code() =~ m/53\d/; + } + } + elsif( $ssl ) { + $smtp_port = $default_smtp_ssl_port unless $smtp_port; + $smtp = Net::SMTP::SSL->new($smtp_server, Port => $smtp_port, Timeout=>$timeout,Debug=>$smtp_debug); + if( $smtp && $username ) { + $smtp->auth($username, $password); + my $message = oneline($smtp->message()); + die "cannot connect with SSL/password: $message" if $smtp->code() =~ m/53\d/; + } + } + elsif( $auth_method ) { + $smtp_port = $default_smtp_port unless $smtp_port; + $smtp = Net::SMTP_auth->new($smtp_server, Port=>$smtp_port, Timeout=>$timeout,Debug=>$smtp_debug); + if( $smtp ) { + $smtp->auth($auth_method, $username, $password); + my $message = oneline($smtp->message()); + die "cannot connect with SSL/$auth_method: $message" if $smtp->code() =~ m/53\d/; + } + } + else { + $smtp_port = $default_smtp_port unless $smtp_port; + $smtp = Net::SMTP->new($smtp_server, Port=>$smtp_port, Timeout=>$timeout,Debug=>$smtp_debug); + if( $smtp && $username ) { + $smtp->auth($username, $password); + my $message = oneline($smtp->message()); + die "cannot connect with password: $message" if $smtp->code() =~ m/53\d/; + } + } +}; +if( $@ ) { + $@ =~ s/\n/ /g; # the error message can be multiline but we want our output to be just one line + print "SMTP SEND CRITICAL - $@\n"; + exit $status{CRITICAL}; +} +unless( $smtp ) { + print "SMTP SEND CRITICAL - Could not connect to $smtp_server port $smtp_port\n"; + exit $status{CRITICAL}; +} +my $time_connected = time; + +# add the monitored server's banner to the report +if( $tls ) { + $report->{banner} = ""; +} +elsif( $ssl ) { + $report->{banner} = $smtp->banner || ""; + chomp $report->{banner}; +} +else { + $report->{banner} = $smtp->banner || ""; + chomp $report->{banner}; +} + + +# send email +if( $stdin ) { + $body = ""; + while() { + $body .= $_; + } +} + +# if user wants to use template substitutions, this is the place to process body and headers +if( $template ) { + foreach my $item (@header,$body) { + my $t = Text::Template->new(TYPE=>'STRING',SOURCE=>$item,PACKAGE=>'SmtpMessageTemplate'); + $item = $t->fill_in(PREPEND=>q{package SmtpMessageTemplate;}); +# print "item: $item\n"; + } +} + + +$smtp->mail($mailfrom); +foreach( @mailto ) { + # the two SMTP modules have different error reporting mechanisms: + if( $tls ) { + # Net::SMTP::TLS croaks when the recipient is rejected + eval { + $smtp->to($_); + }; + if( $@ ) { + print "SMTP SEND CRITICAL - Could not send to $_\n"; + print "Reason: $@\n" if $verbose; + exit $status{CRITICAL}; + } + } + else { + # Net::SMTP returns false when the recipient is rejected + my $to_returned = $smtp->to($_); + if( !$to_returned ) { + print "SMTP SEND CRITICAL - Could not send to $_\n"; + print "Reason: Recipient rejected or authentication failed\n" if $verbose; + exit $status{CRITICAL}; + } + } +} + +# Net::SMTP::TLS doesn't implement code() so we need to wrap calls in eval to get our error messages + + # start data transfer (expect response 354) + $smtp->data(); + + # send data + $smtp->datasend("To: ".join(", ",@mailto)."\n"); + $smtp->datasend("From: $mailfrom\n"); + foreach( @header ) { + $smtp->datasend("$_\n"); + } + $smtp->datasend("\n"); + $smtp->datasend($body); + $smtp->datasend("\n"); + +eval { + # end data transfer (expect response 250) + $smtp->dataend(); +}; +if( $@ ) { + $actual_response = $tls ? get_tls_error($@) : $smtp->code(); +} +else { + $actual_response = $tls ? "250" : $smtp->code(); # no error means we got 250 +} + +eval { + # disconnect from SMTP server (expect response 221) + $smtp->quit(); +}; +if( $@ ) { + push @warning, "Error while disconnecting from $smtp_server"; +} + +# calculate elapsed time and issue warnings +my $time_end = time; +my $elapsedtime = $time_end - $time_start; +$report->{seconds} = $elapsedtime; + +push @warning, "connection time more than $warntime" if( $time_connected - $time_start > $warntime ); +push @critical, "connection time more than $criticaltime" if( $time_connected - $time_start > $criticaltime ); +push @critical, "response was $actual_response but expected $expect_response" if ( $actual_response ne $expect_response ); + +# print report and exit with known status +my $perf_data = "elapsed=".$report->{seconds}."s;$warntime;$criticaltime"; # TODO: need a component for safely generating valid perf data format. for notes on the format, see http://www.perfparse.de/tiki-view_faq.php?faqId=6 and http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN185 +my $short_report = $report->text(qw/seconds/) . " | $perf_data"; +my $long_report = join("", map { "$_: $report->{$_}\n" } qw/banner/ ); +if( scalar @critical ) { + my $crit_alerts = join(", ", @critical); + print "SMTP SEND CRITICAL - $crit_alerts; $short_report\n"; + print $long_report if $verbose; + exit $status{CRITICAL}; +} +if( scalar @warning ) { + my $warn_alerts = join(", ", @warning); + print "SMTP SEND WARNING - $warn_alerts; $short_report\n"; + print $long_report if $verbose; + exit $status{WARNING}; +} +print "SMTP SEND OK - $short_report\n"; +print $long_report if $verbose; +exit $status{OK}; + + +# utility to load required modules. exits if unable to load one or more of the modules. +sub load_modules { + my @missing_modules = (); + foreach( @_ ) { + eval "require $_"; + push @missing_modules, $_ if $@; + } + if( @missing_modules ) { + print "Missing perl modules: @missing_modules\n"; + return 0; + } + return 1; +} + +# utility to extract error codes out of Net::SMTP::TLS croak messages +sub get_tls_error { + my ($errormsg) = @_; + $errormsg =~ m/: (\d+) (.+)/; + my $code = $1; + return $code; +} + +# looks for a specific header in a list of headers; returns true if found +sub find_header { + my ($name, @list) = @_; + return scalar grep { m/^$name: /i } @list; +} + +# RFC 2822 date header +sub default_date_header { + return strftime "Date: %a, %e %b %Y %H:%M:%S %z (%Z)", gmtime; +} + +# RFC 2822 message id header +sub default_messageid_header { + my $random = randomstring(16,qw/0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z/); + my $hostname = `hostname`; + chomp $hostname; + return "Message-ID: <".time.".".$random.".checksmtpsend@".$hostname.">"; +} + +# returns a random string of specified length using characters from specified set +sub randomstring { + my ($length,@set) = @_; + my $size = scalar @set; + my $string = ""; + while($length--) { + $string .= $set[int(rand($size))]; + } + return $string; +} + +# replaces all newlines in the input string with spaces +sub oneline { + my ($input) = @_; + $input =~ s/[\r\n]+/ /g; + return $input; +} + +# NAME +# PluginReport +# SYNOPSIS +# $report = new PluginReport; +# $report->{label1} = "value1"; +# $report->{label2} = "value2"; +# print $report->text(qw/label1 label2/); +package PluginReport; + +sub new { + my ($proto,%p) = @_; + my $class = ref($proto) || $proto; + my $self = bless {}, $class; + $self->{$_} = $p{$_} foreach keys %p; + return $self; +} + +sub text { + my ($self,@labels) = @_; + my @report = map { "$self->{$_} $_" } grep { defined $self->{$_} } @labels; + my $text = join(", ", @report); + return $text; +} + +package SmtpMessageTemplate; + +sub trim { + my ($text) = @_; + $text =~ s/^\s*//; + $text =~ s/\s*$//; + return $text; +} + +# NAME +# TLS_auth +# SYNOPSYS +# +# Based on contribution by Brad Guillory +package TLS_auth; +#use Net::SMTP::TLS; +our @ISA = qw(Net::SMTP::TLS); +use Carp; +sub new { + my ($proto,$server,%p) = @_; + my $class = ref($proto) || $proto; + #my $self = bless {}, $class; + no strict 'refs'; + no warnings 'once'; + *Net::SMTP::TLS::login = *TLS_auth::login; # override parent's login with ours so when it's called in the constructor, our overriden version will be used + my $self = Net::SMTP::TLS->new($server,%p); + return $self; +} + + +sub login { + my ($self) = @_; + my $type = $self->{features}->{AUTH}; + if(not $type){ + die "Server did not return AUTH in capabilities\n"; # croak + } +# print "Feature: $type\nAuth Method: $self->{Auth_Method}\n"; + if($type =~ /CRAM\-MD5/ and $self->{Auth_Method} =~ /CRAM\-MD5/i){ + $self->auth_MD5(); + }elsif($type =~ /LOGIN/ and $self->{Auth_Method} =~ /LOGIN/i){ + $self->auth_LOGIN(); + }elsif($type =~ /PLAIN/ and $self->{Auth_Method} =~ /PLAIN/i){ + #print "Calling auth_PLAIN\n"; + $self->auth_PLAIN(); + }else{ + die "Unsupported Authentication mechanism: $self->{Auth_Method}\n"; # croak + } +} + + +package main; +1; + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/How to connect to IMAP server manually.txt b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/How to connect to IMAP server manually.txt new file mode 100644 index 0000000..ce52655 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/How to connect to IMAP server manually.txt @@ -0,0 +1,69 @@ +HOW TO CONNECT TO IMAP SERVER MANUALLY + +This how-to borrowed from: http://www.bincimap.org/bincimap-faq.html + + +1) Connection +Using telnet, connect to your service on port 143. Replace "server" with your server's name. If the server is set up correctly, you will see this greeting: + # telnet server 143 + * OK IMAP Server ready + +If you have SSL enabled (most likely you do), connect to port 993 with the openssl tool. If the server is set up correctly, you will see this greeting: + # openssl s_client -connect server:993 -crlf + * OK IMAP Server ready + +2) Logging in / authenticating +Firstly, check your bincimap.conf file, in the "Authentication" section, for this setting: +allow plain auth in non ssl = "no" + +If you want users to be able to connect without using SSL, set this to "yes". +Using either the telnet (in case of "yes" in the above example) or openssl tool, try the LOGIN command, replacing "username" with one username on your server, and "password" with that user's password. You should get the reply on the second line. +1 LOGIN username password +1 LOGIN completed + +Note that you should try logging in with at least two users to check that this feature is working properly. +3) Listing, creating, renaming and deleting mailboxes +Enter the following command to list the user's first level mailboxes. You should get at least one line of response (starting with "* LIST") before you get the "2 OK LIST" reponse. +2 LIST "" "%" +* LIST (\UnMarked) "/" "INBOX" +2 OK LIST completed + +Check your bincimap.conf file, under the Mailbox section, and check the "depot" setting. Try creating a mailbox with the following command, replacing mailbox with a name of your choice. Note that if you are using the Maildir++ depot setting, you must use "INBOX/mailbox" instead: +3 CREATE mailbox +3 OK CREATE completed + +Rename the mailbox with this command. Note the "INBOX/" prefix when using a Maildir++ depot. (After that, rerunning the LIST command from above will give you a slightly different result than before): +4 RENAME mailbox newmailbox +4 OK RENAME completed + +Now delete the mailbox with this command: +5 DELETE newmailbox +5 OK DELETE completed + +4) Selecting a mailbox and looking inside +Select your INBOX with this command. Note that the response may be slightly different from in this example: +6 SELECT INBOX +* 146 EXISTS +* OK [UIDVALIDITY 1047992537] +* OK [UIDNEXT 2683] 2683 is the next UID +* FLAGS (\Answered \Flagged \Deleted \Recent \Seen \Draft) +* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft)] Limited +6 OK [READ-WRITE] + +Fetch the flags of all your messages with this command. Note that the "..." is for editorial clarity, many lines of output have been omitted in this example: +7 FETCH 1:* FLAGS +* 1 FETCH (FLAGS (\Seen \Answered)) +* 2 FETCH (FLAGS (\Seen \Answered)) +... +* 146 FETCH (FLAGS (\Seen \Answered)) +7 OK FETCH completed + +Set a flag with this command: +8 STORE 1 +FLAGS \Flagged +* FETCH (FLAGS (\Seen \Flagged)) +8 OK STORE completed + +5) Logging out +9 LOGOUT +* BYE Server logging out +9 OK LOGOUT finished. diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/How to test plugin.txt b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/How to test plugin.txt new file mode 100644 index 0000000..369baf4 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/How to test plugin.txt @@ -0,0 +1,15 @@ +HOW TO TEST THE PLUGIN + +Run the shell script tests which start the test server automatically: + +./test/3_email_delivery.sh + + + + + + +If you want to start up the test server yourself: + +sudo perl test/dummy_smtp_server.pl + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_email_delivery.html b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_email_delivery.html new file mode 100644 index 0000000..31422bc --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_email_delivery.html @@ -0,0 +1,522 @@ + + + + +check_email_delivery - sends email and verifies delivery + + + + + + + + + +
+

+ + + +
+ + +

+

+
+

NAME

+

check_email_delivery - sends email and verifies delivery

+

+

+
+

SYNOPSIS

+
+ check_email_delivery -vV
+ check_email_delivery --usage
+ check_email_delivery --help
+

+

+
+

OPTIONS

+
+
--warning <seconds>[,<smtp_seconds>,<imap_seconds>]
+ +
+

Exit with WARNING if the most recent email found is older than <seconds>. The +optional <smtp_seconds> and <imap_seconds> parameters will be passed on to the +included plugins that are used for those tasks. If they are not +given then they will not be passed on and the default for that plugin will apply. +Also known as: -w <seconds>[,<send>[,<recv>]]

+

When using the --plugin option, only one parameter is supported (-w <seconds>) and it will apply +to the entire process. You can specify a warning threshold specific to each plugin in the +plugin command line.

+

When using the --plugin option, no measuring of "most recent email" is done because we would +not know how to read this information from receive plugins. This may be addressed in future versions.

+
+
--critical <seconds>[,<smtp_seconds>,<imap_seconds>]
+ +
+

Exit with CRITICAL if the most recent email found is older than <seconds>. The +optional <smtp_seconds> and <imap_seconds> parameters will be passed on to the +included plugins that are used for those tasks. If they are not +given then they will not be passed on and the default for that plugin will apply. +Also known as: -c <seconds>[,<send>[,<recv>]]

+

When using the --plugin option, only one parameter is supported (-c <seconds>) and it will apply +to the entire process. You can specify a critical threshold specific to each plugin in the +plugin command line.

+

When using the --plugin option, no measuring of "most recent email" is done because we would +not know how to read this information from receive plugins. This may be addressed in future versions.

+
+
--timeout <seconds>
+ +
--timeout <smtp_seconds>,<imap_seconds>
+ +
--timeout <plugin1_seconds>,<plugin2_seconds>,...
+ +
+

Exit with CRITICAL if the plugins do not return a status within the specified number of seconds. +When only one parameter is used, it applies to each plugin. When multiple parameters are used +(separated by commas) they apply to plugins in the same order the plugins were specified on the +command line. When using --timeout but not the --plugin option, the first parameter is for +check_smtp_send and the second is for check_imap_receive.

+
+
--alert <pluginN>
+ +
+

Exit with WARNING or CRITICAL only if a warning or error (--warning, --critical, or --timeout) +occurs for specified plugins. If a warning or error occurs for non-specified plugins that run +BEFORE the specified plugins, the exit status will be UNKNOWN. If a warning of error occurs +for non-specified plugins that run AFTER the specified plugins, the exit status will not be +affected.

+

You would use this option if you are using check_email_delivery with the --plugin option and +the plugins you configure each use different servers, for example different SMTP and IMAP servers. +By default, if you do not use the --alert option, if anything goes wrong during the email delivery +check, a WARNING or CRITICAL alert will be issued. This means that if you define check_email_delivery +for the SMTP server only and the IMAP server fails, Nagios will alert you for the SMTP server which +would be misleading. If you define it for both the SMTP server and IMAP server and just one of them +fails, Nagios will alert you for both servers, which would still be misleading. If you have this +situation, you may want to use the --alert option. You define the check_email_delivery check for +both servers: for the SMTP server (first plugin) you use --alert 1, and for for the IMAP server +(second plugin) you use --alert 2. When check_email_delivery runs with --alert 1 and the SMTP +server fails, you will get the appropriate alert. If the IMAP server fails it will not affect the +status. When check_email_delivery runs with --alert 2 and the SMTP server fails, you will get the +UNKNOWN return code. If the IMAP server generates an alert you will get a WARNING or CRITICAL as +appropriate.

+

You can repeat this option to specify multiple plugins that should cause an alert. +Do this if you have multiple plugins on the command line but some of them involve the same server.

+

See also: --plugin. +Also known as: -A <pluginN>

+
+
--wait <seconds>[,<seconds>,...]
+ +
+

How long to wait between sending the message and checking that it was received. View default with +the -vV option.

+

When using the --plugin option, you can specify as many wait-between times as you have plugins +(minus the last plugin, because it makes no sense to wait after running the last one). For +example, if you use the --plugin option twice to specify an SMTP plugin and an IMAP plugin, and +you want to wait 5 seconds between sending and receiving, then you would specify --wait 5. A second +example, if you are using the --plugin option three times, then specifying -w 5 will wait 5 seconds +between the second and third plugins also. You can specify a different wait time +of 10 seconds between the second and third plugins, like this: -w 5,10.

+
+
--hostname <server>
+ +
+

Address or name of the SMTP and IMAP server. Examples: mail.server.com, localhost, 192.168.1.100. +Also known as: -H <server>

+
+
--smtp-server <server>
+ +
+

Address or name of the SMTP server. Examples: smtp.server.com, localhost, 192.168.1.100. +Using this option overrides the hostname option.

+
+
--smtp-port <number>
+ +
+

Service port on the SMTP server. Default is 25.

+
+
--smtp-username <username>
+ +
--smtp-password <password>
+ +
+

Username and password to use when connecting to the SMTP server with the TLS option. +Use these options if the SMTP account has a different username/password than the +IMAP account you are testing. These options take precendence over the --username and +the --password options.

+

These are shell-escaped; special characters are ok.

+
+
--imap-server <server>
+ +
+

Address or name of the IMAP server. Examples: imap.server.com, localhost, 192.168.1.100. +Using this option overrides the hostname option.

+
+
--imap-port <number>
+ +
+

Service port on the IMAP server. Default is 143. If you use SSL the default is 993.

+
+
--imap-username <username>
+ +
--imap-password <password>
+ +
+

Username and password to use when connecting to the IMAP server. +Use these options if the IMAP account has a different username/password than the +SMTP account you are testing. These options take precendence over the --username and +the --password options.

+

These are shell-escaped; special characters are ok.

+
+
--username <username>
+ +
--password <password>
+ +
+

Username and password to use when connecting to IMAP server. +Also known as: -U <username> -P <password>

+

Also used as the username and password for SMTP when the TLS option is enabled. +To specify a separate set of credentials for SMTP authentication, see the +options --smtp-username and --smtp-password.

+
+
--imap-check-interval <seconds>
+ +
+

How long to wait between polls of the imap-server for the specified mail. Default is 5 seconds.

+
+
--imap-retries <times>
+ +
+

How many times to poll the imap-server for the mail, before we give up. Default is 10.

+
+
--body <message>
+ +
+

Use this option to specify the body of the email message.

+
+
--header <header>
+ +
+

Use this option to set an arbitrary header in the message. You can use it multiple times.

+
+
--mailto recipient@your.net
+ +
+

You can send a message to multiple recipients by repeating this option or by separating +the email addresses with commas (no whitespace allowed):

+

$ check_email_delivery ... --mailto recipient@your.net,recipient2@your.net --mailfrom sender@your.net

+

This argument is shell-escaped; special characters or angle brackets around the address are ok.

+
+
--mailfrom sender@your.net
+ +
+

Use this option to set the "from" address in the email.

+
+
--imapssl +=item --noimapssl
+ +
+

Use this to enable or disable SSL for the IMAP plugin.

+

This argument is shell-escaped; special characters or angle brackets around the address are ok.

+
+
--smtptls +=item --nosmtptls
+ +
+

Use this to enable or disable TLS/AUTH for the SMTP plugin.

+
+
--libexec
+ +
+

Use this option to set the path of the Nagios libexec directory. The default is +/usr/local/nagios/libexec. This is where this plugin looks for the SMTP and IMAP +plugins that it depends on.

+
+
--plugin <command>
+ +
+

This is a new option introduced in version 0.5 of the check_email_delivery plugin. +It frees the plugin from depending on specific external plugins and generalizes the +work done to determine that the email loop is operational. When using the --plugin +option, the following options are ignored: libexec, imapssl, smtptls, hostname, +username, password, smtp*, imap*, mailto, mailfrom, body, header, search.

+

Use this option multiple times to specify the complete trip. Typically, you would use +this twice to specify plugins for SMTP and IMAP, or SMTP and POP3.

+

The output will be success if all the plugins return success. Each plugin should be a +standard Nagios plugin.

+

A random token will be automatically generated and passed to each plugin specified on +the command line by substituting the string %TOKEN1%.

+

Example usage:

+
+ command_name check_email_delivery
+ command_line check_email_delivery
+ --plugin "$USER1$/check_smtp_send -H $ARG1$ --mailto recipient@your.net --mailfrom sender@your.net --header 'Subject: Nagios Test %TOKEN1%.'"
+ --plugin "$USER1$/check_imap_receive -H $ARG1$ -U $ARG1$ -P $ARG2$ -s SUBJECT -s 'Nagios Test %TOKEN1%.'"
+

This technique allows for a lot of flexibility in configuring the plugins that test +each part of your email delivery loop.

+

See also: --token. +Also known as: -p <command>

+
+
--token <format>
+ +
+

This is a new option introduced in version 0.5 of the check_email_delivery plugin. +It can be used in conjunction with --plugin to control the tokens that are generated +and passed to the plugins, like %TOKEN1%.

+

Use this option multiple times to specify formats for different tokens. For example, +if you want %TOKEN1% to consist of only alphabetical characters but want %TOKEN2% to +consist of only digits, then you might use these options: --token aaaaaa --token nnnnn

+

Any tokens used in your plugin commands that have not been specified by --token <format> +will default to --token U-X-Y

+

Token formats: +a - alpha character (a-z) +n - numeric character (0-9) +c - alphanumeric character (a-z0-9) +h - hexadecimal character (0-9a-f) +U - unix time, seconds from epoch. eg 1193012441 +X - a word from the pgp even list. eg aardvark +Y - a word from the pgp odd list. eg adroitness

+

Caution: It has been observed that some IMAP servers do not handle underscores well in the +search criteria. For best results, avoid using underscores in your tokens. Use hyphens or commas instead.

+

See also: --plugin. +Also known as: -T <format>

+

The PGP word list was obtained from http://en.wikipedia.org/wiki/PGP_word_list

+
+
--file <file>
+ +
+

Save (append) status information into the given tab-delimited file. Format used:

+
+ token  start-time      end-time        status  plugin-num      output
+

Note: format may change in future versions and may become configurable.

+

This option available as of version 0.6.2.

+

Also known as: -F <file>

+
+
--hires
+ +
+

Use the Time::HiRes module to measure time, if available.

+
+
--verbose
+ +
+

Display additional information. Useful for troubleshooting. Use together with --version to see the default +warning and critical timeout values. +Also known as: -v

+
+
--version
+ +
+

Display plugin version and exit. +Also known as: -V

+
+
--help
+ +
+

Display this documentation and exit. Does not work in the ePN version. +Also known as: -h

+
+
--usage
+ +
+

Display a short usage instruction and exit.

+
+
+

+

+
+

EXAMPLES

+

+

+

Send a message with custom headers

+

$ check_email_delivery -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net +--username recipient --password secret

+

EMAIL DELIVERY OK - 1 seconds

+

+

+

Set warning and critical timeouts for receive plugin only:

+

$ check_email_delivery -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net +--username recipient --password secret -w ,,5 -c ,,15

+

EMAIL DELIVERY OK - 1 seconds

+

+

+
+

EXIT CODES

+

Complies with the Nagios plug-in specification: +
0OKThe plugin was able to check the service and it appeared to be functioning properly +
1WarningThe plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly +
2CriticalThe plugin detected that either the service was not running or it was above some "critical" threshold +
3UnknownInvalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service

+

+

+
+

NAGIOS PLUGIN NOTES

+

Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html

+

This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because +the path to utils.pm must be specified completely in this program and forces users to edit the source +code if their install location is different (if they realize this is the problem). You can view +the default timeout for this module by using the --verbose and --version options together. The +short form is -vV.

+

Other than that, it attempts to follow published guidelines for Nagios plugins.

+

+

+
+

CHANGES

+
+ Wed Oct 29 13:08:00 PST 2005
+ + version 0.1
+
+ Wed Nov  9 17:16:09 PST 2005
+ + updated arguments to check_smtp_send and check_imap_receive
+ + added eval/alarm block to implement -c option
+ + added wait option to adjust sleep time between smtp and imap calls
+ + added delay-warn and delay-crit options to adjust email delivery warning thresholds
+ + now using an inline PluginReport package to generate the report
+ + copyright notice and GNU GPL
+ + version 0.2
+
+ Thu Apr 20 14:00:00 CET 2006 (by Johan Nilsson <johann (at) axis.com>)
+ + version 0.2.1
+ + corrected bug in getoptions ($imap_server would never ever be set from command-line...)
+ + will not make $smtp_server and $imap_server == $host if they're defined on commandline 
+ + added support for multiple polls of imap-server, with specified intervals
+ + changed default behaviour in check_imap_server (searches for the specific id in subject and deletes mails found)
+ + increased default delay_warn from 65 seconds to 95 seconds
+
+ Thu Apr 20 16:00:00 PST 2006 (by Geoff Crompton <geoff.crompton@strategicdata.com.au>)
+ + fixed a bug in getoptions
+ + version 0.2.2
+
+ Tue Apr 24 21:17:53 PDT 2007
+ + now there is an alternate version (same but without embedded perl POD) that is compatible with the new new embedded-perl Nagios feature
+ + version 0.2.3
+
+ Fri Apr 27 20:32:53 PDT 2007 
+ + documentation now mentions every command-line option accepted by the plugin, including abbreviations
+ + changed connection error to display timeout only if timeout was the error
+ + default IMAP plugin is libexec/check_imap_receive (also checking for same but with .pl extension)
+ + default SMTP plugin is libexec/check_smtp_send (also checking for same but with .pl extension)
+ + removed default values for SMTP port and IMAP port to allow those plugins to set the defaults; so current behavior stays the same and will continue to make sense with SSL
+ + version 0.3
+
+ Thu Oct 11 10:00:00 EET 2007 (by Timo Virtaneva <timo (at) virtaneva dot com>
+ + Changed the header and the search criteria so that the same email-box can be used for all smtp-servers
+ + version 0.3.1
+
+ Sun Oct 21 11:01:03 PDT 2007
+ + added support for TLS options to the SMTP plugin
+ + version 0.4
+
+ Sun Oct 21 16:17:14 PDT 2007
+ + added support for arbitrary plugins to send and receive mail (or anthing else!). see the --plugin option.
+ + version 0.5
+
+ Tue Dec  4 07:36:20 PST 2007
+ + added --usage option because the official nagios plugins have both --help and --usage
+ + added --timeout option to match the official nagios plugins
+ + shortcut option for --token is now -T to avoid clash with standard shortcut -t for --timeout
+ + fixed some minor pod formatting issues for perldoc
+ + version 0.5.1
+
+ Sat Dec 15 07:39:59 PST 2007
+ + improved compatibility with Nagios embedded perl (ePN)
+ + version 0.5.2
+
+ Thu Jan 17 20:27:36 PST 2008 (by Timo Virtaneva <timo (at) virtaneva dot com> on Thu Oct 11 10:00:00 EET 2007)
+ + Changed the header and the search criteria so that the same email-box can be used for all smtp-servers
+ + version 0.5.3
+
+ Mon Jan 28 22:11:02 PST 2008
+ + fixed a bug, smtp-password and imap-password are now string parameters
+ + added --alert option to allow selection of which plugin(s) should cause a WARNING or CRITICAL alert
+ + version 0.6
+
+ Mon Feb 11 19:09:37 PST 2008
+ + fixed a bug for embedded perl version, variable "%status" will not stay shared in load_modules
+ + version 0.6.1
+
+ Mon May 26 10:39:19 PDT 2008
+ + added --file option to allow plugin to record status information into a tab-delimited file
+ + changed default token from U_X_Y to U-X-Y 
+ + version 0.6.2
+
+ Wed Jan 14 08:29:35 PST 2009
+ + fixed a bug that the --header parameter was not being passed to the smtp plugin.
+ + version 0.6.3
+
+ Mon Jun  8 15:43:48 PDT 2009
+ + added performance data for use with PNP4Nagios! (thanks to Ben Ritcey for the patch)
+ + version 0.6.4
+
+ Wed Sep 16 07:10:10 PDT 2009
+ + added elapsed time in seconds to performance data
+ + version 0.6.5
+
+ Fri Oct  8 19:48:44 PDT 2010
+ + fixed uniform IMAP and SMTP username and password bug (thanks to Micle Moerenhout for pointing it out)
+ + version 0.6.6
+
+ Mon Jan  3 08:24:23 PST 2011
+ + added shell escaping for smtp-username, smtp-password, mailto, mailfrom, imap-username, and imap-password arguments
+ + version 0.7.0
+
+ Fri May  6 08:35:09 AST 2011
+ + added --hires option to enable use of Time::Hires if available
+ + version 0.7.1
+
+ Sun Jun 12 17:17:06 AST 2011
+ + added --imap-mailbox option to pass through to check_imap_receive --mailbox option
+ + added --ssl option to conveniently enable both --smtp-tls and --imap-ssl 
+ + version 0.7.2
+

+

+
+

AUTHOR

+

Jonathan Buhacoff <jonathan@buhacoff.net>

+

+

+
+

COPYRIGHT AND LICENSE

+
+ 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 <http://www.gnu.org/licenses/>;.
+
+ http://www.gnu.org/licenses/gpl.txt
+ + + + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_email_delivery.pod b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_email_delivery.pod new file mode 100644 index 0000000..8e8c9dc --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_email_delivery.pod @@ -0,0 +1,472 @@ + + +=pod + +=head1 NAME + +check_email_delivery - sends email and verifies delivery + +=head1 SYNOPSIS + + check_email_delivery -vV + check_email_delivery --usage + check_email_delivery --help + +=head1 OPTIONS + +=over + +=item --warning [,,] + +Exit with WARNING if the most recent email found is older than . The +optional and parameters will be passed on to the +included plugins that are used for those tasks. If they are not +given then they will not be passed on and the default for that plugin will apply. +Also known as: -w [,[,]] + +When using the --plugin option, only one parameter is supported (-w ) and it will apply +to the entire process. You can specify a warning threshold specific to each plugin in the +plugin command line. + +When using the --plugin option, no measuring of "most recent email" is done because we would +not know how to read this information from receive plugins. This may be addressed in future versions. + +=item --critical [,,] + +Exit with CRITICAL if the most recent email found is older than . The +optional and parameters will be passed on to the +included plugins that are used for those tasks. If they are not +given then they will not be passed on and the default for that plugin will apply. +Also known as: -c [,[,]] + +When using the --plugin option, only one parameter is supported (-c ) and it will apply +to the entire process. You can specify a critical threshold specific to each plugin in the +plugin command line. + +When using the --plugin option, no measuring of "most recent email" is done because we would +not know how to read this information from receive plugins. This may be addressed in future versions. + +=item --timeout + +=item --timeout , + +=item --timeout ,,... + +Exit with CRITICAL if the plugins do not return a status within the specified number of seconds. +When only one parameter is used, it applies to each plugin. When multiple parameters are used +(separated by commas) they apply to plugins in the same order the plugins were specified on the +command line. When using --timeout but not the --plugin option, the first parameter is for +check_smtp_send and the second is for check_imap_receive. + +=item --alert + +Exit with WARNING or CRITICAL only if a warning or error (--warning, --critical, or --timeout) +occurs for specified plugins. If a warning or error occurs for non-specified plugins that run +BEFORE the specified plugins, the exit status will be UNKNOWN. If a warning of error occurs +for non-specified plugins that run AFTER the specified plugins, the exit status will not be +affected. + +You would use this option if you are using check_email_delivery with the --plugin option and +the plugins you configure each use different servers, for example different SMTP and IMAP servers. +By default, if you do not use the --alert option, if anything goes wrong during the email delivery +check, a WARNING or CRITICAL alert will be issued. This means that if you define check_email_delivery +for the SMTP server only and the IMAP server fails, Nagios will alert you for the SMTP server which +would be misleading. If you define it for both the SMTP server and IMAP server and just one of them +fails, Nagios will alert you for both servers, which would still be misleading. If you have this +situation, you may want to use the --alert option. You define the check_email_delivery check for +both servers: for the SMTP server (first plugin) you use --alert 1, and for for the IMAP server +(second plugin) you use --alert 2. When check_email_delivery runs with --alert 1 and the SMTP +server fails, you will get the appropriate alert. If the IMAP server fails it will not affect the +status. When check_email_delivery runs with --alert 2 and the SMTP server fails, you will get the +UNKNOWN return code. If the IMAP server generates an alert you will get a WARNING or CRITICAL as +appropriate. + +You can repeat this option to specify multiple plugins that should cause an alert. +Do this if you have multiple plugins on the command line but some of them involve the same server. + +See also: --plugin. +Also known as: -A + + +=item --wait [,,...] + +How long to wait between sending the message and checking that it was received. View default with +the -vV option. + +When using the --plugin option, you can specify as many wait-between times as you have plugins +(minus the last plugin, because it makes no sense to wait after running the last one). For +example, if you use the --plugin option twice to specify an SMTP plugin and an IMAP plugin, and +you want to wait 5 seconds between sending and receiving, then you would specify --wait 5. A second +example, if you are using the --plugin option three times, then specifying -w 5 will wait 5 seconds +between the second and third plugins also. You can specify a different wait time +of 10 seconds between the second and third plugins, like this: -w 5,10. + +=item --hostname + +Address or name of the SMTP and IMAP server. Examples: mail.server.com, localhost, 192.168.1.100. +Also known as: -H + +=item --smtp-server + +Address or name of the SMTP server. Examples: smtp.server.com, localhost, 192.168.1.100. +Using this option overrides the hostname option. + +=item --smtp-port + +Service port on the SMTP server. Default is 25. + +=item --smtp-username + +=item --smtp-password + +Username and password to use when connecting to the SMTP server with the TLS option. +Use these options if the SMTP account has a different username/password than the +IMAP account you are testing. These options take precendence over the --username and +the --password options. + +These are shell-escaped; special characters are ok. + +=item --imap-server + +Address or name of the IMAP server. Examples: imap.server.com, localhost, 192.168.1.100. +Using this option overrides the hostname option. + +=item --imap-port + +Service port on the IMAP server. Default is 143. If you use SSL the default is 993. + +=item --imap-username + +=item --imap-password + +Username and password to use when connecting to the IMAP server. +Use these options if the IMAP account has a different username/password than the +SMTP account you are testing. These options take precendence over the --username and +the --password options. + +These are shell-escaped; special characters are ok. + +=item --username + +=item --password + +Username and password to use when connecting to IMAP server. +Also known as: -U -P + +Also used as the username and password for SMTP when the TLS option is enabled. +To specify a separate set of credentials for SMTP authentication, see the +options --smtp-username and --smtp-password. + +=item --imap-check-interval + +How long to wait between polls of the imap-server for the specified mail. Default is 5 seconds. + +=item --imap-retries + +How many times to poll the imap-server for the mail, before we give up. Default is 10. + +=item --body + +Use this option to specify the body of the email message. + +=item --header
+ +Use this option to set an arbitrary header in the message. You can use it multiple times. + +=item --mailto recipient@your.net + +You can send a message to multiple recipients by repeating this option or by separating +the email addresses with commas (no whitespace allowed): + +$ check_email_delivery ... --mailto recipient@your.net,recipient2@your.net --mailfrom sender@your.net + +This argument is shell-escaped; special characters or angle brackets around the address are ok. + +=item --mailfrom sender@your.net + +Use this option to set the "from" address in the email. + +=item --imapssl +=item --noimapssl + +Use this to enable or disable SSL for the IMAP plugin. + +This argument is shell-escaped; special characters or angle brackets around the address are ok. + +=item --smtptls +=item --nosmtptls + +Use this to enable or disable TLS/AUTH for the SMTP plugin. + +=item --libexec + +Use this option to set the path of the Nagios libexec directory. The default is +/usr/local/nagios/libexec. This is where this plugin looks for the SMTP and IMAP +plugins that it depends on. + +=item --plugin + +This is a new option introduced in version 0.5 of the check_email_delivery plugin. +It frees the plugin from depending on specific external plugins and generalizes the +work done to determine that the email loop is operational. When using the --plugin +option, the following options are ignored: libexec, imapssl, smtptls, hostname, +username, password, smtp*, imap*, mailto, mailfrom, body, header, search. + +Use this option multiple times to specify the complete trip. Typically, you would use +this twice to specify plugins for SMTP and IMAP, or SMTP and POP3. + +The output will be success if all the plugins return success. Each plugin should be a +standard Nagios plugin. + +A random token will be automatically generated and passed to each plugin specified on +the command line by substituting the string %TOKEN1%. + +Example usage: + + command_name check_email_delivery + command_line check_email_delivery + --plugin "$USER1$/check_smtp_send -H $ARG1$ --mailto recipient@your.net --mailfrom sender@your.net --header 'Subject: Nagios Test %TOKEN1%.'" + --plugin "$USER1$/check_imap_receive -H $ARG1$ -U $ARG1$ -P $ARG2$ -s SUBJECT -s 'Nagios Test %TOKEN1%.'" + +This technique allows for a lot of flexibility in configuring the plugins that test +each part of your email delivery loop. + +See also: --token. +Also known as: -p + +=item --token + +This is a new option introduced in version 0.5 of the check_email_delivery plugin. +It can be used in conjunction with --plugin to control the tokens that are generated +and passed to the plugins, like %TOKEN1%. + +Use this option multiple times to specify formats for different tokens. For example, +if you want %TOKEN1% to consist of only alphabetical characters but want %TOKEN2% to +consist of only digits, then you might use these options: --token aaaaaa --token nnnnn + +Any tokens used in your plugin commands that have not been specified by --token +will default to --token U-X-Y + +Token formats: +a - alpha character (a-z) +n - numeric character (0-9) +c - alphanumeric character (a-z0-9) +h - hexadecimal character (0-9a-f) +U - unix time, seconds from epoch. eg 1193012441 +X - a word from the pgp even list. eg aardvark +Y - a word from the pgp odd list. eg adroitness + +Caution: It has been observed that some IMAP servers do not handle underscores well in the +search criteria. For best results, avoid using underscores in your tokens. Use hyphens or commas instead. + +See also: --plugin. +Also known as: -T + +The PGP word list was obtained from http://en.wikipedia.org/wiki/PGP_word_list + +=item --file + +Save (append) status information into the given tab-delimited file. Format used: + + token start-time end-time status plugin-num output + +Note: format may change in future versions and may become configurable. + +This option available as of version 0.6.2. + +Also known as: -F + +=item --hires + +Use the Time::HiRes module to measure time, if available. + +=item --verbose + +Display additional information. Useful for troubleshooting. Use together with --version to see the default +warning and critical timeout values. +Also known as: -v + +=item --version + +Display plugin version and exit. +Also known as: -V + +=item --help + +Display this documentation and exit. Does not work in the ePN version. +Also known as: -h + +=item --usage + +Display a short usage instruction and exit. + +=back + +=head1 EXAMPLES + +=head2 Send a message with custom headers + +$ check_email_delivery -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net +--username recipient --password secret + +EMAIL DELIVERY OK - 1 seconds + +=head2 Set warning and critical timeouts for receive plugin only: + +$ check_email_delivery -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net +--username recipient --password secret -w ,,5 -c ,,15 + +EMAIL DELIVERY OK - 1 seconds + +=head1 EXIT CODES + +Complies with the Nagios plug-in specification: + 0 OK The plugin was able to check the service and it appeared to be functioning properly + 1 Warning The plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly + 2 Critical The plugin detected that either the service was not running or it was above some "critical" threshold + 3 Unknown Invalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service + +=head1 NAGIOS PLUGIN NOTES + +Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html + +This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because +the path to utils.pm must be specified completely in this program and forces users to edit the source +code if their install location is different (if they realize this is the problem). You can view +the default timeout for this module by using the --verbose and --version options together. The +short form is -vV. + +Other than that, it attempts to follow published guidelines for Nagios plugins. + +=head1 CHANGES + + Wed Oct 29 13:08:00 PST 2005 + + version 0.1 + + Wed Nov 9 17:16:09 PST 2005 + + updated arguments to check_smtp_send and check_imap_receive + + added eval/alarm block to implement -c option + + added wait option to adjust sleep time between smtp and imap calls + + added delay-warn and delay-crit options to adjust email delivery warning thresholds + + now using an inline PluginReport package to generate the report + + copyright notice and GNU GPL + + version 0.2 + + Thu Apr 20 14:00:00 CET 2006 (by Johan Nilsson ) + + version 0.2.1 + + corrected bug in getoptions ($imap_server would never ever be set from command-line...) + + will not make $smtp_server and $imap_server == $host if they're defined on commandline + + added support for multiple polls of imap-server, with specified intervals + + changed default behaviour in check_imap_server (searches for the specific id in subject and deletes mails found) + + increased default delay_warn from 65 seconds to 95 seconds + + Thu Apr 20 16:00:00 PST 2006 (by Geoff Crompton ) + + fixed a bug in getoptions + + version 0.2.2 + + Tue Apr 24 21:17:53 PDT 2007 + + now there is an alternate version (same but without embedded perl POD) that is compatible with the new new embedded-perl Nagios feature + + version 0.2.3 + + Fri Apr 27 20:32:53 PDT 2007 + + documentation now mentions every command-line option accepted by the plugin, including abbreviations + + changed connection error to display timeout only if timeout was the error + + default IMAP plugin is libexec/check_imap_receive (also checking for same but with .pl extension) + + default SMTP plugin is libexec/check_smtp_send (also checking for same but with .pl extension) + + removed default values for SMTP port and IMAP port to allow those plugins to set the defaults; so current behavior stays the same and will continue to make sense with SSL + + version 0.3 + + Thu Oct 11 10:00:00 EET 2007 (by Timo Virtaneva + + Changed the header and the search criteria so that the same email-box can be used for all smtp-servers + + version 0.3.1 + + Sun Oct 21 11:01:03 PDT 2007 + + added support for TLS options to the SMTP plugin + + version 0.4 + + Sun Oct 21 16:17:14 PDT 2007 + + added support for arbitrary plugins to send and receive mail (or anthing else!). see the --plugin option. + + version 0.5 + + Tue Dec 4 07:36:20 PST 2007 + + added --usage option because the official nagios plugins have both --help and --usage + + added --timeout option to match the official nagios plugins + + shortcut option for --token is now -T to avoid clash with standard shortcut -t for --timeout + + fixed some minor pod formatting issues for perldoc + + version 0.5.1 + + Sat Dec 15 07:39:59 PST 2007 + + improved compatibility with Nagios embedded perl (ePN) + + version 0.5.2 + + Thu Jan 17 20:27:36 PST 2008 (by Timo Virtaneva on Thu Oct 11 10:00:00 EET 2007) + + Changed the header and the search criteria so that the same email-box can be used for all smtp-servers + + version 0.5.3 + + Mon Jan 28 22:11:02 PST 2008 + + fixed a bug, smtp-password and imap-password are now string parameters + + added --alert option to allow selection of which plugin(s) should cause a WARNING or CRITICAL alert + + version 0.6 + + Mon Feb 11 19:09:37 PST 2008 + + fixed a bug for embedded perl version, variable "%status" will not stay shared in load_modules + + version 0.6.1 + + Mon May 26 10:39:19 PDT 2008 + + added --file option to allow plugin to record status information into a tab-delimited file + + changed default token from U_X_Y to U-X-Y + + version 0.6.2 + + Wed Jan 14 08:29:35 PST 2009 + + fixed a bug that the --header parameter was not being passed to the smtp plugin. + + version 0.6.3 + + Mon Jun 8 15:43:48 PDT 2009 + + added performance data for use with PNP4Nagios! (thanks to Ben Ritcey for the patch) + + version 0.6.4 + + Wed Sep 16 07:10:10 PDT 2009 + + added elapsed time in seconds to performance data + + version 0.6.5 + + Fri Oct 8 19:48:44 PDT 2010 + + fixed uniform IMAP and SMTP username and password bug (thanks to Micle Moerenhout for pointing it out) + + version 0.6.6 + + Mon Jan 3 08:24:23 PST 2011 + + added shell escaping for smtp-username, smtp-password, mailto, mailfrom, imap-username, and imap-password arguments + + version 0.7.0 + + Fri May 6 08:35:09 AST 2011 + + added --hires option to enable use of Time::Hires if available + + version 0.7.1 + + Sun Jun 12 17:17:06 AST 2011 + + added --imap-mailbox option to pass through to check_imap_receive --mailbox option + + added --ssl option to conveniently enable both --smtp-tls and --imap-ssl + + version 0.7.2 + +=head1 AUTHOR + +Jonathan Buhacoff + +=head1 COPYRIGHT AND LICENSE + + 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 . + + http://www.gnu.org/licenses/gpl.txt + +=cut diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_quota.html b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_quota.html new file mode 100644 index 0000000..8548ca0 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_quota.html @@ -0,0 +1,258 @@ + + + + +check_imap_quota - connects to an IMAP account and checks the quota + + + + + + + + + +
+

+ + + +
+ + +

+

+
+

NAME

+

check_imap_quota - connects to an IMAP account and checks the quota

+

+

+
+

SYNOPSIS

+
+ check_imap_quota -vV
+ check_imap_quota -?
+ check_imap_quota --help
+

+

+
+

OPTIONS

+
+
--warning <seconds>
+ +
+

Warn if it takes longer than <seconds> to connect to the IMAP server. Default is 15 seconds. +Also known as: -w <seconds>

+
+
--critical <seconds>
+ +
+

Return a critical status if it takes longer than <seconds> to connect to the IMAP server. Default is 30 seconds. +See also: --capture-critical <messages> +Also known as: -c <seconds>

+
+
--timeout <seconds>
+ +
+

Abort with critical status if it takes longer than <seconds> to connect to the IMAP server. Default is 60 seconds. +The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to +connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer +than 30 seconds. +Also known as: -t <seconds>

+
+
--hostname <server>
+ +
+

Address or name of the IMAP server. Examples: mail.server.com, localhost, 192.168.1.100 +Also known as: -H <server>

+
+
--port <number>
+ +
+

Service port on the IMAP server. Default is 143. If you use SSL, default is 993. +Also known as: -p <number>

+
+
--username <username>
+ +
--password <password>
+ +
+

Username and password to use when connecting to IMAP server. +Also known as: -U <username> -P <password>

+
+
--mailbox <mailbox>
+ +
+

Use this option to specify the mailbox to search for messages. Default is INBOX. +Also known as: -m <mailbox>

+
+
--ssl
+ +
--nossl
+ +
+

Enable SSL protocol. Requires IO::Socket::SSL.

+

Using this option automatically changes the default port from 143 to 993. You can still +override this from the command line using the --port option.

+

Use the nossl option to turn off the ssl option.

+
+
--hires
+ +
+

Use the Time::HiRes module to measure time, if available.

+
+
--verbose
+ +
+

Display additional information. Useful for troubleshooting. Use together with --version to see the default +warning and critical timeout values.

+

If the selected mailbox was not found, you can use verbosity level 3 (-vvv) to display a list of all +available mailboxes on the server.

+

Also known as: -v

+
+
--version
+ +
+

Display plugin version and exit. +Also known as: -V

+
+
--help
+ +
+

Display this documentation and exit. Does not work in the ePN version. +Also known as: -h

+
+
--usage
+ +
+

Display a short usage instruction and exit.

+
+
+

+

+
+

EXAMPLES

+

+

+

Report how many emails are in the mailbox

+
+ $ check_imap_receive -H mail.server.net --username mailuser --password mailpass
+ -s ALL --nodelete
+
+ IMAP RECEIVE OK - 1 seconds, 7 found
+

+

+

Report the email with the highest value

+

Suppose your mailbox has some emails from an automated script and that a message +from this script typically looks like this (abbreviated):

+
+ To: mailuser@server.net
+ From: autoscript@server.net
+ Subject: Results of Autoscript
+ Date: Wed, 09 Nov 2005 08:30:40 -0800
+ Message-ID: <auto-000000992528@server.net>
+
+ Homeruns 5
+

And further suppose that you are interested in reporting the message that has the +highest number of home runs, and also to leave this message in the mailbox for future +checks, but remove the other matching messages with lesser values:

+
+ $ check_imap_receive -H mail.server.net --username mailuser --password mailpass
+ -s SUBJECT -s "Results of Autoscript" --capture-max "Homeruns (\d+)"  --nodelete-captured
+
+ IMAP RECEIVE OK - 1 seconds, 3 found, 1 captured, 5 max, 2 deleted
+

+

+

Troubleshoot your search parameters

+

Add the --nodelete and --imap-retries=1 parameters to your command line.

+

+

+
+

EXIT CODES

+

Complies with the Nagios plug-in specification: +
0OKThe plugin was able to check the service and it appeared to be functioning properly +
1WarningThe plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly +
2CriticalThe plugin detected that either the service was not running or it was above some "critical" threshold +
3UnknownInvalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service

+

+

+
+

NAGIOS PLUGIN NOTES

+

Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html

+

This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because +the path to utils.pm must be specified completely in this program and forces users to edit the source +code if their install location is different (if they realize this is the problem). You can view +the default timeout for this module by using the --verbose and --version options together. The +short form is -vV.

+

Other than that, it attempts to follow published guidelines for Nagios plugins.

+

+

+
+

SEE ALSO

+

http://nagios.org/ +http://search.cpan.org/~djkernen/Mail-IMAPClient-2.2.9/IMAPClient.pod +http://search.cpan.org/~markov/Mail-IMAPClient-3.00/lib/Mail/IMAPClient.pod

+

+

+
+

CHANGES

+
+ Fri Nov 11 04:53:09 AST 2011
+ + version 0.1 created with quota code contributed by Johan Romme
+
+ Tue Dec 20 17:38:04 PST 2011
+ + fixed bug where a quota of 0 was reported as an incorrect response from the server, thanks to Eike Arndt
+ + version 0.2
+

+

+
+

AUTHOR

+

Jonathan Buhacoff <jonathan@buhacoff.net>

+

+

+
+

COPYRIGHT AND LICENSE

+
+ Copyright (C) 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 <http://www.gnu.org/licenses/>;.
+
+ http://www.gnu.org/licenses/gpl.txt
+ + + + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_quota.pod b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_quota.pod new file mode 100644 index 0000000..03a02c2 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_quota.pod @@ -0,0 +1,196 @@ + + + +=pod + +=head1 NAME + +check_imap_quota - connects to an IMAP account and checks the quota + +=head1 SYNOPSIS + + check_imap_quota -vV + check_imap_quota -? + check_imap_quota --help + +=head1 OPTIONS + +=over + +=item --warning + +Warn if it takes longer than to connect to the IMAP server. Default is 15 seconds. +Also known as: -w + +=item --critical + +Return a critical status if it takes longer than to connect to the IMAP server. Default is 30 seconds. +See also: --capture-critical +Also known as: -c + +=item --timeout + +Abort with critical status if it takes longer than to connect to the IMAP server. Default is 60 seconds. +The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to +connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer +than 30 seconds. +Also known as: -t + +=item --hostname + +Address or name of the IMAP server. Examples: mail.server.com, localhost, 192.168.1.100 +Also known as: -H + +=item --port + +Service port on the IMAP server. Default is 143. If you use SSL, default is 993. +Also known as: -p + +=item --username + +=item --password + +Username and password to use when connecting to IMAP server. +Also known as: -U -P + +=item --mailbox + +Use this option to specify the mailbox to search for messages. Default is INBOX. +Also known as: -m + +=item --ssl + +=item --nossl + +Enable SSL protocol. Requires IO::Socket::SSL. + +Using this option automatically changes the default port from 143 to 993. You can still +override this from the command line using the --port option. + +Use the nossl option to turn off the ssl option. + +=item --hires + +Use the Time::HiRes module to measure time, if available. + +=item --verbose + +Display additional information. Useful for troubleshooting. Use together with --version to see the default +warning and critical timeout values. + +If the selected mailbox was not found, you can use verbosity level 3 (-vvv) to display a list of all +available mailboxes on the server. + +Also known as: -v + +=item --version + +Display plugin version and exit. +Also known as: -V + +=item --help + +Display this documentation and exit. Does not work in the ePN version. +Also known as: -h + +=item --usage + +Display a short usage instruction and exit. + +=back + +=head1 EXAMPLES + +=head2 Report how many emails are in the mailbox + + $ check_imap_receive -H mail.server.net --username mailuser --password mailpass + -s ALL --nodelete + + IMAP RECEIVE OK - 1 seconds, 7 found + +=head2 Report the email with the highest value + +Suppose your mailbox has some emails from an automated script and that a message +from this script typically looks like this (abbreviated): + + To: mailuser@server.net + From: autoscript@server.net + Subject: Results of Autoscript + Date: Wed, 09 Nov 2005 08:30:40 -0800 + Message-ID: + + Homeruns 5 + +And further suppose that you are interested in reporting the message that has the +highest number of home runs, and also to leave this message in the mailbox for future +checks, but remove the other matching messages with lesser values: + + $ check_imap_receive -H mail.server.net --username mailuser --password mailpass + -s SUBJECT -s "Results of Autoscript" --capture-max "Homeruns (\d+)" --nodelete-captured + + IMAP RECEIVE OK - 1 seconds, 3 found, 1 captured, 5 max, 2 deleted + +=head2 Troubleshoot your search parameters + +Add the --nodelete and --imap-retries=1 parameters to your command line. + +=head1 EXIT CODES + +Complies with the Nagios plug-in specification: + 0 OK The plugin was able to check the service and it appeared to be functioning properly + 1 Warning The plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly + 2 Critical The plugin detected that either the service was not running or it was above some "critical" threshold + 3 Unknown Invalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service + +=head1 NAGIOS PLUGIN NOTES + +Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html + +This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because +the path to utils.pm must be specified completely in this program and forces users to edit the source +code if their install location is different (if they realize this is the problem). You can view +the default timeout for this module by using the --verbose and --version options together. The +short form is -vV. + +Other than that, it attempts to follow published guidelines for Nagios plugins. + +=head1 SEE ALSO + +http://nagios.org/ +http://search.cpan.org/~djkernen/Mail-IMAPClient-2.2.9/IMAPClient.pod +http://search.cpan.org/~markov/Mail-IMAPClient-3.00/lib/Mail/IMAPClient.pod + +=head1 CHANGES + + Fri Nov 11 04:53:09 AST 2011 + + version 0.1 created with quota code contributed by Johan Romme + + Tue Dec 20 17:38:04 PST 2011 + + fixed bug where a quota of 0 was reported as an incorrect response from the server, thanks to Eike Arndt + + version 0.2 + +=head1 AUTHOR + +Jonathan Buhacoff + +=head1 COPYRIGHT AND LICENSE + + Copyright (C) 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 . + + http://www.gnu.org/licenses/gpl.txt + +=cut + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_receive.html b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_receive.html new file mode 100644 index 0000000..fee7c08 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_receive.html @@ -0,0 +1,551 @@ + + + + +check_imap_receive - connects to and searches an IMAP account for messages + + + + + + + + + +
+

+ + + +
+ + +

+

+
+

NAME

+

check_imap_receive - connects to and searches an IMAP account for messages

+

+

+
+

SYNOPSIS

+
+ check_imap_receive -vV
+ check_imap_receive -?
+ check_imap_receive --help
+

+

+
+

OPTIONS

+
+
--warning <seconds>
+ +
+

Warn if it takes longer than <seconds> to connect to the IMAP server. Default is 15 seconds. +Also known as: -w <seconds>

+
+
--critical <seconds>
+ +
+

Return a critical status if it takes longer than <seconds> to connect to the IMAP server. Default is 30 seconds. +See also: --capture-critical <messages> +Also known as: -c <seconds>

+
+
--timeout <seconds>
+ +
+

Abort with critical status if it takes longer than <seconds> to connect to the IMAP server. Default is 60 seconds. +The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to +connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer +than 30 seconds. +Also known as: -t <seconds>

+
+
--imap-check-interval <seconds>
+ +
+

How long to wait after searching for a matching message before searching again. Only takes effect +if no messages were found. Default is 5 seconds.

+
+
--imap-retries <number>
+ +
+

How many times to try searching for a matching message before giving up. If you set this to 0 then +messages will not be searched at all. Setting this to 1 means the plugin only tries once. Etc. +Default is 10 times.

+
+
--hostname <server>
+ +
+

Address or name of the IMAP server. Examples: mail.server.com, localhost, 192.168.1.100 +Also known as: -H <server>

+
+
--port <number>
+ +
+

Service port on the IMAP server. Default is 143. If you use SSL, default is 993. +Also known as: -p <number>

+
+
--username <username>
+ +
--password <password>
+ +
+

Username and password to use when connecting to IMAP server. +Also known as: -U <username> -P <password>

+
+
--mailbox <mailbox>
+ +
+

Use this option to specify the mailbox to search for messages. Default is INBOX. +Also known as: -m <mailbox>

+
+
--search <string>
+ +
+

Use this option to filter the messages. Default is not to filter. You may (must) use this option +multiple times in order to create any valid IMAP search criteria. See the examples and see also +http://www.ietf.org/rfc/rfc2060.txt (look for section 6.4.4, the SEARCH command)

+

This is the way to find messages matching a given subject: + -s SUBJECT -s "a given subject"

+

You can use the following technique for any header, including Subject. To find "Header-Name: some value": + -s HEADER -s Header-Name -s "some value"

+

Modern IMAP servers that support rfc5032 extensions allow you to search for messages +older or younger than a number of seconds. So to find messages received in the past hour, +you can do:

+
+ -s YOUNGER -s 3600
+

Or to find messages received more than 5 minutes ago, you can do:

+
+ -s OLDER -s 300
+

Also known as: -s <string>

+
+
--download
+ +
--nodownload
+ +
+

This option causes all messages in the specified mailbox to be downloaded from the server +and searched locally. See --download-max if you only want to download a few messages. +Currently only the following RFC 2060 search criteria are supported: +TEXT, BODY, SUBJECT, HEADER, NOT, OR, SENTBEFORE, SENTON, SENTSINCE.

+

Requires Email::Simple to be installed. It is available on CPAN.

+

This option may be particularly useful to you if your mail server is slow to index +messages (like Exchange 2003), causing the plugin not to find them with IMAP SEARCH +even though they are in the inbox.

+

It's also useful if you're searching for messages that have been on the server for a +specified amount of time, like some minutes or hours, because the standard IMAP search +function only allows whole dates. For this, use the standard search keywords but you +can specify either just a date like in RFC 2060 or a date and a time.

+

If you use SENTBEFORE, SENTON, or SENTSINCE, you must have Date::Manip installed +on your system.

+
+
--download-max
+ +
+

Limits the number of messages downloaded from the server when the --download option is used. +Default is to download and search all messages.

+
+
--search-critical-min <messages>
+ +
+

This option will trigger a CRITICAL status if the number of messages found by the search criteria +is below the given number. Use in conjunction with --search.

+

This parameter defaults to 1 so that if no messages are found, the plugin will exit with a CRITICAL status.

+

If you want the original behavior where the plugin exits with a WARNING status when no messages are found, +set this parameter to 0.

+
+
--search-critical-max <messages>
+ +
+

This option will trigger a CRITICAL status if the number of messages found by the search criteria +is above the given number. Use in conjunction with --search.

+

This parameter defaults to -1 meaning it's disabled. If you set it to 10, the plugin will exit with +CRITICAL if it finds 11 messages. If you set it to 1, the plugin will exit with CRITICAL if it finds +any more than 1 message. If you set it to 0, the plugin will exit with CRITICAL if it finds any messages +at all. If you set it to -1 it will be disabled.

+
+
--search-warning-min <messages>
+ +
+

This option will trigger a WARNING status if the number of messages found by the search criteria +is below the given number. Use in conjunction with --search.

+

This parameter defaults to 1 so that if no messages are found, the plugin will exit with a WARNING status.

+

If you want to suppress the original behavior where the plugin exits with a WARNING status when no messages are found, +set this parameter to 0. When this parameter is 0, it means that you expect the mailbox not to have any messages.

+
+
--search-warning-max <messages>
+ +
+

This option will trigger a WARNING status if the number of messages found by the search criteria +is above the given number. Use in conjunction with --search.

+

This parameter defaults to -1 meaning it's disabled. If you set it to 10, the plugin will exit with +WARNING if it finds 11 messages. If you set it to 1, the plugin will exit with WARNING if it finds +any more than 1 message. If you set it to 0, the plugin will exit with WARNING if it finds any messages +at all. If you set it to -1 it will be disabled.

+
+
--capture-max <regexp>
+ +
+

In addition to specifying search arguments to filter the emails in the IMAP account, you can specify +a "capture-max" regexp argument and the eligible emails (found with search arguments) +will be compared to each other and the OK line will have the highest captured value.

+

The regexp is expected to capture a numeric value.

+
+
--capture-min <regexp>
+ +
+

In addition to specifying search arguments to filter the emails in the IMAP account, you can specify +a "capture-min" regexp argument and the eligible emails (found with search arguments) +will be compared to each other and the OK line will have the lowest captured value.

+

The regexp is expected to capture a numeric value.

+
+
--delete
+ +
--nodelete
+ +
+

Use the delete option to delete messages that matched the search criteria. This is useful for +preventing the mailbox from filling up with automated messages (from the check_smtp_send plugin, for example). +THE DELETE OPTION IS TURNED *ON* BY DEFAULT, in order to preserve compatibility with an earlier version.

+

Use the nodelete option to turn off the delete option.

+
+
--nodelete-captured
+ +
+

If you use both the capture-max and delete arguments, you can also use the nodelete-captured argument to specify that the email +with the highest captured value should not be deleted. This leaves it available for comparison the next time this plugin runs.

+

If you do not use the delete option, this option has no effect.

+
+
--ssl
+ +
--nossl
+ +
+

Enable SSL protocol. Requires IO::Socket::SSL.

+

Using this option automatically changes the default port from 143 to 993. You can still +override this from the command line using the --port option.

+

Use the nossl option to turn off the ssl option.

+
+
--ssl-ca-file
+ +
+

Use this to verify the server SSL certificate against a local .pem file. You'll need to +specify the path to the .pem file as the parameter.

+

You can use the imap_ssl_cert utility included in this distribution to connect to your IMAP +server and save its SSL certificates into your .pem file. Usage is like this:

+
+ imap_ssl_cert -H imap.server.com > ca_file.pem
+

Only applicable when --ssl option is enabled.

+
+
--template
+ +
--notemplate
+ +
+

Enable (or disable) processing of IMAP search parameters. Requires Text::Template and Date::Manip.

+

Use this option to apply special processing to IMAP search parameters that allows you to use the +results of arbitrary computations as the parameter values. For example, you can use this feature +to search for message received up to 4 hours ago.

+

Modern IMAP servers that support rfc5032 extensions allow searching with the YOUNGER and OLDER +criteria so a message received up to 4 hours ago is -s YOUNGER -s 14400. But if your mail server +doesn't support that, you could use the --template option to get similar functionality.

+

When you enable the --template option, each parameter you pass to the -s option is parsed by +Text::Template. See the Text::Template manual for more information, but in general any expression +written in Perl will work.

+

A convenience function called rfc2822dateHeader is provided to you so you can easily compute properly +formatted dates for use as search parameters. The rfc2822date function can take one or two +parameters itself: the date to format and an optional offset. To use the current time as a +search parameter, you can write this:

+
+ $ check_imap_receive ... --template -s HEADER -s Delivery-Date -s '{rfc2822dateHeader("now")}'
+

The output of {rfc2822dateHeader("now")} looks like this: Wed, 30 Sep 2009 22:44:03 -0700 and +is suitable for use with a date header, like HEADER Delivery-Date.

+

To use a time in the past relative to the current time or day, you can use a second convenience function +called rfc2822date and write this:

+
+ $ check_imap_receive ... --template -s SENTSINCE -s '{rfc2822date("now","-1 day")}'
+

The output of {rfc2822date("now","-1 day")} looks like this: 29-Sep-2009 and is suitable for use +with BEFORE, ON, SENTBEFORE, SENTON, SENTSINCE, and SINCE.

+

I have seen some email clients use a different format in the Date field, +like September 17, 2009 9:46:51 AM PDT. To specify an arbitrary format like this one, write this:

+
+ $ check_imap_receive ... --template -s HEADER -s Delivery-Date -s '{date("%B %e, %Y %i:%M:%S %p %Z","now","-4 hours")}'
+

You can use BEFORE, ON, SENTBEFORE, SENTON, SENTSINCE, or SINCE to search for messages that arrived +on, before, or after a given day but not on, before, or after a specific time on that day.

+

To search for messages that arrived on, before, or after a specific time you have to use the +Delivery-Date or another date field, like with -s HEADER -s Delivery-Date in the example above.

+

See the Date::Manip manual for more information on the allowed expressions for date and delta strings.

+
+
--hires
+ +
+

Use the Time::HiRes module to measure time, if available.

+
+
--verbose
+ +
+

Display additional information. Useful for troubleshooting. Use together with --version to see the default +warning and critical timeout values.

+

If the selected mailbox was not found, you can use verbosity level 3 (-vvv) to display a list of all +available mailboxes on the server.

+

Also known as: -v

+
+
--version
+ +
+

Display plugin version and exit. +Also known as: -V

+
+
--help
+ +
+

Display this documentation and exit. Does not work in the ePN version. +Also known as: -h

+
+
--usage
+ +
+

Display a short usage instruction and exit.

+
+
+

+

+
+

EXAMPLES

+

+

+

Report how many emails are in the mailbox

+
+ $ check_imap_receive -H mail.server.net --username mailuser --password mailpass
+ -s ALL --nodelete
+
+ IMAP RECEIVE OK - 1 seconds, 7 found
+

+

+

Report the email with the highest value

+

Suppose your mailbox has some emails from an automated script and that a message +from this script typically looks like this (abbreviated):

+
+ To: mailuser@server.net
+ From: autoscript@server.net
+ Subject: Results of Autoscript
+ Date: Wed, 09 Nov 2005 08:30:40 -0800
+ Message-ID: <auto-000000992528@server.net>
+
+ Homeruns 5
+

And further suppose that you are interested in reporting the message that has the +highest number of home runs, and also to leave this message in the mailbox for future +checks, but remove the other matching messages with lesser values:

+
+ $ check_imap_receive -H mail.server.net --username mailuser --password mailpass
+ -s SUBJECT -s "Results of Autoscript" --capture-max "Homeruns (\d+)"  --nodelete-captured
+
+ IMAP RECEIVE OK - 1 seconds, 3 found, 1 captured, 5 max, 2 deleted
+

+

+

Troubleshoot your search parameters

+

Add the --nodelete and --imap-retries=1 parameters to your command line.

+

+

+
+

EXIT CODES

+

Complies with the Nagios plug-in specification: +
0OKThe plugin was able to check the service and it appeared to be functioning properly +
1WarningThe plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly +
2CriticalThe plugin detected that either the service was not running or it was above some "critical" threshold +
3UnknownInvalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service

+

+

+
+

NAGIOS PLUGIN NOTES

+

Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html

+

This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because +the path to utils.pm must be specified completely in this program and forces users to edit the source +code if their install location is different (if they realize this is the problem). You can view +the default timeout for this module by using the --verbose and --version options together. The +short form is -vV.

+

Other than that, it attempts to follow published guidelines for Nagios plugins.

+

+

+
+

SEE ALSO

+

http://nagios.org/ +http://search.cpan.org/~djkernen/Mail-IMAPClient-2.2.9/IMAPClient.pod +http://search.cpan.org/~markov/Mail-IMAPClient-3.00/lib/Mail/IMAPClient.pod

+

+

+
+

CHANGES

+
+ Wed Oct 29 11:00:00 PST 2005
+ + version 0.1
+
+ Wed Nov  9 09:53:32 PST 2005
+ + added delete/nodelete option.  deleting found messages is still default behavior.
+ + added capture-max option
+ + added nodelete-captured option
+ + added mailbox option
+ + added eval/alarm block to implement -c option
+ + now using an inline PluginReport package to generate the report
+ + copyright notice and GNU GPL
+ + version 0.2
+
+ Thu Apr 20 14:00:00 CET 2006 (by Johan Nilsson <johann (at) axis.com>)
+ + version 0.2.1
+ + added support for multiple polls of imap-server, with specified intervals
+
+ Tue Apr 24 21:17:53 PDT 2007
+ + now there is an alternate version (same but without embedded perl POD) that is compatible with the new new embedded-perl Nagios feature
+ + added patch from Benjamin Ritcey <ben@ritcey.com> for SSL support on machines that have an SSL-enabled
+ + version 0.2.3
+
+ Fri Apr 27 18:56:50 PDT 2007 
+ + fixed problem that "Invalid search parameters" was not printed because of missing newline to flush it
+ + warnings and critical errors now try to append error messages received from the IMAP client
+ + changed connection error to display timeout only if timeout was the error
+ + documentation now mentions every command-line option accepted by the plugin, including abbreviations
+ + added abbreviations U for username, P for password, m for mailbox
+ + fixed bug that imap-check-interval applied even after the last try (imap-retries) when it was not necessary
+ + the IMAP expunge command is not sent unless at least one message is deleted
+ + fixed bug that the "no messages" warning was printed even if some messages were found
+ + version 0.3
+
+ Sun Oct 21 14:08:07 PDT 2007
+ + added port info to the "could not connect" error message
+ + fixed bug that occurred when using --ssl --port 143 which caused port to remain at the default 993 imap/ssl port
+ + added clarity shortcuts --search-subject and --search-header
+ + port is no longer a required option. defaults to 143 for regular IMAP and 993 for IMAP/SSL
+ + version 0.3.1
+
+ Sun Oct 21 20:41:56 PDT 2007
+ + reworked ssl support to use IO::Socket::SSL instead of the convenience method Mail::IMAPClient->Ssl (which is not included in the standard Mail::IMAPClient package)
+ + removed clarity shortcuts (bad idea, code bloat) 
+ + version 0.4
+
+ Tue Dec  4 07:05:27 PST 2007
+ + added version check to _read_line workaround for SSL-related bug in Mail::IMAPClient version 2.2.9 ; newer versions fixed the bug 
+ + added --usage option because the official nagios plugins have both --help and --usage
+ + added --timeout option to match the official nagios plugins
+ + fixed some minor pod formatting issues for perldoc
+ + version 0.4.1
+
+ Sat Dec 15 07:39:59 PST 2007
+ + improved compatibility with Nagios embedded perl (ePN)
+ + version 0.4.2
+
+ Mon Jan  7 21:35:23 PST 2008
+ + changed version check for Mail::IMAPClient version 2.2.9 to use string comparison le "2.2.9"
+ + fixed bug where script was dying on socket->autoflush when socket does not exist because autoflush was being called before checking the socket object 
+ + version 0.4.3
+
+ Mon Feb 11 19:13:38 PST 2008
+ + fixed a bug for embedded perl version, variable "%status" will not stay shared in load_modules
+ + version 0.4.4
+
+ Mon May 26 08:33:27 PDT 2008
+ + fixed a bug for number captured, it now reflects number of messages captured instead of always returning "1"
+ + added --capture-min option to complement --capture-max
+ + added --search-critical-min to trigger a CRITICAL alert if number of messages found is less than argument, with default 1.
+ + fixed warning and critical messages to use "more than" or "less than" instead of the angle brackets, to make them more web friendly
+ + version 0.5
+
+ Wed Jul  2 14:59:05 PDT 2008
+ + fixed a bug for not finding a message after the first try, by reselecting the mailbox before each search
+ + version 0.5.1
+
+ Sat Dec 13 08:57:29 PST 2008
+ + added --download option to allow local searching of messages (useful if your server has an index that handles searching but it takes a while before new emails show up and you want immediate results), supports only the TEXT, BODY, SUBJECT, and HEADER search keys 
+ + added --download-max option to set a limit on number of messages downloaded with --download
+ + version 0.6.0
+
+ Wed Sep 30 23:25:33 PDT 2009
+ + fixed --download-max option (was incorrectly looking for --download_max). currently both will work, in the future only --download-max will work
+ + added --template option to allow arbitrary substitutions for search parameters, and provided three convenience functions for working with dates
+ + added date search criteria to the --download option: SENTBEFORE, SENTON, and SENTSINCE which check the Date header and allow hours and minutes in addition to dates (whereas the IMAP standard only allows dates)
+ + added --search-critical-max to trigger a CRITICAL alert if number of messages found is more than argument, disabled by default.
+ + fixed a bug in --download --search where messages would match even though they failed the search criteria
+ + changed behavior of --download-max to look at the most recent messages first (hopefully); the IMAP protocol doesn't guarantee the order that the messages are returned but I observed that many mail servers return them in chronological order; so now --download-max reverses the order to look at the newer messages first
+ + added performance data for use with PNP4Nagios!
+ + version 0.7.0
+
+ Fri Oct  2 15:22:00 PDT 2009
+ + added --search-warning-max and --search-warning-min to trigger a WARNING alert if number of messages is more than or less than the specified number. 
+ + fixed --download option not to fail with CRITICAL if mailbox is empty; now this can be configured with --search-warning-min or --search-critical-min
+ + version 0.7.1
+
+ Sat Nov 21 18:27:17 PST 2009
+ + fixed problem with using --download option on certain mail servers by turning on the IgnoreSizeErrors feature in IMAPClient
+ + added --peek option to prevent marking messages as seen 
+ + version 0.7.2
+
+ Tue Jan  5 12:13:53 PST 2010
+ + added error message and exit with unknown status when an unrecognized IMAP search criteria is encountered by the --download --search option
+
+ Wed May  5 11:14:51 PDT 2010
+ + added mailbox list when mailbox is not found and verbose level 3 is on (-vvv)
+ + version 0.7.3
+
+ Tue Mar  8 18:58:14 AST 2011
+ + updated documentation for --search and --template to mention rfc5032 extensions (thanks to Stuart Henderson)
+
+ Fri May  6 08:35:09 AST 2011
+ + added --hires option to enable use of Time::Hires if available
+ + version 0.7.4
+
+ Fri Nov 11 01:51:40 AST 2011
+ + added --ssl-ca-file option to allow verifying the server certificate against a local .pem file (thanks to Alexandre Bezroutchko)
+ + added imap_ssl_cert.pl utility (not in this file) to conveniently save the server's SSL certificates into a local .pem file
+ + version 0.7.5
+

+

+
+

AUTHOR

+

Jonathan Buhacoff <jonathan@buhacoff.net>

+

+

+
+

COPYRIGHT AND LICENSE

+
+ 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 <http://www.gnu.org/licenses/>;.
+
+ http://www.gnu.org/licenses/gpl.txt
+ + + + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_receive.pod b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_receive.pod new file mode 100644 index 0000000..9e9faf9 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_imap_receive.pod @@ -0,0 +1,507 @@ + + + +=pod + +=head1 NAME + +check_imap_receive - connects to and searches an IMAP account for messages + +=head1 SYNOPSIS + + check_imap_receive -vV + check_imap_receive -? + check_imap_receive --help + +=head1 OPTIONS + +=over + +=item --warning + +Warn if it takes longer than to connect to the IMAP server. Default is 15 seconds. +Also known as: -w + +=item --critical + +Return a critical status if it takes longer than to connect to the IMAP server. Default is 30 seconds. +See also: --capture-critical +Also known as: -c + +=item --timeout + +Abort with critical status if it takes longer than to connect to the IMAP server. Default is 60 seconds. +The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to +connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer +than 30 seconds. +Also known as: -t + +=item --imap-check-interval + +How long to wait after searching for a matching message before searching again. Only takes effect +if no messages were found. Default is 5 seconds. + +=item --imap-retries + +How many times to try searching for a matching message before giving up. If you set this to 0 then +messages will not be searched at all. Setting this to 1 means the plugin only tries once. Etc. +Default is 10 times. + +=item --hostname + +Address or name of the IMAP server. Examples: mail.server.com, localhost, 192.168.1.100 +Also known as: -H + +=item --port + +Service port on the IMAP server. Default is 143. If you use SSL, default is 993. +Also known as: -p + +=item --username + +=item --password + +Username and password to use when connecting to IMAP server. +Also known as: -U -P + +=item --mailbox + +Use this option to specify the mailbox to search for messages. Default is INBOX. +Also known as: -m + +=item --search + +Use this option to filter the messages. Default is not to filter. You may (must) use this option +multiple times in order to create any valid IMAP search criteria. See the examples and see also +http://www.ietf.org/rfc/rfc2060.txt (look for section 6.4.4, the SEARCH command) + +This is the way to find messages matching a given subject: + -s SUBJECT -s "a given subject" + +You can use the following technique for any header, including Subject. To find "Header-Name: some value": + -s HEADER -s Header-Name -s "some value" + +Modern IMAP servers that support rfc5032 extensions allow you to search for messages +older or younger than a number of seconds. So to find messages received in the past hour, +you can do: + + -s YOUNGER -s 3600 + +Or to find messages received more than 5 minutes ago, you can do: + + -s OLDER -s 300 + +Also known as: -s + +=item --download + +=item --nodownload + +This option causes all messages in the specified mailbox to be downloaded from the server +and searched locally. See --download-max if you only want to download a few messages. +Currently only the following RFC 2060 search criteria are supported: +TEXT, BODY, SUBJECT, HEADER, NOT, OR, SENTBEFORE, SENTON, SENTSINCE. + +Requires Email::Simple to be installed. It is available on CPAN. + +This option may be particularly useful to you if your mail server is slow to index +messages (like Exchange 2003), causing the plugin not to find them with IMAP SEARCH +even though they are in the inbox. + +It's also useful if you're searching for messages that have been on the server for a +specified amount of time, like some minutes or hours, because the standard IMAP search +function only allows whole dates. For this, use the standard search keywords but you +can specify either just a date like in RFC 2060 or a date and a time. + +If you use SENTBEFORE, SENTON, or SENTSINCE, you must have Date::Manip installed +on your system. + + +=item --download-max + +Limits the number of messages downloaded from the server when the --download option is used. +Default is to download and search all messages. + +=item --search-critical-min + +This option will trigger a CRITICAL status if the number of messages found by the search criteria +is below the given number. Use in conjunction with --search. + +This parameter defaults to 1 so that if no messages are found, the plugin will exit with a CRITICAL status. + +If you want the original behavior where the plugin exits with a WARNING status when no messages are found, +set this parameter to 0. + +=item --search-critical-max + +This option will trigger a CRITICAL status if the number of messages found by the search criteria +is above the given number. Use in conjunction with --search. + +This parameter defaults to -1 meaning it's disabled. If you set it to 10, the plugin will exit with +CRITICAL if it finds 11 messages. If you set it to 1, the plugin will exit with CRITICAL if it finds +any more than 1 message. If you set it to 0, the plugin will exit with CRITICAL if it finds any messages +at all. If you set it to -1 it will be disabled. + +=item --search-warning-min + +This option will trigger a WARNING status if the number of messages found by the search criteria +is below the given number. Use in conjunction with --search. + +This parameter defaults to 1 so that if no messages are found, the plugin will exit with a WARNING status. + +If you want to suppress the original behavior where the plugin exits with a WARNING status when no messages are found, +set this parameter to 0. When this parameter is 0, it means that you expect the mailbox not to have any messages. + +=item --search-warning-max + +This option will trigger a WARNING status if the number of messages found by the search criteria +is above the given number. Use in conjunction with --search. + +This parameter defaults to -1 meaning it's disabled. If you set it to 10, the plugin will exit with +WARNING if it finds 11 messages. If you set it to 1, the plugin will exit with WARNING if it finds +any more than 1 message. If you set it to 0, the plugin will exit with WARNING if it finds any messages +at all. If you set it to -1 it will be disabled. + +=item --capture-max + +In addition to specifying search arguments to filter the emails in the IMAP account, you can specify +a "capture-max" regexp argument and the eligible emails (found with search arguments) +will be compared to each other and the OK line will have the highest captured value. + +The regexp is expected to capture a numeric value. + +=item --capture-min + +In addition to specifying search arguments to filter the emails in the IMAP account, you can specify +a "capture-min" regexp argument and the eligible emails (found with search arguments) +will be compared to each other and the OK line will have the lowest captured value. + +The regexp is expected to capture a numeric value. + +=item --delete + +=item --nodelete + +Use the delete option to delete messages that matched the search criteria. This is useful for +preventing the mailbox from filling up with automated messages (from the check_smtp_send plugin, for example). +THE DELETE OPTION IS TURNED *ON* BY DEFAULT, in order to preserve compatibility with an earlier version. + +Use the nodelete option to turn off the delete option. + +=item --nodelete-captured + +If you use both the capture-max and delete arguments, you can also use the nodelete-captured argument to specify that the email +with the highest captured value should not be deleted. This leaves it available for comparison the next time this plugin runs. + +If you do not use the delete option, this option has no effect. + +=item --ssl + +=item --nossl + +Enable SSL protocol. Requires IO::Socket::SSL. + +Using this option automatically changes the default port from 143 to 993. You can still +override this from the command line using the --port option. + +Use the nossl option to turn off the ssl option. + +=item --ssl-ca-file + +Use this to verify the server SSL certificate against a local .pem file. You'll need to +specify the path to the .pem file as the parameter. + +You can use the imap_ssl_cert utility included in this distribution to connect to your IMAP +server and save its SSL certificates into your .pem file. Usage is like this: + + imap_ssl_cert -H imap.server.com > ca_file.pem + +Only applicable when --ssl option is enabled. + +=item --template + +=item --notemplate + +Enable (or disable) processing of IMAP search parameters. Requires Text::Template and Date::Manip. + +Use this option to apply special processing to IMAP search parameters that allows you to use the +results of arbitrary computations as the parameter values. For example, you can use this feature +to search for message received up to 4 hours ago. + +Modern IMAP servers that support rfc5032 extensions allow searching with the YOUNGER and OLDER +criteria so a message received up to 4 hours ago is -s YOUNGER -s 14400. But if your mail server +doesn't support that, you could use the --template option to get similar functionality. + +When you enable the --template option, each parameter you pass to the -s option is parsed by +Text::Template. See the Text::Template manual for more information, but in general any expression +written in Perl will work. + +A convenience function called rfc2822dateHeader is provided to you so you can easily compute properly +formatted dates for use as search parameters. The rfc2822date function can take one or two +parameters itself: the date to format and an optional offset. To use the current time as a +search parameter, you can write this: + + $ check_imap_receive ... --template -s HEADER -s Delivery-Date -s '{rfc2822dateHeader("now")}' + +The output of {rfc2822dateHeader("now")} looks like this: Wed, 30 Sep 2009 22:44:03 -0700 and +is suitable for use with a date header, like HEADER Delivery-Date. + +To use a time in the past relative to the current time or day, you can use a second convenience function +called rfc2822date and write this: + + $ check_imap_receive ... --template -s SENTSINCE -s '{rfc2822date("now","-1 day")}' + +The output of {rfc2822date("now","-1 day")} looks like this: 29-Sep-2009 and is suitable for use +with BEFORE, ON, SENTBEFORE, SENTON, SENTSINCE, and SINCE. + +I have seen some email clients use a different format in the Date field, +like September 17, 2009 9:46:51 AM PDT. To specify an arbitrary format like this one, write this: + + $ check_imap_receive ... --template -s HEADER -s Delivery-Date -s '{date("%B %e, %Y %i:%M:%S %p %Z","now","-4 hours")}' + +You can use BEFORE, ON, SENTBEFORE, SENTON, SENTSINCE, or SINCE to search for messages that arrived +on, before, or after a given day but not on, before, or after a specific time on that day. + +To search for messages that arrived on, before, or after a specific time you have to use the +Delivery-Date or another date field, like with -s HEADER -s Delivery-Date in the example above. + +See the Date::Manip manual for more information on the allowed expressions for date and delta strings. + +=item --hires + +Use the Time::HiRes module to measure time, if available. + +=item --verbose + +Display additional information. Useful for troubleshooting. Use together with --version to see the default +warning and critical timeout values. + +If the selected mailbox was not found, you can use verbosity level 3 (-vvv) to display a list of all +available mailboxes on the server. + +Also known as: -v + +=item --version + +Display plugin version and exit. +Also known as: -V + +=item --help + +Display this documentation and exit. Does not work in the ePN version. +Also known as: -h + +=item --usage + +Display a short usage instruction and exit. + +=back + +=head1 EXAMPLES + +=head2 Report how many emails are in the mailbox + + $ check_imap_receive -H mail.server.net --username mailuser --password mailpass + -s ALL --nodelete + + IMAP RECEIVE OK - 1 seconds, 7 found + +=head2 Report the email with the highest value + +Suppose your mailbox has some emails from an automated script and that a message +from this script typically looks like this (abbreviated): + + To: mailuser@server.net + From: autoscript@server.net + Subject: Results of Autoscript + Date: Wed, 09 Nov 2005 08:30:40 -0800 + Message-ID: + + Homeruns 5 + +And further suppose that you are interested in reporting the message that has the +highest number of home runs, and also to leave this message in the mailbox for future +checks, but remove the other matching messages with lesser values: + + $ check_imap_receive -H mail.server.net --username mailuser --password mailpass + -s SUBJECT -s "Results of Autoscript" --capture-max "Homeruns (\d+)" --nodelete-captured + + IMAP RECEIVE OK - 1 seconds, 3 found, 1 captured, 5 max, 2 deleted + +=head2 Troubleshoot your search parameters + +Add the --nodelete and --imap-retries=1 parameters to your command line. + +=head1 EXIT CODES + +Complies with the Nagios plug-in specification: + 0 OK The plugin was able to check the service and it appeared to be functioning properly + 1 Warning The plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly + 2 Critical The plugin detected that either the service was not running or it was above some "critical" threshold + 3 Unknown Invalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service + +=head1 NAGIOS PLUGIN NOTES + +Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html + +This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because +the path to utils.pm must be specified completely in this program and forces users to edit the source +code if their install location is different (if they realize this is the problem). You can view +the default timeout for this module by using the --verbose and --version options together. The +short form is -vV. + +Other than that, it attempts to follow published guidelines for Nagios plugins. + +=head1 SEE ALSO + +http://nagios.org/ +http://search.cpan.org/~djkernen/Mail-IMAPClient-2.2.9/IMAPClient.pod +http://search.cpan.org/~markov/Mail-IMAPClient-3.00/lib/Mail/IMAPClient.pod + +=head1 CHANGES + + Wed Oct 29 11:00:00 PST 2005 + + version 0.1 + + Wed Nov 9 09:53:32 PST 2005 + + added delete/nodelete option. deleting found messages is still default behavior. + + added capture-max option + + added nodelete-captured option + + added mailbox option + + added eval/alarm block to implement -c option + + now using an inline PluginReport package to generate the report + + copyright notice and GNU GPL + + version 0.2 + + Thu Apr 20 14:00:00 CET 2006 (by Johan Nilsson ) + + version 0.2.1 + + added support for multiple polls of imap-server, with specified intervals + + Tue Apr 24 21:17:53 PDT 2007 + + now there is an alternate version (same but without embedded perl POD) that is compatible with the new new embedded-perl Nagios feature + + added patch from Benjamin Ritcey for SSL support on machines that have an SSL-enabled + + version 0.2.3 + + Fri Apr 27 18:56:50 PDT 2007 + + fixed problem that "Invalid search parameters" was not printed because of missing newline to flush it + + warnings and critical errors now try to append error messages received from the IMAP client + + changed connection error to display timeout only if timeout was the error + + documentation now mentions every command-line option accepted by the plugin, including abbreviations + + added abbreviations U for username, P for password, m for mailbox + + fixed bug that imap-check-interval applied even after the last try (imap-retries) when it was not necessary + + the IMAP expunge command is not sent unless at least one message is deleted + + fixed bug that the "no messages" warning was printed even if some messages were found + + version 0.3 + + Sun Oct 21 14:08:07 PDT 2007 + + added port info to the "could not connect" error message + + fixed bug that occurred when using --ssl --port 143 which caused port to remain at the default 993 imap/ssl port + + added clarity shortcuts --search-subject and --search-header + + port is no longer a required option. defaults to 143 for regular IMAP and 993 for IMAP/SSL + + version 0.3.1 + + Sun Oct 21 20:41:56 PDT 2007 + + reworked ssl support to use IO::Socket::SSL instead of the convenience method Mail::IMAPClient->Ssl (which is not included in the standard Mail::IMAPClient package) + + removed clarity shortcuts (bad idea, code bloat) + + version 0.4 + + Tue Dec 4 07:05:27 PST 2007 + + added version check to _read_line workaround for SSL-related bug in Mail::IMAPClient version 2.2.9 ; newer versions fixed the bug + + added --usage option because the official nagios plugins have both --help and --usage + + added --timeout option to match the official nagios plugins + + fixed some minor pod formatting issues for perldoc + + version 0.4.1 + + Sat Dec 15 07:39:59 PST 2007 + + improved compatibility with Nagios embedded perl (ePN) + + version 0.4.2 + + Mon Jan 7 21:35:23 PST 2008 + + changed version check for Mail::IMAPClient version 2.2.9 to use string comparison le "2.2.9" + + fixed bug where script was dying on socket->autoflush when socket does not exist because autoflush was being called before checking the socket object + + version 0.4.3 + + Mon Feb 11 19:13:38 PST 2008 + + fixed a bug for embedded perl version, variable "%status" will not stay shared in load_modules + + version 0.4.4 + + Mon May 26 08:33:27 PDT 2008 + + fixed a bug for number captured, it now reflects number of messages captured instead of always returning "1" + + added --capture-min option to complement --capture-max + + added --search-critical-min to trigger a CRITICAL alert if number of messages found is less than argument, with default 1. + + fixed warning and critical messages to use "more than" or "less than" instead of the angle brackets, to make them more web friendly + + version 0.5 + + Wed Jul 2 14:59:05 PDT 2008 + + fixed a bug for not finding a message after the first try, by reselecting the mailbox before each search + + version 0.5.1 + + Sat Dec 13 08:57:29 PST 2008 + + added --download option to allow local searching of messages (useful if your server has an index that handles searching but it takes a while before new emails show up and you want immediate results), supports only the TEXT, BODY, SUBJECT, and HEADER search keys + + added --download-max option to set a limit on number of messages downloaded with --download + + version 0.6.0 + + Wed Sep 30 23:25:33 PDT 2009 + + fixed --download-max option (was incorrectly looking for --download_max). currently both will work, in the future only --download-max will work + + added --template option to allow arbitrary substitutions for search parameters, and provided three convenience functions for working with dates + + added date search criteria to the --download option: SENTBEFORE, SENTON, and SENTSINCE which check the Date header and allow hours and minutes in addition to dates (whereas the IMAP standard only allows dates) + + added --search-critical-max to trigger a CRITICAL alert if number of messages found is more than argument, disabled by default. + + fixed a bug in --download --search where messages would match even though they failed the search criteria + + changed behavior of --download-max to look at the most recent messages first (hopefully); the IMAP protocol doesn't guarantee the order that the messages are returned but I observed that many mail servers return them in chronological order; so now --download-max reverses the order to look at the newer messages first + + added performance data for use with PNP4Nagios! + + version 0.7.0 + + Fri Oct 2 15:22:00 PDT 2009 + + added --search-warning-max and --search-warning-min to trigger a WARNING alert if number of messages is more than or less than the specified number. + + fixed --download option not to fail with CRITICAL if mailbox is empty; now this can be configured with --search-warning-min or --search-critical-min + + version 0.7.1 + + Sat Nov 21 18:27:17 PST 2009 + + fixed problem with using --download option on certain mail servers by turning on the IgnoreSizeErrors feature in IMAPClient + + added --peek option to prevent marking messages as seen + + version 0.7.2 + + Tue Jan 5 12:13:53 PST 2010 + + added error message and exit with unknown status when an unrecognized IMAP search criteria is encountered by the --download --search option + + Wed May 5 11:14:51 PDT 2010 + + added mailbox list when mailbox is not found and verbose level 3 is on (-vvv) + + version 0.7.3 + + Tue Mar 8 18:58:14 AST 2011 + + updated documentation for --search and --template to mention rfc5032 extensions (thanks to Stuart Henderson) + + Fri May 6 08:35:09 AST 2011 + + added --hires option to enable use of Time::Hires if available + + version 0.7.4 + + Fri Nov 11 01:51:40 AST 2011 + + added --ssl-ca-file option to allow verifying the server certificate against a local .pem file (thanks to Alexandre Bezroutchko) + + added imap_ssl_cert.pl utility (not in this file) to conveniently save the server's SSL certificates into a local .pem file + + version 0.7.5 + +=head1 AUTHOR + +Jonathan Buhacoff + +=head1 COPYRIGHT AND LICENSE + + 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 . + + http://www.gnu.org/licenses/gpl.txt + +=cut + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_smtp_send.html b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_smtp_send.html new file mode 100644 index 0000000..0afa438 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_smtp_send.html @@ -0,0 +1,375 @@ + + + + +check_smtp_send - connects to an SMTP server and sends a message + + + + + + + + + +
+

+ + + +
+ + +

+

+
+

NAME

+

check_smtp_send - connects to an SMTP server and sends a message

+

+

+
+

SYNOPSIS

+
+ check_smtp_send -vV
+ check_smtp_send -?
+ check_smtp_send --help
+

+

+
+

OPTIONS

+
+
--warning <seconds>
+ +
+

Warn if it takes longer than <seconds> to connect to the SMTP server. Default is 15 seconds. +Also known as: -w <seconds>

+
+
--critical <seconds>
+ +
+

Return a critical status if it takes longer than <seconds> to connect to the SMTP server. Default is 30 seconds. +Also known as: -c <seconds>

+
+
--timeout <seconds>
+ +
+

Abort with critical status if it takes longer than <seconds> to connect to the SMTP server. Default is 60 seconds. +The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to +connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer +than 30 seconds. +Also known as: -t <seconds>

+
+
--hostname <server>
+ +
+

Address or name of the SMTP server. Examples: mail.server.com, localhost, 192.168.1.100

+

If not provided, and if there is only one --mailto address, the script will automatically look up the MX record +for the --mailto address and use that as the hostname. You can use this to check that your MX records are correct. +When omitting the --hostname option, it doesn't really make sense to specify --port, --username, or --password +but you can still do so and they will have their normal effect. To look up the MX records you need to have the +module Net::DNS and Email::Address installed.

+

Also known as: -H <server>

+
+
--port <number>
+ +
+

Service port on the SMTP server. Default is 25 for regular SMTP, 465 for SSL, and 587 for TLS. +Also known as: -p <number>

+
+
--tls
+ +
--notls
+ +
+

Enable TLS/AUTH protocol. Requires Net::SMTP::TLS, availble on CPAN.

+

When using this option, the default port is 587. +You can specify a port from the command line using the --port option.

+

Use the notls option to turn off the tls option.

+

Also, you may need to fix your copy of Net::SMTP::TLS. Here is the diff against version 0.12:

+
+ 254c254
+ <      $me->_command(sprintf("AUTH PLAIN %S",
+ ---
+ >      $me->_command(sprintf("AUTH PLAIN %s",
+
+
--ssl
+ +
--nossl
+ +
+

Enable SSL protocol. Requires Net::SMTP::SSL and Authen::SASL, availble on CPAN.

+

When using this option, the default port is 465. You can override with the --port option.

+

Use the nossl option to turn off the ssl option.

+
+
--auth <method>
+ +
+

Enable authentication with Net::SMTP_auth (sold separately). +For example, try using --auth PLAIN or --auth CRAM-MD5.

+
+
--username <username>
+ +
--password <password>
+ +
+

Username and password to use when connecting to SMTP server. +Also known as: -U <username> -P <password>

+
+
--body <message>
+ +
+

Use this option to specify the body of the email message. If you need newlines in your message, +you might need to use the --stdin option instead.

+
+
--header <header>
+ +
+

Use this option to set an arbitrary header in the message. You can use it multiple times.

+
+
--stdin
+ +
+

Grab the body of the email message from stdin.

+
+
--mailto recipient@your.net
+ +
+

You can send a message to multiple recipients by repeating this option or by separating +the email addresses with commas (no whitespace allowed):

+

$ check_smtp_send -H mail.server.net --mailto recipient@your.net,recipient2@your.net --mailfrom sender@your.net

+

SMTP SEND OK - 1 seconds

+
+
--mailfrom sender@your.net
+ +
+

Use this option to set the "from" address in the email.

+
+
--template
+ +
--notemplate
+ +
+

Enable (or disable) processing of message body and headers. Requires Text::Template.

+

Use this option to apply special processing to your message body and headers that allows you to use the +results of arbitrary computations in the text. For example, you can use this feature to send a message +containing the hostname of the machine that sent the message without customizing the plugin configuration +on each machine.

+

When you enable the --template option, the message body and headers are parsed by +Text::Template. Even a message body provided using the --stdin option will be parsed. +See the Text::Template manual for more information, but in general any expression +written in Perl will work.

+

There is one convenience function provided to you, trim, which will remove leading and trailing whitespace +from its parameter. Here's an example:

+
+ check_smtp_send -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net 
+ --template --body 'hello, this message is from {use Sys::Hostname; hostname}' 
+ --header 'Subject: test message from {trim(`whoami`)}'
+
+
--expect-response <code>
+ +
+

Use this option to specify which SMTP response code should be expected from the server +after the SMTP dialog is complete. The default is 250 (message accepted).

+

Also known as: -E <code>

+
+
--hires
+ +
+

Use the Time::HiRes module to measure time, if available.

+
+
--verbose
+ +
+

Display additional information. Useful for troubleshooting.

+

One --verbose will show extra information for OK, WARNING, and CRITICAL status.

+

Use one --verbose together with --version to see the default warning and critical timeout values.

+

Three --verbose (or -vvv) will show debug information, unless you're using --tls because Net::SMTP::TLS +does not have a Debug feature.

+

Also known as: -v

+
+
--version
+ +
+

Display plugin version and exit. +Also known as: -V

+
+
--help
+ +
+

Display this documentation and exit. Does not work in the ePN version. +Also known as: -h

+
+
--usage
+ +
+

Display a short usage instruction and exit.

+
+
+

+

+
+

EXAMPLES

+

+

+

Send a message with custom headers

+

$ check_smtp_send -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net +--body 'Homeruns 5' --header 'Subject: Hello, world!' --header 'X-Your-Header: Yes'

+

SMTP SEND OK - 1 seconds

+

+

+
+

EXIT CODES

+

Complies with the Nagios plug-in specification: +
0OKThe plugin was able to check the service and it appeared to be functioning properly +
1WarningThe plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly +
2CriticalThe plugin detected that either the service was not running or it was above some "critical" threshold +
3UnknownInvalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service

+

+

+
+

NAGIOS PLUGIN NOTES

+

Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html

+

This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because +the path to utils.pm must be specified completely in this program and forces users to edit the source +code if their install location is different (if they realize this is the problem). You can view +the default timeout for this module by using the --verbose and --version options together. The +short form is -vV.

+

Other than that, it attempts to follow published guidelines for Nagios plugins.

+

+

+
+

CHANGES

+
+ Wed Oct 29 14:05:00 PST 2005
+ + version 0.1
+
+ Wed Nov  9 15:01:48 PST 2005
+ + now using an inline PluginReport package to generate the report
+ + added stdin option
+ + copyright notice and GNU GPL
+ + version 0.2
+
+ Thu Apr 20 16:00:00 PST 2006 (by Geoff Crompton <geoff.crompton@strategicdata.com.au>)
+ + added bailing if the $smtp->to() call fails
+ + added support for mailto recipients separated by commas
+ + version 0.2.1
+
+ Tue Apr 24 21:17:53 PDT 2007
+ + moved POD text to separate file in order to accomodate the new embedded-perl Nagios feature
+ + version 0.2.3
+
+ Fri Apr 27 20:26:42 PDT 2007
+ + documentation now mentions every command-line option accepted by the plugin, including abbreviations
+ + version 0.3
+ 
+ Sun Oct 21 10:34:14 PDT 2007
+ + added support for TLS and authentication via the Net::SMTP::TLS module. see --tls option.
+ + version 0.4
+
+ Sun Oct 21 13:54:26 PDT 2007
+ + added support for SSL via the Net::SMTP::SSL module. see --ssl option.
+ + port is no longer a required option. defaults to 25 for regular smtp, 465 for ssl, and 587 for tls.
+ + added port info to the "could not connect" error message
+ + version 0.4.1
+
+ Tue Dec  4 07:42:32 PST 2007
+ + added --usage option because the official nagios plugins have both --help and --usage
+ + added --timeout option to match the official nagios plugins
+ + fixed some minor pod formatting issues for perldoc
+ + version 0.4.2
+
+ Mon Feb 11 19:09:37 PST 2008
+ + fixed a bug for embedded perl version, variable "%status" will not stay shared in load_modules
+ + version 0.4.3
+
+ Mon May 26 09:12:14 PDT 2008
+ + fixed warning and critical messages to use "more than" or "less than" instead of the angle brackets, to make them more web friendly
+ + version 0.4.4
+ 
+ Wed Jul  2 07:12:35 PDT 2008
+ + added --expect-response option submitted by Christian Kauhaus <kc@gocept.com>
+ + added support for authentication via Net::SMTP_auth. see --auth option.
+ + version 0.4.5
+
+ Sun Oct  5 15:18:23 PDT 2008
+ + added error handling for smtp server disconnects ungracefully during QUIT (gmail.com does)
+ + version 0.4.6
+
+ Thu Oct  1 12:09:35 PDT 2009
+ + added --template option to allow arbitrary substitutions for body and headers, and provided one convenience function for trimming strings
+ + added performance data for use with PNP4Nagios!
+ + version 0.5.0
+
+ Thu Oct  8 11:17:04 PDT 2009
+ + added more detailed error messages when using --verbose
+ + version 0.5.1
+
+ Tue Feb  9 12:14:49 PST 2010
+ + added support for combining --auth with --tls using a subclass of Net::SMTP::TLS submitted by Brad Guillory; please note that to use the "PLAIN" authentication type you need to patch your Net::SMTP:TLS because it has a bug in sub auth_PLAIN (sprintf %S instead of %s)
+ + version 0.5.2
+
+ Mon Jan  3 10:39:42 PST 2011
+ + added default Date and Message-ID headers; Date header uses POSIX strftime and Message-ID header uses hostname command to get localhost name
+ + version 0.7.0
+
+ Fri May  6 08:35:09 AST 2011
+ + added --hires option to enable use of Time::Hires if available
+ + version 0.7.1
+
+ Wed Jul  6 19:18:26 AST 2011
+ + the --hostname is now optional; if not provided the plugin will lookup the MX record for the --mailto address (requires Net::DNS)
+ + version 0.7.2
+
+ Tue Dec 13 09:24:04 PST 2011
+ + separated authentication errors from connection errors
+ + version 0.7.3
+

+

+
+

AUTHOR

+

Jonathan Buhacoff <jonathan@buhacoff.net>

+

+

+
+

COPYRIGHT AND LICENSE

+
+ 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 <http://www.gnu.org/licenses/>;.
+
+ http://www.gnu.org/licenses/gpl.txt
+ + + + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_smtp_send.pod b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_smtp_send.pod new file mode 100644 index 0000000..db33549 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/check_smtp_send.pod @@ -0,0 +1,324 @@ + + +=pod + +=head1 NAME + +check_smtp_send - connects to an SMTP server and sends a message + +=head1 SYNOPSIS + + check_smtp_send -vV + check_smtp_send -? + check_smtp_send --help + +=head1 OPTIONS + +=over + +=item --warning + +Warn if it takes longer than to connect to the SMTP server. Default is 15 seconds. +Also known as: -w + +=item --critical + +Return a critical status if it takes longer than to connect to the SMTP server. Default is 30 seconds. +Also known as: -c + +=item --timeout + +Abort with critical status if it takes longer than to connect to the SMTP server. Default is 60 seconds. +The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to +connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer +than 30 seconds. +Also known as: -t + +=item --hostname + +Address or name of the SMTP server. Examples: mail.server.com, localhost, 192.168.1.100 + +If not provided, and if there is only one --mailto address, the script will automatically look up the MX record +for the --mailto address and use that as the hostname. You can use this to check that your MX records are correct. +When omitting the --hostname option, it doesn't really make sense to specify --port, --username, or --password +but you can still do so and they will have their normal effect. To look up the MX records you need to have the +module Net::DNS and Email::Address installed. + +Also known as: -H + +=item --port + +Service port on the SMTP server. Default is 25 for regular SMTP, 465 for SSL, and 587 for TLS. +Also known as: -p + +=item --tls + +=item --notls + +Enable TLS/AUTH protocol. Requires Net::SMTP::TLS, availble on CPAN. + +When using this option, the default port is 587. +You can specify a port from the command line using the --port option. + +Use the notls option to turn off the tls option. + +Also, you may need to fix your copy of Net::SMTP::TLS. Here is the diff against version 0.12: + + 254c254 + < $me->_command(sprintf("AUTH PLAIN %S", + --- + > $me->_command(sprintf("AUTH PLAIN %s", + + +=item --ssl + +=item --nossl + +Enable SSL protocol. Requires Net::SMTP::SSL and Authen::SASL, availble on CPAN. + +When using this option, the default port is 465. You can override with the --port option. + +Use the nossl option to turn off the ssl option. + +=item --auth + +Enable authentication with Net::SMTP_auth (sold separately). +For example, try using --auth PLAIN or --auth CRAM-MD5. + +=item --username + +=item --password + +Username and password to use when connecting to SMTP server. +Also known as: -U -P + +=item --body + +Use this option to specify the body of the email message. If you need newlines in your message, +you might need to use the --stdin option instead. + +=item --header
+ +Use this option to set an arbitrary header in the message. You can use it multiple times. + +=item --stdin + +Grab the body of the email message from stdin. + +=item --mailto recipient@your.net + +You can send a message to multiple recipients by repeating this option or by separating +the email addresses with commas (no whitespace allowed): + +$ check_smtp_send -H mail.server.net --mailto recipient@your.net,recipient2@your.net --mailfrom sender@your.net + +SMTP SEND OK - 1 seconds + +=item --mailfrom sender@your.net + +Use this option to set the "from" address in the email. + +=item --template + +=item --notemplate + +Enable (or disable) processing of message body and headers. Requires Text::Template. + +Use this option to apply special processing to your message body and headers that allows you to use the +results of arbitrary computations in the text. For example, you can use this feature to send a message +containing the hostname of the machine that sent the message without customizing the plugin configuration +on each machine. + +When you enable the --template option, the message body and headers are parsed by +Text::Template. Even a message body provided using the --stdin option will be parsed. +See the Text::Template manual for more information, but in general any expression +written in Perl will work. + +There is one convenience function provided to you, trim, which will remove leading and trailing whitespace +from its parameter. Here's an example: + + check_smtp_send -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net + --template --body 'hello, this message is from {use Sys::Hostname; hostname}' + --header 'Subject: test message from {trim(`whoami`)}' + + +=item --expect-response + +Use this option to specify which SMTP response code should be expected from the server +after the SMTP dialog is complete. The default is 250 (message accepted). + +Also known as: -E + +=item --hires + +Use the Time::HiRes module to measure time, if available. + +=item --verbose + +Display additional information. Useful for troubleshooting. + +One --verbose will show extra information for OK, WARNING, and CRITICAL status. + +Use one --verbose together with --version to see the default warning and critical timeout values. + +Three --verbose (or -vvv) will show debug information, unless you're using --tls because Net::SMTP::TLS +does not have a Debug feature. + +Also known as: -v + +=item --version + +Display plugin version and exit. +Also known as: -V + +=item --help + +Display this documentation and exit. Does not work in the ePN version. +Also known as: -h + +=item --usage + +Display a short usage instruction and exit. + +=back + +=head1 EXAMPLES + +=head2 Send a message with custom headers + +$ check_smtp_send -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net +--body 'Homeruns 5' --header 'Subject: Hello, world!' --header 'X-Your-Header: Yes' + +SMTP SEND OK - 1 seconds + +=head1 EXIT CODES + +Complies with the Nagios plug-in specification: + 0 OK The plugin was able to check the service and it appeared to be functioning properly + 1 Warning The plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly + 2 Critical The plugin detected that either the service was not running or it was above some "critical" threshold + 3 Unknown Invalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service + +=head1 NAGIOS PLUGIN NOTES + +Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html + +This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because +the path to utils.pm must be specified completely in this program and forces users to edit the source +code if their install location is different (if they realize this is the problem). You can view +the default timeout for this module by using the --verbose and --version options together. The +short form is -vV. + +Other than that, it attempts to follow published guidelines for Nagios plugins. + +=head1 CHANGES + + Wed Oct 29 14:05:00 PST 2005 + + version 0.1 + + Wed Nov 9 15:01:48 PST 2005 + + now using an inline PluginReport package to generate the report + + added stdin option + + copyright notice and GNU GPL + + version 0.2 + + Thu Apr 20 16:00:00 PST 2006 (by Geoff Crompton ) + + added bailing if the $smtp->to() call fails + + added support for mailto recipients separated by commas + + version 0.2.1 + + Tue Apr 24 21:17:53 PDT 2007 + + moved POD text to separate file in order to accomodate the new embedded-perl Nagios feature + + version 0.2.3 + + Fri Apr 27 20:26:42 PDT 2007 + + documentation now mentions every command-line option accepted by the plugin, including abbreviations + + version 0.3 + + Sun Oct 21 10:34:14 PDT 2007 + + added support for TLS and authentication via the Net::SMTP::TLS module. see --tls option. + + version 0.4 + + Sun Oct 21 13:54:26 PDT 2007 + + added support for SSL via the Net::SMTP::SSL module. see --ssl option. + + port is no longer a required option. defaults to 25 for regular smtp, 465 for ssl, and 587 for tls. + + added port info to the "could not connect" error message + + version 0.4.1 + + Tue Dec 4 07:42:32 PST 2007 + + added --usage option because the official nagios plugins have both --help and --usage + + added --timeout option to match the official nagios plugins + + fixed some minor pod formatting issues for perldoc + + version 0.4.2 + + Mon Feb 11 19:09:37 PST 2008 + + fixed a bug for embedded perl version, variable "%status" will not stay shared in load_modules + + version 0.4.3 + + Mon May 26 09:12:14 PDT 2008 + + fixed warning and critical messages to use "more than" or "less than" instead of the angle brackets, to make them more web friendly + + version 0.4.4 + + Wed Jul 2 07:12:35 PDT 2008 + + added --expect-response option submitted by Christian Kauhaus + + added support for authentication via Net::SMTP_auth. see --auth option. + + version 0.4.5 + + Sun Oct 5 15:18:23 PDT 2008 + + added error handling for smtp server disconnects ungracefully during QUIT (gmail.com does) + + version 0.4.6 + + Thu Oct 1 12:09:35 PDT 2009 + + added --template option to allow arbitrary substitutions for body and headers, and provided one convenience function for trimming strings + + added performance data for use with PNP4Nagios! + + version 0.5.0 + + Thu Oct 8 11:17:04 PDT 2009 + + added more detailed error messages when using --verbose + + version 0.5.1 + + Tue Feb 9 12:14:49 PST 2010 + + added support for combining --auth with --tls using a subclass of Net::SMTP::TLS submitted by Brad Guillory; please note that to use the "PLAIN" authentication type you need to patch your Net::SMTP:TLS because it has a bug in sub auth_PLAIN (sprintf %S instead of %s) + + version 0.5.2 + + Mon Jan 3 10:39:42 PST 2011 + + added default Date and Message-ID headers; Date header uses POSIX strftime and Message-ID header uses hostname command to get localhost name + + version 0.7.0 + + Fri May 6 08:35:09 AST 2011 + + added --hires option to enable use of Time::Hires if available + + version 0.7.1 + + Wed Jul 6 19:18:26 AST 2011 + + the --hostname is now optional; if not provided the plugin will lookup the MX record for the --mailto address (requires Net::DNS) + + version 0.7.2 + + Tue Dec 13 09:24:04 PST 2011 + + separated authentication errors from connection errors + + version 0.7.3 + +=head1 AUTHOR + +Jonathan Buhacoff + +=head1 COPYRIGHT AND LICENSE + + 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 . + + http://www.gnu.org/licenses/gpl.txt + +=cut + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/imap_ssl_cert.html b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/imap_ssl_cert.html new file mode 100644 index 0000000..cff7a09 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/imap_ssl_cert.html @@ -0,0 +1,178 @@ + + + + +imap_ssl_cert - connects to an IMAP server using SSL and saves the server certificate into a .pem file + + + + + + + + + +
+

+ + + +
+ + +

+

+
+

NAME

+

imap_ssl_cert - connects to an IMAP server using SSL and saves the server certificate into a .pem file

+

+

+
+

SYNOPSIS

+
+ imap_ssl_cert -H imap.server.com > server_ca_file.pem
+ imap_ssl_cert -?
+ imap_ssl_cert --help
+

+

+
+

DEPENDENCIES

+

This utility requires the following perl modules to be installed:

+

Getopt::Long +Mail::IMAPClient +IO::Socket::SSL +Net::SSLeay

+

+

+
+

OPTIONS

+
+
--timeout <seconds>
+ +
+

Abort with critical status if it takes longer than <seconds> to connect to the IMAP server. Default is 60 seconds. +The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to +connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer +than 30 seconds. +Also known as: -t <seconds>

+
+
--hostname <server>
+ +
+

Address or name of the IMAP server. Examples: mail.server.com, localhost, 192.168.1.100 +Also known as: -H <server>

+
+
--port <number>
+ +
+

Service port on the IMAP server. Default is 143. If you use SSL, default is 993. +Also known as: -p <number>

+
+
--verbose
+ +
+

Display additional information. Useful for troubleshooting.

+

Also known as: -v

+
+
--version
+ +
+

Display plugin version and exit. +Also known as: -V

+
+
--help
+ +
+

Display this documentation and exit. +Also known as: -h

+
+
--usage
+ +
+

Display a short usage instruction and exit.

+
+
+

+

+
+

EXAMPLES

+

+

+

Print the server's SSL certificate chain

+
+ $ perl imap_ssl_cert.pl -H imap.server.com > ca_file.pem
+ $ cat ca_file.pem
+
+ -----BEGIN CERTIFICATE-----
+ MIID1zCCAr+gAwIBAgIQPr3bVk0SkuXygjxgA7EVGDANBgkqhkiG9w0BAQUFADA8
+ [...snip...]
+ 0FF4warjskrfqaVtWeIV58LJheaM4cPJkc2M
+ -----END CERTIFICATE-----
+
+ $ openssl x509 -in ca_file.pem -text
+

+

+
+

SEE ALSO

+

http://en.wikipedia.org/wiki/X.509 +http://en.wikipedia.org/wiki/Privacy_Enhanced_Mail +http://tools.ietf.org/html/rfc1422 +http://search.cpan.org/~mikem/Net-SSLeay-1.42/lib/Net/SSLeay.pm +http://search.cpan.org/~plobbes/Mail-IMAPClient-3.29/lib/Mail/IMAPClient.pod

+

+

+
+

CHANGES

+
+ Fri Nov 11 03:38:13 AST 2011
+ + version 0.1
+

+

+
+

AUTHOR

+

Jonathan Buhacoff <jonathan@buhacoff.net>

+

+

+
+

COPYRIGHT AND LICENSE

+
+ Copyright (C) 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 <http://www.gnu.org/licenses/>;.
+
+ http://www.gnu.org/licenses/gpl.txt
+ + + + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/imap_ssl_cert.pod b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/imap_ssl_cert.pod new file mode 100644 index 0000000..dc42d5c --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/docs/imap_ssl_cert.pod @@ -0,0 +1,122 @@ + + + +=pod + +=head1 NAME + +imap_ssl_cert - connects to an IMAP server using SSL and saves the server certificate into a .pem file + +=head1 SYNOPSIS + + imap_ssl_cert -H imap.server.com > server_ca_file.pem + imap_ssl_cert -? + imap_ssl_cert --help + +=head1 DEPENDENCIES + +This utility requires the following perl modules to be installed: + +Getopt::Long +Mail::IMAPClient +IO::Socket::SSL +Net::SSLeay + +=head1 OPTIONS + +=over + +=item --timeout + +Abort with critical status if it takes longer than to connect to the IMAP server. Default is 60 seconds. +The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to +connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer +than 30 seconds. +Also known as: -t + +=item --hostname + +Address or name of the IMAP server. Examples: mail.server.com, localhost, 192.168.1.100 +Also known as: -H + +=item --port + +Service port on the IMAP server. Default is 143. If you use SSL, default is 993. +Also known as: -p + +=item --verbose + +Display additional information. Useful for troubleshooting. + +Also known as: -v + +=item --version + +Display plugin version and exit. +Also known as: -V + +=item --help + +Display this documentation and exit. +Also known as: -h + +=item --usage + +Display a short usage instruction and exit. + +=back + +=head1 EXAMPLES + +=head2 Print the server's SSL certificate chain + + $ perl imap_ssl_cert.pl -H imap.server.com > ca_file.pem + $ cat ca_file.pem + + -----BEGIN CERTIFICATE----- + MIID1zCCAr+gAwIBAgIQPr3bVk0SkuXygjxgA7EVGDANBgkqhkiG9w0BAQUFADA8 + [...snip...] + 0FF4warjskrfqaVtWeIV58LJheaM4cPJkc2M + -----END CERTIFICATE----- + + $ openssl x509 -in ca_file.pem -text + + +=head1 SEE ALSO + +http://en.wikipedia.org/wiki/X.509 +http://en.wikipedia.org/wiki/Privacy_Enhanced_Mail +http://tools.ietf.org/html/rfc1422 +http://search.cpan.org/~mikem/Net-SSLeay-1.42/lib/Net/SSLeay.pm +http://search.cpan.org/~plobbes/Mail-IMAPClient-3.29/lib/Mail/IMAPClient.pod + +=head1 CHANGES + + Fri Nov 11 03:38:13 AST 2011 + + version 0.1 + +=head1 AUTHOR + +Jonathan Buhacoff + +=head1 COPYRIGHT AND LICENSE + + Copyright (C) 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 . + + http://www.gnu.org/licenses/gpl.txt + +=cut + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/imap_ssl_cert b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/imap_ssl_cert new file mode 100644 index 0000000..a79c56e --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/imap_ssl_cert @@ -0,0 +1,236 @@ +#!/usr/bin/perl +use strict; +my $VERSION = '0.1'; +my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +my $LICENSE = 'http://www.gnu.org/licenses/gpl.txt'; +my %status = ( 'OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3 ); + +use Getopt::Long; +use Mail::IMAPClient; +use IO::Socket::SSL; +use Net::SSLeay; + +# get options from command line +Getopt::Long::Configure("bundling"); +my $verbose = 0; +my $help = ""; +my $help_usage = ""; +my $show_version = ""; +my $imap_server = ""; +my $default_imap_port = "143"; +my $default_imap_ssl_port = "993"; +my $imap_port = ""; +my $timeout = 60; +my $ok; +$ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, + "v|verbose+"=>\$verbose,"h|help"=>\$help,"usage"=>\$help_usage, + # imap settings + "H|hostname=s"=>\$imap_server,"p|port=i"=>\$imap_port, + # time + "t|timeout=i"=>\$timeout + ); + +if( $show_version ) { + print "$VERSION\n"; + exit $status{UNKNOWN}; +} + +if( $help ) { + exec "perldoc", $0 or print "Try `perldoc $0`\n"; + exit $status{UNKNOWN}; +} + +if( $help_usage + || + ( $imap_server eq "" ) + ) { + print "Usage: $0 -H host [-p port]\n"; + exit $status{UNKNOWN}; +} + +my @certs = (); # we have to store the certs we get Net::SSLeay here so that we can output them in REVERSE order (server cert first, root cert last) + +# connect to IMAP server +print "connecting to server $imap_server\n" if $verbose > 2; +my $imap; +eval { + local $SIG{ALRM} = sub { die "exceeded timeout $timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm` + alarm $timeout; + + $imap_port = $default_imap_ssl_port unless $imap_port; + my $socket = IO::Socket::SSL->new( + PeerAddr => "$imap_server:$imap_port", + SSL_verify_mode => 1, + SSL_ca_file => undef, + SSL_verifycn_scheme => 'imap', + SSL_verifycn_name => $imap_server, + SSL_verify_callback => \&ssl_printer + ); + die IO::Socket::SSL::errstr() unless $socket; + $socket->autoflush(1); + $imap = Mail::IMAPClient->new(Socket=>$socket, Debug => 0 ); + $imap->State(Mail::IMAPClient->Connected); + $imap->_read_line() if "$Mail::IMAPClient::VERSION" le "2.2.9"; # necessary to remove the server's "ready" line from the input buffer for old versions of Mail::IMAPClient. Using string comparison for the version check because the numeric didn't work on Darwin and for Mail::IMAPClient the next version is 2.3.0 and then 3.00 so string comparison works +# $imap->User($username); +# $imap->Password($password); +# $imap->login() or die "Cannot login: $@"; + + print join("\n",reverse(@certs)); + alarm 0; +}; +if( $@ ) { + chomp $@; + print "Could not connect to $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} +unless( $imap ) { + print "Could not connect to $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} + +# deselect the mailbox +$imap->close(); + +# disconnect from IMAP server +print "disconnecting from server\n" if $verbose > 2; +$imap->logout(); + + +exit $status{OK}; + +# see IO::Socket::SSL documentation for SSL_verify_callback: +sub ssl_printer { + my ($boolOpenSSLResult, $cmemCertificateStore, $strCertIssuerOwnerAttr, $strError, $cmemPeerCertificate) = @_; + warn "OpenSSL says certificate is " . ( $boolOpenSSLResult ? "valid" : "invalid" ) if $verbose > 0; + warn "Peer certificate: $strCertIssuerOwnerAttr" if $verbose > 0; + warn "Errors: $strError" if $verbose > 0; + #print Net::SSLeay::PEM_get_string_X509($cmemPeerCertificate); + push @certs, $strCertIssuerOwnerAttr . "\n" . Net::SSLeay::PEM_get_string_X509($cmemPeerCertificate); +} + +package main; +1; + +__END__ + + +=pod + +=head1 NAME + +imap_ssl_cert - connects to an IMAP server using SSL and saves the server certificate into a .pem file + +=head1 SYNOPSIS + + imap_ssl_cert -H imap.server.com > server_ca_file.pem + imap_ssl_cert -? + imap_ssl_cert --help + +=head1 DEPENDENCIES + +This utility requires the following perl modules to be installed: + +Getopt::Long +Mail::IMAPClient +IO::Socket::SSL +Net::SSLeay + +=head1 OPTIONS + +=over + +=item --timeout + +Abort with critical status if it takes longer than to connect to the IMAP server. Default is 60 seconds. +The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to +connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer +than 30 seconds. +Also known as: -t + +=item --hostname + +Address or name of the IMAP server. Examples: mail.server.com, localhost, 192.168.1.100 +Also known as: -H + +=item --port + +Service port on the IMAP server. Default is 143. If you use SSL, default is 993. +Also known as: -p + +=item --verbose + +Display additional information. Useful for troubleshooting. + +Also known as: -v + +=item --version + +Display plugin version and exit. +Also known as: -V + +=item --help + +Display this documentation and exit. +Also known as: -h + +=item --usage + +Display a short usage instruction and exit. + +=back + +=head1 EXAMPLES + +=head2 Print the server's SSL certificate chain + + $ perl imap_ssl_cert.pl -H imap.server.com > ca_file.pem + $ cat ca_file.pem + + -----BEGIN CERTIFICATE----- + MIID1zCCAr+gAwIBAgIQPr3bVk0SkuXygjxgA7EVGDANBgkqhkiG9w0BAQUFADA8 + [...snip...] + 0FF4warjskrfqaVtWeIV58LJheaM4cPJkc2M + -----END CERTIFICATE----- + + $ openssl x509 -in ca_file.pem -text + + +=head1 SEE ALSO + +http://en.wikipedia.org/wiki/X.509 +http://en.wikipedia.org/wiki/Privacy_Enhanced_Mail +http://tools.ietf.org/html/rfc1422 +http://search.cpan.org/~mikem/Net-SSLeay-1.42/lib/Net/SSLeay.pm +http://search.cpan.org/~plobbes/Mail-IMAPClient-3.29/lib/Mail/IMAPClient.pod + +=head1 CHANGES + + Fri Nov 11 03:38:13 AST 2011 + + version 0.1 + +=head1 AUTHOR + +Jonathan Buhacoff + +=head1 COPYRIGHT AND LICENSE + + Copyright (C) 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 . + + http://www.gnu.org/licenses/gpl.txt + +=cut + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/imap_ssl_cert_epn b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/imap_ssl_cert_epn new file mode 100644 index 0000000..dce2f32 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/imap_ssl_cert_epn @@ -0,0 +1,114 @@ +#!/usr/bin/perl +use strict; +my $VERSION = '0.1'; +my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +my $LICENSE = 'http://www.gnu.org/licenses/gpl.txt'; +my %status = ( 'OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3 ); + +use Getopt::Long; +use Mail::IMAPClient; +use IO::Socket::SSL; +use Net::SSLeay; + +# get options from command line +Getopt::Long::Configure("bundling"); +my $verbose = 0; +my $help = ""; +my $help_usage = ""; +my $show_version = ""; +my $imap_server = ""; +my $default_imap_port = "143"; +my $default_imap_ssl_port = "993"; +my $imap_port = ""; +my $timeout = 60; +my $ok; +$ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, + "v|verbose+"=>\$verbose,"h|help"=>\$help,"usage"=>\$help_usage, + # imap settings + "H|hostname=s"=>\$imap_server,"p|port=i"=>\$imap_port, + # time + "t|timeout=i"=>\$timeout + ); + +if( $show_version ) { + print "$VERSION\n"; + exit $status{UNKNOWN}; +} + +if( $help ) { + exec "perldoc", $0 or print "Try `perldoc $0`\n"; + exit $status{UNKNOWN}; +} + +if( $help_usage + || + ( $imap_server eq "" ) + ) { + print "Usage: $0 -H host [-p port]\n"; + exit $status{UNKNOWN}; +} + +my @certs = (); # we have to store the certs we get Net::SSLeay here so that we can output them in REVERSE order (server cert first, root cert last) + +# connect to IMAP server +print "connecting to server $imap_server\n" if $verbose > 2; +my $imap; +eval { + local $SIG{ALRM} = sub { die "exceeded timeout $timeout seconds\n" }; # NB: \n required, see `perldoc -f alarm` + alarm $timeout; + + $imap_port = $default_imap_ssl_port unless $imap_port; + my $socket = IO::Socket::SSL->new( + PeerAddr => "$imap_server:$imap_port", + SSL_verify_mode => 1, + SSL_ca_file => undef, + SSL_verifycn_scheme => 'imap', + SSL_verifycn_name => $imap_server, + SSL_verify_callback => \&ssl_printer + ); + die IO::Socket::SSL::errstr() unless $socket; + $socket->autoflush(1); + $imap = Mail::IMAPClient->new(Socket=>$socket, Debug => 0 ); + $imap->State(Mail::IMAPClient->Connected); + $imap->_read_line() if "$Mail::IMAPClient::VERSION" le "2.2.9"; # necessary to remove the server's "ready" line from the input buffer for old versions of Mail::IMAPClient. Using string comparison for the version check because the numeric didn't work on Darwin and for Mail::IMAPClient the next version is 2.3.0 and then 3.00 so string comparison works +# $imap->User($username); +# $imap->Password($password); +# $imap->login() or die "Cannot login: $@"; + + print join("\n",reverse(@certs)); + alarm 0; +}; +if( $@ ) { + chomp $@; + print "Could not connect to $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} +unless( $imap ) { + print "Could not connect to $imap_server port $imap_port: $@\n"; + exit $status{CRITICAL}; +} + +# deselect the mailbox +$imap->close(); + +# disconnect from IMAP server +print "disconnecting from server\n" if $verbose > 2; +$imap->logout(); + + +exit $status{OK}; + +# see IO::Socket::SSL documentation for SSL_verify_callback: +sub ssl_printer { + my ($boolOpenSSLResult, $cmemCertificateStore, $strCertIssuerOwnerAttr, $strError, $cmemPeerCertificate) = @_; + warn "OpenSSL says certificate is " . ( $boolOpenSSLResult ? "valid" : "invalid" ) if $verbose > 0; + warn "Peer certificate: $strCertIssuerOwnerAttr" if $verbose > 0; + warn "Errors: $strError" if $verbose > 0; + #print Net::SSLeay::PEM_get_string_X509($cmemPeerCertificate); + push @certs, $strCertIssuerOwnerAttr . "\n" . Net::SSLeay::PEM_get_string_X509($cmemPeerCertificate); +} + +package main; +1; + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/nagios-plugins-check_email_delivery.spec b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/nagios-plugins-check_email_delivery.spec new file mode 100644 index 0000000..7af2882 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/check_email_delivery-0.7.1b/nagios-plugins-check_email_delivery.spec @@ -0,0 +1,63 @@ +Summary: A Nagios plugin to check IMAP delivery times +#Name: check_email_delivery +Name: nagios-plugins-check_email_delivery +Version: 0.7.1a +Release: 0.2%{?dist} +License: GPLv2 +Group: Applications/System +URL: http://buhacoff.net/software/check_email_delivery/ +Source0: http://buhacoff.net/software/check_email_delivery/archive/check_email_delivery-%{version}.tar.gz +#http://exchange.nagios.org/components/com_mtree/attachment.php?link_id=1339&cf_id=30 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root + +# For handling --help options +Requires: /usr/bin/nroff + +%description +The Nagios email delivery plugin uses two other plugins +(smtp send and imap receive), also included, to send a message +to an email account and then check that account for the message +and delete it. The plugin times how long it takes for the +message to be delivered and the warning and critical thresholds +are for this elapsed time. + +%prep +#%setup -q +%setup -n check_email_delivery-%{version} + +# Avoid filenames with unnecessary punction in them +%{__mv} "./docs/check_smtp_send (Greek's conflicted copy 2011-08-24).pod" \ + ./docs/check_smtp_send-Greeks-conflicted-copy-2011-08-24.pod +%{__mv} "docs/How to connect to IMAP server manually.txt" \ + docs/How-to-connect-to-IMAP-server-manually.txt + +%build +# No build required, just drop in place + +%install +rm -rf $RPM_BUILD_ROOT +%{__install} -d -m0755 %{buildroot}%{_libdir}/nagios/plugins + +# No instlalation procedure, install manually +%{__install} -m0755 -m0755 check_* %{buildroot}%{_libdir}/nagios/plugins +%{__install} -m0755 -m0755 imap_* %{buildroot}%{_libdir}/nagios/plugins + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-, root, root, 0755) +%{_libdir}/nagios/plugins/check_* +%{_libdir}/nagios/plugins/imap_* +%doc CHANGES.txt LICENSE.txt README.txt +%doc docs/* + +%changelog +* Sun Feb 5 2012 Nico Kadel-Garcia - 0.68-0.1 +- Update to 0.7.1a +- Add nroff dependency for --help options + +* Thu Nov 3 2011 Nico Kadel-Garcia - 0.68-0.1 +- Initial build. diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/control new file mode 100644 index 0000000..0976284 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/control @@ -0,0 +1,15 @@ +Uploaders: Bernd Zeimetz +Recommends: libio-socket-ssl-perl, libmail-imapclient-perl, libnet-smtp-tls-perl, libnet-smtp-ssl-perl, libnet-ssleay-perl, libnet-smtpauth-perl +Suggests: perl-doc +Version: 0.7.1b +Homepage: http://buhacoff.net/software/check_email_delivery/ +Watch: http://buhacoff.net/software/check_email_delivery/ archive/check_email_delivery-(\S+)\.tar\.gz +Description: 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 diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/copyright new file mode 100644 index 0000000..bc4614a --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/copyright @@ -0,0 +1,15 @@ +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 . + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/email_delivery.cfg b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/email_delivery.cfg new file mode 100644 index 0000000..1c067bd --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/email_delivery.cfg @@ -0,0 +1,4 @@ +define command{ + command_name check_email_delivery + command_line /usr/lib/nagios/plugins/check_email_delivery -p '$USER1$/check_smtp_send -H $HOSTADDRESS$ --mailfrom $ARG3$ --mailto $ARG4$ -U $ARG5$ -P $ARG6$ --header "Subject: Nagios %TOKEN1%" -w $ARG1$ -c $ARG2$' -p '$USER1$/check_imap_receive -H $HOSTADDRESS$ -U $ARG5$ -P $ARG6$ -s SUBJECT -s "Nagios %TOKEN1%" -w $ARG1$ -c $ARG2$' -w $ARG1$,$ARG1$ -c $ARG2$,$ARG2$ + } diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/src b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/src new file mode 120000 index 0000000..3df4986 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_email_delivery/src @@ -0,0 +1 @@ +check_email_delivery-0.7.1b \ No newline at end of file diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/Makefile new file mode 100644 index 0000000..05be571 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/Makefile @@ -0,0 +1,5 @@ +#/usr/bin/make -f + +PLUGIN = check_etc_hosts + +include ../common.mk diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/check_etc_hosts b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/check_etc_hosts new file mode 100755 index 0000000..e804131 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/check_etc_hosts @@ -0,0 +1,249 @@ +#!/usr/bin/perl -w +# +# Author: Petter Reinholdtsen +# Date: 2002-07-08 +# +# Check /etc/hosts, and make sure the content matches the information +# in DNS. Lookup IP, and check if the names listed in /etc/hosts +# maches the one in DNS. It will ignore entries with '# NAGIOSIGNORE' +# at the end. + +use vars qw($use_perl_resolver $debug $returnvalue $nagiosmsg); + +$debug = 0; +$returnvalue = 0; # all ok +$nagiosmsg = ""; + +# Report missing reverse lookup. This will ignore CNAME entries +# pointing to the IP address, and report error in these cases. +$use_reverse = 0; + +# Report missing forward-lookup. This will complain on private +# network IP addresses using the same name as a DNS entry. +$use_forward = 1; + +eval 'use Net::DNS;'; +if ($@) { + print "Using /etc/hosts\n" if $debug; + $use_perl_resolver = 0; +} else { + print "Using Net::DNS\n" if $debug; + $use_perl_resolver = 1; +} + +$host = '/usr/bin/host'; + +# Look up ip address, and return ($error status, @DNS names, @DNS addresses) +sub dns_lookup_ext { + local $address = shift; + + # Stupid Tru64 Unix give me two copies of the error messages from + # host. Throw away one of them. + close(STDERR); + + print "Looking up $address using $host\n" if $debug; + + my @names = (); + my @addresses = (); + + my $lookup = ""; + # Some versions need -i to make sure it uses reverse DNS lookup, + # and not /etc/hosts. + # This option will confuse 'host' on Irix and HP/UX, and make the + # program loop forever. Avoiding it for now [pere 2002-08-06] + for $options ("") { + open(HOST, "$host $options $address 2>&1 |") + || die "Unable to execute host"; + while () { + $lookup .= $_; + chomp; + print "host: $_\n" if $debug; + + push(@names, lc($1)) if (/^Name: (.+)$/); + push(@names, lc($1)) if (/^Aliases: (.+)$/); + + # 10.6.240.129.in-addr.arpa PTR perleporten.uio.no + push(@names, lc($1)) if (/\s+PTR\s+(.+)$/); + + # spheniscus.uio.no has address 129.240.148.19 + if (/^\S+ has address (\S+)$/) { + print "Match addr $1\n" if $debug; + push(@addresses, lc($1)) + } + + # 10.6.240.129.IN-ADDR.ARPA domain name pointer perleporten.uio.no + if (/IN-ADDR.ARPA domain name pointer\s+(.+)$/) { + print "Match name $1\n" if $debug; + push(@names, lc($1)) + } + + push(@addresses, $1) if (/^Address: (.+)$/); + push(@addresses, $1) if (/\s+A\s+(\d+.+)$/) + } + close(HOST); + if ($lookup =~ /Usage: /) { + # Probably unknown parameter, try again without -i + $lookup = ""; + } else { + last; + } + } + return ("no/bad reply from DNS server", undef, undef) + if ($lookup !~ /domain name pointer/ + && $lookup !~ /\shas address\s/ + && $lookup !~ /\sPTR\s/ + && $lookup !~ /Name:/); + + if ( $address =~ m/^\d+\.\d+\.\d+\.\d+/ + && ! grep /$address/, @addresses ) { + print "Adding $address to list of addresses\n" if $debug; + unshift(@addresses, $address) ; + } + + return (undef, \@names, \@addresses); +} + +sub dns_lookup_int { + my $address = shift; + + print "Looking up $address using Net::DNS\n" if $debug; + + my @names = (); + my @addresses = (); + + my $res = new Net::DNS::Resolver; + my $query; + if ($address =~ m/\d+\.\d+\.\d+\.\d+/) { + $query = $res->query($address); + } else { + $query = $res->search($address); + } + if ($query) { + foreach $rr ($query->answer) { + print "Type: $rr->type\n" if $debug; + if ($rr->type eq "A") { + print $rr->address, " - A\n" if $debug; + push(@addresses, $rr->address); + } + if ($rr->type eq "CNAME") { + print $rr->cname, " - CNAME\n" if $debug; + push(@addresses, $rr->cname); + } + if ($rr->type eq "PTR") { + print $rr->ptrdname, " - PTR\n" if $debug; + push(@names, lc($rr->ptrdname)); + } + } + return (undef, \@names, \@addresses); + } + else { + print "query failed: ", $res->errorstring, "\n" if $debug; + return ($res->errorstring, (), ()); + } +} + +sub dns_lookup { + my $entry = shift; + + if ($use_perl_resolver) { + return dns_lookup_int($entry); + } else { + return dns_lookup_ext($entry); + } +} + +sub error { + local ($level, $error) = @_; + + $returnvalue = 1 if ($level =~ /^W$/ && $returnvalue <= 1); + $returnvalue = 2 if ($level =~ /^C$/); + + $nagiosmsg = $nagiosmsg . "
" unless ($nagiosmsg =~ /^$/); + $nagiosmsg = $nagiosmsg . "$error"; +} + +sub is_ip_private { + my $ip = shift; + + return 1 if ($ip =~ m/^10\./); + return 1 if ($ip =~ m/^192\.168\./); + + return 0; +} + +sub is_names_ip_matching { + local ($ip, @names) = @_; + + my $level = "W"; + + # Ignore IPv6 addresses for now. + return if ($ip =~ m/:/); + + # Ignore private network + return if (is_ip_private($ip)); + + my $name; + for $name (sort @names) { + if ($use_reverse) { + # Check reverse + my ($retval, $revnames) = dns_lookup($ip); + + return if ( $retval ); # Ignore unknown IP addresses + + if ( ! $retval && ! grep /$name/, @{$revnames} ) { + error $level, "Incorrect /etc/hosts for $ip: ". + "$name not in reverse DNS list"; + } + } + + if ($use_forward) { + # Check forward + my ($retval, $revnames, $forwip); + + ($retval, $revnames) = dns_lookup($ip); + ($retval, undef, $forwip) = dns_lookup($name); + + print "Forward DNS $name/$ip: ", join(" ", @{$forwip}), "\n" + if $debug; + + # Ignore entry if both IP and hostname fail to resolve in DNS + return if ( ! defined $revnames && ! defined $forwip ); + + if ( ! grep /$ip/, @{$forwip} ) { + error $level, "Incorrect /etc/hosts for $ip: ". + "IP not in forward DNS list for '$name'"; + } + } + } +} + +sub check_etc_hosts { + open(HOSTS, "< /etc/hosts") || die "Unable to open /etc/hosts"; + while () { + chomp; + next if (/# NAGIOSIGNORE$/); # Skip lines marked to be ignored + s/\#.+//; # Skip comments + next if (/^\s*$/); # Skip empty lines + + print "Testing $_\n" if $debug; + + $_ = lc($_); + + local ($ip, @names) = split(/\s+/); + + # Skip localhost, it is different on some platforms. + next if ($ip eq '127.0.0.1'); + + is_names_ip_matching($ip, @names); + } + close(HOSTS); +} + +check_etc_hosts() if ( -f "/etc/hosts" ); + +if ($nagiosmsg =~ /^$/) { + print "/etc/hosts OK\n"; +} else { + print $nagiosmsg . "\n"; +} +exit $returnvalue; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/control new file mode 100644 index 0000000..313dffc --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/control @@ -0,0 +1,8 @@ +Uploaders: Petter Reinholdtsen +Description: plugin to check /etc/hosts for DNS consistency + Check /etc/hosts, and make sure the content matches the information + in DNS. Lookup IP, and check if the names listed in /etc/hosts + maches the one in DNS. It will ignore entries with '# NAGIOSIGNORE' + at the end. +Recommends: libnet-dns-perl +Version: ? diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/copyright new file mode 100644 index 0000000..49c53a6 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/copyright @@ -0,0 +1,14 @@ +Copyright (C) 2002 Petter Reinholdtsen + +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, see . diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/tests b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/tests new file mode 100644 index 0000000..026679d --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_hosts/tests @@ -0,0 +1,3 @@ +Depends: libnet-dns-perl +Test-Command: echo "127.0.0.1 localhost" > /etc/hosts && /usr/lib/nagios/plugins/check_etc_hosts +Restrictions: needs-root, breaks-testbed diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/Makefile new file mode 100644 index 0000000..cac655c --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/Makefile @@ -0,0 +1,5 @@ +#/usr/bin/make -f + +PLUGIN = check_etc_resolv + +include ../common.mk diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/check_etc_resolv b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/check_etc_resolv new file mode 100755 index 0000000..e94b72e --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/check_etc_resolv @@ -0,0 +1,139 @@ +#!/usr/bin/perl -w +# +# Author: Petter Reinholdtsen +# Date: 2001-11-09 +# +# Check /etc/resolv.conf, and make sure the name servers listed are +# working. It will ignore entries with '# NAGIOSIGNORE' at the end. + +use Socket; + +use vars qw($host $debug $mincount $trycount $testhost $retval $nagiosmsg); + +$retval = 0; +$nagiosmsg = ""; + +$host = '/usr/bin/host'; + +$debug = 0; + +# There should be at least this many servers in the list +$mincount = 1; + +# Try to call host this many times before reporting any bugs +$trycount = 3; + +# Which DNS name to look up +$testhost = "www.uio.no"; + +# Stolen from Logwatch.pm +sub canonical_ipv6_address { + my @a = split /:/, shift; + my @b = qw(0 0 0 0 0 0 0 0); + my $i = 0; + # comparison is numeric, so we use hex function + while (defined $a[0] and $a[0] ne '') {$b[$i++] = hex(shift @a);} + @a = reverse @a; + $i = 7; + while (defined $a[0] and $a[0] ne '') {$b[$i--] = hex(shift @a);} + @b; +} + +sub error_with_dns { + local ($count, $ip, $error) = @_; + + # Count 1 = Error + # Count 2 = Problem + # Count 3-> = Warning + if (1 == $count) { + $retval = 2; + } elsif (2 == $count) { + $retval = 1 unless ($retval > 0); + } + + $nagiosmsg .= "
" unless ($nagiosmsg =~ /^$/); + $nagiosmsg .= "/etc/resolv.conf: nameserver #$count $ip: $error"; +} + +# Check if there is a DNS server running on the given IP address +sub test_dns_server { + local ($ip) = @_; + local ($name) = ""; + + print "Checking $1\n" if $debug; + + # there are other module functions that do this more gracefully + # (such as inet_pton), but we can't guarantee that they are available + # in every system, so we use the built-in gethostbyaddr. + if ($ip =~ /^[\d\.]*$/) { + $PackedAddr = pack('C4', split /\./,$ip); + $name = gethostbyaddr($PackedAddr,AF_INET()); + } elsif ($ip =~ /^[0-9a-zA-Z:]*/) { + $PackedAddr = pack('n8', canonical_ipv6_address($ip)); + $name = gethostbyaddr($PackedAddr, AF_INET6()); + } + + return "missing in DNS" if ( ! defined $name ); + + my $try = $trycount; + my $delay = 1; # Exponensial backoff + for ($try = $trycount; $try; --$try) { + print "Running '$host $testhost $ip 2>/dev/null'\n" if $debug; + local $lookup = `$host $testhost $ip 2>/dev/null`; + + print "Reply from host (try=$try):\n $lookup\n" if $debug; + + if ($lookup =~ /\sA\s+\d/ || $lookup =~ /has address/ || + $lookup =~ /domain name pointer/ || $lookup =~ /Name: /) { + return undef; # true + } + print "Sleeping $delay\n" if $debug; + sleep $delay; + $delay += $delay; + } + + return "no/bad reply from DNS server"; +} + +sub check_etc_resolv_conf { + open(RESOLV, "< /etc/resolv.conf") || die "Unable to open /etc/resolv.conf"; + local $count = 0; + while () { + chomp; + if (/# NAGIOSIGNORE$/) { # Skip lines marked to be ignored + $count++ if (m/^nameserver\s+/); # Count ignored nameservers + next; + } + s/\#.+//; # Skip comments + next if (/^\s*$/); # Skip empty lines + if (/^nameserver\s+(\S+)/) { + $count++; + local ($error) = test_dns_server($1); + if ( defined $error ) { + error_with_dns($count, $1, $error); + } + } + } + close(RESOLV); + + if ($count < $mincount) { + $retval = 1 unless $retval > 0; + $nagiosmsg .= "
" unless ($nagiosmsg =~ /^$/); + $nagiosmsg .= "/etc/resolv.conf: Only $count nameservers in " . + "/etc/resolv.conf (low-limit is $mincount)"; + } +} + +check_etc_resolv_conf() if ( -f "/etc/resolv.conf" && -x $host ); + +unless ( -x $host ) { + $nagiosmsg .= "$host is missing or not executable, please fix.."; + $retval = 1; +} + +if ($nagiosmsg =~ /^$/) { + print "/etc/resolv.conf OK\n"; +} else { + print $nagiosmsg . "\n"; +} +exit $retval; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/control new file mode 100644 index 0000000..8f4a735 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/control @@ -0,0 +1,5 @@ +Uploaders: Petter Reinholdtsen +Description: plugin to check /etc/resolv.conf + Check /etc/resolv.conf, and make sure the name servers listed are + working. It will ignore entries with '# NAGIOSIGNORE' at the end. +Recommends: bind9-host | knot-host diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/copyright new file mode 100644 index 0000000..ed4b2a9 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/copyright @@ -0,0 +1,14 @@ +Copyright (C) 2001 Petter Reinholdtsen + +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, see . diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/tests b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/tests new file mode 100644 index 0000000..1349860 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_etc_resolv/tests @@ -0,0 +1,2 @@ +Test-Command: /usr/lib/nagios/plugins/check_etc_resolv +Depends: bind9-host | knot-host diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/Makefile new file mode 100644 index 0000000..7ae74f4 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/Makefile @@ -0,0 +1,10 @@ +PLUGIN := check_graphite +CLEANFILES := check_graphite +DOCFILES := README.md + +include ../common.mk + +check_graphite: + cp $@.py $@ + chmod 755 $@ + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/README.md b/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/README.md new file mode 100644 index 0000000..0d86ab9 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/README.md @@ -0,0 +1,34 @@ +# Disqus Nagios plugins + +This is a collection of Nagios plugins written at Disqus. + +## Scripts + +* check_graphite.py + +## check_graphite.py + + % ./check_graphite.py -h + Usage: check_graphite.py [options] + + Options: + -h, --help show this help message and exit + -U URL, --graphite-url=URL + Graphite URL [http://localhost/] + -t TARGET, --target=TARGET + Target to check + --compare=SERIES Compare TARGET against SERIES + --from=_FROM From timestamp/date + --until=_UNTIL Until timestamp/date [now] + -c COUNT, --count=COUNT + Alert on at least COUNT metrics [0] + --percentile=PERCENT Use nPercentile Graphite function on the target + (returns one datapoint) + --confidence Use holtWintersConfidenceBands Graphite function on + the target + --over Over specified WARNING or CRITICAL threshold [True] + --under Under specified WARNING or CRITICAL threshold [False] + -W VALUE Warning if datapoints beyond VALUE + -C VALUE Critical if datapoints beyond VALUE + +Mandatory arguments: -U, [-t|--target], --from diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/check_graphite.py b/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/check_graphite.py new file mode 100755 index 0000000..bedb7c1 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/check_graphite.py @@ -0,0 +1,286 @@ +#!/usr/bin/env python +""" +check_graphite.py +~~~~~~~ + +:copyright: (c) 2012 DISQUS. +:license: Apache License 2.0, see LICENSE for more details. +""" + +import json +import optparse +import urllib +import urllib2 +import sys + +from numbers import Real + +NAGIOS_STATUSES = { + 'OK': 0, + 'WARNING': 1, + 'CRITICAL': 2, + 'UNKNOWN': 3 +} + +class Graphite(object): + + def __init__(self, url, targets, _from, _until): + self.url = url.rstrip('/') + self.targets = targets + self._from = _from + self._until = _until + params = [('target', t) for t in self.targets] +\ + [('from', self._from)] +\ + [('until', self._until)] +\ + [('format', 'json')] + self.full_url = self.url + '/render?' +\ + urllib.urlencode(params) + + def check_datapoints(self, datapoints, check_func, **kwargs): + """Find alerting datapoints + + Args: + datapoints (list): The list of datapoints to check + + Kwargs: + check_func (function): The function to find out of bounds datapoints + bounds (list): Compare against `datapoints` to find out of bounds list + compare (list): Used for comparison if `datapoints` is out of bounds + threshold (float): `check_func` is called for each datapoint against `threshold` + beyond (float): Return datapoint if `beyond` value in bounds list (percentage). + + Returns: + The list of out of bounds datapoints + """ + if 'threshold' in kwargs: + return [x for x in datapoints if isinstance(x, Real) and check_func(x, kwargs['threshold'])] + elif 'bounds' in kwargs: + if 'compare' in kwargs: + return [datapoints[x] for x in xrange(len(datapoints)) if all([datapoints[x], kwargs['bounds'][x], kwargs['compare'][x]]) and check_func(datapoints[x] / kwargs['bounds'][x], kwargs['beyond']) and check_func(datapoints[x], kwargs['compare'][x])] + else: + return [datapoints[x] for x in xrange(len(datapoints)) if all([datapoints[x], kwargs['bounds'][x]]) and check_func(datapoints[x], kwargs['bounds'][x])] + + def fetch_metrics(self): + try: + response = urllib2.urlopen(self.full_url) + + if response.code != 200: + return None + else: + return json.loads(response.read()) + except urllib2.URLError, TypeError: + return None + + def generate_output(self, datapoints, *args, **kwargs): + """Generate check output + + Args: + datapoints (list): The list of datapoints to check + warn_oob (list): Optional list of datapoints considered in warning state + crit_oob (list): Mandatory list of datapoints considered in warning state + + Kwargs: + count (int): Number of metrics that would generate an alert + warning (float): The check's warning threshold + critical (float): The check's critical threshold + target (str): The target for `datapoints` + + Returns: + A dictionary of datapoints grouped by their status ('CRITICAL', 'WARNING', 'OK') + """ + check_output = dict(OK=[], WARNING=[], CRITICAL=[]) + count = kwargs['count'] + warning = kwargs.get('warning', 0) + critical = kwargs.get('critical', 0) + target = kwargs.get('target', 'timeseries') + + if len(args) > 1: + (warn_oob, crit_oob) = args + else: + crit_oob = [x for x in args[0] if isinstance(x, Real)] + warn_oob = [] + + if self.has_numbers(crit_oob) and len(crit_oob) >= count: + check_output['CRITICAL'].append('%s [crit=%f|datapoints=%s]' %\ + (target, critical, ','.join(['%s' % str(x) for x in crit_oob]))) + elif self.has_numbers(warn_oob) and len(warn_oob) >= count: + check_output['WARNING'].append('%s [warn=%f|datapoints=%s]' %\ + (target, warning, ','.join(['%s' % str(x) for x in warn_oob]))) + else: + check_output['OK'].append('%s [warn=%0.3f|crit=%f|datapoints=%s]' %\ + (target, warning, critical, ','.join(['%s' % str(x) for x in datapoints]))) + + return check_output + + def has_numbers(self, lst): + try: + return any([isinstance(x, Real) for x in lst]) + except TypeError: + return False + + +if __name__ == '__main__': + parser = optparse.OptionParser() + parser.add_option('-U', '--graphite-url', dest='graphite_url', + default='http://localhost/', + metavar='URL', + help='Graphite URL [%default]') + parser.add_option('-t', '--target', dest='target', + action='append', + help='Target to check') + parser.add_option('--compare', dest='compare', + metavar='SERIES', + help='Compare TARGET against SERIES') + parser.add_option('--from', dest='_from', + help='From timestamp/date') + parser.add_option('--until', dest='_until', + default='now', + help='Until timestamp/date [%default]') + parser.add_option('-c', '--count', dest='count', + default=0, + type='int', + help='Alert on at least COUNT metrics [%default]') + parser.add_option('--beyond', dest='beyond', + default=0.7, + type='float', + help='Alert if metric is PERCENTAGE beyond comparison value [%default]') + parser.add_option('--percentile', dest='percentile', + default=0, + type='int', + metavar='PERCENT', + help='Use nPercentile Graphite function on the target (returns one datapoint)') + parser.add_option('--empty-ok', dest='empty_ok', + default=False, + action='store_true', + help='Empty data from Graphite is OK') + parser.add_option('--confidence', dest='confidence_bands', + default=False, + action='store_true', + help='Use holtWintersConfidenceBands Graphite function on the target') + parser.add_option('--over', dest='over', + default=True, + action='store_true', + help='Over specified WARNING or CRITICAL threshold [%default]') + parser.add_option('--under', dest='under', + default=False, + action='store_true', + help='Under specified WARNING or CRITICAL threshold [%default]') + parser.add_option('-W', dest='warning', + type='float', + metavar='VALUE', + help='Warning if datapoints beyond VALUE') + parser.add_option('-C', dest='critical', + type='float', + metavar='VALUE', + help='Critical if datapoints beyond VALUE') + + (options, args) = parser.parse_args() + + if not all([getattr(options, option) for option in ('_from', 'target')]): + parser.print_help() + sys.exit(NAGIOS_STATUSES['UNKNOWN']) + + real_from = options._from + + if options.under: + check_func = lambda x, y: x < y + options.over = False + else: + check_func = lambda x, y: x > y + + if options.confidence_bands: + targets = [options.target[0], 'holtWintersConfidenceBands(%s)' % options.target[0]] + check_threshold = None + from_slice = int(options._from) * -1 + real_from = '-2w' + + if options.compare: + targets.append(options.compare) + else: + if not all([getattr(options, option) for option in ('critical', 'warning')]): + parser.print_help() + sys.exit(NAGIOS_STATUSES['UNKNOWN']) + + if options.percentile: + targets = ['nPercentile(%s, %d)' % (options.target[0], options.percentile)] + else: + targets = options.target + + try: + warn = float(options.warning) + crit = float(options.critical) + except ValueError: + print 'ERROR: WARNING or CRITICAL threshold is not a number\n' + parser.print_help() + sys.exit(NAGIOS_STATUSES['UNKNOWN']) + + check_output = {} + graphite = Graphite(options.graphite_url, targets, real_from, options._until) + metric_data = graphite.fetch_metrics() + + if metric_data: + if options.confidence_bands: + actual = [x[0] for x in metric_data[0].get('datapoints', [])][from_slice:] + target_name = metric_data[0]['target'] + kwargs = {} + kwargs['beyond'] = options.beyond + + if options.over: + kwargs['bounds'] = [x[0] for x in metric_data[1].get('datapoints', [])][from_slice:] + elif options.under: + kwargs['bounds'] = [x[0] for x in metric_data[2].get('datapoints', [])][from_slice:] + + if options.compare: + kwargs['compare'] = [x[0] for x in metric_data[3].get('datapoints', [])][from_slice:] + + if not graphite.has_numbers(kwargs['compare']): + print 'CRITICAL: No compare target output from Graphite!' + sys.exit(NAGIOS_STATUSES['CRITICAL']) + + if graphite.has_numbers(actual) and graphite.has_numbers(kwargs['bounds']): + points_oob = graphite.check_datapoints(actual, check_func, **kwargs) + check_output[target_name] = graphite.generate_output(actual, + points_oob, + count=options.count, + target=target_name) + + else: + print 'CRITICAL: No output from Graphite for target(s): %s' % ', '.join(targets) + sys.exit(NAGIOS_STATUSES['CRITICAL']) + else: + for target in metric_data: + datapoints = [x[0] for x in target.get('datapoints', []) if isinstance(x[0], Real)] + if not graphite.has_numbers(datapoints) and not options.empty_ok: + print 'CRITICAL: No output from Graphite for target(s): %s' % ', '.join(targets) + sys.exit(NAGIOS_STATUSES['CRITICAL']) + + crit_oob = graphite.check_datapoints(datapoints, check_func, threshold=crit) + warn_oob = graphite.check_datapoints(datapoints, check_func, threshold=warn) + check_output[target['target']] = graphite.generate_output(datapoints, + warn_oob, + crit_oob, + count=options.count, + target=target['target'], + warning=warn, + critical=crit) + else: + if options.empty_ok and isinstance(metric_data, list): + print 'OK: No output from Graphite for target(s): %s' % ', '.join(targets) + sys.exit(NAGIOS_STATUSES['OK']) + + print 'CRITICAL: No output from Graphite for target(s): %s' % ', '.join(targets) + sys.exit(NAGIOS_STATUSES['CRITICAL']) + + for target, messages in check_output.iteritems(): + if messages['CRITICAL']: + exit_code = NAGIOS_STATUSES['CRITICAL'] + elif messages['WARNING']: + exit_code = NAGIOS_STATUSES['WARNING'] + else: + exit_code = NAGIOS_STATUSES['OK'] + + for status_code in ['CRITICAL', 'WARNING', 'OK']: + if messages[status_code]: + print '\n'.join(['%s: %s' % (status_code, status) for status in messages[status_code]]) + + sys.exit(exit_code) diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/control new file mode 100644 index 0000000..f871084 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/control @@ -0,0 +1,4 @@ +Uploaders: Bernd Zeimetz +Description: Plugin to monitor graphite metrics +Homepage: https://github.com/disqus/nagios-plugins +Recommends: python diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/copyright new file mode 100644 index 0000000..beddebf --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_graphite/copyright @@ -0,0 +1,5 @@ +Copyright: (c) 2012 DISQUS. +License: Apache License 2.0 + +On Debian systems, a copy of the Apache License 2.0 can be found in +/usr/share/common-licenses/Apache-2.0 diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/Makefile new file mode 100644 index 0000000..52de70c --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/Makefile @@ -0,0 +1,4 @@ +#/usr/bin/make -f + +include ../common.mk + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/check_haproxy b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/check_haproxy new file mode 100644 index 0000000..1da4240 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/check_haproxy @@ -0,0 +1,321 @@ +#!/usr/bin/perl -w +# +# Copyright (c) 2010 Stéphane Urbanovski +# +# 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 (or with Nagios); if not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA +# +# $Id: $ + +use strict; # should never be differently :-) +use warnings; + + +use Locale::gettext; +use File::Basename; # get basename() + +use POSIX qw(setlocale); +use Time::HiRes qw(time); # get microtime +use POSIX qw(mktime); + +use Nagios::Plugin ; + +use LWP::UserAgent; # http client +use HTTP::Request; # used by LWP::UserAgent +use HTTP::Status; # to get http err msg + + +use Data::Dumper; + + +my $PROGNAME = basename($0); +'$Revision: 1.0 $' =~ /^.*(\d+\.\d+) \$$/; # Use The Revision from RCS/CVS/SVN +my $VERSION = $1; + +my $DEBUG = 0; +my $TIMEOUT = 9; + +# i18n : +setlocale(LC_MESSAGES, ''); +textdomain('nagios-plugins-perl'); + + +my $np = Nagios::Plugin->new( + version => $VERSION, + blurb => _gt('Plugin to check HAProxy stats url'), + usage => "Usage: %s [ -v|--verbose ] -u [-t ] [-U ] [-P ] [ -c|--critical= ] [ -w|--warning= ]", + timeout => $TIMEOUT+1 +); +$np->add_arg ( + spec => 'debug|d', + help => _gt('Debug level'), + default => 0, +); +$np->add_arg ( + spec => 'username|U=s', + help => _gt('Username for HTTP Auth'), + required => 0, +); +$np->add_arg ( + spec => 'password|P=s', + help => _gt('Password for HTTP Auth'), + required => 0, +); +$np->add_arg ( + spec => 'w=f', + help => _gt('Warning request time threshold (in seconds)'), + default => 2, + label => 'FLOAT' +); +$np->add_arg ( + spec => 'c=f', + help => _gt('Critical request time threshold (in seconds)'), + default => 10, + label => 'FLOAT' +); +$np->add_arg ( + spec => 'url|u=s', + help => _gt('URL of the HAProxy csv statistics page.'), + required => 1, +); + + +$np->getopts; + +$DEBUG = $np->opts->get('debug'); +my $verbose = $np->opts->get('verbose'); +my $username = $np->opts->get('username'); +my $password = $np->opts->get('password'); + +# Thresholds : +# time +my $warn_t = $np->opts->get('w'); +my $crit_t = $np->opts->get('c'); + +my $url = $np->opts->get('url'); + + +# Create a LWP user agent object: +my $ua = new LWP::UserAgent( + 'env_proxy' => 0, + 'timeout' => $TIMEOUT, + ); +$ua->agent(basename($0)); + +# Workaround for LWP bug : +$ua->parse_head(0); + +if ( defined($ENV{'http_proxy'}) ) { + # Normal http proxy : + $ua->proxy(['http'], $ENV{'http_proxy'}); + # Https must use Crypt::SSLeay https proxy (to use CONNECT method instead of GET) + $ENV{'HTTPS_PROXY'} = $ENV{'http_proxy'}; +} + +# Build and submit an http request : +my $request = HTTP::Request->new('GET', $url); +# Authenticate if username and password are supplied +if ( defined($username) && defined($password) ) { + $request->authorization_basic($username, $password); +} +my $timer = time(); +my $http_response = $ua->request( $request ); +$timer = time()-$timer; + + + +my $status = $np->check_threshold( + 'check' => $timer, + 'warning' => $warn_t, + 'critical' => $crit_t, +); + +$np->add_perfdata( + 'label' => 't', + 'value' => sprintf('%.6f',$timer), + 'min' => 0, + 'uom' => 's', + 'threshold' => $np->threshold() +); + +if ( $status > OK ) { + $np->add_message($status, sprintf(_gt("Response time degraded: %.6fs !"),$timer) ); +} + + +my $message = 'msg'; + + +if ( $http_response->is_error() ) { + my $err = $http_response->code." ".status_message($http_response->code)." (".$http_response->message.")"; + $np->add_message(CRITICAL, _gt("HTTP error: ").$err ); + +} elsif ( ! $http_response->is_success() ) { + my $err = $http_response->code." ".status_message($http_response->code)." (".$http_response->message.")"; + $np->add_message(CRITICAL, _gt("Internal error: ").$err ); +} + + +($status, $message) = $np->check_messages(); + +if ( $http_response->is_success() ) { + + # Get xml content ... + my $stats = $http_response->content; + if ($DEBUG) { + print "------------------===http output===------------------\n$stats\n-----------------------------------------------------\n"; + print "t=".$timer."s\n"; + }; + + my @fields = (); + my @rows = split(/\n/,$stats); + if ( $rows[0] =~ /#\ \w+/ ) { + $rows[0] =~ s/#\ //; + @fields = split(/\,/,$rows[0]); + } else { + $np->nagios_exit(UNKNOWN, _gt("Can't find csv header !") ); + } + + my %stats = (); + for ( my $y = 1; $y < $#rows; $y++ ) { + my @values = split(/\,/,$rows[$y]); + if ( !defined($stats{$values[0]}) ) { + $stats{$values[0]} = {}; + } + if ( !defined($stats{$values[0]}{$values[1]}) ) { + $stats{$values[0]}{$values[1]} = {}; + } + for ( my $x = 2,; $x <= $#values; $x++ ) { + # $stats{pxname}{svname}{valuename} + $stats{$values[0]}{$values[1]}{$fields[$x]} = $values[$x]; + } + } +# print Dumper(\%stats); + my %stats2 = (); + my $okMsg = ''; + foreach my $pxname ( keys(%stats) ) { + $stats2{$pxname} = { + 'act' => 0, + 'acttot' => 0, + 'bck' => 0, + 'bcktot' => 0, + 'scur' => 0, + 'slim' => 0, + }; + foreach my $svname ( keys(%{$stats{$pxname}}) ) { + if ( $stats{$pxname}{$svname}{'type'} eq '2' ) { + my $svstatus = $stats{$pxname}{$svname}{'status'} eq 'UP'; + my $active = $stats{$pxname}{$svname}{'act'} eq '1'; + my $activeDescr = $active ? _gt("Active service") :_gt("Backup service") ; + if ( $stats{$pxname}{$svname}{'status'} eq 'UP' ) { + logD( sprintf(_gt("%s '%s' is up on '%s' proxy."),$activeDescr,$svname,$pxname) ); + } elsif ( $stats{$pxname}{$svname}{'status'} eq 'DOWN' ) { + $np->add_message(CRITICAL, sprintf(_gt("%s '%s' is DOWN on '%s' proxy !"),$activeDescr,$svname,$pxname) ); + } + if ( $stats{$pxname}{$svname}{'act'} eq '1' ) { + $stats2{$pxname}{'acttot'}++; + $stats2{$pxname}{'act'} += $svstatus; + + } elsif ($stats{$pxname}{$svname}{'bck'} eq '1') { + $stats2{$pxname}{'bcktot'}++; + $stats2{$pxname}{'bck'} += $svstatus; + } + $stats2{$pxname}{'scur'} += $stats{$pxname}{$svname}{'scur'}; + logD( "Current sessions : ".$stats{$pxname}{$svname}{'scur'} ); + + } elsif ( $stats{$pxname}{$svname}{'type'} eq '0' ) { + $stats2{$pxname}{'slim'} = $stats{$pxname}{$svname}{'slim'}; + } + } + if ( $stats2{$pxname}{'acttot'} > 0 ) { + $okMsg .= ' '.$pxname.' (Active: '.$stats2{$pxname}{'act'}.'/'.$stats2{$pxname}{'acttot'}; + if ( $stats2{$pxname}{'bcktot'} > 0 ) { + $okMsg .= ' , Backup: '.$stats2{$pxname}{'bck'}.'/'.$stats2{$pxname}{'bcktot'}; + } + $okMsg .= ')'; + $np->add_perfdata( + 'label' => 'sess_'.$pxname, + 'value' => $stats2{$pxname}{'scur'}, + 'min' => 0, + 'uom' => 'sessions', + 'max' => $stats2{$pxname}{'slim'}, + ); + } + } + +# print Dumper(\%stats2); + ($status, $message) = $np->check_messages('join' => ' '); + + if ( $status == OK ) { + $message = $okMsg; + + } + +} +# if ( $verbose ) { +# ($status, $message) = $np->check_messages('join' => '
','join_all' => '
'); +# } else { +# ($status, $message) = $np->check_messages('join' => '
'); +# } + + +$np->nagios_exit($status, $message ); + + +sub logD { + print STDERR 'DEBUG: '.$_[0]."\n" if ($DEBUG); +} +sub logW { + print STDERR 'WARNING: '.$_[0]."\n" if ($DEBUG); +} +# Gettext wrapper +sub _gt { + return gettext($_[0]); +} + + +__END__ + +=head1 NAME + +This Nagios plugins check the statistics url provided by HAProxy (http://haproxy.1wt.eu/). + + +=head1 NAGIOS CONGIGURATIONS + +In F you have to add : + + define command { + command_name check_haproxy + command_line $USER1$/check_haproxy.pl -u $ARG1$ + } + + +In F you just have to add something like : + + define service { + host_name haproxy.exemple.org + normal_check_interval 10 + retry_check_interval 5 + contact_groups linux-admins + service_description HAProxy + check_command check_haproxy!http://haproxy.exemple.org/haproxy?stats;csv + } + +=head1 AUTHOR + +Stéphane Urbanovski + +=cut \ No newline at end of file diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/control new file mode 100644 index 0000000..85fbbc5 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/control @@ -0,0 +1,6 @@ +Homepage: http://cvs.orion.education.fr/viewvc/viewvc.cgi/nagios-plugins-perl/trunk/plugins/check_haproxy.pl?view=log +Watch: http://cvs.orion.education.fr/viewvc/viewvc.cgi/nagios-plugins-perl/trunk/plugins/check_haproxy.pl?view=log +Recommends: liblocale-gettext-perl, liblwp-useragent-determined-perl, libmonitoring-plugin-perl | libnagios-plugin-perl +Version: rev135 +Uploaders: Jan Wagner +Description: plugin to check the HAProxy statistics url diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/copyright new file mode 100644 index 0000000..d48a8e3 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/copyright @@ -0,0 +1,8 @@ +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". + + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/haproxy.cfg b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/haproxy.cfg new file mode 100644 index 0000000..ecf54b2 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy/haproxy.cfg @@ -0,0 +1,5 @@ +# 'check_haproxy' command definition +define command{ + command_name check_haproxy + command_line /usr/lib/nagios/plugins/check_haproxy -u '$ARG1$' + } diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/Makefile new file mode 100644 index 0000000..c074838 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/Makefile @@ -0,0 +1,12 @@ +#/usr/bin/make -f + +PLUGIN := check_haproxy_stats +CLEANEXTRAFILES := $(PLUGIN) + + +include ../common.mk + +check_haproxy_stats: check_haproxy_stats.pl + cp $< $@ + + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/check_haproxy_stats.pl b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/check_haproxy_stats.pl new file mode 100644 index 0000000..9698f78 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/check_haproxy_stats.pl @@ -0,0 +1,225 @@ +#!/usr/bin/env perl +# vim: se et ts=4: + +# +# Copyright (C) 2012, Giacomo Montagner +# +# This program is free software; you can redistribute it and/or modify it +# under the same terms as Perl 5.10.1. +# For more details, see http://dev.perl.org/licenses/artistic.html +# +# 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. +# + +our $VERSION = "1.0.1"; + +# CHANGELOG: +# 1.0.0 - first release +# 1.0.1 - fixed empty message if all proxies are OK +# + +use strict; +use warnings; +use 5.010.001; +use File::Basename qw/basename/; +use IO::Socket::UNIX; +use Getopt::Long; + +sub usage { + my $me = basename $0; + print <. + $me is distributed under GPL and the Artistic License 2.0 + +SEE ALSO + Check out online haproxy documentation at + +EOU +} + +my %check_statuses = ( + UNK => "unknown", + INI => "initializing", + SOCKERR => "socket error", + L4OK => "layer 4 check OK", + L4CON => "connection error", + L4TMOUT => "layer 1-4 timeout", + L6OK => "layer 6 check OK", + L6TOUT => "layer 6 (SSL) timeout", + L6RSP => "layer 6 protocol error", + L7OK => "layer 7 check OK", + L7OKC => "layer 7 conditionally OK", + L7TOUT => "layer 7 (HTTP/SMTP) timeout", + L7RSP => "layer 7 protocol error", + L7STS => "layer 7 status error", +); + +my @status_names = (qw/OK WARNING CRITICAL UNKNOWN/); + +# Defaults +my $swarn = 80.0; +my $scrit = 90.0; +my $sock = "/var/run/haproxy.sock"; +my $dump; +my $proxy; +my $help; + +# Read command line +Getopt::Long::Configure ("bundling"); +GetOptions ( + "c|critical=i" => \$scrit, + "d|dump" => \$dump, + "h|help" => \$help, + "p|proxy=s" => \$proxy, + "s|sock|socket=s" => \$sock, + "w|warning=i" => \$swarn, +); + +# Want help? +if ($help) { + usage; + exit 3; +} + +# Connect to haproxy socket and get stats +my $haproxy = new IO::Socket::UNIX ( + Peer => $sock, + Type => SOCK_STREAM, +); +die "Unable to connect to haproxy socket: $@" unless $haproxy; +print $haproxy "show stat\n" or die "Print to socket failed: $!"; + +# Dump stats and exit if requested +if ($dump) { + while (<$haproxy>) { + print; + } + exit 0; +} + +# Get labels from first output line and map them to their position in the line +my $labels = <$haproxy>; +chomp($labels); +$labels =~ s/^# // or die "Data format not supported."; +my @labels = split /,/, $labels; +{ + no strict "refs"; + my $idx = 0; + map { $$_ = $idx++ } @labels; +} + +# Variables I will use from here on: +our $pxname; +our $svname; +our $status; + +my @proxies = split ',', $proxy if $proxy; +my $exitcode = 0; +my $msg; +my $checked = 0; +while (<$haproxy>) { + chomp; + next if /^[[:space:]]*$/; + my @data = split /,/, $_; + if (@proxies) { next unless grep {$data[$pxname] eq $_} @proxies; }; + + # Is session limit enforced? + our $slim; + if ($data[$slim]) { + # Check current session # against limit + our $scur; + my $sratio = $data[$scur]/$data[$slim]; + if ($sratio >= $scrit || $sratio >= $swarn) { + $exitcode = $sratio >= $scrit ? 2 : + $exitcode < 2 ? 1 : $exitcode; + $msg .= sprintf "%s:%s sessions: %.2f%%; ", $data[$pxname], $data[$svname], $sratio; + } + } + + # Check of BACKENDS + if ($data[$svname] eq 'BACKEND') { + if ($data[$status] ne 'UP') { + $msg .= sprintf "BACKEND: %s is %s; ", $data[$pxname], $data[$status]; + $exitcode = 2; + } + # Check of FRONTENDS + } elsif ($data[$svname] eq 'FRONTEND') { + if ($data[$status] ne 'OPEN') { + $msg .= sprintf "FRONTEND: %s is %s; ", $data[$pxname], $data[$status]; + $exitcode = 2; + } + # Check of servers + } else { + if ($data[$status] ne 'UP') { + next if $data[$status] eq 'no check'; # Ignore server if no check is configured to be run + $exitcode = 2; + our $check_status; + $msg .= sprintf "server: %s:%s is %s", $data[$pxname], $data[$svname], $data[$status]; + $msg .= sprintf " (check status: %s)", $check_statuses{$data[$check_status]} if $check_statuses{$data[$check_status]}; + $msg .= "; "; + } + } + ++$checked; +} + +unless ($msg) { + $msg = @proxies ? sprintf("checked proxies: %s", join ', ', sort @proxies) : "checked $checked proxies."; +} +say "Check haproxy $status_names[$exitcode] - $msg"; +exit $exitcode; + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/control b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/control new file mode 100644 index 0000000..595d483 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/control @@ -0,0 +1,7 @@ +Homepage: http://exchange.nagios.org/directory/Plugins/Clustering-and-High-2DAvailability/check_haproxy_stats-2Epl/details +Watch: http://exchange.nagios.org/components/com_mtree/attachment.php?link_id=4089&cf_id=24 VERSION = "([0-9.]+)" +Version: 1.0.1 +Uploaders: Bernd Zeimetz +Description: check haproxy via admin socket + Different from check_haproxy this plugin is able to check + haproxy via the unix admin socket. diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/copyright b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/copyright new file mode 100644 index 0000000..1efcc91 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_haproxy_stats/copyright @@ -0,0 +1,13 @@ +Copyright (C) 2012, Giacomo Montagner + +This program is free software; you can redistribute it and/or modify it +under the same terms as Perl 5.10.1. +For more details, see http://dev.perl.org/licenses/artistic.html + +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. + +On Debian systems a copy of the Artistic license can be found +in /usr/share/common-licenses/Artistic. + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/Makefile b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/Makefile new file mode 100644 index 0000000..f961263 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/Makefile @@ -0,0 +1,11 @@ +PLUGIN := check_hp_bladechassis +MANPAGES := check_hp_bladechassis.8 + +CLEANFILES := check_hp_bladechassis check_hp_bladechassis.8 + +include ../common.mk + + +check_hp_%: src/check_hp_% + cp $< $@ + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/CHANGES b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/CHANGES new file mode 100644 index 0000000..fa49813 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/CHANGES @@ -0,0 +1,15 @@ +1.0.1 2010-01-22 +------------------ + +* Ignore components that are absent, such as power supplies and + fans. If your chassis isn't fully stacked with blades, it may not be + fully stacked with power supplies and fans either. +* Collect perl warnings and output them in a Nagios friendly way +* Plugin version information is now available in the debug output +* Manpage moved from section 3 to section 8 +* Plugin now installs in /nagios, not /nagios/contrib + +1.0.0 2009-08-04 +------------------ + +* Initial release diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/COPYING b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/INSTALL b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/INSTALL new file mode 100644 index 0000000..54c9078 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/INSTALL @@ -0,0 +1,23 @@ +Automatic installation +---------------------- + +Run the script install.sh to install automatically. The install.sh +script will ask where to install the files, unless given the '-q' +option, which will install the files in the default location. + + +Manual installation +------------------- + +To install check_hp_bladechassis, copy the file check_hp_bladechassis to the +Nagios plugin directory (usually /usr/lib/nagios/plugins): + + cp check_hp_bladechassis /usr/lib/nagios/plugins + +To install the manual page: + + cp check_hp_bladechassis.8 /usr/share/man/man8 + +This is all. + +-trond diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/README b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/README new file mode 100644 index 0000000..0e81b9f --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/README @@ -0,0 +1,16 @@ +Files in this directory: + + check_hp_bladechassis - The plugin + check_hp_bladechassis.8 - Man page + check_hp_bladechassis.pod - POD (raw man page) + check_hp_bladechassis.php - PNP4Nagios template + COPYING - License information + INSTALL - Install HOWTO + CHANGES - Changelog + install.sh - Linux/UNIX install script + README - This file + +More information avilable online: + + http://folk.uio.no/trondham/software/check_hp_bladechassis.html + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis new file mode 100755 index 0000000..02e0d5a --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis @@ -0,0 +1,1004 @@ +#!/usr/bin/perl +# +# DESCRIPTION: Nagios plugin for checking the status of HP +# blade chassis via SNMP. +# +# AUTHOR: Trond H. Amundsen +# +# $Id: check_hp_bladechassis 16304 2010-01-22 11:20:34Z trondham $ +# +# Copyright (C) 2010 Trond H. Amundsen +# +# 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 . +# +# HP ASN.1 prefix: 1.3.6.1.4.1.232 + +use strict; +use warnings; +use POSIX qw(isatty); +use Getopt::Long qw(:config no_ignore_case); + +# Global (package) variables used throughout the code +use vars qw( $NAME $VERSION $AUTHOR $CONTACT $E_OK $E_WARNING $E_CRITICAL + $E_UNKNOWN $USAGE $HELP $LICENSE $original_sigwarn + $snmp_session $snmp_error $linebreak $exit_code + $count_ioms $count_blades $global $total_wattage + %opt %reverse_exitcode %status2nagios %snmp_status %sysinfo + %nagios_alert_count %present_map + @reports @perfdata @perl_warnings + ); + +#--------------------------------------------------------------------- +# Initialization and global variables +#--------------------------------------------------------------------- + +# Small subroutine to collect any perl warnings during execution +sub collect_perl_warning { + push @perl_warnings, [@_]; +} + +# Set the WARN signal to use our collect subroutine above +$original_sigwarn = $SIG{__WARN__}; +$SIG{__WARN__} = \&collect_perl_warning; + +# Version and similar info +$NAME = 'check_hp_bladechassis'; +$VERSION = '1.0.1'; +$AUTHOR = 'Trond H. Amundsen'; +$CONTACT = 't.h.amundsen@usit.uio.no'; + +# Exit codes +$E_OK = 0; +$E_WARNING = 1; +$E_CRITICAL = 2; +$E_UNKNOWN = 3; + +# Usage text +$USAGE = <<"END_USAGE"; +Usage: $NAME -H [OPTION]... +END_USAGE + +# Help text +$HELP = <<'END_HELP'; + +OPTIONS: + -H, --hostname Hostname or IP of the enclosure + -C, --community SNMP community string + -P, --protocol SNMP protocol version + --port SNMP port number + -p, --perfdata Output performance data + -t, --timeout Plugin timeout in seconds + -i, --info Prefix alerts with the enclosure's serial number + -v, --verbose Append extra info to alerts (part no. etc.) + -e, --extinfo Append system info to alerts + -s, --state Prefix alerts with alert state + --short-state Prefix alerts with alert state (abbreviated) + -d, --debug Debug output, reports everything + -h, --help Display this help text + -V, --version Display version info + +For more information and advanced options, see the manual page or URL: + http://folk.uio.no/trondham/software/check_hp_bladechassis.html +END_HELP + +# Version text +$LICENSE = <<"END_LICENSE"; +$NAME $VERSION +Copyright (C) 2010 $AUTHOR +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +Written by $AUTHOR <$CONTACT> +END_LICENSE + +# Options with default values +%opt + = ( + 'port' => 161, # default SNMP port + 'hostname' => undef, + 'community' => 'public', # SMNP v1 or v2c + 'protocol' => 2, # default is SNMPv2c + 'username' => undef, # SMNP v3 + 'authpassword' => undef, # SMNP v3 + 'authkey' => undef, # SMNP v3 + 'authprotocol' => undef, # SMNP v3 + 'privpassword' => undef, # SMNP v3 + 'privkey' => undef, # SMNP v3 + 'privprotocol' => undef, # SMNP v3 + 'timeout' => 30, # default timeout is 30 seconds + 'verbose' => 0, + 'info' => 0, + 'extinfo' => 0, + 'help' => 0, + 'version' => 0, + 'state' => 0, + 'short-state' => 0, + 'linebreak' => undef, + 'perfdata' => undef, + 'debug' => 0, + ); + +# Get options +GetOptions('H|hostname=s' => \$opt{hostname}, + 'C|community=s' => \$opt{community}, + 'P|protocol=i' => \$opt{protocol}, + 'port=i' => \$opt{port}, + 'U|username=s' => \$opt{username}, + 'authpassword=s' => \$opt{authpassword}, + 'authkey=s' => \$opt{authkey}, + 'authprotocol=s' => \$opt{authprotocol}, + 'privpassword=s' => \$opt{privpassword}, + 'privkey=s' => \$opt{privkey}, + 'privprotocol=s' => \$opt{privprotocol}, + 't|timeout=i' => \$opt{timeout}, + 'v|verbose' => \$opt{verbose}, + 'i|info' => \$opt{info}, + 'e|extinfo' => \$opt{extinfo}, + 'h|help' => \$opt{help}, + 'V|version' => \$opt{version}, + 's|state' => \$opt{state}, + 'short-state' => \$opt{shortstate}, + 'linebreak=s' => \$opt{linebreak}, + 'p|perfdata:s' => \$opt{perfdata}, + 'd|debug' => \$opt{debug}, + ) or do { print $USAGE; exit $E_UNKNOWN; }; + +# If user requested help +if ($opt{'help'}) { + print $USAGE, $HELP; + exit $E_OK; +} + +# If user requested version info +if ($opt{'version'}) { + print $LICENSE; + exit $E_OK; +} + +# Error if hostname option is not present +if (!defined $opt{hostname}) { + print "ERROR: No hostname or address given on command line. Use the '-H' or '--hostname' option\n"; + exit $E_UNKNOWN; +} + +# Nagios error levels reversed +%reverse_exitcode + = ( + 0 => 'OK', + 1 => 'WARNING', + 2 => 'CRITICAL', + 3 => 'UNKNOWN', + ); + +# HP SNMP status (condition) +%status2nagios + = ( + 'Other' => $E_CRITICAL, + 'Ok' => $E_OK, + 'Degraded' => $E_WARNING, + 'Failed' => $E_CRITICAL, + ); + +# Status via SNMP +%snmp_status + = ( + 1 => 'Other', + 2 => 'Ok', + 3 => 'Degraded', + 4 => 'Failed', + ); + +# Present map +%present_map + = ( + 1 => 'other', + 2 => 'absent', + 3 => 'present', + 4 => 'OMG!WTF!BUG!', # for blades it can return 4, which is NOT spesified in MIB + ); + +# Reports (messages) are gathered in this array +@reports = (); + +# Setting timeout +$SIG{ALRM} = sub { + print "PLUGIN TIMEOUT: $NAME timed out after $opt{timeout} seconds\n"; + exit $E_UNKNOWN; +}; +alarm $opt{timeout}; + +# Default line break +$linebreak = isatty(*STDOUT) ? "\n" : '
'; + +# Line break from option +if (defined $opt{linebreak}) { + if ($opt{linebreak} eq 'REG') { + $linebreak = "\n"; + } + elsif ($opt{linebreak} eq 'HTML') { + $linebreak = '
'; + } + else { + $linebreak = $opt{linebreak}; + } +} + +# System information gathered +%sysinfo + = ( + 'serial' => 'N/A', # serial number (service tag) + 'model' => 'N/A', # system model + 'firmware' => 'N/A', # firmware version + ); + +# Counter variable +%nagios_alert_count + = ( + 'OK' => 0, + 'WARNING' => 0, + 'CRITICAL' => 0, + 'UNKNOWN' => 0, + ); + +# Number of blades +$count_blades = 0; + +# Number of IO modules +$count_ioms = 0; + +# Overall health status +$global = 'Ok'; + +# Initialize SNMP +snmp_initialize(); + +# Check that SNMP works +snmp_check(); + +#--------------------------------------------------------------------- +# Functions +#--------------------------------------------------------------------- + +# +# Store a message in the message array +# +sub report { + my ($msg, $exval, $part, $spare, $serial) = @_; + return push @reports, [ $msg, $exval, $part, $spare, $serial ]; +} + +# +# Give an error and exit with unknown state +# +sub unknown_error { + my $msg = shift; + print "ERROR: $msg\n"; + exit $E_UNKNOWN; +} + +# +# Initialize SNMP +# +sub snmp_initialize { + # Legal SNMP v3 protocols + my $snmp_v3_privprotocol = qr{\A des|aes|aes128|3des|3desde \z}xms; + my $snmp_v3_authprotocol = qr{\A md5|sha \z}xms; + + # Parameters to Net::SNMP->session() + my %param + = ( + '-port' => $opt{port}, + '-hostname' => $opt{hostname}, + '-version' => $opt{protocol}, + ); + + # Parameters for SNMP v3 + if ($opt{protocol} == 3) { + + # Username is mandatory + if (defined $opt{username}) { + $param{'-username'} = $opt{username}; + } + else { + print "SNMP ERROR: With SNMPv3 the username must be specified\n"; + exit $E_UNKNOWN; + } + + # Authpassword is optional + if (defined $opt{authpassword}) { + $param{'-authpassword'} = $opt{authpassword}; + } + + # Authkey is optional + if (defined $opt{authkey}) { + $param{'-authkey'} = $opt{authkey}; + } + + # Privpassword is optional + if (defined $opt{privpassword}) { + $param{'-privpassword'} = $opt{privpassword}; + } + + # Privkey is optional + if (defined $opt{privkey}) { + $param{'-privkey'} = $opt{privkey}; + } + + # Privprotocol is optional + if (defined $opt{privprotocol}) { + if ($opt{privprotocol} =~ m/$snmp_v3_privprotocol/xms) { + $param{'-privprotocol'} = $opt{privprotocol}; + } + else { + print "SNMP ERROR: Unknown privprotocol '$opt{privprotocol}', " + . "must be one of [des|aes|aes128|3des|3desde]\n"; + exit $E_UNKNOWN; + } + } + + # Authprotocol is optional + if (defined $opt{authprotocol}) { + if ($opt{authprotocol} =~ m/$snmp_v3_authprotocol/xms) { + $param{'-authprotocol'} = $opt{authprotocol}; + } + else { + print "SNMP ERROR: Unknown authprotocol '$opt{authprotocol}', " + . "must be one of [md5|sha]\n"; + exit $E_UNKNOWN; + } + } + } + # Parameters for SNMP v2c or v1 + elsif ($opt{protocol} == 2 or $opt{protocol} == 1) { + $param{'-community'} = $opt{community}; + } + else { + print "SNMP ERROR: Unknown SNMP version '$opt{protocol}'\n"; + exit $E_UNKNOWN; + } + + # Try to initialize the SNMP session + if ( eval { require Net::SNMP; 1 } ) { + ($snmp_session, $snmp_error) = Net::SNMP->session( %param ); + if (!defined $snmp_session) { + printf "SNMP: %s\n", $snmp_error; + exit $E_UNKNOWN; + } + } + else { + print "ERROR: Required perl module Net::SNMP not found\n"; + exit $E_UNKNOWN; + } + return; +} + +# +# Checking if SNMP works by probing for "EnclosureModel", which all +# enclosures should have +# +sub snmp_check { + my $cpqRackCommonEnclosureModel = '1.3.6.1.4.1.232.22.2.3.1.1.1.3.1'; + my $result = $snmp_session->get_request(-varbindlist => [$cpqRackCommonEnclosureModel]); + + # Typically if remote host isn't responding + if (!defined $result) { + printf "SNMP CRITICAL: %s\n", $snmp_session->error; + exit $E_CRITICAL; + } + + # If OpenManage isn't installed or is not working + if ($result->{$cpqRackCommonEnclosureModel} =~ m{\A noSuch (Instance|Object) \z}xms) { + print "SNMP ERROR: Can't determine model name\n"; + exit $E_UNKNOWN; + } + + # Store the model name + $sysinfo{model} = $result->{$cpqRackCommonEnclosureModel}; + $sysinfo{model} =~ s{\s+\z}{}xms; # remove trailing whitespace + + return; +} + +# Gets the output from SNMP result according to the OIDs checked +sub get_snmp_output { + my ($result,$oidref) = @_; + my @output = (); + + foreach my $oid (keys %{ $result }) { + my @dummy = split m{\.}xms, $oid; + my $id = pop @dummy; + --$id; + my $foo = join q{.}, @dummy; + if (exists $oidref->{$foo}) { + $output[$id]{$oidref->{$foo}} = $result->{$oid}; + } + } + return \@output; +} + +# Get enclosure status and firmware info +sub get_enclosure_status { + my @output = (); + + my $part = undef; # part number + my $spare = undef; # spare part number + my $serial = undef; # serial + my $condition = undef; # enclosure condition + + # OIDs we are interested in + my %oid + = ( + '1.3.6.1.4.1.232.22.2.3.1.1.1.5' => 'cpqRackCommonEnclosurePartNumber', # part number + '1.3.6.1.4.1.232.22.2.3.1.1.1.6' => 'cpqRackCommonEnclosureSparePartNumber', # spare + '1.3.6.1.4.1.232.22.2.3.1.1.1.7' => 'cpqRackCommonEnclosureSerialNum', # serial no. + '1.3.6.1.4.1.232.22.2.3.1.1.1.8' => 'cpqRackCommonEnclosureFWRev', # firmware rev. + '1.3.6.1.4.1.232.22.2.3.1.1.1.16' => 'cpqRackCommonEnclosureCondition', # condition + ); + + my $result = $snmp_session->get_entries(-columns => [keys %oid]); + + # Error if we don't get anything + if (!defined $result) { + printf "SNMP CRITICAL: [enclosure table] %s\n", $snmp_session->error; + exit $E_CRITICAL; + } + + @output = @{ get_snmp_output($result, \%oid) }; + + ENCL: + foreach my $out (@output) { + $sysinfo{'serial'} = $out->{cpqRackCommonEnclosureSerialNum}; + $sysinfo{'firmware'} = $out->{cpqRackCommonEnclosureFWRev}; + + $part = $out->{cpqRackCommonEnclosurePartNumber}; + $spare = $out->{cpqRackCommonEnclosureSparePartNumber}; + $serial = $out->{cpqRackCommonEnclosureSerialNum}; + $condition = $out->{cpqRackCommonEnclosureCondition}; + } + + # report global enclosure condition + report( (sprintf q{Enclosure overall health condition is %s}, $snmp_status{$condition}), + $status2nagios{$snmp_status{$condition}}, $part, $spare, $serial ); + + $global = $snmp_status{$condition}; + + return; +} + +# Check the enclosure managers +sub check_managers { + my @output = (); + + my $index = undef; # index + my $part = undef; # part number + my $spare = undef; # spare part number + my $serial = undef; # serial number + my $role = undef; # manager role (primary / secondary) + my $condition = undef; # condition + + # OIDs we are interested in + my %oid + = ( + '1.3.6.1.4.1.232.22.2.3.1.6.1.3' => 'cpqRackCommonEnclosureManagerIndex', + '1.3.6.1.4.1.232.22.2.3.1.6.1.6' => 'cpqRackCommonEnclosureManagerPartNumber', + '1.3.6.1.4.1.232.22.2.3.1.6.1.7' => 'cpqRackCommonEnclosureManagerSparePartNumber', + '1.3.6.1.4.1.232.22.2.3.1.6.1.8' => 'cpqRackCommonEnclosureManagerSerialNum', + '1.3.6.1.4.1.232.22.2.3.1.6.1.9' => 'cpqRackCommonEnclosureManagerRole', + '1.3.6.1.4.1.232.22.2.3.1.6.1.12' => 'cpqRackCommonEnclosureManagerCondition', + ); + + my $default_timeout = $snmp_session->timeout(); # get existing session timeout + $snmp_session->timeout(20); # set new session timeout + my $result = $snmp_session->get_entries(-columns => [keys %oid]); # get entries + $snmp_session->timeout($default_timeout); # reset session timeout + + # Error if we don't get anything + if (!defined $result) { + printf "ERROR: [manager table] %s\n", $snmp_session->error; + exit $E_UNKNOWN; + } + + @output = @{ get_snmp_output($result, \%oid) }; + + my %map_role + = ( + 1 => 'Standby', + 2 => 'Active', + ); + + MANAGER: + foreach my $out (@output) { + $index = $out->{cpqRackCommonEnclosureManagerIndex}; + $part = $out->{cpqRackCommonEnclosureManagerPartNumber}; + $spare = $out->{cpqRackCommonEnclosureManagerSparePartNumber}; + $serial = $out->{cpqRackCommonEnclosureManagerSerialNum}; + $role = $out->{cpqRackCommonEnclosureManagerRole}; + $condition = $out->{cpqRackCommonEnclosureManagerCondition}; + + # report manager condition + if (exists $snmp_status{$condition}) { + report( (sprintf q{Enclosure management module %d is %s, status is %s}, + $index, $map_role{$role}, $snmp_status{$condition}), + $status2nagios{$snmp_status{$condition}}, $part, $spare, $serial ); + } + else { + report( (sprintf q{Enclosure management module %d is %s, status is Unknown}, + $index, $map_role{$role}), + $E_OK, $part, $spare, $serial ); + } + } + + return; +} + + +# Check the enclosure fans +sub check_fans { + my @output = (); + + my $index = undef; # index + my $present = undef; # if device is present + my $part = undef; # part number + my $spare = undef; # spare part number + my $condition = undef; # condition + + # OIDs we are interested in + my %oid + = ( + '1.3.6.1.4.1.232.22.2.3.1.3.1.3' => 'cpqRackCommonEnclosureFanIndex', + '1.3.6.1.4.1.232.22.2.3.1.3.1.6' => 'cpqRackCommonEnclosureFanPartNumber', + '1.3.6.1.4.1.232.22.2.3.1.3.1.7' => 'cpqRackCommonEnclosureFanSparePartNumber', + '1.3.6.1.4.1.232.22.2.3.1.3.1.8' => 'cpqRackCommonEnclosureFanPresent', + '1.3.6.1.4.1.232.22.2.3.1.3.1.11' => 'cpqRackCommonEnclosureFanCondition', + ); + + my $result = $snmp_session->get_entries(-columns => [keys %oid]); + + # Error if we don't get anything + if (!defined $result) { + printf "SNMP ERROR: [fan table] %s\n", $snmp_session->error; + exit $E_UNKNOWN; + } + + @output = @{ get_snmp_output($result, \%oid) }; + + FAN: + foreach my $out (@output) { + $index = $out->{cpqRackCommonEnclosureFanIndex}; + $present = $out->{cpqRackCommonEnclosureFanPresent}; + $part = $out->{cpqRackCommonEnclosureFanPartNumber}; + $spare = $out->{cpqRackCommonEnclosureFanSparePartNumber}; + $condition = $out->{cpqRackCommonEnclosureFanCondition}; + + next FAN if $present_map{$present} ne 'present'; + + # report fan condition + report( (sprintf q{Fan %d condition is %s}, $index, $snmp_status{$condition}), + $status2nagios{$snmp_status{$condition}}, $part, $spare, q{} ); + } + + return; +} + + +# Check the blades +sub check_blades { + my @output = (); + + my $index = undef; # index + my $name = undef; # blade name + my $part = undef; # part number + my $spare = undef; # spare part number + my $serial = undef; # serial number + my $position = undef; # blade position + my $present = undef; # if device is present + my $product = undef; # product id + my $status = undef; # blade status + my $major = undef; # major fault + my $minor = undef; # minor fault + my $diag = undef; # blade fault diagnostic string + my $power = undef; # if blade is powered up + + # OIDs we are interested in + my %oid + = ( + '1.3.6.1.4.1.232.22.2.4.1.1.1.3' => 'cpqRackServerBladeIndex', + '1.3.6.1.4.1.232.22.2.4.1.1.1.4' => 'cpqRackServerBladeName', + '1.3.6.1.4.1.232.22.2.4.1.1.1.6' => 'cpqRackServerBladePartNumber', + '1.3.6.1.4.1.232.22.2.4.1.1.1.7' => 'cpqRackServerBladeSparePartNumber', + '1.3.6.1.4.1.232.22.2.4.1.1.1.8' => 'cpqRackServerBladePosition', + '1.3.6.1.4.1.232.22.2.4.1.1.1.12' => 'cpqRackServerBladePresent', + '1.3.6.1.4.1.232.22.2.4.1.1.1.16' => 'cpqRackServerBladeSerialNum', + '1.3.6.1.4.1.232.22.2.4.1.1.1.17' => 'cpqRackServerBladeProductId', + '1.3.6.1.4.1.232.22.2.4.1.1.1.21' => 'cpqRackServerBladeStatus', + '1.3.6.1.4.1.232.22.2.4.1.1.1.22' => 'cpqRackServerBladeFaultMajor', + '1.3.6.1.4.1.232.22.2.4.1.1.1.23' => 'cpqRackServerBladeFaultMinor', + '1.3.6.1.4.1.232.22.2.4.1.1.1.24' => 'cpqRackServerBladeFaultDiagnosticString', + '1.3.6.1.4.1.232.22.2.4.1.1.1.25' => 'cpqRackServerBladePowered', + ); + + my $result = $snmp_session->get_entries(-columns => [keys %oid]); + + # Error if we don't get anything + if (!defined $result) { + printf "SNMP ERROR: [blade table] %s\n", $snmp_session->error; + exit $E_UNKNOWN; + } + + @output = @{ get_snmp_output($result, \%oid) }; + + sub get { + my ($hash, $val) = @_; + return exists $hash->{$val} ? $hash->{$val} : undef; + } + + BLADE: + foreach my $out (@output) { + $index = get($out, 'cpqRackServerBladeIndex'); + $name = get($out, 'cpqRackServerBladeName'); + $part = get($out, 'cpqRackServerBladePartNumber'); + $spare = get($out, 'cpqRackServerBladeSparePartNumber'); + $serial = get($out, 'cpqRackServerBladeSerialNum'); + $position = get($out, 'cpqRackServerBladePosition'); + $present = get($out, 'cpqRackServerBladePresent'); + $product = get($out, 'cpqRackServerBladeProductId'); + $status = get($out, 'cpqRackServerBladeStatus'); + $major = get($out, 'cpqRackServerBladeFaultMajor'); + $minor = get($out, 'cpqRackServerBladeFaultMinor'); + $diag = get($out, 'cpqRackServerBladeFaultDiagnosticString'); + $power = get($out, 'cpqRackServerBladePowered'); + + next BLADE if $present_map{$present} ne 'present'; + ++$count_blades; + + $part =~ s{\s+\z}{}xms; # remove trailing whitespace + + # report blade condition + if (!defined $status) { + report( (sprintf q{Blade %d is a %s with name: %s}, + $index, $product, $name), + $E_OK, $part, $spare, $serial ); + } + else { + report( (sprintf q{Blade %d (%s, %s) status is %s}, + $index, $name, $product, $snmp_status{$status}), + $status2nagios{$snmp_status{$status}}, $part, $spare, $serial ); + } + } + + return; +} + + +# Check the enclosure power supplies +sub check_psu { + my @output = (); + + my $index = undef; # index + my $serial = undef; # serial number + my $present = undef; # if device is present + my $part = undef; # part number + my $spare = undef; # spare part number + my $currpwr = undef; # The current power output of the power supply in watts + my $status = undef; # The status of the power supply + my $inputline = undef; # The status of line input power + my $condition = undef; # The condition of the power supply + + # OIDs we are interested in + my %oid + = ( + '1.3.6.1.4.1.232.22.2.5.1.1.1.3' => 'cpqRackPowerSupplyIndex', + '1.3.6.1.4.1.232.22.2.5.1.1.1.5' => 'cpqRackPowerSupplySerialNum', + '1.3.6.1.4.1.232.22.2.5.1.1.1.6' => 'cpqRackPowerSupplyPartNumber', + '1.3.6.1.4.1.232.22.2.5.1.1.1.7' => 'cpqRackPowerSupplySparePartNumber', + '1.3.6.1.4.1.232.22.2.5.1.1.1.10' => 'cpqRackPowerSupplyCurPwrOutput', + '1.3.6.1.4.1.232.22.2.5.1.1.1.14' => 'cpqRackPowerSupplyStatus', + '1.3.6.1.4.1.232.22.2.5.1.1.1.15' => 'cpqRackPowerSupplyInputLineStatus', + '1.3.6.1.4.1.232.22.2.5.1.1.1.16' => 'cpqRackPowerSupplyPresent', + '1.3.6.1.4.1.232.22.2.5.1.1.1.17' => 'cpqRackPowerSupplyCondition', + ); + + my $result = $snmp_session->get_entries(-columns => [keys %oid]); + + # Error if we don't get anything + if (!defined $result) { + printf "SNMP ERROR: [psu table] %s\n", $snmp_session->error; + exit $E_UNKNOWN; + } + + @output = @{ get_snmp_output($result, \%oid) }; + + my %psu_status + = ( + 1 => 'noError', + 2 => 'generalFailure', + 3 => 'bistFailure', + 4 => 'fanFailure', + 5 => 'tempFailure', + 6 => 'interlockOpen', + 7 => 'epromFailed', + 8 => 'vrefFailed', + 9 => 'dacFailed', + 10 => 'ramTestFailed', + 11 => 'voltageChannelFailed', + 12 => 'orringdiodeFailed', + 13 => 'brownOut', + 14 => 'giveupOnStartup', + 15 => 'nvramInvalid', + 16 => 'calibrationTableInvalid', + ); + + my %inputline_status + = ( + 1 => 'noError', + 2 => 'lineOverVoltage', + 3 => 'lineUnderVoltage', + 4 => 'lineHit', + 5 => 'brownOut', + 6 => 'linePowerLoss', + ); + + $total_wattage = 0; + + PSU: + foreach my $out (@output) { + $index = $out->{cpqRackPowerSupplyIndex}; + $present = $out->{cpqRackPowerSupplyPresent}; + $part = $out->{cpqRackPowerSupplyPartNumber}; + $spare = $out->{cpqRackPowerSupplySparePartNumber}; + $condition = $out->{cpqRackPowerSupplyCondition}; + $serial = $out->{cpqRackPowerSupplySerialNum}; + $currpwr = $out->{cpqRackPowerSupplyCurPwrOutput}; + $status = $out->{cpqRackPowerSupplyStatus}; + $inputline = $out->{cpqRackPowerSupplyInputLineStatus}; + + next PSU if $present_map{$present} ne 'present'; + + # Calculate total power consumption + $total_wattage += $currpwr; + + # Report PSU condition + if ($snmp_status{$condition} eq 'Ok') { + report( (sprintf q{PSU %d is %s, output: %d W}, + $index, $snmp_status{$condition}, $currpwr), + $status2nagios{$snmp_status{$condition}}, $part, $spare, $serial ); + } + else { + my $msg = sprintf q{PSU %d is %s}, + $index, $snmp_status{$condition}; + $msg .= " ($psu_status{$status})" if $status >= 1; + $msg .= ", input line status: $inputline_status{$inputline}" if $inputline >= 1; + + report( $msg, $status2nagios{$snmp_status{$condition}}, $part, $spare, $serial ); + } + } + + # Collect performance data + if (defined $opt{perfdata}) { + push @perfdata, "'total_watt'=${total_wattage}W;0;0"; + } + + return; +} + + +# Check the IO modules +sub check_iom { + my @output = (); + + my $index = undef; # index + my $present = undef; # if device is present + my $part = undef; # part number + my $spare = undef; # spare part number + my $serial = undef; # serial number + my $model = undef; # The model name of the network connector + my $location = undef; # The location of the network connector within the enclosure + my $devtype = undef; # The type of interrconnect in the enclosure + + # OIDs we are interested in + my %oid + = ( + '1.3.6.1.4.1.232.22.2.6.1.1.1.3' => 'cpqRackNetConnectorIndex', + '1.3.6.1.4.1.232.22.2.6.1.1.1.6' => 'cpqRackNetConnectorModel', + '1.3.6.1.4.1.232.22.2.6.1.1.1.7' => 'cpqRackNetConnectorSerialNum', + '1.3.6.1.4.1.232.22.2.6.1.1.1.8' => 'cpqRackNetConnectorPartNumber', + '1.3.6.1.4.1.232.22.2.6.1.1.1.9' => 'cpqRackNetConnectorSparePartNumber', + '1.3.6.1.4.1.232.22.2.6.1.1.1.12' => 'cpqRackNetConnectorLocation', + '1.3.6.1.4.1.232.22.2.6.1.1.1.13' => 'cpqRackNetConnectorPresent', + '1.3.6.1.4.1.232.22.2.6.1.1.1.17' => 'cpqRackNetConnectorDeviceType', + ); + + my $result = $snmp_session->get_entries(-columns => [keys %oid]); + + # Error if we don't get anything + if (!defined $result) { + printf "SNMP ERROR: [fan table] %s\n", $snmp_session->error; + exit $E_UNKNOWN; + } + + @output = @{ get_snmp_output($result, \%oid) }; + + my %device_type + = ( + 1 => 'noconnect', + 2 => 'network', + 3 => 'fibrechannel', + 4 => 'sas', + 5 => 'inifiband', + 6 => 'pciexpress', + ); + + IOM: + foreach my $out (@output) { + $index = $out->{cpqRackNetConnectorIndex}; + $present = $out->{cpqRackNetConnectorPresent}; + $part = $out->{cpqRackNetConnectorPartNumber}; + $model = $out->{cpqRackNetConnectorModel}; + $location = $out->{cpqRackNetConnectorLocation}; + $devtype = $out->{cpqRackNetConnectorDeviceType}; + + next IOM if $present_map{$present} ne 'present'; + ++$count_ioms; + + # report IOM + report( (sprintf q{I/O module %d is type %s: %s}, + $index, $device_type{$devtype}, $model), + $E_OK, $part, $spare, $serial ); + } + + return; +} + + +# Default plugin output +sub output_default { + my $c = 0; # counter to determine linebreaks + + # Run through each message, sorted by severity level + ALERT: + foreach (sort {$a->[1] < $b->[1]} @reports) { + my ($msg, $level, $part, $spare, $serial) = @{ $_ }; + next ALERT if $level == $E_OK; + + # Prefix with service tag if specified with option '-i|--info' + if ($opt{info}) { + $msg = "[$sysinfo{serial}] " . $msg; + } + + # Prefix with nagios level if specified with option '--state' + $msg = $reverse_exitcode{$level} . ": $msg" if $opt{state}; + + # Prefix with one-letter nagios level if specified with option '--short-state' + $msg = (substr $reverse_exitcode{$level}, 0, 1) . ": $msg" if $opt{shortstate}; + + if ($opt{verbose} and $msg !~ m/overall health condition/) { + $msg .= sprintf q{ [part: %s, spare: %s, sn: %s]}, + $part eq q{} ? 'n/a' : $part, + $spare eq q{} ? 'n/a' : $spare, + $serial eq q{} ? 'n/a' : $serial; + } + + ($c++ == 0) ? print $msg : print $linebreak, $msg; + + $nagios_alert_count{$reverse_exitcode{$level}}++; + } + + return; +} + +# Debug plugin output +sub output_debug { + print " System: $sysinfo{model}\n"; + print " ServiceTag: $sysinfo{serial}\n"; + print " Firmware: $sysinfo{firmware}"; + print q{ } x (25 - length "$sysinfo{firmware}"), "Plugin version: $VERSION\n"; + if ($#reports >= 0) { + print "-----------------------------------------------------------------------------\n"; + print " System Component Status \n"; + print "=============================================================================\n"; + print " STATE | PART NO. | MESSAGE TEXT \n"; + print "---------+----------------+--------------------------------------------------\n"; + foreach (@reports) { + my ($msg, $level, $part, $spare, $serial) = @{$_}; + print q{ } x (8 - length $reverse_exitcode{$level}) . "$reverse_exitcode{$level} | " + . q{ } x (14 - length $part) . "$part | $msg\n"; + $nagios_alert_count{$reverse_exitcode{$level}}++; + } + } + + # Print system power readings + print "-----------------------------------------------------------------------------\n"; + print " System Power Readings \n"; + print "=============================================================================\n"; + print " Total power consumption: $total_wattage W\n"; + + return; +} + +# Performance data output +sub output_perfdata { + my $lb = $opt{perfdata} eq 'multiline' ? "\n" : q{ }; # line break for perfdata + print q{|}; + print join $lb, @perfdata; + return; +} + + +#===================================================================== +# Main program +#===================================================================== + +# Probe the blade chassis via SNMP +get_enclosure_status(); + +# Only check managers if global health is not Ok, or debug +if ($global ne 'Ok' or $opt{debug}) { + check_managers(); +} + +# Always these +check_fans(); +check_blades(); +check_iom(); +check_psu(); + +# Print output +if ($opt{debug}) { + output_debug(); +} +else { + output_default(); +} + +# Determine our exit code +$exit_code = $E_OK; +if ($nagios_alert_count{UNKNOWN} > 0) { $exit_code = $E_UNKNOWN; } +if ($nagios_alert_count{WARNING} > 0) { $exit_code = $E_WARNING; } +if ($nagios_alert_count{CRITICAL} > 0) { $exit_code = $E_CRITICAL; } + +# Print any perl warnings that have occured +if (@perl_warnings) { + foreach (@perl_warnings) { + chop @$_; + print "${linebreak}INTERNAL ERROR: @$_"; + } + $exit_code = $E_UNKNOWN; +} + +# Reset the WARN signal +$SIG{__WARN__} = $original_sigwarn; + +# OK message +if ($exit_code == $E_OK && !$opt{debug}) { + printf q{OK - System: '%s', SN: '%s', Firmware: '%s', hardware working fine, %d blades, %d i/o modules}, + $sysinfo{model}, $sysinfo{serial}, $sysinfo{firmware}, $count_blades, $count_ioms; +} + +# Extended info output +if ($opt{extinfo} && !$opt{debug} && $exit_code != $E_OK) { + print $linebreak; + printf '------ SYSTEM: %s, SN: %s, FW: %s', + $sysinfo{model}, $sysinfo{serial}, $sysinfo{firmware}; +} + +# Print performance data +if (defined $opt{perfdata} && !$opt{debug} && @perfdata) { + output_perfdata(); +} + +print "\n" if !$opt{debug}; + +# Exit with proper exit code +exit $exit_code; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.8 b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.8 new file mode 100644 index 0000000..2c872cb --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.8 @@ -0,0 +1,325 @@ +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to +.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' +.\" expand to `' in nroff, nothing in troff, for use with C<>. +.tr \(*W-|\(bv\*(Tr +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.hy 0 +.if n .na +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "CHECK_HP_BLADECHASSIS 8" +.TH CHECK_HP_BLADECHASSIS 8 "2009-08-20" "check_hp_bladechassis 1.0.1" "Nagios plugin" +.SH "NAME" +check_hp_bladechassis \- Nagios plugin for checking the status of HP +blade enclosures via SNMP +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +check_hp_bladechassis \-H <\fI\s-1HOSTNAME\s0\fR> [\fI\s-1OPTION\s0\fR]... +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +check_hp_bladechassis is a plugin for the Nagios monitoring software +that checks the hardware health status of a \s-1HP\s0 blade +enclosure/chassis. The plugin is only tested with the c7000 enclosure. +.SH "COMMON OPTIONS" +.IX Header "COMMON OPTIONS" +.IP "\-H, \-\-hostname \fI\s-1HOSTNAME\s0\fR" 4 +.IX Item "-H, --hostname HOSTNAME" +The transport address (hostname or \s-1IP\s0) of the blade enclosure you want +to monitor. This option is mandatory. +.IP "\-C, \-\-community \fI\s-1COMMUNITY\s0\fR" 4 +.IX Item "-C, --community COMMUNITY" +This option expects a string that is to be used as the \s-1SNMP\s0 community +name when using \s-1SNMP\s0 version 1 or 2c. By default the community name +is set to \f(CW\*(C`public\*(C'\fR if the option is not present. +.IP "\-p, \-\-perfdata" 4 +.IX Item "-p, --perfdata" +Collect performance data. Performance data collected is total +power usage. +.IP "\-t, \-\-timeout \fI\s-1SECONDS\s0\fR" 4 +.IX Item "-t, --timeout SECONDS" +The number of seconds after which the plugin will abort. Default +timeout is 30 seconds if the option is not present. +.IP "\-i, \-\-info" 4 +.IX Item "-i, --info" +Prefix any alerts with the enclosure serial number. +.IP "\-v, \-\-verbose" 4 +.IX Item "-v, --verbose" +In case of an alert, the part number, spare part number and serial +number of the failed component is appended to the alert message. +.IP "\-e, \-\-extinfo" 4 +.IX Item "-e, --extinfo" +Display a short summary of system information (product, serial number, +firmware and the number of blades and I/O modules) in case of an +alert. +.IP "\-s, \-\-state" 4 +.IX Item "-s, --state" +Prefix each alert with its corresponding service state (i.e. warning, +critical etc.). This is useful in case of several alerts from the same +monitored system. +.IP "\-\-short\-state" 4 +.IX Item "--short-state" +Same as the \fB\-\-state\fR option above, except that the state is +abbreviated to a single letter (W=warning, C=critical etc.). +.IP "\-d, \-\-debug" 4 +.IX Item "-d, --debug" +Debug output. Will report status on all monitored subsystems, +regardless of their alert state. Will also report total power usage. +.IP "\-h, \-\-help" 4 +.IX Item "-h, --help" +Display help text. +.IP "\-V, \-\-version" 4 +.IX Item "-V, --version" +Display version info. +.SH "ADVANCED OPTIONS" +.IX Header "ADVANCED OPTIONS" +.IP "\-P, \-\-protocol \fI\s-1PROTOCOL\s0\fR" 4 +.IX Item "-P, --protocol PROTOCOL" +\&\s-1SNMP\s0 protocol version. This option is optional and expects a digit +(i.e. \f(CW1\fR, \f(CW2\fR or \f(CW3\fR) to define the \s-1SNMP\s0 version. The default is +\&\f(CW2\fR, i.e. \s-1SNMP\s0 version 2c. +.IP "\-\-port \fI\s-1PORT\s0\fR" 4 +.IX Item "--port PORT" +\&\s-1SNMP\s0 port of the remote (monitored) system. Defaults to the well-known +\&\s-1SNMP\s0 port 161. +.IP "\-U, \-\-username \fI\s-1SECURITYNAME\s0\fR" 4 +.IX Item "-U, --username SECURITYNAME" +[SNMPv3] The User-based Security Model (\s-1USM\s0) used by SNMPv3 requires +that a securityName be specified. This option is required when using +\&\s-1SNMP\s0 version 3, and expects a string 1 to 32 octets in lenght. +.IP "\-\-authpassword \fI\s-1PASSWORD\s0\fR, \-\-authkey \fI\s-1KEY\s0\fR" 4 +.IX Item "--authpassword PASSWORD, --authkey KEY" +[SNMPv3] By default a securityLevel of \f(CW\*(C`noAuthNoPriv\*(C'\fR is assumed. If +the \-\-authpassword option is specified, the securityLevel becomes +\&\f(CW\*(C`authNoPriv\*(C'\fR. The \-\-authpassword option expects a string which is at +least 1 octet in length as argument. +.Sp +Optionally, instead of the \-\-authpassword option, the \-\-authkey option +can be used so that a plain text password does not have to be +specified in a script. The \-\-authkey option expects a hexadecimal +string produced by localizing the password with the +authoritativeEngineID for the specific destination device. The +\&\f(CW\*(C`snmpkey\*(C'\fR utility included with the Net::SNMP distribution can be +used to create the hexadecimal string (see snmpkey). +.IP "\-\-authprotocol \fI\s-1ALGORITHM\s0\fR" 4 +.IX Item "--authprotocol ALGORITHM" +[SNMPv3] Two different hash algorithms are defined by SNMPv3 which can +be used by the Security Model for authentication. These algorithms are +\&\s-1HMAC\-MD5\-96\s0 \f(CW\*(C`MD5\*(C'\fR (\s-1RFC\s0 1321) and \s-1HMAC\-SHA\-96\s0 \f(CW\*(C`SHA\-1\*(C'\fR (\s-1NIST\s0 \s-1FIPS\s0 \s-1PUB\s0 +180\-1). The default algorithm used by the plugin is \s-1HMAC\-MD5\-96\s0. This +behavior can be changed by using this option. The option expects +either the string \f(CW\*(C`md5\*(C'\fR or \f(CW\*(C`sha\*(C'\fR to be passed as argument to modify +the hash algorithm. +.IP "\-\-privpassword \fI\s-1PASSWORD\s0\fR, \-\-privkey \fI\s-1KEY\s0\fR" 4 +.IX Item "--privpassword PASSWORD, --privkey KEY" +[SNMPv3] By specifying the options \-\-privkey or \-\-privpassword, the +securityLevel associated with the object becomes +\&\f(CW\*(C`authPriv\*(C'\fR. According to SNMPv3, privacy requires the use of +authentication. Therefore, if either of these two options are present +and the \-\-authkey or \-\-authpassword arguments are missing, the +creation of the object fails. The \-\-privkey and \-\-privpassword +options expect the same input as the \-\-authkey and \-\-authpassword +options respectively. +.IP "\-\-privprotocol \fI\s-1ALGORITHM\s0\fR" 4 +.IX Item "--privprotocol ALGORITHM" +[SNMPv3] The User-based Security Model described in \s-1RFC\s0 3414 defines a +single encryption protocol to be used for privacy. This protocol, +CBC-DES \f(CW\*(C`DES\*(C'\fR (\s-1NIST\s0 \s-1FIPS\s0 \s-1PUB\s0 46\-1), is used by default or if the +string \f(CW\*(C`des\*(C'\fR is passed to the \-\-privprotocol option. The Net::SNMP +module also supports \s-1RFC\s0 3826 which describes the use of +\&\s-1CFB128\-AES\-128\s0 \f(CW\*(C`AES\*(C'\fR (\s-1NIST\s0 \s-1FIPS\s0 \s-1PUB\s0 197) in the \s-1USM\s0. The \s-1AES\s0 +encryption protocol can be selected by passing \f(CW\*(C`aes\*(C'\fR or \f(CW\*(C`aes128\*(C'\fR to +the \-\-privprotocol option. +.Sp +One of the following arguments are required: des, aes, aes128, 3des, +3desde +.IP "\-\-linebreak=\fI\s-1STRING\s0\fR" 4 +.IX Item "--linebreak=STRING" +check_hp_bladechassis will sometimes report more than one line, +e.g. if there are several alerts. If the script has a \s-1TTY\s0, it will use +regular linebreaks. If not (which is the case with \s-1NRPE\s0) it will use +\&\s-1HTML\s0 linebreaks. Sometimes it can be useful to control what the plugin +uses as a line separator, and this option provides that control. +.Sp +The argument is the exact string to be used as the line +separator. There are two exceptions, i.e. two keywords that translates +to the following: +.RS 4 +.IP "\fB\s-1REG\s0\fR" 4 +.IX Item "REG" +Regular linebreaks, i.e. \*(L"\en\*(R". +.IP "\fB\s-1HTML\s0\fR" 4 +.IX Item "HTML" +\&\s-1HTML\s0 linebreaks, i.e. \*(L"
\*(R". +.RE +.RS 4 +.Sp +This is a rather special option that is normally not needed. The +default behaviour should be sufficient for most users. +.SH "DIAGNOSTICS" +.IX Header "DIAGNOSTICS" +The option \f(CW\*(C`\-\-debug\*(C'\fR (or \f(CW\*(C`\-d\*(C'\fR) can be specified to display status +of all components. +.SH "DEPENDENCIES" +.IX Header "DEPENDENCIES" +The perl module Net::SNMP is required on the Nagios host. +.SH "EXIT STATUS" +.IX Header "EXIT STATUS" +If no errors are discovered, a value of 0 (\s-1OK\s0) is returned. An exit +value of 1 (\s-1WARNING\s0) signifies one or more non-critical errors, while +2 (\s-1CRITICAL\s0) signifies one or more critical errors. +.Sp +The exit value 3 (\s-1UNKNOWN\s0) is reserved for errors within the script, +or errors getting values via \s-1SNMP\s0. +.SH "AUTHOR" +.IX Header "AUTHOR" +Written by Trond H. Amundsen +.SH "BUGS AND LIMITATIONS" +.IX Header "BUGS AND LIMITATIONS" +None known at present. +.SH "INCOMPATIBILITIES" +.IX Header "INCOMPATIBILITIES" +None known at present. +.Sp +Note that as of this writing, the plugin is only tested against the +c7000 enclosure. +.SH "REPORTING BUGS" +.IX Header "REPORTING BUGS" +Report bugs to +.SH "LICENSE AND COPYRIGHT" +.IX Header "LICENSE AND COPYRIGHT" +This program is free software: you can redistribute it and/or modify +it under the terms of the \s-1GNU\s0 General Public License as published by +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. +.Sp +This program is distributed in the hope that it will be useful, but +\&\s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of +\&\s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. See the \s-1GNU\s0 +General Public License for more details. +.Sp +You should have received a copy of the \s-1GNU\s0 General Public License +along with this program. If not, see . +.SH "SEE ALSO" +.IX Header "SEE ALSO" + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.php b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.php new file mode 100644 index 0000000..b3525fc --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.php @@ -0,0 +1,42 @@ + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.pod b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.pod new file mode 100644 index 0000000..ada33e1 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/check_hp_bladechassis/check_hp_bladechassis-1.0.1/check_hp_bladechassis.pod @@ -0,0 +1,245 @@ +# Man page for check_hp_bladechassis + +# Man page created with: +# +# pod2man -s 3pm -r "`./check_hp_bladechassis -V | head -n 1`" -c 'Nagios plugin' check_hp_bladechassis.pod check_hp_bladechassis.3pm +# + + +=head1 NAME + +check_hp_bladechassis - Nagios plugin for checking the status of HP +blade enclosures via SNMP + +=head1 SYNOPSIS + +check_hp_bladechassis -H > [I