Page 1 of 3
Remove Autodiscovery Feature
Posted: Tue Mar 10, 2015 11:47 am
by emartine
Is it possible to remove the auto-discovery component?
On Nagios XI 2014R2.6
Re: Remove Autodiscovery Feature
Posted: Tue Mar 10, 2015 12:01 pm
by jdalrymple
Auto-Discover Wizard is a special component of NagiosXI and there is no current way to remove or disable it to the best of my knowledge. It could probably be purposefully broken so it cannot be used, however that change would be overriden upon upgrade or reinstall.
Are you trying to prevent users from running it? Regular users are unable to run configuration wizards.
Re: Remove Autodiscovery Feature
Posted: Tue Mar 10, 2015 2:06 pm
by emartine
Just making it unavailable so folks don't see it or use it.
Re: Remove Autodiscovery Feature
Posted: Tue Mar 10, 2015 3:13 pm
by jdalrymple
emartine,
As I mentioned, this is not a built-in feature of NagiosXI so while the solution I provide will mask the Auto-Discovery wizard, I cannot promise that it won't have adverse affects. Additionally, as mentioned, when you upgrade or reinstall the changes will get overwritten and the Auto-Discovery wizard will become visible again. It is further imperative that you have good backups of any files that you modify prior to making these adjustments.
The file that needs to be modified in order to hide the Auto-Discovery component is:
Code: Select all
/usr/local/nagiosxi/html/includes/components/autodiscovery/autodiscovery.inc.php
You need to comment out some portions of the 2 functions listed below:
autodiscovery.inc.php lines 284-328:
Code: Select all
function autodiscovery_component_addmenu($arg = null)
{
global $autodiscovery_component_name;
$mi = find_menu_item(MENU_CONFIGURE, "menu-configure-monitoringwizard", "id");
if ($mi == null)
return;
$order = grab_array_var($mi, "order", "");
if ($order == "")
return;
$neworder = $order + 0.1;
// add_menu_item(MENU_CONFIGURE, array(
// "type" => "link",
// "title" => gettext("Auto-Discovery Wizard"),
// "id" => "menu-configure-autodiscovery",
// "order" => $neworder,
// "opts" => array(
// "href" => get_base_url() . 'includes/components/autodiscovery/',
// )
// ));
}
function autodiscovery_component_addsplash($arg = null)
{
$url = get_base_url() . 'includes/components/autodiscovery/';
$img_url = $url . "images/";
$output = '';
$output .= '
<br clear="all">
<p>
<a href="' . $url . '"><img src="' . $img_url . 'autodiscovery.png" style="float: left; margin-right: 10px;"> ' .
gettext('Run the Auto-Discovery Wizard') . '</a><br>
' . gettext('Auto-discover new devices and services to monitor.') . '
</p>
';
// echo $output;
}
Lastly you will have to remove the Auto-Discovery Wizard from the Manage Configuration Wizards menu in the Admin area of NagiosXI.
As I mentioned this is not an ideal solution and it is not something that we can't necessarily support, It is a workaround. In lieu of this we strongly recommend that you use the builtin user control features to prevent users from running the Auto Discovery feature.
Re: Remove Autodiscovery Feature
Posted: Tue Mar 10, 2015 3:26 pm
by emartine
Well.... it's not users but Admins that need to stop attempting to use this since it causes security flags to be raised.
Re: Remove Autodiscovery Feature
Posted: Tue Mar 10, 2015 3:30 pm
by emartine
It's kinda like putting a lolly pop in front of a 3 year old and not expecting them to take it. Mmmmm candy.

Re: Remove Autodiscovery Feature
Posted: Tue Mar 10, 2015 3:36 pm
by tmcdonald
So it's like taking nmap from a baby? Now I'm confused.
Did the purposeful breakage work for you?
Re: Remove Autodiscovery Feature
Posted: Tue Mar 10, 2015 3:41 pm
by cmerchant
Another way to lock it down, at least for the real security concern would be to remove the nmap function (backend to the autodiscovery)
or comment out the two lines in the /etc/sudoers file:
Code: Select all
NAGIOSXI ALL = NOPASSWD:/usr/bin/nmap *
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/nmap *
change to
Code: Select all
#NAGIOSXI ALL = NOPASSWD:/usr/bin/nmap *
#NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/nmap *
Re: Remove Autodiscovery Feature
Posted: Tue Mar 10, 2015 3:48 pm
by emartine
Maybe just comment the URL instead? Where can I find it?
Re: Remove Autodiscovery Feature
Posted: Tue Mar 10, 2015 3:50 pm
by jdalrymple
The change I proposed above "comments out the URL" as you're requesting.