|
Patrick,
Thanks for the tip, but I went that route before and didn’t see the performance data. When I look at the logs, I see the output, but nothing beyond the “|”
If I use the commands manually (the SNMP check command) I see the data.
When I look at the logs, I see the output, but nothing beyond the “|” .
Here is a little info:
Checkcommands.cfg:
define command { command_name submit_check_result command_line $USER1$/submit_check_result $HOSTNAME$ '$SERVICEDESC$' '$SERVICESTATE$' '$SERVICEOUTPUT$' '$SERVICEPERFDATA$' }
Submit_check_result:
#!/bin/sh
# 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=3 ;; esac
/usr/bin/printf "%s\t%s\t%s\t%s|%s\n" "$1" "$2" "$return_code" "$4" "$5" | /usr/local/nagios/libexec/send_nsca -H <Server_IP> -to 15 -c /usr/local/nagios/etc/send_nsca.cfg
Thanks in advance for your help.
Mike
-----Original Message-----
You'll need to pass the $SERVICEPERFDATA$ variable into the submission script as well. I tweaked my nsca submission command to include $SERVICEPERFDATA$ in the command configuration, then changed the prontf line in the submission script like this:
/usr/bin/printf "%s\t%s\t%s\t%s|%s\n" "$1" "$2" "$return_code" "$4" "$5" | /usr/local/nagios/libexec/send_nsca -H <HOST> -to 15 -c /usr/local/nagios/etc/send_nsca.cfg
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Mike Koponick I might be closer to answer my own question, but I think this is a “submit_check_result” issue, rather than NDO issue. Looking through the NDO source code, I see where it has the ability to write to the perfdata column. I think the problem lies within the “submit_check_results” command. It doesn’t really send the performance data, but rather drops it.
Here is my output:
./check_snmp_int -H 10.1.1.1 -C public -n -f em1:UP, em0:UP, exp0:UP:3 UP: OK | 'em1_in_octet'=381357882c 'em1_out_octet'=1161492429c 'em0_in_octet'=1464302566c 'em0_out_octet'=550763402c 'exp0_in_octet'=70379851c 'exp0_out_octet'=56255289c
I think it has to do with the single quotes and the “|” (pipe) . I by far am no programmer.
My submit_check_result is the typical one that comes with Nagios.
Here it is:
#!/bin/sh
# 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=3 ;; esac
/usr/bin/printf "%s\t%s\t%s\t%s\n" "$1" "$2" "$return_code" "$4" | /usr/local/nagios/libexec/send_nsca -H <HOST> -to 15 -c /usr/local/nagios/etc/send_nsca.cfg
Thoughts?
Mike
-----Original Message-----
Hello Everyone, For some odd reason, I have it in my head that you can write performance data into the NDO tables via a service check command. I have looked at PerfParse, but quite frankly, adding on, yet another add-on seems like more work than it should be. I’m looking for bandwidth utilization type performance, uptime, interface errors, etc. I would like to write that the perfdata column for the ndo_servicestatus table. I can use the check_snmp check for the interface errors, and write the data. But I wonder if that’s the correct direction. Am I off base here, or do I need another cup of coffee? Thanks in advance, |
Title: Perfomance Data via NDO?
