diff --git a/roles/nagios_server/files/nagios/services/disk.cfg b/roles/nagios_server/files/nagios/services/disk.cfg index 04ae68909f..dd827d848e 100644 --- a/roles/nagios_server/files/nagios/services/disk.cfg +++ b/roles/nagios_server/files/nagios/services/disk.cfg @@ -27,6 +27,13 @@ define service { use disktemplate } +define service { + host_name qa11.qa + service_description Disk Space /srv/diskimages + check_command check_by_nrpe!check_disk_/srv/diskimages + use disktemplate +} + #define service { # host_name hosted04 # service_description Disk Space /srv diff --git a/roles/nagios_server/files/nagios/services/testcloud.cfg b/roles/nagios_server/files/nagios/services/testcloud.cfg new file mode 100644 index 0000000000..276a18b6c3 --- /dev/null +++ b/roles/nagios_server/files/nagios/services/testcloud.cfg @@ -0,0 +1,8 @@ +define service { + host_name qa11.qa + service_description Check Testcloud + check_command check_testcloud + max_check_attempts 5 + use criticaltemplate +} + diff --git a/roles/nagios_server/files/nrpe.cfg b/roles/nagios_server/files/nrpe.cfg index 5bd1cad836..3c2f40bde3 100644 --- a/roles/nagios_server/files/nrpe.cfg +++ b/roles/nagios_server/files/nrpe.cfg @@ -201,6 +201,7 @@ command[check_disk_/boot]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p command[check_disk_/git]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /git command[check_disk_/postgreslogs]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /postgreslogs command[check_disk_/srv]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /srv +command[check_disk_/srv/diskimages]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /srv/diskimages command[check_disk_/var/lib64/mock]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /var/lib/mock command[check_disk_/var/log]=/usr/lib64/nagios/plugins/check_disk -w 15% -c 10% -p /var/log command[check_disk_/srv/cache/lookaside]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /srv/cache/lookaside diff --git a/roles/nagios_server/files/plugins/check_testcloud b/roles/nagios_server/files/plugins/check_testcloud new file mode 100644 index 0000000000..f17b397016 --- /dev/null +++ b/roles/nagios_server/files/plugins/check_testcloud @@ -0,0 +1,19 @@ +#!/bin/bash + +RUNNING_VMS=`testcloud instance list | grep -i 'running' | wc -l` +$CRITICAL=10 +$WARNING=4 + + +if [ $RUNNING_VMS -gt $CRITICAL ] +then + echo "Testcloud: CRITICAL Number of VMs running: $running_vms" + exit 2 +elif [ $RUNNING_VMS -gt $WARNING ] +then + echo "Testcloud: WARNING Number of VMs running: $running_vms" + exit 1 +else + echo "Testcloud: OK Number of VMs running: $running_vms" + exit 0 +fi diff --git a/roles/nagios_server/templates/nagios-external/checkcommands.cfg b/roles/nagios_server/templates/nagios-external/checkcommands.cfg index a01ebe4465..f553db5057 100644 --- a/roles/nagios_server/templates/nagios-external/checkcommands.cfg +++ b/roles/nagios_server/templates/nagios-external/checkcommands.cfg @@ -52,6 +52,12 @@ define command{ command_line $USER1$/check_koji } +# 'check_testcloud' +define command{ + command_name check_testcloud + command_line $USER1$/check_testcloud +} + # 'check by nrpe' define command{ command_name check_by_nrpe diff --git a/roles/nagios_server/templates/nagios/checkcommands.cfg b/roles/nagios_server/templates/nagios/checkcommands.cfg index 63fdafcb88..29bc65b955 100644 --- a/roles/nagios_server/templates/nagios/checkcommands.cfg +++ b/roles/nagios_server/templates/nagios/checkcommands.cfg @@ -67,6 +67,12 @@ define command{ command_line $USER1$/check_koji } +# 'check_testcloud' +define command{ + command_name check_testcloud + command_line $USER1$/check_testcloud +} + # 'test nrpe' define command{ command_name test_nrpe