Page 1 of 1

server exclude

PostPosted: Mon Jun 27, 2022 8:15 am
by tonnag
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?


Re: server exclude

PostPosted: Tue Jun 28, 2022 11:17 am
by tonnag
I just found
Code: Select all
host_name                !*hass

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

Re: server exclude

PostPosted: Tue Jul 05, 2022 3:52 am
by tonnag
Well, ended up building a test machine from scratch. The "!" stops functioning when

Code: Select all

reset to zero and off we go