Page 1 of 1
Network Defaults
Posted: Mon Aug 06, 2018 10:04 am
by ab3pu
I was wondering if there was a way to default the sources summary view to use linear and bytes/sec? While on that topic, I noticed back in 2014 the issue about speed being shown in bytes/sec should be labelled bit/sec but 3+ years later it has been changed. Any idea when that will occur?
Re: Network Defaults
Posted: Mon Aug 06, 2018 4:40 pm
by cdienger
Change lines 87 and 20 in /var/www/html/nagiosna/application/views/generic/summary.php to look like:
Line 87:
<?php echo lang('summary_graph_using'); ?> <label class="radio" style="display: inline-block; margin: 0 0 0 5px; font-weight: bold;"><input type="radio" name="graphalg" va lue="log"><?php echo lang('summary_graph_log'); ?></label> <label class="radio" style="display: inline-block; margin: 0 0 0 5px; font-weight: bold;"><input type="radio" name="graphalg" va lue="linear" checked><?php echo lang('summary_graph_linear'); ?></label>
Line 20:
var yAxis_type = 'linear';
Re: Network Defaults
Posted: Tue Aug 07, 2018 9:00 am
by ab3pu
Ok...that fixes the linear default ...Many thanks. Is there an edit to force bytes/sec as default as opposed to just bytes?
Re: Network Defaults
Posted: Tue Aug 07, 2018 11:27 am
by cdienger
Transfer rates have been fixed in a couple places. The graph for example will show bytes but queries will return Bits/Second. Where are you seeing a discrepancy? Are you saying the graph should be bits/second as well?
Re: Network Defaults
Posted: Tue Aug 07, 2018 12:34 pm
by ab3pu
Well as the network engineer I am interested in throughput typically measured as bps (Mbps Gbps etc.) . I would like the default view to be in bit/sec. The graph defaults to Bytes. Not a huge issue but a hassle to toggle to Bytes/Sec. Also the graph seems to be in bits/sec but the radio button label still shows bytes/sec. A minor point I realize but when try to explain the discrepancy to others it can become problematic.
Re: Network Defaults
Posted: Tue Aug 07, 2018 3:01 pm
by tgriep
To change the label for the Bandwidth graph to say Bits/Sec,
Edit the /var/www/html/nagiosna/www/media/js/summary.js file.
Change line 236
from
to
Save the file and restart apache by running
Refresh the GUI to update the label.
Getting the default changed may need a rewrite of the function.
Re: Network Defaults
Posted: Wed Aug 08, 2018 8:18 am
by ab3pu
Thank you. Will give it a shot. Quick question though. Why, if it is that simple to change, has the interface been reading Bytes/Sec instead of bits/sec if that is truly what is being displayed?
Re: Network Defaults
Posted: Wed Aug 08, 2018 8:54 am
by tgriep
It was just that the label was wrong on the graph. The system is graphing Bits/Sec for the data.
Re: Network Defaults
Posted: Wed Aug 08, 2018 1:41 pm
by ab3pu
I understand. Why is the label still wrong after all these years? is my question.
Re: Network Defaults
Posted: Wed Aug 08, 2018 4:58 pm
by tgriep
Because it was missed.