Bandwidth Report in bits/s instead of bytes/s

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
logix88
Posts: 20
Joined: Fri Jun 15, 2012 5:27 am

Bandwidth Report in bits/s instead of bytes/s

Post by logix88 »

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?
scottwilkerson
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

Post by scottwilkerson »

The Bandwidth report doesn't ready the MRTG config, it assumes the default and currently displays "Bytes/s".
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
logix88
Posts: 20
Joined: Fri Jun 15, 2012 5:27 am

Re: Bandwidth Report in bits/s instead of bytes/s

Post by logix88 »

scottwilkerson wrote:The Bandwidth report doesn't ready the MRTG config, it assumes the default and currently displays "Bytes/s".
And there is no way/hack around this?
scottwilkerson
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

Post by scottwilkerson »

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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Bandwidth Report in bits/s instead of bytes/s

Post by tmcdonald »

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:

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'";
            }
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.
Former Nagios employee
logix88
Posts: 20
Joined: Fri Jun 15, 2012 5:27 am

Re: Bandwidth Report in bits/s instead of bytes/s

Post by logix88 »

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:

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'";
            }
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.
It's converting to Bytes/sec... and the services are in bits/s and that makes it inconsistent and confusing...

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.
logix88
Posts: 20
Joined: Fri Jun 15, 2012 5:27 am

Re: Bandwidth Report in bits/s instead of bytes/s

Post by logix88 »

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'";
scottwilkerson
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

Post by scottwilkerson »

@logix88 - Thanks for posting this for others!
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked