summaryrefslogtreecommitdiffstats
path: root/roles/nagios_client/files/scripts/check_testcloud
blob: eb8c7aab3be35a3e288626bf8c2563f5f7d87d54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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