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 --- .../debian/tests/control | 37 ++++++++++++++++++++++ .../debian/tests/test_check_varnish | 35 ++++++++++++++++++++ 2 files changed, 72 insertions(+) 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 (limited to 'nagios-plugins-contrib-24.20190301~bpo9+1/debian/tests') diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/tests/control b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/tests/control new file mode 100644 index 0000000..1b5c612 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/tests/control @@ -0,0 +1,37 @@ +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 + +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 + +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 + +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 + +Test-Command: /usr/lib/nagios/plugins/check_etc_resolv +Depends: bind9-host | knot-host, @ + +Depends: apache2, liblocale-gettext-perl, libmonitoring-plugin-perl | libnagios-plugin-perl, liblwp-useragent-determined-perl, @ +Test-Command: /usr/lib/nagios/plugins/check_httpd_status -H localhost +Restrictions: needs-root, allow-stderr, isolation-container + +Depends: lsof, libyaml-syck-perl, @ +Test-Command: /usr/lib/nagios/plugins/check_libs + +Restrictions: needs-root +Test-Command: /usr/lib/nagios/plugins/check_libs_ng + +Depends: openssl, curl, file, @ +Test-Command: /usr/lib/nagios/plugins/check_ssl_cert -H www.debian.org + +Depends: libmonitoring-plugin-perl | libnagios-plugin-perl, @ +Test-Command: /usr/lib/nagios/plugins/check_uptime -f + +Depends: varnish, systemd, dbus, @ +Restrictions: needs-root, isolation-container +Tests: test_check_varnish + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/tests/test_check_varnish b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/tests/test_check_varnish new file mode 100755 index 0000000..cd373aa --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/tests/test_check_varnish @@ -0,0 +1,35 @@ +#!/bin/bash + +VARNISH_PORT=$(( ($RANDOM % 60000) + 1024 )) +API_PORT=$(( ($RANDOM % 60000) + 1024 )) + +systemctl stop varnish.service 2>/dev/null + +cat > /etc/systemd/system/varnish.service << __EOF__ + +[Unit] +Description=Varnish HTTP accelerator +Documentation=https://www.varnish-cache.org/docs/4.1/ man:varnishd + +[Service] +Type=simple +LimitNOFILE=131072 +LimitMEMLOCK=82000 +ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a localhost:${VARNISH_PORT} -T localhost:${API_PORT} -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,50m +ExecReload=/usr/share/varnish/reload-vcl +ProtectSystem=full +ProtectHome=true +PrivateTmp=true +PrivateDevices=true + +[Install] +WantedBy=multi-user.target + +__EOF__ + +systemctl daemon-reload 2>/dev/null +systemctl start varnish.service 2>/dev/null + +/usr/lib/nagios/plugins/check_varnish -p MAIN.pools -w 1: -c 1: +exit $? + -- cgit v1.2.3