Graphing on a custom up/down check

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jenstar13
Posts: 174
Joined: Wed May 11, 2016 7:48 am

Graphing on a custom up/down check

Post by jenstar13 »

Hi
Is there a graphing for dummies document
I've searched the forum, and I only found this
https://nagios-plugins.org/doc/guidelines.html#AEN78

That doesn't help me understand

I have a custom check that exits with an 1 on up and a 2 on down, and my manager wants it to graph that to give to customers
but how to do it, is not getting through to me.
are there examples in other checks, I could look at to see how it's accomplished?

thank you for any help
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Graphing on a custom up/down check

Post by tmcdonald »

Can you post the plugin code here? We can't do custom development without getting Sales involved, but we can point out where and how to add performance data for graphing.
Former Nagios employee
jenstar13
Posts: 174
Joined: Wed May 11, 2016 7:48 am

Re: Graphing on a custom up/down check

Post by jenstar13 »

I went looking at the checks in libexec that were .sh, and I found some code to copy,
it's not what I was hoping for up or critical, but it gives me a graph that I can send to people who don't understand when the instance go down

at the top of the script
STATE_OK=2
STATE_CRITICAL=0

then we do a curl using a soap xml and looking for the word approved in the curl result
if it's found, that gives us a 1
so the exit code is

if [ $status -eq 1 ]; then
echo "OK - Instance is Responding Correctly |Connection=$STATE_OK"
exit 0
else
echo "CRITICAL - Instance is not responding correctly |Connection=$STATE_CRITICAL"
exit 2
fi

this give a constant line at 2 and when the instance is down, it drops to 0, and that graph is something end-users can understand
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Graphing on a custom up/down check

Post by tgriep »

OK, let us know if you need any more help on this.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jenstar13
Posts: 174
Joined: Wed May 11, 2016 7:48 am

Re: Graphing on a custom up/down check

Post by jenstar13 »

if you have a graphing for dummies, i would really like it, that one little section just doesn't cut it.
thank you
Jen
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Graphing on a custom up/down check

Post by tgriep »

There is not much else to it. As long as the performance data output follows the format, the system will graph it for you.
Is there anything specific you need?
Be sure to check out our Knowledgebase for helpful articles and solutions!
jenstar13
Posts: 174
Joined: Wed May 11, 2016 7:48 am

Re: Graphing on a custom up/down check

Post by jenstar13 »

an example of doing connect and critical that is better than what I came up with above
The above doesn't show critical on the chart
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Graphing on a custom up/down check

Post by tgriep »

You are asking to have the Warning and Critical lines on the graph, correct?
If so, for example, you would have to change this line from

Code: Select all

echo "OK - Instance is Responding Correctly |Connection=$STATE_OK"
to

Code: Select all

echo "OK - Instance is Responding Correctly |Connection=$STATE_OK";<Warning>;<Critical>;;
You would have to replace <Warning> and <Critical> in the above command with the Warning and Critical threshold options that you pass to the script.

That way, the performance data will output the thresholds and then you can display them on the graph.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jenstar13
Posts: 174
Joined: Wed May 11, 2016 7:48 am

Re: Graphing on a custom up/down check

Post by jenstar13 »

ok, thank you very much
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Graphing on a custom up/down check

Post by tgriep »

Your welcome. Let us know if it is OK to close the post and lock it up.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked