I changed the options for a particular host in /etc/mrtg/conf.d/192.168.10.100.cfg
Options[_]: growright, bits
However the report (Bandwidth Usage report) in Nagios XI still seem to plot in Bytes/sec.
I thought it read cfg file in next sample, i.e. in 5 mins - or is there something else that needs to be changed?
Bandwidth Report in bits/s instead of bytes/s
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Bandwidth Report in bits/s instead of bytes/s
The Bandwidth report doesn't ready the MRTG config, it assumes the default and currently displays "Bytes/s".
Re: Bandwidth Report in bits/s instead of bytes/s
And there is no way/hack around this?scottwilkerson wrote:The Bandwidth report doesn't ready the MRTG config, it assumes the default and currently displays "Bytes/s".
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Bandwidth Report in bits/s instead of bytes/s
You could download the bandwidthreport component, make the changes you like and then re-upload it..
The changes will be made in the index.php file.
The changes will be made in the index.php file.
Re: Bandwidth Report in bits/s instead of bytes/s
Is it actually displaying the bytes/second or is it displaying what appears to be the proper bits/second but the label just says bytes?
If you just need to change the label for one host, you might be able to do something like this:
/usr/local/nagiosxi/html/includes/components/bandwidthreport/index.php ~line 118:
The $name variable I believe is just the name you have set in XI, but I am not 100% sure. I would need to defer to a developer on that.
If you just need to change the label for one host, you might be able to do something like this:
/usr/local/nagiosxi/html/includes/components/bandwidthreport/index.php ~line 118:
Code: Select all
$fname = filename($name);
header("content-type: image/png");
if ($name='192.168.1.100') {
$rrdcommand = "$rrdcommand graph - -v 'bits/s' -b 1024 -w 390 DEF:avgin=$fname:ds0:AVERAGE AREA:avgin#00CC00:'Traffic in' DEF:avgout=$fname:ds1:AVERAGE LINE2:avgout#0000FF:'Traffic out'";
} else {
$rrdcommand = "$rrdcommand graph - -v 'Bytes/s' -b 1024 -w 390 DEF:avgin=$fname:ds0:AVERAGE AREA:avgin#00CC00:'Traffic in' DEF:avgout=$fname:ds1:AVERAGE LINE2:avgout#0000FF:'Traffic out'";
}
Former Nagios employee
Re: Bandwidth Report in bits/s instead of bytes/s
It's converting to Bytes/sec... and the services are in bits/s and that makes it inconsistent and confusing...tmcdonald wrote:Is it actually displaying the bytes/second or is it displaying what appears to be the proper bits/second but the label just says bytes?
If you just need to change the label for one host, you might be able to do something like this:
/usr/local/nagiosxi/html/includes/components/bandwidthreport/index.php ~line 118:The $name variable I believe is just the name you have set in XI, but I am not 100% sure. I would need to defer to a developer on that.Code: Select all
$fname = filename($name); header("content-type: image/png"); if ($name='192.168.1.100') { $rrdcommand = "$rrdcommand graph - -v 'bits/s' -b 1024 -w 390 DEF:avgin=$fname:ds0:AVERAGE AREA:avgin#00CC00:'Traffic in' DEF:avgout=$fname:ds1:AVERAGE LINE2:avgout#0000FF:'Traffic out'"; } else { $rrdcommand = "$rrdcommand graph - -v 'Bytes/s' -b 1024 -w 390 DEF:avgin=$fname:ds0:AVERAGE AREA:avgin#00CC00:'Traffic in' DEF:avgout=$fname:ds1:AVERAGE LINE2:avgout#0000FF:'Traffic out'"; }
I will have a look at the php... It doesn't need to be for the one host, it could be for all - as all our stuff is in bits/s.
Re: Bandwidth Report in bits/s instead of bytes/s
FYI, line 118 - replaced with below alterations to convert to bits/sec.
$rrdcommand = "$rrdcommand graph - -v 'Bits/s' -b 1024 -w 390 DEF:avgin=$fname:ds0:AVERAGE CDEF:avginbits=avgin,8,* AREA:avginbits#00CC00:'Traffic in' DEF:avgo ut=$fname:ds1:AVERAGE CDEF:avgoutbits=avgout,8,* LINE2:avgoutbits#0000FF:'Traffic out'";
$rrdcommand = "$rrdcommand graph - -v 'Bits/s' -b 1024 -w 390 DEF:avgin=$fname:ds0:AVERAGE CDEF:avginbits=avgin,8,* AREA:avginbits#00CC00:'Traffic in' DEF:avgo ut=$fname:ds1:AVERAGE CDEF:avgoutbits=avgout,8,* LINE2:avgoutbits#0000FF:'Traffic out'";
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Bandwidth Report in bits/s instead of bytes/s
@logix88 - Thanks for posting this for others!