I want to create a nagios_hostgroup if some hosts exists. For creating hosts in nagios I am using exported resources which I collect on the monitoring server.
How can I test that a exported nagios_host resource exists? I tried the following:
Nagios_host <<| |>>
if defined(Nagios_host['host_1']) and defined(Nagios_host['host_2']) {
nagios_hostgroup { 'database_servers':
alias => 'My Hostgroup',
members => 'host_1,host_2',
}
}
Any idea?