Bandwidth usage

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Bandwidth usage

Post by BanditBBS »

Ok, so finally testing network stuff in nagios here and seeing some weirdness on the bw usage report.

1.) No matter what BW report I choose, the graphs never change from the first available report, regardless of which report I select and click run. - Confirmed still, numbers at bottom change, but the graphs are always the same
Additional Information: I have 300+ BW reports available. When I select BW Report is autorun(#4 in this list) and the graphs and numbers below look correct for the first BW report in the list. If I then choose any of the other 300+ BW Reports, the numbers below get updated but the 4 graphs shown are the same 4 that were there when it auto ran. It is showing the graph data for the initial BW report instead of the one I selected.
2.) If I switch to "Old Graphs" there is some how data going back to midnight last night when I just added all this stuff in the past 2 hours
Additional Information: Forget this one for now, if we get #1 working, then I don't care one bit about #2
3.) No numbers other than 0 are being shown in the tables under the graphs - Resolved after first full day(guess numbers don't show up until end of day)
4.) BW Usage report is not obeying the "Do not auto run reports" setting in admin. If I goto reports and select BW Usage it auto runs before I can make a selection
5.) If I click on a month in the lower section, the graph that comes up is showing ONLY data from yesterday...all very very weird...it looks like the time is just way off on that next screen and before you ask, all time settings are correct according to https://assets.nagios.com/downloads/nag ... m_Time.pdf The image below is from just now at 12:32PM CDT but you can see this chart only goes to yesterday at 11:02AM.
Capture.PNG
6.) For the love of God, please alphabetize lists anywhere in Nagios a list is made! trying to find a specific BW report is a pain when you have 300+ and I'll eventually have thousands if we go this route
Additional Information: Would be nice to have the dropdwon selection box alphabetized by host then service description.
You do not have the required permissions to view the files attached to this post.
Last edited by BanditBBS on Mon Oct 26, 2015 12:35 pm, edited 6 times in total.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: Bandwidth usage

Post by lgroschen »

Hey Bandit,

I'll have to replicate and debug each section of this post, but I'll try to get some solutions for each one once I get into it. I'll report back with my findings.

The report got a makeover to support Highcharts so there could be some problems.
/Luke
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Bandwidth usage

Post by BanditBBS »

Updated my opening post Luke with better detail and a resolved issue :)
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: Bandwidth usage

Post by lgroschen »

Thanks Bandit,

I'll put this on the list with the metrics. Shouldn't be to long to debug them.

I'm going to lock this and update my post with an internal task id for referencing this problem.

task_id=6707
/Luke
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: Bandwidth usage

Post by lgroschen »

Bandit, can you verify that you are on version 1.7.0 of the bandwidth component?

I've tried on my dev machine - which might be totally different, but:

1) Report should load the first in the dropdown list on page load. Then I click run and the graphs match the service detail graphs so I haven't been able to replicate this one.

2) The old graphs use the MRTG method which makes the page requests take as long as they do. Adding highcharts was the way to avoid those long report loading times and the highcharts graphs are displaying the most recent data from the /usr/local/nagiosxi/share/perfdata/<hostname>/<servicename>. The Old graphs part might be another feature change since the report is creating jpg when using the old graphs. We wanted to move away from this method, but I would like it to work correctly.

4) This might be unaccounted for since the changes have been made. I can verify this.

5) the month selection should display the time for that month, this is what the request looks like when i select a month: http://<IP>/nagiosxi/includes/components/bandwidthreport/index.php?name=192.168.5.41_15&year=2015&month=7 - So it should be displaying data for that month in the view. This might be a bug on the request.

6) the list is using natsort() so that they are organized alphabetically, is it not working correctly? I can also do you one better and make that dropdown an autocomplete list (like the availability report) for ease of searching.
/Luke
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Bandwidth usage

Post by BanditBBS »

I am on 1.7.0. I updated my initial post with more information, but in reply to your post:

1.) You selected a completely different one than the initial loaded one? My graphs are always identical, let me show you...
Auto Run:
Capture1.PNG
Selected new/different, look at numbers below:
Capture2.PNG
2.) I wouldn't care if #1 gets fixed :)

4.) Trust me, it is, lol

5.) It is showing the month data, but its wrong/not showing all, look at additional notes in OP

6.) No it is not sorted at all for me and the auto-complete would be great!
You do not have the required permissions to view the files attached to this post.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: Bandwidth usage

Post by lgroschen »

I'll work on this and report back here what I found.

UPDATES:
5) This was a month specific bug which wasn't using the correct increment from the RRD so that's good to go.

So, bare with me here. I'm going to have you edit the index.php file for the component. Shouldn't break anything, but I wouldn't try this on prod to be safe. Also backup the original file before making the changes.

In /usr/local/nagiosxi/html/includes/components/bandwidthreport/index.php

At Line 711 ( should be right after the function with the following comment "Get the xmlDoc and units of measurement/names")
place the following code and save:

Code: Select all

echo "<pre>";
var_dump($br_args['host']);
var_dump($br_args['service']);
var_dump($xmlDoc);
var_dump($xmlDat);
echo "</pre>";
Then, navigate to the home page > select Reports and click Bandwidth Report. It should dump the information under the graphs. Grab that information and then select a different graph and it should make another dump. Post both of those dumps here. If there is any sensitive data just shoot it to me in an email or PM (email is the best).
/Luke
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Bandwidth usage

Post by BanditBBS »

Luke,

So I did as you asked, and for me it was line 733, not 711, so there seems to be a difference between our files. That being said, when it autoruns the report I get the report for the firs tone in the list, same as the pic I attached earlier. Here is the output:

Code: Select all

string(9) "chisslb02"
string(14) "eth0_Bandwidth"
string(61) "/usr/local/nagios/share/perfdata/chisslb02/eth0_Bandwidth.xml"
object(SimpleXMLElement)#11 (23) {
  ["DATASOURCE"]=>
  array(2) {
    [0]=>
    object(SimpleXMLElement)#9 (20) {
      ["TEMPLATE"]=>
      string(25) "check_xi_service_mrtgtraf"
      ["RRDFILE"]=>
      string(61) "/usr/local/nagios/share/perfdata/chisslb02/eth0_Bandwidth.rrd"
      ["RRD_STORAGE_TYPE"]=>
      string(6) "SINGLE"
      ["RRD_HEARTBEAT"]=>
      string(4) "8460"
      ["IS_MULTI"]=>
      string(1) "0"
      ["DS"]=>
      string(1) "1"
      ["NAME"]=>
      string(2) "in"
      ["LABEL"]=>
      string(2) "in"
      ["UNIT"]=>
      string(4) "Mb/s"
      ["ACT"]=>
      string(7) ".008357"
      ["WARN"]=>
      string(6) "500.00"
      ["WARN_MIN"]=>
      object(SimpleXMLElement)#14 (0) {
      }
      ["WARN_MAX"]=>
      object(SimpleXMLElement)#15 (0) {
      }
      ["WARN_RANGE_TYPE"]=>
      object(SimpleXMLElement)#16 (0) {
      }
      ["CRIT"]=>
      string(6) "800.00"
      ["CRIT_MIN"]=>
      object(SimpleXMLElement)#17 (0) {
      }
      ["CRIT_MAX"]=>
      object(SimpleXMLElement)#18 (0) {
      }
      ["CRIT_RANGE_TYPE"]=>
      object(SimpleXMLElement)#19 (0) {
      }
      ["MIN"]=>
      object(SimpleXMLElement)#20 (0) {
      }
      ["MAX"]=>
      object(SimpleXMLElement)#21 (0) {
      }
    }
    [1]=>
    object(SimpleXMLElement)#1 (20) {
      ["TEMPLATE"]=>
      string(25) "check_xi_service_mrtgtraf"
      ["RRDFILE"]=>
      string(61) "/usr/local/nagios/share/perfdata/chisslb02/eth0_Bandwidth.rrd"
      ["RRD_STORAGE_TYPE"]=>
      string(6) "SINGLE"
      ["RRD_HEARTBEAT"]=>
      string(4) "8460"
      ["IS_MULTI"]=>
      string(1) "0"
      ["DS"]=>
      string(1) "2"
      ["NAME"]=>
      string(3) "out"
      ["LABEL"]=>
      string(3) "out"
      ["UNIT"]=>
      string(4) "Mb/s"
      ["ACT"]=>
      string(7) ".047408"
      ["WARN"]=>
      string(6) "500.00"
      ["WARN_MIN"]=>
      object(SimpleXMLElement)#21 (0) {
      }
      ["WARN_MAX"]=>
      object(SimpleXMLElement)#20 (0) {
      }
      ["WARN_RANGE_TYPE"]=>
      object(SimpleXMLElement)#19 (0) {
      }
      ["CRIT"]=>
      string(6) "800.00"
      ["CRIT_MIN"]=>
      object(SimpleXMLElement)#18 (0) {
      }
      ["CRIT_MAX"]=>
      object(SimpleXMLElement)#17 (0) {
      }
      ["CRIT_RANGE_TYPE"]=>
      object(SimpleXMLElement)#16 (0) {
      }
      ["MIN"]=>
      object(SimpleXMLElement)#15 (0) {
      }
      ["MAX"]=>
      object(SimpleXMLElement)#14 (0) {
      }
    }
  }
  ["RRD"]=>
  object(SimpleXMLElement)#10 (2) {
    ["RC"]=>
    string(1) "0"
    ["TXT"]=>
    string(18) "successful updated"
  }
  ["NAGIOS_AUTH_HOSTNAME"]=>
  string(9) "chisslb02"
  ["NAGIOS_AUTH_SERVICEDESC"]=>
  string(14) "eth0 Bandwidth"
  ["NAGIOS_CHECK_COMMAND"]=>
  string(73) "check_xi_service_mrtgtraf!10.160.0.32_2.rrd!500.00,500.00!800.00,800.00!M"
  ["NAGIOS_DATATYPE"]=>
  string(15) "SERVICEPERFDATA"
  ["NAGIOS_DISP_HOSTNAME"]=>
  string(9) "chisslb02"
  ["NAGIOS_DISP_SERVICEDESC"]=>
  string(14) "eth0 Bandwidth"
  ["NAGIOS_HOSTNAME"]=>
  string(9) "chisslb02"
  ["NAGIOS_HOSTSTATE"]=>
  string(2) "UP"
  ["NAGIOS_HOSTSTATETYPE"]=>
  string(4) "HARD"
  ["NAGIOS_MULTI_PARENT"]=>
  object(SimpleXMLElement)#12 (0) {
  }
  ["NAGIOS_PERFDATA"]=>
  string(59) "in=.008357Mb/s;500.00;800.00 out=.047408Mb/s;500.00;800.00 "
  ["NAGIOS_RRDFILE"]=>
  string(61) "/usr/local/nagios/share/perfdata/chisslb02/eth0_Bandwidth.rrd"
  ["NAGIOS_SERVICECHECKCOMMAND"]=>
  string(73) "check_xi_service_mrtgtraf!10.160.0.32_2.rrd!500.00,500.00!800.00,800.00!M"
  ["NAGIOS_SERVICEDESC"]=>
  string(14) "eth0_Bandwidth"
  ["NAGIOS_SERVICEOUTPUT"]=>
  string(38) "OK - Current BW in: 0Mbps Out: .04Mbps"
  ["NAGIOS_SERVICEPERFDATA"]=>
  string(58) "in=.008357Mb/s;500.00;800.00 out=.047408Mb/s;500.00;800.00"
  ["NAGIOS_SERVICESTATE"]=>
  string(2) "OK"
  ["NAGIOS_SERVICESTATETYPE"]=>
  string(4) "HARD"
  ["NAGIOS_TIMET"]=>
  string(10) "1445903162"
  ["NAGIOS_XMLFILE"]=>
  string(61) "/usr/local/nagios/share/perfdata/chisslb02/eth0_Bandwidth.xml"
  ["XML"]=>
  object(SimpleXMLElement)#13 (1) {
    ["VERSION"]=>
    string(1) "4"
  }
}
So, I then selected the same second one I did before and the output of graphs were still the same and the output from the commands you have me enter was the EXACT same. I compared it, there isn't one character difference. Just to show youu the code, here is the bit of code before what I pasted:

Code: Select all

 726     // Get the xmlDoc and units of measurement/names
 727     if (file_exists($xmlDoc)) {
 728         $xmlDat = simplexml_load_file($xmlDoc);
 729         $br_args['units'] = $xmlDat->xpath('/NAGIOS/DATASOURCE/UNIT');  // Units of measurement from perfdata
 730         $br_args['names'] = $xmlDat->xpath('/NAGIOS/DATASOURCE/NAME');  // Perfdata names (rta and pl)
 731         $br_args['datatypes'] = $br_args['names'];
 732     }
 733 echo "<pre>";
 734 var_dump($br_args['host']);
 735 var_dump($br_args['service']);
 736 var_dump($xmlDoc);
 737 var_dump($xmlDat);
 738 echo "</pre>";
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: Bandwidth usage

Post by lgroschen »

PMed you back Bandit. Post back here what you found.
/Luke
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Bandwidth usage

Post by BanditBBS »

Current status of all bugs/issues after putting in the pm'd update. Version number in manage components is still the same though, so no clue why I had an "old" version:

1.) No matter what BW report I choose, the graphs never change from the first available report, regardless of which report I select and click run. - Confirmed still, numbers at bottom change, but the graphs are always the same
Additional Information: I have 300+ BW reports available. When I select BW Report is autorun(#4 in this list) and the graphs and numbers below look correct for the first BW report in the list. If I then choose any of the other 300+ BW Reports, the numbers below get updated but the 4 graphs shown are the same 4 that were there when it auto ran. It is showing the graph data for the initial BW report instead of the one I selected.
- Resolved
2.) If I switch to "Old Graphs" there is some how data going back to midnight last night when I just added all this stuff in the past 2 hours
Additional Information: Forget this one for now, if we get #1 working, then I don't care one bit about #2
- Don't care anymore, but seems good
3.) No numbers other than 0 are being shown in the tables under the graphs - Resolved after first full day(guess numbers don't show up until end of day)
4.) BW Usage report is not obeying the "Do not auto run reports" setting in admin. If I goto reports and select BW Usage it auto runs before I can make a selection - Still an issue
5.) If I click on a month in the lower section, the graph that comes up is showing ONLY data from yesterday...all very very weird...it looks like the time is just way off on that next screen and before you ask, all time settings are correct according to https://assets.nagios.com/downloads/nag ... m_Time.pdf The image below is from just now at 12:32PM CDT but you can see this chart only goes to yesterday at 11:02AM. - Not sure, it is 10am here and the graph came up showing to 8am. I think its just showing up to 2 hours ago and not all the way to current time
6.) For the love of God, please alphabetize lists anywhere in Nagios a list is made! trying to find a specific BW report is a pain when you have 300+ and I'll eventually have thousands if we go this route
Additional Information: Would be nice to have the dropdwon selection box alphabetized by host then service description. - Still not sorted!
7.) Need auto complete for the dropdown - Apparently I'm blind as it is already a searchable box
Last edited by BanditBBS on Wed Oct 28, 2015 12:25 pm, edited 2 times in total.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Locked