Or is this source guardian protected?
Metrics unusable
Metrics unusable
I just put in a feature request for this, but I sort of need this fixed asap, so is there any code I can change myself to make the metrics not auto run when I go to the link? It is basically crashing because it has to go through so much data and I can't get the reports from there that I need to get. 
Or is this source guardian protected?
Or is this source guardian protected?
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
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
Re: Metrics unusable
Not SG-protected. I'm taking a look in /usr/local/nagiosxi/html/includes/components/metrics right now. Looks like it is all handled in the index.php page. The whole page is rendered in a single PHP function it looks like (display_metrics). It's probably as easy as adding a button that re-visits the page with a certain GET variable applied, then it only runs the metrics with that variable defined.
Just got in so I have some things to take care of (tickets, emails, coffee) but that's a good place to get started.
Just got in so I have some things to take care of (tickets, emails, coffee) but that's a good place to get started.
Former Nagios employee
Re: Metrics unusable
I just figured out the issue that's killing it. Even though its limited to top 50 it is still graphing and gauging ALL thousands of disk checks. Why aren't those tabs limited like the summary tab.
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
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
Re: Metrics unusable
This worked for me:
Put that in the file I mentioned above, line 163 on my system (just below the section where they end the <form> tag). That will make it so nothing is really run until you hit the Update button. You will just see the Hostgroup/Servicegroup and Metrics down-downs until you hit Update for the first time.
Not too sure about the other tabs, will have to look further into that.
Code: Select all
<?php if(!isset($_GET['goButton'])) {exit;} ?>Not too sure about the other tabs, will have to look further into that.
Former Nagios employee
Re: Metrics unusable
yeah, that will help once the tab issue is resolved. It crashed my httpd when trying to run it 
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
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
Re: Metrics unusable
Not gonna bother with a patch since I probably messed up the spacing, but you wanna look for the following in that same metrics.inc.php file:
and
They will have a foreach loop which should look like:
and that will need to be changed to:
for both tab-gauges and tab-graphs sections.
Not sure why they don't respect the limit, but I just stole some code from the Summary section and applied it here. Bear in mind this does not do a lot of sanity checking, but it does still respect a limit of 0, so I figure it should be alright.
EDIT: Link back to tracker post for reference - http://tracker.nagios.com/view.php?id=515
Code: Select all
<div id="tab-graphs">Code: Select all
<div id="tab-gauges">Code: Select all
<?php
foreach($metricdata as $id => $arr){
$hostname=$arr["host_name"];
$servicename=$arr["service_name"];
Code: Select all
<?php
$current_items = 0;
foreach($metricdata as $id => $arr){
$current_item++;
if($current_item>$_GET['maxitems'])
break;
$hostname=$arr["host_name"];
$servicename=$arr["service_name"];
Not sure why they don't respect the limit, but I just stole some code from the Summary section and applied it here. Bear in mind this does not do a lot of sanity checking, but it does still respect a limit of 0, so I figure it should be alright.
EDIT: Link back to tracker post for reference - http://tracker.nagios.com/view.php?id=515
Former Nagios employee
Re: Metrics unusable
Umm, you mean same index.phptmcdonald wrote:Not gonna bother with a patch since I probably messed up the spacing, but you wanna look for the following in that same metrics.inc.php file:
Also, this has made it usable now, but the gauges tab shows nothing after applying the fix. The graphs tab works great.
EDIT: I removed the 'fix' from the gauges tab and all gauges are shown but it no longer crashes me. So it was definitely the graphs tab doing it. I can live with this for now, but still would like these changes commited and also the gauges tab adhere to limit
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
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
Re: Metrics unusable
Yea, I meant index.phpBanditBBS wrote:Umm, you mean same index.php
I would check for typos. Specifically in my code >_>BanditBBS wrote:Also, this has made it usable now, but the gauges tab shows nothing after applying the fix. The graphs tab works great.
I wrote "current_items" when they should all be "current_item". This is what it should be:
Code: Select all
<?php
$current_item = 0;
foreach($metricdata as $id => $arr){
$current_item++;
if($current_item>$_GET['maxitems'])
break;
$hostname=$arr["host_name"];
$servicename=$arr["service_name"];
Former Nagios employee
Re: Metrics unusable
Who is the biggest idiot, you for the typo or me for blindly listening to you?
The graphs tab worked because the variable with an s would have been 0 starting out but would have been > the limit when it hit the gauge tab.
Please commit these changes
Lock this up!
EDIT: I thought about it, I'm the bigger one, LOL.
The graphs tab worked because the variable with an s would have been 0 starting out but would have been > the limit when it hit the gauge tab.
Please commit these changes
Lock this up!
EDIT: I thought about it, I'm the bigger one, LOL.
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
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