Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Same server in Multiple group #8

Closed
chetanpatangade opened this issue Oct 14, 2016 · 3 comments
Closed

Add Same server in Multiple group #8

chetanpatangade opened this issue Oct 14, 2016 · 3 comments
Labels

Comments

@chetanpatangade
Copy link

Hi,

I downloaded this module, but I have one query. If i add same server in multiple groups it should be run.
For eg I added one server [10.1.2.86] in [switches][webservers] [servers] Group. I am thinking that it would use the checks that we have mentioned in [switches][webservers] [servers] i.e. in Nagios My server will be like this :- 10.1.2.86 : [switches] :- All Checks
[webservers] All Checks
[servers] All Checks

How can it be done ? Can you please give any suggestion ?

@chetanpatangade
Copy link
Author

Any update on this ?

@sadsfae
Copy link
Owner

sadsfae commented Nov 29, 2016

Hi @chetanpatangade

The way this is templated you should be adding a server (or device) only to one type of hostgroup or as it parses the inventory file - one group only that matches the purpose.

For example a generic Linux server should only be added to the [servers] inventory group in hosts

[servers]
your-server-hostname

Don't put it in other categories as Ansible will pick the first occurrence of it due to how it's written and parsed by nagios.

If this server is also a webserver then just place it in the [webservers] group. It will still inherit the same checks as [servers] with the inclusion of HTTP checks.

[webservers]
my-web-server01

If you have a generic switch that needs checks for ssh, ping

[switches]
my-switch-hostname ansible_host=10.1.2.88

If you have a generic out-of-band interface that needs ssh, ping, http checks

[oobservers]
my-ipmi-interface-server01 ansible_host=10.2.1.88

Note: You only need to specify the IP address via ansible_host for devices that are not standard Linux servers and cannot run the NRPE Nagios client (and Python and Ansible facts discovery).

@sadsfae
Copy link
Owner

sadsfae commented Dec 21, 2016

Closing this now, I hope this answers your query. If not please re-open.

@sadsfae sadsfae closed this as completed Dec 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants