Remove Autodiscovery Feature

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Remove Autodiscovery Feature

Post by emartine »

Is it possible to remove the auto-discovery component?
On Nagios XI 2014R2.6
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Remove Autodiscovery Feature

Post 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.
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Remove Autodiscovery Feature

Post by emartine »

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

Post 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.
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Remove Autodiscovery Feature

Post 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.
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Remove Autodiscovery Feature

Post 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. :)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Remove Autodiscovery Feature

Post by tmcdonald »

So it's like taking nmap from a baby? Now I'm confused.

Did the purposeful breakage work for you?
Former Nagios employee
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: Remove Autodiscovery Feature

Post 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)

Code: Select all

yum remove nmap
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 *
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Remove Autodiscovery Feature

Post by emartine »

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

Post by jdalrymple »

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.
Locked