[rrd-users] The Y-Axis is Displaying an Incorrect Unit
mmartin
mmartin at jwpepper.com
Tue Apr 22 23:48:46 CEST 2014
Hey Steve, thanks again for the reply, much appreciated...
Ok, no problem. I've already modified my script to send bytes instead. I am
also sending "CPU-Time" as part of the PerformanceData, which is currently
sent in 'minutes'. With the unit of measure being "m". It used to be "min",
but it didn't seem to recognize it so I changed it to just "m" because I
read somewhere on oss.oetiker.ch that it recognizes *m*inutes, *s*econds...
*w*eek, *d*ay, etc... But the Y-Axis is using the Unit "k". Is there any
special option I need to use in order to use minutes as the unit of measure?
Is this also a case where I should send the data in seconds, instead of
minutes..?
Here is what I did for the HRULE for the WARN and CRIT values since the
sizes will vary depending upon which server is being checked. This is in PHP
for pnp4nagios, I did the same for WARN as well and it seems to do the
trick:
> if($CRIT[4] != "")
> {
> ### OLD HRULE Line:
> # *This would display in bytes, which is why it is commented out...
> #$def[4] .= rrd::hrule($CRIT[4], "#FF0000", "
> Critical\:
*
> $CRIT[4] $UNIT[4]
*
> \\n");
>
> ### If $CRIT[*] is Greater then 1048576, then convert to MB...
> # 1048576 Bytes == 1 MB
> if ($CRIT[4] > 1048576) {
> $tmp_CRIT = round(($CRIT[4]/1024)/1024, 1, PHP_ROUND_HALF_EVEN);
> $tmp_UNIT = "M";
> ### If tmp_CRIT is still > 1024, then convert to GB...
> if ($tmp_CRIT > 1024) {
> $tmp_CRIT = round($tmp_CRIT/1024, 1, PHP_ROUND_HALF_EVEN);
> $tmp_UNIT = "G";
> }
> ### Else-If, CRIT[4] (in bytes) is > 1024, then convert to KB...
> } elseif ($CRIT[4] > 1024) {
> $tmp_CRIT = round($CRIT[4]/1024, 1, PHP_ROUND_HALF_EVEN);
> $tmp_UNIT = "K";
> ### Else, it's smaller then 1024 bytes, keep as is...
> } else { $tmp_CRIT = $CRIT[4]; $tmp_UNIT = ""; }
>
> $def[4] .= rrd::hrule($CRIT[4], "#FF0000", "
> CRITICAL\:
*
> " . $tmp_CRIT . " ${tmp_UNIT}b
*
> \\n");
> }
Thanks again for the replies!
Thanks,
Matt
--
View this message in context: http://rrd-mailinglists.937164.n2.nabble.com/The-Y-Axis-is-Displaying-an-Incorrect-Unit-tp7581952p7581957.html
Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.
More information about the rrd-users
mailing list