Is the goal just to catch hosts not added to a hostgroup so you can spot them?
If so, you could do it with a service definition since with those you *can* send it a * for the host_name and then do a set of exceptions with hostgroups.
Something like this would use check_dummy for all hosts not defined in the hostgroups you list:
Code: Select all
define service{
use yourservicetemplate
host_name *
hostgroup_name !hostgroup1, !hostgroup2, !hostgroupC
service_description NoHostGroup
check_command check_dummy!2!IHaveNoHostGroup
#check_dummy takes 0-3 (0=ok, 1=warn, 2=crit, 3=unk)
#as the first arg and just returns that as the nagios state
#2nd arg is output text
}
check_dummy command def in case you don't have one:
Code: Select all
define command{
command_name check_dummy
command_line $USER1$/check_dummy $ARG1$ $ARG2$
}
(If you want to include other hostgroups in a hostgoups directive, you'd normally do with the optional 'hostgroup_members' directive, not in the members directive; unfortunately hostgroup_members doesn't take !'s for negation - feature request?)
Edit1: Changed the check to use check_dummy instead of check_ping