nagios check_testcloud: add client-side definition
This commit is contained in:
parent
3c7653a350
commit
6947b5d382
3 changed files with 22 additions and 0 deletions
19
roles/nagios_client/files/scripts/check_testcloud
Normal file
19
roles/nagios_client/files/scripts/check_testcloud
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
RUNNING_VMS=`testcloud instance list | grep -i 'running' | wc -l`
|
||||
CRITICAL=20
|
||||
WARNING=15
|
||||
|
||||
|
||||
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
|
|
@ -54,6 +54,7 @@
|
|||
- check_memcache_connect
|
||||
- check_readonly_fs
|
||||
- check_lock_file_age
|
||||
- check_testcloud
|
||||
when: not inventory_hostname.startswith('noc')
|
||||
tags:
|
||||
- nagios_client
|
||||
|
@ -121,6 +122,7 @@
|
|||
- check_koschei_resolver_proc.cfg
|
||||
- check_koschei_scheduler_proc.cfg
|
||||
- check_koschei_watcher_proc.cfg
|
||||
- check_testcloud.cfg
|
||||
notify:
|
||||
- restart nrpe
|
||||
tags:
|
||||
|
|
1
roles/nagios_client/templates/check_testcloud.cfg.j2
Normal file
1
roles/nagios_client/templates/check_testcloud.cfg.j2
Normal file
|
@ -0,0 +1 @@
|
|||
command[check_testcloud]={{ libdir }}/nagios/plugins/check_testcloud
|
Loading…
Add table
Add a link
Reference in a new issue