i have created simple script that uses nmap to collect data from host.
here is the script:
#!/bin/bash
# Return codes:
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
while test $# -ne 0; do
case "$1" in
-H)
shift
HOST_TO_SCAN=$1
shift
;;
-t)
shift
HOST_TIMEOUT=$1
shift
;;
esac
done
NMAP_RESULT=`nmap --script /myscript.nse -sU -p 56000 $HOST_TO_SCAN | grep -i "host is up"`
if [ ! -z "$NMAP_RESULT" ]
then
echo "OK: $HOST_TO_SCAN - $NMAP_RESULT|"
exitstatus=$STATE_OK
exit $exitstatus
else
echo "CRITICAL: $HOST_TO_SCAN - $NMAP_RESULT"
exitstatus=$STATE_CRITICAL
exit $exitstatus
fi
When i run this script in shell, my output is:
OK: 10.10.10.1 - Host is up (0.024s latency).
but in Centreon web GUI when i check Resource Status for that host, Information column shows only:
OK: 10.10.10.1 -
How can i have "Host is up (0.024s latency)." visible in Information column?
Thank you