Page 1 of 1
Graphs and thresholds for custom command
Posted: Thu Jan 29, 2015 12:46 pm
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?
Re: Graphs and thresholds for custom command
Posted: Thu Jan 29, 2015 1:05 pm
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
Re: Graphs and thresholds for custom command
Posted: Thu Jan 29, 2015 1:18 pm
by jpipitone
Sure, attached it here.
Re: Graphs and thresholds for custom command
Posted: Thu Jan 29, 2015 5:08 pm
by jpipitone
How about thresholds?
Re: Graphs and thresholds for custom command
Posted: Thu Jan 29, 2015 5:12 pm
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]
Re: Graphs and thresholds for custom command
Posted: Tue Feb 10, 2015 3:03 pm
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.
Re: Graphs and thresholds for custom command
Posted: Tue Feb 10, 2015 5:43 pm
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...
Re: Graphs and thresholds for custom command
Posted: Wed Feb 11, 2015 9:18 am
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.
Re: Graphs and thresholds for custom command
Posted: Wed Feb 11, 2015 10:49 am
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.