UI Change Request 2

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

UI Change Request 2

Post by rajasegar »

Nagios XI 2012R2.9
Offloaded DB
RHEL 6.5 x64
Manual Install

Please refer to the attached pic, the list is not sorted.
The user has to scroll up and down to find the correct host group.
19-06-2014 10-52-38 AM.png
You do not have the required permissions to view the files attached to this post.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: UI Change Request 2

Post by abrist »

I have opened an internal bug report. Thanks for the report!
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: UI Change Request 2

Post by tmcdonald »

I might have a fix for this - checking with devs. Will update post when I know more.

Edit the /usr/local/nagiosxi/html/reports/execsummary.php file to change the following:

Code: Select all

	<select name="hostgroup" id="hostgroupList" style="width: 150px;">
	<option value=""><?php echo gettext("Hostgroup"); ?>:</option>
<?php
	$oxml=get_xml_hostgroup_objects();
	if($oxml){
		foreach($oxml->hostgroup as $hg){
			$name=strval($hg->hostgroup_name);
			echo "<option value='".$name."' ".is_selected($hostgroup,$name).">$name</option>\n";
			}
		}
?>
	</select>
	<select name="servicegroup" id="servicegroupList" style="width: 150px;">
	<option value=""><?php echo gettext("Servicegroup"); ?>:</option>
<?php
	$oxml=get_xml_servicegroup_objects();
	if($oxml){
		foreach($oxml->servicegroup as $sg){
			$name=strval($sg->servicegroup_name);
			echo "<option value='".$name."' ".is_selected($servicegroup,$name).">$name</option>\n";
			}
		}
?>
	</select>
to

Code: Select all

	<select name="hostgroup" id="hostgroupList" style="width: 150px;">
	<option value=""><?php echo gettext("Hostgroup"); ?>:</option>
<?php
	$hg_array = array();
	$oxml=get_xml_hostgroup_objects();
	if($oxml){
		foreach($oxml->hostgroup as $hg){
			$name=strval($hg->hostgroup_name);
			$hg_array["$name"] = "<option value='".$name."' ".is_selected($hostgroup,$name).">$name</option>\n";
		}
		sort($hg_array);
		foreach($hg_array as $name => $html) {
			echo $html;
		}
    }
?>
	</select>
	<select name="servicegroup" id="servicegroupList" style="width: 150px;">
	<option value=""><?php echo gettext("Servicegroup"); ?>:</option>
<?php
	$sg_array = array();
	$oxml=get_xml_servicegroup_objects();
	if($oxml){
		foreach($oxml->servicegroup as $sg){
			$name=strval($sg->servicegroup_name);
			$sg_array["$name"] = "<option value='".$name."' ".is_selected($servicegroup,$name).">$name</option>\n";
			}
		}
	sort($sg_array);
	foreach($sg_array as $name => $html) {
		echo $html;
	}
?>
	</select>
beginning on line 241. Note that other reports like the SLA will need to be similarly changed, but in the meantime this will work. The devs should hopefully be fixing this for all reports.
Former Nagios employee
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: UI Change Request 2

Post by rajasegar »

tmcdonald wrote:I might have a fix for this - checking with devs. Will update post when I know more.

Edit the /usr/local/nagiosxi/html/reports/execsummary.php file to change the following:

Code: Select all

	<select name="hostgroup" id="hostgroupList" style="width: 150px;">
	<option value=""><?php echo gettext("Hostgroup"); ?>:</option>
<?php
	$oxml=get_xml_hostgroup_objects();
	if($oxml){
		foreach($oxml->hostgroup as $hg){
			$name=strval($hg->hostgroup_name);
			echo "<option value='".$name."' ".is_selected($hostgroup,$name).">$name</option>\n";
			}
		}
?>
	</select>
	<select name="servicegroup" id="servicegroupList" style="width: 150px;">
	<option value=""><?php echo gettext("Servicegroup"); ?>:</option>
<?php
	$oxml=get_xml_servicegroup_objects();
	if($oxml){
		foreach($oxml->servicegroup as $sg){
			$name=strval($sg->servicegroup_name);
			echo "<option value='".$name."' ".is_selected($servicegroup,$name).">$name</option>\n";
			}
		}
?>
	</select>
to

Code: Select all

	<select name="hostgroup" id="hostgroupList" style="width: 150px;">
	<option value=""><?php echo gettext("Hostgroup"); ?>:</option>
<?php
	$hg_array = array();
	$oxml=get_xml_hostgroup_objects();
	if($oxml){
		foreach($oxml->hostgroup as $hg){
			$name=strval($hg->hostgroup_name);
			$hg_array["$name"] = "<option value='".$name."' ".is_selected($hostgroup,$name).">$name</option>\n";
		}
		sort($hg_array);
		foreach($hg_array as $name => $html) {
			echo $html;
		}
    }
?>
	</select>
	<select name="servicegroup" id="servicegroupList" style="width: 150px;">
	<option value=""><?php echo gettext("Servicegroup"); ?>:</option>
<?php
	$sg_array = array();
	$oxml=get_xml_servicegroup_objects();
	if($oxml){
		foreach($oxml->servicegroup as $sg){
			$name=strval($sg->servicegroup_name);
			$sg_array["$name"] = "<option value='".$name."' ".is_selected($servicegroup,$name).">$name</option>\n";
			}
		}
	sort($sg_array);
	foreach($sg_array as $name => $html) {
		echo $html;
	}
?>
	</select>
beginning on line 241. Note that other reports like the SLA will need to be similarly changed, but in the meantime this will work. The devs should hopefully be fixing this for all reports.
Mine does not look the same as yours. Please double confirm the version this is for.
See attached execsummary.php.
execsummary.zip
You do not have the required permissions to view the files attached to this post.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: UI Change Request 2

Post by tmcdonald »

Our two versions are different, yes. Looking at yours the changes begin on line 212 and go to line 235, and in mine there is an extra "style" parameter that should not affect anything. Other than that they are the same as far as this patch goes.
Former Nagios employee
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: UI Change Request 2

Post by rajasegar »

tmcdonald wrote:Our two versions are different, yes. Looking at yours the changes begin on line 212 and go to line 235, and in mine there is an extra "style" parameter that should not affect anything. Other than that they are the same as far as this patch goes.
I am not comfortable introducing change that is not based on the same version. There might be some other changes that possibly not considered.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: UI Change Request 2

Post by tmcdonald »

I just manually configured a new 2012R2.9 server and applied the patch myself - it works:
exec-alpha.png
Line 212 is the beginning of the <select> for hostgroups, and line 235 is the end of the <select> for servicegroups. All of the changes should be made in-between those lines. The only difference is that you will not have the CSS width attribute, which will not affect the functionality.
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: UI Change Request 2

Post by rajasegar »

tmcdonald wrote:I just manually configured a new 2012R2.9 server and applied the patch myself - it works:
exec-alpha.png
Line 212 is the beginning of the <select> for hostgroups, and line 235 is the end of the <select> for servicegroups. All of the changes should be made in-between those lines. The only difference is that you will not have the CSS width attribute, which will not affect the functionality.
Ok. Thanks for the confirmation.

Removed line 212 to 235 from original file and pasted your code.
The list is sorted now but the page does not produce any reports.

Noticed the following errors in the httpd error log. This errors are still there from the original version but it seems to be working.

Code: Select all

[Tue Jun 24 07:26:51 2014] [error] [client 10.17.44.201] PHP Notice:  Undefined variable: data in /usr/local/nagiosxi/html/reports/availability.php on line 98, referer: http://10.17.19.235/nagiosxi/reports/execsummary.php
[Tue Jun 24 07:26:51 2014] [error] [client 10.17.44.201] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/reports/availability.php on line 98, referer: http://10.17.19.235/nagiosxi/reports/execsummary.php
[Tue Jun 24 07:26:51 2014] [error] [client 10.17.44.201] PHP Notice:  Undefined variable: xdata in /usr/local/nagiosxi/html/reports/availability.php on line 111, referer: http://10.17.19.235/nagiosxi/reports/execsummary.php
[Tue Jun 24 07:26:51 2014] [error] [client 10.17.44.201] PHP Notice:  Undefined variable: data in /usr/local/nagiosxi/html/reports/availability.php on line 98, referer: http://10.17.19.235/nagiosxi/reports/execsummary.php
[Tue Jun 24 07:26:51 2014] [error] [client 10.17.44.201] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/reports/availability.php on line 98, referer: http://10.17.19.235/nagiosxi/reports/execsummary.php
[Tue Jun 24 07:26:51 2014] [error] [client 10.17.44.201] PHP Notice:  Undefined variable: xdata in /usr/local/nagiosxi/html/reports/availability.php on line 111, referer: http://10.17.19.235/nagiosxi/reports/execsummary.php
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: UI Change Request 2

Post by tmcdonald »

I'm a bit confused here. Those errors are from the Availability Report but we were working on the Executive Summary. Which of these are you seeing issues with?
Former Nagios employee
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: UI Change Request 2

Post by rajasegar »

tmcdonald wrote:I'm a bit confused here. Those errors are from the Availability Report but we were working on the Executive Summary. Which of these are you seeing issues with?
Sorry for the confusion, this was FYI on the possible issues on the other report. There was no errors in Executive Summary but nothing came out after making the changes.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
Locked