Remove Autodiscovery Feature
Remove Autodiscovery Feature
Is it possible to remove the auto-discovery component?
On Nagios XI 2014R2.6
On Nagios XI 2014R2.6
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Remove Autodiscovery Feature
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.
Are you trying to prevent users from running it? Regular users are unable to run configuration wizards.
Re: Remove Autodiscovery Feature
Just making it unavailable so folks don't see it or use it.
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Remove Autodiscovery Feature
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:
You need to comment out some portions of the 2 functions listed below:
autodiscovery.inc.php lines 284-328:
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.
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.phpautodiscovery.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;
}
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
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
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
So it's like taking nmap from a baby? Now I'm confused.
Did the purposeful breakage work for you?
Did the purposeful breakage work for you?
Former Nagios employee
Re: Remove Autodiscovery Feature
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:
change to
Code: Select all
yum remove nmapCode: Select all
NAGIOSXI ALL = NOPASSWD:/usr/bin/nmap *
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/nmap *
Code: Select all
#NAGIOSXI ALL = NOPASSWD:/usr/bin/nmap *
#NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/nmap *
Re: Remove Autodiscovery Feature
Maybe just comment the URL instead? Where can I find it?
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Remove Autodiscovery Feature
The change I proposed above "comments out the URL" as you're requesting.
You do not have the required permissions to view the files attached to this post.