Files
osops/tools/monitoring/nagios-plugins/nova-services.sh
Cyril Lopez 08de36aaee [fix] false positive on nova-services
Nova-services have a false positive due to index of return table contain
the word "down" for column "Forced down"

Tested on Xena

Story: 2008299
Task: 41184

Change-Id: I4ffecb21079c04ca1a7976bea06544dad271d851
Signed-off-by: Cyril Lopez <cylopez@redhat.com>
2022-01-06 14:31:11 +01:00

17 lines
334 B
Bash

#!/bin/bash
source ~/openrc
output=$(nova service-list | tail -n +3 | grep down)
if [ $? -eq 0 ]; then
echo -n "CRITICAL - OpenStack Nova services down: "
echo "${output}" | awk '{print $2,$4}' | while read LINE; do
echo -n "${LINE}; "
done
echo ""
exit 2
else
echo "OK - All nodes up"
exit 0
fi