May 30 11:43:06 myhost systemd[1]: Starting Naemon Monitoring Daemon...
May 30 11:43:06 myhost systemd[1]: Failed to read PID from file /var/run/naemon/naemon.pid: Invalid argument
May 30 11:43:06 myhost systemd[1]: Started Naemon Monitoring Daemon.
May 30 11:43:06 myhost systemd[1]: naemon.service: main process exited, code=exited, status=254/n/a
May 30 11:43:08 myhost systemd[1]: Unit naemon.service entered failed state.
May 30 11:43:08 myhost systemd[1]: naemon.service failed.
/usr/bin/naemon -v /etc/naemon/naemon.cfg
Naemon Core 1.0.6-pkg
Copyright (c) 2013-present Naemon Core Development Team and Community Contributors
Copyright (c) 2009-2013 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
License: GPL
Website: http://www.naemon.org
Reading configuration data...
Read main config file okay...
Error: Could not find any host matching 'localhost' (config file '/etc/naemon/conf.d/localhost.cfg', starting on line 35)
Error: Could not expand members specified in hostgroup (config file '/etc/naemon/conf.d/localhost.cfg', starting on line 35)
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Analising 35 line will have:
Define an optional hostgroup for Linux machines
define hostgroup {
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
members localhost ; Comma separated list of hosts that belong to this group
}
I think that member need be localhost2
maybe file /etc/naemon/conf.d/localhost.cfg needs be renamed too.
The problems are just with the examples hosts in /etc/naemon/conf.d/
New hosts created are in /etc/naemon/okconfig/hosts/ and are working with no problems.
Used Naemon and Adagios Install Guide https://github.com/opinkerfi/adagios/wiki/Naemon-and-Adagios-Install-Guide
Working normally except if I need to rename a host I try to apply the config and got a error on service restart:
● naemon.service - Naemon Monitoring Daemon Loaded: loaded (/usr/lib/systemd/system/naemon.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Tue 2017-05-30 11:43:08 -03; 717ms ago Docs: http://naemon.org/documentation Process: 10956 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS) Process: 14780 ExecStart=/usr/bin/naemon --daemon /etc/naemon/naemon.cfg (code=exited, status=0/SUCCESS) Process: 14777 ExecStartPre=/usr/bin/chown -R naemon:naemon /var/run/naemon/ (code=exited, status=0/SUCCESS) Process: 14776 ExecStartPre=/usr/bin/mkdir /var/run/naemon (code=exited, status=1/FAILURE) Main PID: 14782 (code=exited, status=254)
May 30 11:43:06 myhost systemd[1]: Starting Naemon Monitoring Daemon... May 30 11:43:06 myhost systemd[1]: Failed to read PID from file /var/run/naemon/naemon.pid: Invalid argument May 30 11:43:06 myhost systemd[1]: Started Naemon Monitoring Daemon. May 30 11:43:06 myhost systemd[1]: naemon.service: main process exited, code=exited, status=254/n/a May 30 11:43:08 myhost systemd[1]: Unit naemon.service entered failed state. May 30 11:43:08 myhost systemd[1]: naemon.service failed.
/usr/bin/naemon -v /etc/naemon/naemon.cfg
Naemon Core 1.0.6-pkg Copyright (c) 2013-present Naemon Core Development Team and Community Contributors Copyright (c) 2009-2013 Nagios Core Development Team and Community Contributors Copyright (c) 1999-2009 Ethan Galstad License: GPL
Website: http://www.naemon.org Reading configuration data... Read main config file okay... Error: Could not find any host matching 'localhost' (config file '/etc/naemon/conf.d/localhost.cfg', starting on line 35) Error: Could not expand members specified in hostgroup (config file '/etc/naemon/conf.d/localhost.cfg', starting on line 35) Error processing object config files!
***> One or more problems was encountered while processing the config files...
Analising 35 line will have:
Define an optional hostgroup for Linux machines
define hostgroup { hostgroup_name linux-servers ; The name of the hostgroup alias Linux Servers ; Long name of the group members localhost ; Comma separated list of hosts that belong to this group }
I think that member need be localhost2 maybe file /etc/naemon/conf.d/localhost.cfg needs be renamed too.