Page 1 of 1

Change of hostgroups.cfg without restarting nagios

Posted: Thu Jun 28, 2018 8:11 pm
by yomiko
If I changed the cfg files in objects/ (e.g. hostgroups.cfg), is there a way to make nagios pick up the
config changes without restarting the nagios service?

The server is running RHEL7.

Using the unit file below.

Code: Select all

[Unit]
Description=Nagios Network Monitoring
After=network.target
Documentation=https://www.nagios.org/documentation/

[Service]
Type=forking
User=nagios
Group= nagios
PIDFile=/app/var/nagios/nagios.pid
#----------------------------------------------------------
# Verify Nagios config before start as upstream suggested
#----------------------------------------------------------
ExecStartPre=/usr/sbin/nagios -v /app/etc/nagios/nagios.cfg
ExecStart=/usr/sbin/nagios -d /app/etc/nagios/nagios.cfg
ExecStopPost=/usr/bin/rm -f /app/var/nagios/rw/nagios.cmd

[Install]
WantedBy=multi-user.target

What should the ExecReload command be like? This doesn't work

ExecReload=/usr/bin/kill -HUP $MAINPID


Thanks!

Re: Change of hostgroups.cfg without restarting nagios

Posted: Thu Jun 28, 2018 8:40 pm
by yomiko
Nevermind. It worked. :)

Re: Change of hostgroups.cfg without restarting nagios

Posted: Fri Jun 29, 2018 10:53 am
by scottwilkerson
Excellent, glad it is resolved.

Usually you just need to restart nagios after making the change.