File: travis-test-1

package info (click to toggle)
nagios-nrpe 3.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,480 kB
  • sloc: ansic: 5,777; sh: 4,164; makefile: 248; perl: 59
file content (34 lines) | stat: -rwxr-xr-x 981 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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