I'm having some strange issues where icinga (1.8.1) is saying that it can't
find the host when external commands come in.
I ran NSCA manually a 4 times and 2 times it failed, any ideas?
[root@logan scripts]# ./submit_nsca_service BELL-mycourses2 "DNS - kona" 0
"test 1 2 3"
1 data packet(s) sent to host successfully.
[1352307345] EXTERNAL COMMAND:
PROCESS_SERVICE_CHECK_RESULT;BELL-mycourses2;DNS - kona;-1;test 1 2 3
[1352307347] PASSIVE SERVICE CHECK: BELL-mycourses2;DNS - kona;3;test 1 2 3
[1352307347] SERVICE ALERT: BELL-mycourses2;DNS - kona;UNKNOWN;SOFT;1;test
1 2 3
[root@logan scripts]# ./submit_nsca_service BELL-mycourses2 "DNS - kona" 0
"test 1 2 3"
1 data packet(s) sent to host successfully.
[1352307351] EXTERNAL COMMAND:
PROCESS_SERVICE_CHECK_RESULT;BELL-mycourses2;DNS - kona;-1;test 1 2 3
[1352307351] Warning: Passive check result was received for service 'DNS -
kona' on host 'BELL-mycourses2', but the host could not be found!
[root@logan scripts]# ./submit_nsca_service BELL-mycourses2 "DNS - kona" 0
"test 1 2 3"
1 data packet(s) sent to host successfully.
[1352307358] EXTERNAL COMMAND:
PROCESS_SERVICE_CHECK_RESULT;BELL-mycourses2;DNS - kona;-1;test 1 2 3
[1352307358] Warning: Passive check result was received for service 'DNS -
kona' on host 'BELL-mycourses2', but the host could not be found!
[root@logan scripts]# ./submit_nsca_service BELL-mycourses2 "DNS - kona" 0
"test 1 2 3"
1 data packet(s) sent to host successfully.
[1352307362] EXTERNAL COMMAND:
PROCESS_SERVICE_CHECK_RESULT;BELL-mycourses2;DNS - kona;-1;test 1 2 3
[1352307363] PASSIVE SERVICE CHECK: BELL-mycourses2;DNS - kona;3;test 1 2 3
[1352307363] SERVICE ALERT: BELL-mycourses2;DNS - kona;UNKNOWN;HARD;2;test
1 2 3
This is my script I'm using for submit_nsca_service, modified the original
/usr/lib64/icinga/eventhandlers/submit_check_result, I read somewhere that
some people suggest using bash instead of sh for this script so I tired that
[root@logan scripts]# more submit_nsca_service
#!/bin/bash
# Arguments:
# $1 = host_name (Short name of host that the service is
# associated with)
# $2 = svc_description (Description of the service)
# $3 = state_string (A string representing the status of
# the given service - "OK", "WARNING", "CRITICAL"
# or "UNKNOWN")
# $4 = plugin_output (A text string that should be used
# as the plugin output for the service checks)
#
# Convert the state string to the corresponding return code
return_code=-1
case "$3" in
OK)
return_code=0
;;
WARNING)
return_code=1
;;
CRITICAL)
return_code=2
;;
UNKNOWN)
return_code=-1
;;
esac
# pipe the service check info into the send_nsca program, which
# in turn transmits the data to the nsca daemon on the central
# monitoring server
# Remove any tabs from output
output=`echo -e "$4" | tr "\t" " "`
/usr/bin/printf "%s\t%s\t%s\t%s\n" "$1" "$2" "$return_code" "$output" |
/usr/sbin/send_nsca -H 192.168.0.100 -c /etc/icinga/send_nsca.cfg
------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
icinga-users mailing list
icinga-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/icinga-users