We've moved to a new support system!

The Nagios Answer Hub is a place where you can get help with technical questions from our experts. There, you can quickly open tickets and join discussion boards.

Request Nagios Answer Hub access here: https://info.nagios.com/answer-hub-access-new-users

After completing the access form, you will be given access to a portal where new tickets can be created. We will keep the old customer forum sections and ticket system available for current cases to be resolved.

Go to the Answer Hub

server exclude

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

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 Community Support

Who is online

Users browsing this forum: dawaggen and 21 guests