Checking a service on all hosts _except_...
Andreas Ericsson
ae at op5.se
Tue Oct 18 14:21:30 CEST 2005
Ian Marlier wrote:
>
>
>>From: Andreas Ericsson <ae at op5.se>
>>Date: Tue, 18 Oct 2005 08:57:20 +0200
>>To: Ian Marlier <ian.marlier at studentuniverse.com>
>>Cc: "nagios-users at lists.sourceforge.net" <nagios-users at lists.sourceforge.net>
>>Subject: Re: [Nagios-users] Checking a service on all hosts _except_...
>>
>>Ian Marlier wrote:
>>
>>>Hey, all --
>>>
>>>This is one of those questions that I'm sure many people have asked before,
>>>but I haven't been able to find the answer if/when it was given...so sorry
>>>if I'm making someone repeat him/herself....
>>>
>>>Anyway.
>>>
>>>I've got an environment with about 65 linux servers, and about 5 windows
>>>servers. There's a base set of 6 or 7 services that I want to monitor on
>>>all of them: connectivity, ssh, cron, and a couple of others.
>>>
>>>I'm wondering whether it's possible to define a hostgroup (say,
>>>"windows-servers") with the non-linux boxes listed, and then define a
>>>service check for all hosts except those.
>>>
>>>Something like:
>>>
>>>define service {
>>>name SSH
>>>host_name *
>>>except_hostgroup windows-servers
>>>check_command check_ssh
>>>.
>>>.
>>>.
>>>}
>>>
>>>So, anyone have any thoughts? C'mon, make my life better ;-)
>>>
>>
>>define service {
>> service_description SSH
>> host_name *
>> hostgroup_name !windows-servers
>> check_command check_ssh
>>}
>>
>>I think that should work. If it doesn't you can always do it the other
>>way around and create a hostgroup with everything but the
>>windows-servers in them.
>
>
>
> Hmmm....that doesn't seem to work, unfortunately, because that would be a
> very nice solution...
>
> I know that I can create the hostgroup -- since I have so few machines that
> run windows (and it's a number that's going to get smaller), I'm just hoping
> to avoid having to maintain an "all but 5 machines" type of group...
>
> Thanks for the thought, Andreas.
>
I know the ! should work somewhere in the config. Perhaps you'll have
better luck if you do
define hostgroup {
hostgroup_name non-windows-servers
alias Only FUN servers
members *,!windows-server1,!windows-server2
}
Then make a service for that hostgroup to check ssh.
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list