We're using nagios to check our ssh server is running. We have the check_ssh group defined for all members of a certain group. We have other services defined for that group as well. Everything is fine. However for 2 of the members of this group, they listen for ssh on a different port. Hence I have to make a new service for them. Which is fine, but then nagios complains that I'm defining the SSH service twice for the same host.

Can I change the original ssh service to include all the members of group A, but exclude hosts X and Y?

link|improve this question

79% accept rate
feedback

3 Answers

up vote 5 down vote accepted

Use the host_name directive in the service definition with an exclamation before the name of the host. For example:

define service{
        service_description     CPU Stats
        servicegroups   sysres
        use             generic
        hostgroup_name  linux
        host_name       !server1
        check_command   check_iostat
}
link|improve this answer
feedback
define service{
    service_name myservice
    hostgroup_name mygroup
    host_name !dontmonitorthis,!orthis
}
link|improve this answer
feedback

I tried the ! sign in front of host name but nagios configuration threw me an error. It doesnt like ! sign.

Is there something i might be missing

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.