Page 1 of 1
needing to get perfdata working for a custom plugin ...
Posted: Sun Feb 07, 2021 11:12 am
by katieKatiePants
and looking for some documentation / simple examples. i already have my custom plugins working all gangbusters, now the need has finally arisen to start graphing some custom perfdata. where to go / which docos?
thx,
k
additional info:
1. using check_ncpa on nagiosxi server and custom plugins are deployed to the monitored hosts.
Re: needing to get perfdata working for a custom plugin ...
Posted: Mon Feb 08, 2021 11:55 am
by benjaminsmith
Hi
@katieKatiePants
What kind of plugin did you write? You'll find the performance data specs on the page below. If the plugin returns performance data in the correct format it will be automatically processed by PNP.
Nagios Plugins Development Guidelines
This page is pretty helpful for understanding how performance data works in Nagios XI.
Nagios XI - Performance Data Architecture
Let us know if you get it working.
Benjamin
Re: needing to get perfdata working for a custom plugin ...
Posted: Mon Feb 08, 2021 3:10 pm
by katieKatiePants
sweet mother hubbard. give katie a firm place to stand and healthy documentation ... she can move the whole universe!
Re: needing to get perfdata working for a custom plugin ...
Posted: Tue Feb 09, 2021 11:20 am
by benjaminsmith
sweet mother hubbard. give katie a firm place to stand and healthy documentation ... she can move the whole universe!
Excellent!
Good luck with the perf data on this project.
Re: needing to get perfdata working for a custom plugin ...
Posted: Tue Feb 16, 2021 2:24 pm
by katieKatiePants
hello nagiods! got my perfdata project started but getting "integer expression expected: regardless of how i modify the perf data output.
current output from the host:
Code: Select all
superDuper@ip-10-41-1-66 plugins]# ./askForESFilesOpen
CurrentFilesOpen OK | currFilesOpen=44
current output from my xiserver:
Code: Select all
superDuper@nagiosXIServer libexec]$ ./check_ncpa.py -H 10.10.10.10 -M 'plugins/askForESFilesOpen'
/usr/local/ncpa/plugins/askForESFilesOpen: line 38: [: : integer expression expected
i've been reading this:
https://nagios-plugins.org/doc/guidelines.html#AEN200 especially the portion labeled "performance data"
frankly, i'm not really smart enough to understand the documentation line:
This is the expected format:
'label'=value[UOM];[warn];[crit];[min];[max]
think you universal masters could hook me with an example of ^^?
Re: needing to get perfdata working for a custom plugin ...
Posted: Tue Feb 16, 2021 5:07 pm
by benjaminsmith
Hi
@katieKatiePants,
The first output looks right to me, but the second output suggests the script is comparing non-integer values and this is causing an error. If you want, please PM the script and I can review it for you.
Regarding performance graph output, yeah it's a little confusing. The performance graph is optional and not required for a plugin, and should following those guidelines:
This is the expected format:
'label'=value[UOM];[warn];[crit];[min];[max]
The first field is the label followed by the output from the check followed with the
unit of measurement , for example:
The warn and crit fields are the thresholds passed to the plugin. Those will be added to the graph so you can view the output in the graph as it relates to the thresholds set at that time. For this to fully work, make sure this is turned on in the GUI. Go to
Admin > System Settings > Theme & Display and select the following.
warning-critical-lines.png
The min and max fields would be computed by the plugin and not commonly used. Let me know if that helps answer your question.