Access Hosts VS Services

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ITOMB_IMT
Posts: 181
Joined: Wed Oct 17, 2018 12:55 pm

Access Hosts VS Services

Post by ITOMB_IMT »

I need a small clarification, if the contact is the Host alert list, but not in Host's associated service contact. will the contact be able to see the service and make changes to the service?

Also is there a way we can multiple hosts and services to Nagios Xi other than GUI as when i add the host.cfg and service.cfg, i cannot see them in GUI.

Thanks,
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Access Hosts VS Services

Post by lmiltchev »

I need a small clarification, if the contact is the Host alert list, but not in Host's associated service contact. will the contact be able to see the service and make changes to the service?
If a contact is added to a host, he/she would be able to see all of the services on that host as well. This is by design. If the contact was created in Nagios XI as a "regular user" with no special permissions, the contact would be able to enable/disable notifications, force immediate checks, view performance graphs, etc.
Also is there a way we can multiple hosts and services to Nagios Xi other than GUI as when i add the host.cfg and service.cfg, i cannot see them in GUI.
I am not sure I am following. Are you trying to add hosts/services in Nagios XI from the command line? Can you describe the exact steps that you took when adding the host.cfg and service.cfg?
Be sure to check out our Knowledgebase for helpful articles and solutions!
ITOMB_IMT
Posts: 181
Joined: Wed Oct 17, 2018 12:55 pm

Re: Access Hosts VS Services

Post by ITOMB_IMT »

I tried to add multiple hosts from command like i created host.cfg and service.cfg and placed those files in /usr/local/nagios/etc/hosts and/usr/local/nagios/etc/services. then i ran reconfigure_nagios.sh but i don't see those hosts and services in Nagios Xi. am i doing it in wrong way? if so let me know how to add multiple hosts/services from command line.


Thanks,
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Access Hosts VS Services

Post by lmiltchev »

You need to place your configuration files to the /usr/local/nagios/etc/import directory, prior to running the reconfigure_nagios.sh script, so that configs can be imported into the CCM (DB).

Please review our documentation on the Nagios XI directory structure here:
https://assets.nagios.com/downloads/nag ... ucture.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
ITOMB_IMT
Posts: 181
Joined: Wed Oct 17, 2018 12:55 pm

Re: Access Hosts VS Services

Post by ITOMB_IMT »

is there any document or way to create/add multiple hosts and services to Nagios xi from command line?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Access Hosts VS Services

Post by lmiltchev »

You could use Nagios XI REST API functionality to achieve this. Add all of your curl commands for adding hosts/services in a shell script, and run it. You will find examples of various API commands under the Help menu in the Nagios XI web UI.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ITOMB_IMT
Posts: 181
Joined: Wed Oct 17, 2018 12:55 pm

Re: Access Hosts VS Services

Post by ITOMB_IMT »

If i have to add 4 hosts each having 20 services to monitor, then do i need to create a API for each service (total 80 services)?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Access Hosts VS Services

Post by lmiltchev »

It depends. What kind of services are these? Are they similar/same across these hosts? Nagios is a very flexible product. You could achieve the same results different ways. You could add a service to a host group. This way it would be added to all hosts that are members of the hostgroup. As you add new members to this hostgroup, the service would be added automatically. So, instead of adding 4 identical services to 4 different hosts, you could place these hosts in a hostgroup, and add one service to it.

There are other ways of adding objects from the CLI. You could generate your configs via some kind of scripting solution, then copy the configs to the /usr/local/nagios/etc/import directory, and run the /usr/local/nagiosxi/scripts/reconfigure_nagios.sh script.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ITOMB_IMT
Posts: 181
Joined: Wed Oct 17, 2018 12:55 pm

Re: Access Hosts VS Services

Post by ITOMB_IMT »

I have to monitor logical volumes(disk space) on all the 4 servers, the logical volumes differ from server to server, i can add the service to host group if its same on all servers but in my case the logical volumes(disk space) and services are different on different servers.

can you explain more on this?
There are other ways of adding objects from the CLI. You could generate your configs via some kind of scripting solution, then copy the configs to the /usr/local/nagios/etc/import directory, and run the /usr/local/nagiosxi/scripts/reconfigure_nagios.sh script.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Access Hosts VS Services

Post by lmiltchev »

I have to monitor logical volumes(disk space) on all the 4 servers, the logical volumes differ from server to server, i can add the service to host group if its same on all servers but in my case the logical volumes(disk space) and services are different on different servers.
If your logical volumes all differ, and your services need to be different, then you need to have different REST API calls.
can you explain more on this?
When you run the reconfigure_nagios.sh script, any configuration files that are located in the /usr/local/nagios/etc/import directory will get automatically imported into the CCM (database), provided these are "valid" configs, and you didn't have any config errors. See our documentation on the directory structure in Nagios XI here:

https://assets.nagios.com/downloads/nag ... ucture.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked