Perfomance Data via NDO?

Mike Koponick mkoponick at redhawk.info
Wed May 10 17:33:48 CEST 2006


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-----
From: Morris, Patrick [mailto:patrick.morris at hp.com] 
Sent: Wednesday, May 03, 2006 9:01 AM
To: Mike Koponick; nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] Perfomance Data via NDO?

 

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: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Mike
Koponick
Sent: Tuesday, May 02, 2006 2:50 PM
To: nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] Perfomance Data via NDO?

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-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Mike
Koponick
Sent: Tuesday, May 02, 2006 10:41 AM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Perfomance Data via NDO?

 

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,

Mike

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20060510/98b7eeb0/attachment.html>


More information about the Users mailing list