z

Commercial Support Clients: Clients with support contracts can get escalated support assistance by visiting Nagios Answer Hub. These forums are for community support services. Although we at Nagios try our best to help out on the forums here, we always give priority support to our support clients.

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.

server exclude

Postby tonnag » Mon Jun 27, 2022 8:15 am

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: 15
Joined: Thu Sep 06, 2018 2:27 am

Re: server exclude

Postby tonnag » Tue Jun 28, 2022 11:17 am

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: 15
Joined: Thu Sep 06, 2018 2:27 am

Re: server exclude

Postby tonnag » Tue Jul 05, 2022 3:52 am

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
tonnag
 
Posts: 15
Joined: Thu Sep 06, 2018 2:27 am


Return to Open Source Nagios Projects

Who is online

Users browsing this forum: No registered users and 28 guests