Graphs and thresholds for custom command

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jpipitone
Posts: 102
Joined: Tue Oct 12, 2010 1:21 pm

Graphs and thresholds for custom command

Post by jpipitone »

I have a python script that checks an F5 BigIP's current total connections per second, and returns a value between 0 and 500. The syntax is as follows:

Code: Select all

check_bigip_tps.py -H 10.9.0.0 -C public -T 500
The custom nagiosxi command is as follows:

Code: Select all

$USER1$/check_bigip_tps.py -H $HOSTADDRESS$ -C $ARG1$ -T $ARG2$
Results are returned like so:

Code: Select all

Transactions Per Second is now 1 (0 of 500)
Is there a method to allow graphing after results are returned, or does the check script have to support this? Also, is there a way to set a threshold, so 200 connections is a warning, and 300 is critical?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Graphs and thresholds for custom command

Post by slansing »

Yep, you would have to build in handling for performance data, which is not all that hard. Can you attach your script here so we can take a look?

I'd take a look at this for perf data:

https://nagios-plugins.org/doc/guidelines.html#AEN200
jpipitone
Posts: 102
Joined: Tue Oct 12, 2010 1:21 pm

Re: Graphs and thresholds for custom command

Post by jpipitone »

Sure, attached it here.
You do not have the required permissions to view the files attached to this post.
jpipitone
Posts: 102
Joined: Tue Oct 12, 2010 1:21 pm

Re: Graphs and thresholds for custom command

Post by jpipitone »

How about thresholds?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Graphs and thresholds for custom command

Post by tmcdonald »

Thresholds are explained in the link as well. They are the "warn" and "crit" values:

Code: Select all

'label'=value[UOM];[warn];[crit];[min];[max]
Former Nagios employee
jpipitone
Posts: 102
Joined: Tue Oct 12, 2010 1:21 pm

Re: Graphs and thresholds for custom command

Post by jpipitone »

If the plugin doesn't allow the use of parameters for threshold values or performance graphs, are you saying that there's a way to implement them without modifying the code in the python script, or will I have to implement some logic?

I am still at a loss as far as where to start.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Graphs and thresholds for custom command

Post by scottwilkerson »

You would have to modify the script. but, I made an attempt to add the perf data for you, you can give it a whirl...
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jpipitone
Posts: 102
Joined: Tue Oct 12, 2010 1:21 pm

Re: Graphs and thresholds for custom command

Post by jpipitone »

scottwilkerson wrote:You would have to modify the script. but, I made an attempt to add the perf data for you, you can give it a whirl...
Thank you - the graphing works!

I'm curious to know how I can add the thresholds now. Basically, this would be how we'd want it configured:

Critical: 150
Warning: 75

I'll try to get this going as well.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Graphs and thresholds for custom command

Post by abrist »

You will need to add a few logical blocks to the script to check the results against the configured thresholds. You will also need to add the threshold getopts for the script and alter the perfdata output to use the thresholds.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked