Page 1 of 1

Hide a Hostgroup in XI

Posted: Fri Jun 17, 2016 6:05 am
by Deantwo
As detailed in this thread: https://support.nagios.com/forum/viewto ... =16&t=9524
It is possible to hide a hostgroup in Nagios XI, but using the above detailed method is not only a weird workaround, it is plain weird to work with.

I would very much like a simple option to "hide" a hostgroup in XI.
It would seemingly be as simple as adding a checkbox in the "Host Group Management" window in the CCM, since the hostgroup's "register" value just needs to be set to "0".

Re: Hide a Hostgroup in XI

Posted: Fri Jun 17, 2016 9:46 am
by tmcdonald
By "hide" do you mean to still use it but just not show it anywhere? Setting "register 0" actually means something is a template as opposed to a complete object, or should simply not be loaded into Nagios as-is (incomplete object/template, see below).

https://assets.nagios.com/downloads/nag ... tance.html

So while this would hide it, if you have any hosts associated with that group they will not be added to it since it won't exist.

Please clarify the specific usage you are looking for and we'll see what can be done, or if a feature request needs to be added.

Re: Hide a Hostgroup in XI

Posted: Fri Jun 17, 2016 4:23 pm
by Deantwo
Much like explained in the thread I mentioned.

I have a couple of hostgroups that I use to assign specific services to their member hosts.
But I do not want these hostgroups to appear is the views for users. Such as on the Hostgroup Overview and BBmap dropdown filter.

I do it this way because I have hosts being created dynamically, and depending on what the host has running I add the specific hostgroup that has the desired services.
This means that I now have hostgroups that do nothing but add special services. These hostgroups I then don't want to show up in the XI views.

I can't think of any better way to accomplish what I want, and the method in the mentioned thread works, it just seems silly that I have to fiddle with static configuration, and repeatedly enable and disable the hostgroups when making changes to the members in CCM.

Re: Hide a Hostgroup in XI

Posted: Mon Jun 20, 2016 11:04 am
by lmiltchev
tmcdonald is correct:
Setting "register 0" actually means something is a template as opposed to a complete object...
This was the only "workaround" that I could think of 3 years ago, as this functionality doesn't exist in Nagios XI. You are welcome to post a feature request on our public tracker here: http://tracker.nagios.com, but I am not sure if it will be implemented. I haven't seen any requests for adding this functionality to Nagios XI.

Re: Hide a Hostgroup in XI

Posted: Mon Jun 20, 2016 11:25 am
by Deantwo
lmiltchev wrote:tmcdonald is correct:
Setting "register 0" actually means something is a template as opposed to a complete object...
This was the only "workaround" that I could think of 3 years ago, as this functionality doesn't exist in Nagios XI.
know it means it is a template, but oddly enough it works.
So if it actually works, why can't we do it in Nagios XI?
lmiltchev wrote:You are welcome to post a feature request on our public tracker here: http://tracker.nagios.com, but I am not sure if it will be implemented. I haven't seen any requests for adding this functionality to Nagios XI.
Thought this forum was for making feature requests, at least didn't see mention of that tracker.
Sure I'll post a feature request on it.

Re: Hide a Hostgroup in XI

Posted: Mon Jun 20, 2016 12:57 pm
by lmiltchev
know it means it is a template, but oddly enough it works.
So if it actually works, why can't we do it in Nagios XI?
Using hostgroup/servicegroup templates is not that common in Nagios Core. With object inheritance mostly host, service, and contact templates are used. That is why, in Nagios XI (under the CCM), you have links to these templates only (under the "Templates" menu on the left). Other words, you can't add/modify a "hostgroup template" in the CCM.

You could do the following from the command line:
1. Move the "hostgroups.cfg" to the imports directory.

Code: Select all

mv /usr/local/nagios/etc/hostgroups.cfg /usr/local/nagios/etc/import/
2. Open the "hostgroups.cfg" in a text editor:

Code: Select all

vi /usr/local/nagios/etc/import/hostgroups.cfg
and modify "set" the hostgroup in question as a template, i.e.

Code: Select all

define hostgroup {
        hostgroup_name                          MyHostgroup
        alias                                   My Host Group
        members                                 Host1,Host2
	     register								        0
        }
3. Run reconfigure_nagios.sh script:

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
After running the above commands, you will be able to see the hosgroup in the CCM but it will be deactivated, so you won't be able to modify it as it is NOT an active object... So, this is not a good approach, either. The only other way would be to use the static.
Thought this forum was for making feature requests, at least didn't see mention of that tracker.
Sure I'll post a feature request on it.
This is our public tracker. We can also file an internal feature request for you to our system, but it would NOT be publicly available/visible. Other users who would like to see the same functionality implemented in XI won't be able to post comments.

Re: Hide a Hostgroup in XI

Posted: Tue Jun 21, 2016 3:11 am
by Deantwo
lmiltchev wrote:...

After running the above commands, you will be able to see the hosgroup in the CCM but it will be deactivated, so you won't be able to modify it as it is NOT an active object... So, this is not a good approach, either. The only other way would be to use the static.
Yeah, that is possible too.
But since I don't actually need to change the hostgroup at all once it is made, this may work better, I'll give it a try.

The current annoyance is that I can't add the hostgroup to hosts and services in the CCM while it is disabled.
So I have to enable the hostgroup, add the hostgroup to hosts and services, then disable the hostgroup again.

It just seems very simple to me to add an option in CCM to save a hostgroup (or servicegroup) as a template, but otherwise treat it as a normal object.
Then again, I don't know how the CCM works behind the scene.
lmiltchev wrote:
Deantwo wrote:Thought this forum was for making feature requests, at least didn't see mention of that tracker.
Sure I'll post a feature request on it.
This is our public tracker. We can also file an internal feature request for you to our system, but it would NOT be publicly available/visible. Other users who would like to see the same functionality implemented in XI won't be able to post comments.
I have made a feature request on the public tracker.
Found here: http://tracker.nagios.com/view.php?id=797

Re: Hide a Hostgroup in XI

Posted: Tue Jun 21, 2016 10:54 am
by lmiltchev
@Deantwo thanks for posting the feature request!

Since, the FR has been already posted on our public tracker, I will be locking this topic. If you have any more questions/issues, please start a new thread.