server exclude

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
tonnag
Posts: 16
Joined: Thu Sep 06, 2018 2:27 am

server exclude

Post by tonnag »

Hi,
i'm running "Nagios Core 4.4.6" and I thought I could exclude a hostname in the definition.

This works

Code: Select all

define service {
    use                     generic-service
    hostgroup_name          grp-raspbian
    service_description     ping
    check_command           check_ping!200.0,20%!600.0,60%
     check_interval          5
    retry_interval          1
}
But adding

Code: Select all

   host_name                !hass

in the block above result in an errors

Code: Select all

Error: Could not find any host matching '!hass' 
Error: Failed to expand host list '!hass' 
indeed there is no host named !hass but host_name hass is there. Did I miss something somewhere in excluding one host from the group in one service?

Thnx
Ton
tonnag
Posts: 16
Joined: Thu Sep 06, 2018 2:27 am

Re: server exclude

Post by tonnag »

I just found

Code: Select all

 host_name                !*hass
and

Code: Select all

 host_name                !?ass
eliminate the pre-check error, but still not excludes the server from the service check
placing the wildcard not directly after the exclamation mark but anywhere else, results in an error during pre-check
tonnag
Posts: 16
Joined: Thu Sep 06, 2018 2:27 am

Re: server exclude

Post by tonnag »

Well, ended up building a test machine from scratch. The "!" stops functioning when

Code: Select all

use_true_regexp_matching=1
reset to zero and off we go
Locked