Page 1 of 1

Unconfigured Objects - automation

Posted: Thu Nov 23, 2017 5:34 am
by harshalx
Moderator Edit: This thread has been split from another - https://support.nagios.com/forum/viewto ... =6&t=45612

In the future, please create a new thread and link to the old one instead of adding on.


Did this feature ever get added to XI ?

I'm into a situation where we have federated monitoring in place where Nagios Core does the monitoring part and passes the passive check results to XI, which works like an aggregator and alerting tool for us.

We have an infrastructure of 100s of pods which pass check information to a central Nagios XI host. Each pod could have 200-300 hosts within it. I really cannot add each individual device manually by clicking the checkbox and then configure. Nor does the bulk "Hosts" checkbox at the top help when the unconfigured onjects run into 500+ devices.

Can I please request the following.

1. I see the entire concept of unconfigured objects a bit silly. This should be completely removed and the check results should be shown directly as normally configured objects.

2. If (1) cannot be done, then XI should provide a "Select All" checkbox which selects all the unconfigured objects and adds them in one go. This should have no limits to the # of objects that exist in that list.

3. Provide a rest url which takes in a single bulk request like http://nagiosxi/configure_objects?obj=all and configures all the objects in one go as normal objects.

Re: Unconfigured Objects - automation

Posted: Mon Nov 27, 2017 3:39 pm
by lmiltchev
1. I see the entire concept of unconfigured objects a bit silly. This should be completely removed and the check results should be shown directly as normally configured objects.
In Nagios XI 5.5, we are adding the ability to auto-monitor unconfigured objects (passive checks) that arrive (TASK ID 2231). XI 5.5 should be released sometime in December, even though this is not "set in stone" - I don't have an exact ETA.
2. If (1) cannot be done, then XI should provide a "Select All" checkbox which selects all the unconfigured objects and adds them in one go. This should have no limits to the # of objects that exist in that list.
You can select the check-box on the top in order to select ALL objects. Then you can click on the "Configure" button, and add them with "one go".

Example:
example01.PNG
3. Provide a rest url which takes in a single bulk request like http://nagiosxi/configure_objects?obj=all and configures all the objects in one go as normal objects.
Can you elaborate on this? Give us some examples. Thank you!

Re: Unconfigured Objects - automation

Posted: Thu Nov 30, 2017 12:41 pm
by harshalx
You can select the check-box on the top in order to select ALL objects. Then you can click on the "Configure" button, and add them with "one go".
You have selected just 3 unconfigured objects in the example snapshot. Please select 500 objects and try to hit the "Configure" button. It will fail.

Re: Unconfigured Objects - automation

Posted: Thu Nov 30, 2017 4:21 pm
by kyang
When you click configure, what's the error? Or does it just says a generic output of "fail"

If you selected a few at a time, would it work in general? Instead of all 500?

Re: Unconfigured Objects - automation

Posted: Mon Dec 11, 2017 8:44 am
by harshalx
If I select few at a time it will work, but if you select 500+ here is what you get :
unconfobj1.png
I have already increased the /etc/php.ini limit to 100,000.

Re: Unconfigured Objects - automation

Posted: Mon Dec 11, 2017 3:53 pm
by kyang
Did you restart apache after you edited that value in the /etc/php.ini file?

Code: Select all

service httpd restart

Re: Unconfigured Objects - automation

Posted: Tue Dec 12, 2017 4:01 am
by harshalx
Of course. That goes without question.

Re: Unconfigured Objects - automation

Posted: Tue Dec 12, 2017 10:54 am
by tmcdonald
harshalx wrote:Of course. That goes without question.
There are very few things that go without question when you are trying to troubleshoot a problem. Making assumptions is the easiest way to miss a potential solution.

If you have set the limit to 100,000 and are trying to throw in 500 objects, then that is 200 bytes per object which could very well be too much. I did some testing, and came up with these rough numbers for overhead:
  • Host: ~150 bytes + (2 * length of host name)
  • Service: ~160 bytes + length of host name + length of service description
  • Total per single host with single service: ~310 + (3 * length of host name) + length of service description
I came to these numbers by adding in some PHP print_r() calls to the wizard during the final stage. print_r() will take whatever you pass it and print it to the terminal/screen in a friendly debug format, so I passed in the array of variables built up from the unconfigured objects list. It looks like this:

Code: Select all

Array
(
    [0] => Array
        (
            [type] => 1
            [use] => xiwizard_passive_host
            [host_name] => somehost4
            [address] => somehost4
            [icon_image] => passiveobject.png
            [statusmap_image] => passiveobject.png
            [stalking_options] => n
            [_xiwizard] => passiveobject
        )

    [1] => Array
        (
            [type] => 2
            [host_name] => somehost4
            [service_description] => someservice4
            [use] => xiwizard_passive_service
            [check_interval] => 1
            [retry_interval] => 1
            [max_check_attempts] => 1
            [is_volatile] => 0
            [stalking_options] => n
            [_xiwizard] => passiveobject
        )

    [2] => Array
        (
            [type] => 1
            [use] => xiwizard_passive_host
            [host_name] => somehost5
            [address] => somehost5
            [icon_image] => passiveobject.png
            [statusmap_image] => passiveobject.png
            [stalking_options] => n
            [_xiwizard] => passiveobject
        )

    [3] => Array
        (
            [type] => 2
            [host_name] => somehost5
            [service_description] => someservice5
            [use] => xiwizard_passive_service
            [check_interval] => 1
            [retry_interval] => 1
            [max_check_attempts] => 1
            [is_volatile] => 0
            [stalking_options] => n
            [_xiwizard] => passiveobject
        )

    [4] => Array
        (
            [type] => 1
            [use] => xiwizard_passive_host
            [host_name] => somehost2
            [address] => somehost2
            [icon_image] => passiveobject.png
            [statusmap_image] => passiveobject.png
            [stalking_options] => n
            [_xiwizard] => passiveobject
        )

    [5] => Array
        (
            [type] => 2
            [host_name] => somehost2
            [service_description] => someservice2
            [use] => xiwizard_passive_service
            [check_interval] => 1
            [retry_interval] => 1
            [max_check_attempts] => 1
            [is_volatile] => 0
            [stalking_options] => n
            [_xiwizard] => passiveobject
        )

    [6] => Array
        (
            [type] => 1
            [use] => xiwizard_passive_host
            [host_name] => somehost3
            [address] => somehost3
            [icon_image] => passiveobject.png
            [statusmap_image] => passiveobject.png
            [stalking_options] => n
            [_xiwizard] => passiveobject
        )

    [7] => Array
        (
            [type] => 2
            [host_name] => somehost3
            [service_description] => someservice3
            [use] => xiwizard_passive_service
            [check_interval] => 1
            [retry_interval] => 1
            [max_check_attempts] => 1
            [is_volatile] => 0
            [stalking_options] => n
            [_xiwizard] => passiveobject
        )

    [8] => Array
        (
            [type] => 1
            [use] => xiwizard_passive_host
            [host_name] => somehost
            [address] => somehost
            [icon_image] => passiveobject.png
            [statusmap_image] => passiveobject.png
            [stalking_options] => n
            [_xiwizard] => passiveobject
        )

    [9] => Array
        (
            [type] => 2
            [host_name] => somehost
            [service_description] => someservice
            [use] => xiwizard_passive_service
            [check_interval] => 1
            [retry_interval] => 1
            [max_check_attempts] => 1
            [is_volatile] => 0
            [stalking_options] => n
            [_xiwizard] => passiveobject
        )

)
I submitted 5 separate host and service checks named somehost (and service) through somehost5 (and service). I then counted the characters in each of the array sections to come up with a very rough count of the total bytes in use.

Judging by my math, and assuming your hostnames are about 15 characters (can hold a whole IP address) and your service descriptions are about 25 (number pulled from thin air) then with a limit of 100,000 bytes you should start to see issues after 100,000 / (310 + (3 * host) + service) = 100,000 / (310 + (3 * 15) + 25) = 100,000 / (310 + (45) + 25) = 100,000 / 380 = about 260 objects.

Conversely, if you want to handle 500 objects then you should aim for about 250,000 in your php.ini settings for good measure.