Graphing Multiple Variables from Single Plugin
Posted: Fri Mar 29, 2019 11:58 am
Hello All,
I've been writing my own Plugins for a while.
This is the first one where I'm trying to get it to graph multiple values on the same graph.
Here is the end of my plugin... where I prep the output.
If I delete the 3rd and 4th performanceData lines I can get Connections to graph by itself.
However once I add the additional metrics... nothing graphs.
I get all of the "speedometers" for each of the three metrics.
I can see that Nagios is getting performance data in the Advanced tab.
Performance Data: 'connections'=2;100;200;0;250 'NECC'=0;;;0;250 'Direct'=1;;;0;250
All my other graphs work.
And there is a MySQL plugin someone else made. It has multiple metrics being tracked and my output is in the same format as theirs. That one graphs just fine.
I reviewed the documentation for plugin output. I believe I have everything right. Especially since I can get it to work with a single metric but not multiple. Searched online for answers for a bit and I'm at the end of my rope! Any help would be appreciated.
-- Eric
I've been writing my own Plugins for a while.
This is the first one where I'm trying to get it to graph multiple values on the same graph.
Here is the end of my plugin... where I prep the output.
Code: Select all
#---------- Step 3 ------------------------------------------------------------
# Format Output
performanceData=""
performanceData=$performanceData"'connections'=$NUM_CONNECTIONS;$WARNING_THRESHOLD;$CRITICAL_THRESHOLD;0;250 "
performanceData=$performanceData"NECC'=$NUM_NECC;;;0;250 "
performanceData=$performanceData"'Direct'=$NUM_DCS;;;0;250 "
echo "Connections - $NUM_CONNECTIONS"
echo " | $performanceData"
exit $RESULT
#-- END
However once I add the additional metrics... nothing graphs.
I get all of the "speedometers" for each of the three metrics.
I can see that Nagios is getting performance data in the Advanced tab.
Performance Data: 'connections'=2;100;200;0;250 'NECC'=0;;;0;250 'Direct'=1;;;0;250
All my other graphs work.
And there is a MySQL plugin someone else made. It has multiple metrics being tracked and my output is in the same format as theirs. That one graphs just fine.
I reviewed the documentation for plugin output. I believe I have everything right. Especially since I can get it to work with a single metric but not multiple. Searched online for answers for a bit and I'm at the end of my rope! Any help would be appreciated.
-- Eric