I'm trying to get regex matching to work.
Something like this:
Code: Select all
define hostgroup {
hostgroup_name Linux-Regex
alias Regex Test for All Linux Hosts
members ^[a-zA-Z]{4}[l]*.*
}Code: Select all
# grep regex /etc/nagios/nagios.cfg
use_regexp_matching=1
use_true_regexp_matching=0Code: Select all
# /usr/local/nagios/bin/nagios -vv /etc/nagios/nagios.cfg
Nagios Core 4.4.6
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2020-04-28
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config directory '/usr/local/nagios/etc/static'...
Processing object config file '/usr/local/nagios/etc/static/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/static/host-templates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/service-templates.cfg'...
Processing object config directory '/usr/local/nagios/etc/static/EIS'...
Processing object config directory '/usr/local/nagios/etc/static/EIS/backup'...
Processing object config directory '/usr/local/nagios/etc/static/EIS/HOSTS'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/other-hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/VIP-hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/linux-hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/vmware-hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/security-hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/netops-hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/windows-prod-hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/windows-dev-hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/windows-test-hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/infoblox-hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/acd-hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/paloalto-hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/HOSTS/network-security-hosts.cfg'...
Processing object config directory '/usr/local/nagios/etc/static/EIS/SERVICES'...
Processing object config file '/usr/local/nagios/etc/static/EIS/SERVICES/netops-services.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/SERVICES/ACD-services.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/SERVICES/ldap-admin-checks.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/SERVICES/ldap-service-accounts-checks.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/SERVICES/security-services.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/SERVICES/services.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/SERVICES/windows-services.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/SERVICES/linux-services.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/SERVICES/palo-alto-services.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/SERVICES/netsec-windows-services.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/hostgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/static/EIS/hostgroups-empty.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.cfg'...
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contactgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/hostgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/servicegroups.cfg'...
Processing object config file '/usr/local/nagios/etc/hosttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicetemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicedependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostdependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/hostescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostextinfo.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceextinfo.cfg'...
Processing object config directory '/usr/local/nagios/etc/hosts'...
Processing object config directory '/usr/local/nagios/etc/services'...
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data definitions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
#