nagios, same command for multiple hosts
Hi, I was wondering if it is possible in Nagios (monitoring software) to define a command to run for multiple hosts in one go.
The normal way is to write a stanza for each host. Since all my hosts and commands are the same I would like to define a group of hosts to which apply the same monitor-command. Is that possible? How? If possible I would like to avoid plugins or extensions. |
I assume you mean you use the same cmds/checks for all hosts (you can't have all the 'same hosts' ;-) )
Anyway, create a stanza for each cmd for 1 host, then write a short script to cp the file for each extra host and substitute eg via sed, the name of each host, then concat the files together eg: cat host1.cfg host2.cfg ... >> hosts.cfg |
Thanks for the try. But I found out it can be done with the hostgroup_name definition in nagios. Or you can use a comma-separated list of multiple hosts in host_name.
So /etc/nagios/services.cfg would look something like this: Code:
define service{ Code:
define service{ |
All times are GMT -5. The time now is 07:45 AM. |