Add nsca-ng test

resolves #5392
This commit is contained in:
Johannes Meyer 2013-12-20 15:32:45 +01:00
parent 3e5af43e4d
commit 1022adf172
2 changed files with 31 additions and 1 deletions

View File

@ -117,6 +117,7 @@ authorize "*" {
#
hosts = ".*"
services = ".*"
commands = ".*"
}
#
@ -124,4 +125,4 @@ authorize "*" {
# "*.conf" files within this directory and all subdirectories are included.
#
# include(nsca-ng.d/included.cfg)
#
#

29
test/jenkins/nsca-ng.test Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
pid_before_restart=`ps -U icinga | grep icinga2 | awk '{print $1}'`
echo 'RESTART_PROCESS' | sudo send_nsca -C
sleep 3
pid_after_restart=`ps -U icinga | grep icinga2 | awk '{print $1}'`
if [ $pid_after_restart -eq $pid_before_restart ]; then
echo "Failed to send 'RESTART_PROCESS' to icinga2"
exit 1
else
echo "Successfully sent 'RESTART_PROCESS' to icinga2"
fi
printf "localhost\t0\tA passive result returning OK\n" | sudo send_nsca
if [ $? -gt 0 ]; then
echo "Failed to send passive check result for host 'localhost'"
exit 1
else
echo "Successfully sent a passive check result for host 'localhost'"
fi
printf "localhost\tdisk\t2\tA passive result not returning OK\n" | sudo send_nsca
if [ $? -gt 0 ]; then
echo "Failed to send passive check result for service 'disk' on host 'localhost'"
exit 1
else
echo "Successfully sent a passive check result for service 'disk' on host 'localhost'"
fi