summaryrefslogtreecommitdiffstats
path: root/travis-test-1
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:20:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:20:09 +0000
commit018433a6da60c6395baaaa0833d5c50ac6645552 (patch)
tree2012deeff2f98b267c0c10425c1d4a054190b73f /travis-test-1
parentInitial commit. (diff)
downloadnagios-nrpe-018433a6da60c6395baaaa0833d5c50ac6645552.tar.xz
nagios-nrpe-018433a6da60c6395baaaa0833d5c50ac6645552.zip
Adding upstream version 3.2.1.upstream/3.2.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'travis-test-1')
-rwxr-xr-xtravis-test-134
1 files changed, 34 insertions, 0 deletions
diff --git a/travis-test-1 b/travis-test-1
new file mode 100755
index 0000000..fca5d95
--- /dev/null
+++ b/travis-test-1
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# Integration test for nrpe/check_nrpe
+# Should be run only on machines which do NOT have Nagios installed
+# and which do not have an enabled firewall.
+cd sample-config
+echo >> nrpe.cfg # Hopefully this is a newline! I think nrpe.cfg ends in a newling anyways.
+echo 'command[check_test]=/tmp/check_yes.sh' >> nrpe.cfg
+
+# Make sure the directory exists such that nrpe can create the nrpe.pid file in the default location
+mkdir /usr/ || true
+mkdir /usr/local || true
+mkdir /usr/local/nagios || true
+mkdir /usr/local/nagios/var || true
+
+# Make sure nagios user exists
+useradd nagios
+
+# Make a plugin
+touch /tmp/check_yes.sh
+echo 'echo OK' >> /tmp/check_yes.sh
+
+# Give nagios control of plugins
+chown nagios /tmp/check_yes.sh
+chmod +x /tmp/check_yes.sh
+
+# Start running the NRPE daemon to accept commands
+cd ../src
+./nrpe -c ../sample-config/nrpe.cfg -d
+
+# Try to check_nrpe with our check_test command/check_yes.sh plugin
+./check_nrpe -H 127.0.0.1 -c check_test
+
+exit 0