Hi,
I created a plugin which supposed to write several metrics on the same graph.
What I did is create a variable which saves the performance output line and then I simple print if after the pipe as usual.
The line output looks like this:
108304=64.44%;;108306=65.74%;;108308=61.94%
The problem is that the graph is not being created.
What could be the problem?
Multiple values in performance graph
Re: Multiple values in performance graph
Please refer to the Nagios Plugin Development Guidelines.
Your labels need to be in single quotes. I would also suggest space-delimiting each label-value pair.
Your labels need to be in single quotes. I would also suggest space-delimiting each label-value pair.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Multiple values in performance graph
Thanks @mcapra!
@reincarne let us know if mcapra's suggestions helped you solve the issue.
@reincarne let us know if mcapra's suggestions helped you solve the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Multiple values in performance graph
It didn't really help me.
What I'm doing is this:
Within a for loop, I'm creating a one line of performance data like this (using perl language);
for ($z=0; $z<$arrSizeNew2; $z++)
{
$sn=@results[$z];
#$sn=print"'$sn1'";
$pr=@results[$z+1];
$output=$sn."=".$pr.";";
#$output=exec(print "'$sn'=$pr;");
$perf_line.=$output;
$z=$z+4;
}
From this line, this will be an output example:
9866703=99.52;48666=38.34;20466=13.97;464613=33.35;103441=10.24;24444=16.27;899000=26.06
And the final output line goes like this:
print "Critical! SN ID: @results_excluded[$index_max-1], @results_excluded[$index_max]% Requests above 0.5s (@results_excluded[$index_max+1] out of @results_excluded[$index_max+2]) | $perf_line";
What I'm doing is this:
Within a for loop, I'm creating a one line of performance data like this (using perl language);
for ($z=0; $z<$arrSizeNew2; $z++)
{
$sn=@results[$z];
#$sn=print"'$sn1'";
$pr=@results[$z+1];
$output=$sn."=".$pr.";";
#$output=exec(print "'$sn'=$pr;");
$perf_line.=$output;
$z=$z+4;
}
From this line, this will be an output example:
9866703=99.52;48666=38.34;20466=13.97;464613=33.35;103441=10.24;24444=16.27;899000=26.06
And the final output line goes like this:
print "Critical! SN ID: @results_excluded[$index_max-1], @results_excluded[$index_max]% Requests above 0.5s (@results_excluded[$index_max+1] out of @results_excluded[$index_max+2]) | $perf_line";
Re: Multiple values in performance graph
As @mcapra mentioned, there should be a space, separating the label-value pairs. It doesn't seem that you followed the nagios plugins development guidelines...
Your output doesn't contain spaces between label/value pairs:This is the expected format:
'label'=value[UOM];[warn];[crit];[min];[max]
Notes:
1. space separated list of label/value pairs
2. label can contain any characters except the equals sign or single quote (')
3. the single quotes for the label are optional. Required if spaces are in the label
4. label length is arbitrary, but ideally the first 19 characters are unique (due to a limitation in RRD). Be aware of a limitation in the amount of data that NRPE returns to Nagios
5. to specify a quote character, use two single quotes
6. warn, crit, min or max may be null (for example, if the threshold is not defined or min and max do not apply). Trailing unfilled semicolons can be dropped
7. min and max are not required if UOM=%
8. value, min and max in class [-0-9.]. Must all be the same UOM. value may be a literal "U" instead, this would indicate that the actual value couldn't be determined
9. warn and crit are in the range format (see the Section called Threshold and Ranges). Must be the same UOM
10. UOM (unit of measurement) is one of:
1. no unit specified - assume a number (int or float) of things (eg, users, processes, load averages)
2. s - seconds (also us, ms)
3. % - percentage
4. B - bytes (also KB, MB, TB)
5. c - a continous counter (such as bytes transmitted on an interface)
It is up to third party programs to convert the Nagios Plugins performance data into graphs.
Can you show the actual check, run from the command line and the output of it?9866703=99.52;48666=38.34;20466=13.97;464613=33.35;103441=10.24;24444=16.27;899000=26.06
Be sure to check out our Knowledgebase for helpful articles and solutions!