Page 1 of 1

Graph data

Posted: Thu Feb 11, 2016 12:12 pm
by eddiez
How can I get the following script to graph data?

root@rdbt3024 # more check_informix_maxconn_sdr.sh
#!/bin/ksh -
#
# Informix IDS
#
# Usage: check_informix_maxconn_sdr.sh
#
#
INFORMIXDIR=/usr/informix
INFORMIXSERVER=sdrsrvnet
ONCONFIG=onconfig.sdr
export INFORMIXDIR INFORMIXSERVER ONCONFIG

PROGDIR='/opt/nagios/libexec/'

$PROGDIR./check_informix_maxconn.sh -w 300 -c 400

Re: Graph data

Posted: Thu Feb 11, 2016 4:38 pm
by lmiltchev
I would recommend reviewing the "Nagios Plugin Development Guidelines":
https://nagios-plugins.org/doc/guidelines.html#AEN200

What is the output that you see when you run your check from the command line?

Re: Graph data

Posted: Fri Feb 12, 2016 1:56 pm
by eddiez
Here is what the output looks like:

OK: Max connections= 13

Re: Graph data

Posted: Fri Feb 12, 2016 2:16 pm
by rkennedy
Nagios 3 and newer will concatenate the parts following a "|" in a) the first line output by the plugin, and b) in the second to last line, into a string it passes to whatever performance data processing it has configured. (Note that it currently does not insert additional whitespace between both, so the plugin needs to provide some to prevent the last pair of a) and the first of b) getting run together.) Please refer to the Nagios documentation for information on how to configure such processing. However, it is the responsibility of the plugin writer to ensure the performance data is in a "Nagios Plugins" format. This is the expected format:

'label'=value[UOM];[warn];[crit];[min];[max]
You will want to adjust your output accordingly. As you can see this result of a check_http for example -

Code: Select all

[root@localhost libexec]# ./check_http -H google.com
HTTP OK: HTTP/1.1 301 Moved Permanently - 559 bytes in 3.156 second response time |time=3.156087s;;;0.000000 size=559B;;;0