Graph data

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
eddiez
Posts: 72
Joined: Tue Dec 11, 2012 10:38 am

Graph data

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Graph data

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
eddiez
Posts: 72
Joined: Tue Dec 11, 2012 10:38 am

Re: Graph data

Post by eddiez »

Here is what the output looks like:

OK: Max connections= 13
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Graph data

Post 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
Former Nagios Employee
Locked