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/test_check_varnish | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) 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/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