define service{
use array-service ; Inherit values from a template
service_description check unity Status
host_name unity5400 ; hostname the service is associated with
check_command check_unity_status!xxx!ppp!/env/ps
normal_check_interval 10 ; Check the service every 60 minutes under normal conditions
}
Hi,
I have updated the .cfg file, but still no output from nagios. However from command is working fine
define service{
use array-service ; Inherit values from a template
service_description check unity Status
host_name unity500 ; hostname the service is associated with
check_command check_unity_status!Monitor!'pppp%ppp'!/env/ps
normal_check_interval 10 ; Check the service every 60 minutes under normal conditions
}
#/opt/nagios/etc # sudo su nagios -c '/opt/nagios/libexec/check_unity.sh unity500 Monitor 'pppp%ppp'' /env/ps'
OK - no faults detected
Note : it is necessary to restart nagios service for this change ?
Last edited by raja2206 on Wed Jun 13, 2018 9:22 pm, edited 2 times in total.
raja2206 wrote:
Note : it is necessary to restart nagios service for this change ?
Yes, but you should be making the change in Configure -> CCM and then Apply Configuration not directly in the .cfg as this will get overwritten by the CCM the next time you Apply Configuration.
define service{
use array-service ; Inherit values from a template
service_description check unity Status
host_name unity500 ; hostname the service is associated with
check_command check_unity_status!Monitor!'pppp%ppp'!/env/ps
normal_check_interval 10 ; Check the service every 60 minutes under normal conditions
}
I have updated the script with echo output :
#!/bin/bash
ucli=/usr/bin/uemcli
#ucli=/opt/emc/uemcli/bin/uemcli.sh
host=$1
user="$2"
password="$3"
check_path="$4"
if [ "`$ucli -d $host -user $user -password $password $check_path show -output csv | sed '1d' | cut -d"," -f5 | sed -e 's/\"//g' -e 's/\s.*//g' | sort | uniq | awk '{if (NR == 4) print}'`" == "OK" ] ; then
echo "OK - no faults detected"
exit 0
else
C="`$ucli -d $host -user $user -password $password $check_path show -output csv | sed '1d' | cut -d"," -f5 | sed -e 's/\"//g' -e 's/\s.*//g' | sort | uniq | awk '{if (NR == 4) print}'`" echo "C= $C"
# echo "UNKNOWN - Unisphere CLI returned an error, unable to perform check"
exit 1
fi
Try commenting the first echo and uncommenting the second. Note that a plugin returning nothing on STDOUT is not an error and that the return status ($?) is the significant part.
gormank wrote:Try commenting the first echo and uncommenting the second. Note that a plugin returning nothing on STDOUT is not an error and that the return status ($?) is the significant part.
Except this isn't actually returning nothing, it is returning