mirror of https://github.com/Icinga/icinga2.git
Let all vm-tests output filesystem paths when they work with them
This commit is contained in:
parent
9bdf2f4766
commit
f867029180
|
@ -1,10 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ -e "/var/run/icinga2/cmd/icinga2.cmd" ];
|
commandpipe_path="/var/run/icinga2/cmd/icinga2.cmd"
|
||||||
|
|
||||||
|
if [ -e $commandpipe_path ];
|
||||||
then
|
then
|
||||||
echo "[OK] Icinga2 commandpipe found"
|
echo "[OK] Icinga2 commandpipe found ($commandpipe_path)"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "[FAIL] Icinga2 commandpipe not found"
|
echo "[FAIL] Icinga2 commandpipe not found ($commandpipe_path)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1159,51 +1159,51 @@ def test_servicegroup_commands():
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
failure = test_host_comments('localhost')
|
failure = test_host_comments('localhost')
|
||||||
#failure &= test_host_comments('nsca-ng') # Cannot work without a hostcheck!
|
#failure |= test_host_comments('nsca-ng') # Cannot work without a hostcheck!
|
||||||
|
|
||||||
failure &= test_service_comments('localhost', 'disk')
|
failure |= test_service_comments('localhost', 'disk')
|
||||||
failure &= test_service_comments('nsca-ng', 'PassiveService1')
|
failure |= test_service_comments('nsca-ng', 'PassiveService1')
|
||||||
|
|
||||||
failure &= test_host_downtimes('localhost')
|
failure |= test_host_downtimes('localhost')
|
||||||
#failure &= test_host_downtimes('nsca-ng')
|
#failure |= test_host_downtimes('nsca-ng')
|
||||||
|
|
||||||
failure &= test_service_downtimes('localhost', 'disk')
|
failure |= test_service_downtimes('localhost', 'disk')
|
||||||
failure &= test_service_downtimes('nsca-ng', 'PassiveService1')
|
failure |= test_service_downtimes('nsca-ng', 'PassiveService1')
|
||||||
|
|
||||||
failure &= test_host_problem_acknowledgements('localhost')
|
failure |= test_host_problem_acknowledgements('localhost')
|
||||||
failure &= test_remove_host_acknowledgements('localhost')
|
failure |= test_remove_host_acknowledgements('localhost')
|
||||||
failure &= test_expiring_host_acknowledgements('localhost')
|
failure |= test_expiring_host_acknowledgements('localhost')
|
||||||
|
|
||||||
failure &= test_change_host_check_command('localhost', 'disk')
|
failure |= test_change_host_check_command('localhost', 'disk')
|
||||||
failure &= test_change_service_check_command('localhost', 'disk', 'ping4')
|
failure |= test_change_service_check_command('localhost', 'disk', 'ping4')
|
||||||
failure &= test_change_host_check_timeperiod('localhost', 'none')
|
failure |= test_change_host_check_timeperiod('localhost', 'none')
|
||||||
failure &= test_change_service_check_timeperiod('localhost', 'disk', 'none')
|
failure |= test_change_service_check_timeperiod('localhost', 'disk', 'none')
|
||||||
failure &= test_change_host_max_check_attempts('localhost')
|
failure |= test_change_host_max_check_attempts('localhost')
|
||||||
failure &= test_change_service_max_check_attempts('localhost', 'disk')
|
failure |= test_change_service_max_check_attempts('localhost', 'disk')
|
||||||
failure &= test_change_host_normal_check_interval('localhost')
|
failure |= test_change_host_normal_check_interval('localhost')
|
||||||
failure &= test_change_service_normal_check_interval('localhost', 'disk')
|
failure |= test_change_service_normal_check_interval('localhost', 'disk')
|
||||||
failure &= test_change_host_retry_check_interval('localhost')
|
failure |= test_change_host_retry_check_interval('localhost')
|
||||||
failure &= test_change_service_retry_check_interval('localhost', 'disk')
|
failure |= test_change_service_retry_check_interval('localhost', 'disk')
|
||||||
failure &= test_change_host_modified_attributes('localhost')
|
failure |= test_change_host_modified_attributes('localhost')
|
||||||
|
|
||||||
failure &= test_delay_service_notification('localhost', 'disk')
|
failure |= test_delay_service_notification('localhost', 'disk')
|
||||||
failure &= test_delay_host_notification('localhost')
|
failure |= test_delay_host_notification('localhost')
|
||||||
|
|
||||||
failure &= test_disabling_scheduling_host_checks('localhost')
|
failure |= test_disabling_scheduling_host_checks('localhost')
|
||||||
failure &= test_disabling_scheduling_service_checks('localhost', 'disk')
|
failure |= test_disabling_scheduling_service_checks('localhost', 'disk')
|
||||||
|
|
||||||
failure &= test_shutdown_restart_process()
|
failure |= test_shutdown_restart_process()
|
||||||
|
|
||||||
failure &= test_passive_host_checkresult_processing('localhost')
|
failure |= test_passive_host_checkresult_processing('localhost')
|
||||||
failure &= test_passive_svc_checkresult_processing('localhost', 'disk')
|
failure |= test_passive_svc_checkresult_processing('localhost', 'disk')
|
||||||
|
|
||||||
failure &= test_process_file('localhost')
|
failure |= test_process_file('localhost')
|
||||||
|
|
||||||
failure &= test_custom_host_notifications('localhost')
|
failure |= test_custom_host_notifications('localhost')
|
||||||
failure &= test_custom_svc_notifications('localhost', 'disk')
|
failure |= test_custom_svc_notifications('localhost', 'disk')
|
||||||
|
|
||||||
failure &= test_hostgroup_commands()
|
failure |= test_hostgroup_commands()
|
||||||
failure &= test_servicegroup_commands()
|
failure |= test_servicegroup_commands()
|
||||||
|
|
||||||
return 1 if failure else 0
|
return 1 if failure else 0
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ template Notification "mail-notification" {
|
||||||
NotificationFilterDowntimeRemoved),
|
NotificationFilterDowntimeRemoved),
|
||||||
|
|
||||||
notification_period = "24x7",
|
notification_period = "24x7",
|
||||||
notifications_interval = 10
|
notification_interval = 10
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ ! -e /var/run/icinga2/cmd/livestatus ];
|
livestatus_path="/var/run/icinga2/cmd/livestatus"
|
||||||
|
|
||||||
|
if [ ! -e $livestatus_path ];
|
||||||
then
|
then
|
||||||
sudo icinga2-enable-feature livestatus 1> /dev/null
|
sudo icinga2-enable-feature livestatus 1> /dev/null
|
||||||
sudo service icinga2 restart 1> /dev/null
|
sudo service icinga2 restart 1> /dev/null
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
if [ ! -e /var/run/icinga2/cmd/livestatus ];
|
if [ ! -e $livestatus_path ];
|
||||||
then
|
then
|
||||||
echo "[FAIL] Icinga2 Livestatus socket not found"
|
echo "[FAIL] Icinga2 Livestatus socket not found ($livestatus_path)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[OK] Icinga2 Livestatus socket found"
|
echo "[OK] Icinga2 Livestatus socket found ($livestatus_path)"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if sudo test -f /var/log/icinga2/icinga2.log;
|
logfile_path="/var/log/icinga2/icinga2.log"
|
||||||
|
|
||||||
|
if sudo test -f $logfile_path;
|
||||||
then
|
then
|
||||||
echo "[OK] Icinga2 log file found"
|
echo "[OK] Icinga2 log file found ($logfile_path)"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "[FAIL] Icinga2 log file not found"
|
echo "[FAIL] Icinga2 log file not found ($logfile_path)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ -f /var/run/icinga2/icinga2.pid ];
|
pidfile_path="/var/run/icinga2/icinga2.pid"
|
||||||
|
|
||||||
|
if [ -f $pidfile_path ];
|
||||||
then
|
then
|
||||||
echo "[OK] Icinga2 pidfile found"
|
echo "[OK] Icinga2 pidfile found ($pidfile_path)"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "[FAIL] Icinga2 pidfile not found"
|
echo "[FAIL] Icinga2 pidfile not found ($pidfile_path)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
if [ ! -f /var/cache/icinga2/status.dat ];
|
statusdata_path="/var/cache/icinga2/status.dat"
|
||||||
|
objectscache_path="/var/cache/icinga2/objects.cache"
|
||||||
|
|
||||||
|
if [ ! -f $statusdata_path ];
|
||||||
then
|
then
|
||||||
sudo icinga2-enable-feature statusdata 1> /dev/null
|
sudo icinga2-enable-feature statusdata 1> /dev/null
|
||||||
sudo service icinga2 restart 1> /dev/null
|
sudo service icinga2 restart 1> /dev/null
|
||||||
|
@ -10,7 +13,7 @@ then
|
||||||
do
|
do
|
||||||
sleep 15
|
sleep 15
|
||||||
|
|
||||||
if [ -f /var/cache/icinga2/status.dat ];
|
if [ -f $statusdata_path ];
|
||||||
then
|
then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
@ -20,32 +23,32 @@ then
|
||||||
|
|
||||||
if [ $n -eq 3 ];
|
if [ $n -eq 3 ];
|
||||||
then
|
then
|
||||||
echo "[FAIL] Icinga2 status.dat not found"
|
echo "[FAIL] Icinga2 status.dat not found ($statusdata_path)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[OK] Icinga2 status.dat found"
|
echo "[OK] Icinga2 status.dat found ($statusdata_path)"
|
||||||
|
|
||||||
if [ -f /var/cache/icinga2/objects.cache ];
|
if [ -f $objectscache_path ];
|
||||||
then
|
then
|
||||||
echo "[OK] Icinga2 objects.cache found"
|
echo "[OK] Icinga2 objects.cache found ($objectscache_path)"
|
||||||
else
|
else
|
||||||
echo "[FAIL] Icinga2 objects.cache not found"
|
echo "[FAIL] Icinga2 objects.cache not found ($objectscache_path)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
status_time=$(stat --format="%Y" /var/cache/icinga2/status.dat)
|
status_time=$(stat --format="%Y" $statusdata_path)
|
||||||
|
|
||||||
now=$(date +"%s")
|
now=$(date +"%s")
|
||||||
sleep $(((15 + 5) - ($now - $status_time)))
|
sleep $(((15 + 5) - ($now - $status_time)))
|
||||||
|
|
||||||
new_status_time=$(stat --format="%Y" /var/cache/icinga2/status.dat)
|
new_status_time=$(stat --format="%Y" $statusdata_path)
|
||||||
|
|
||||||
if [ $new_status_time -eq $status_time ];
|
if [ $new_status_time -eq $status_time ];
|
||||||
then
|
then
|
||||||
echo "[FAIL] Icinga2 status.dat is not being updated"
|
echo "[FAIL] Icinga2 status.dat is not being updated (Last update: $(date -r $statusdata_path '+%x %X'))"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "[OK] Icinga2 status.dat is being updated"
|
echo "[OK] Icinga2 status.dat is being updated (Last update: $(date -r $statusdata_path '+%x %X'))"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue