Page 1 of 1

Nagios4 configuration check on start \ reload

Posted: Fri Mar 07, 2014 5:49 pm
by thetechguy
Recently installed a new Build 4.0.3 - I am familiar with Nagios also have a 3.0b5 build running..

On my 3.0b5 build when ever the Nagios service is started / restarted / reloaded a configuration check is run and the output is seen as below.

Code: Select all

[root@nagios ~]# service nagios reload
Running configuration check...done.
Reloading nagios configuration...done
On the new build (for me) this is not happening. And the output is a bit different.

Code: Select all

[root@nagiosvm ~]# service nagios reload
nagios (pid 10681 10680 10679 10678 10677 10675) is running...
Reloading nagios:                                          [  OK  ]
Is this a feature change in the newer versions..

Let me know..

Thank you

Jon

Re: Nagios4 configuration check on start \ reload

Posted: Mon Mar 10, 2014 10:12 am
by slansing
What distro is this installed on, and was it installed by a package manager, or source?

Re: Nagios4 configuration check on start \ reload

Posted: Wed Mar 12, 2014 11:45 am
by thetechguy
This was installed on Centos 6.5 - I followed this the below guide to install.

http://nagios.sourceforge.net/docs/nagi ... edora.html


Thank you

Jon

Re: Nagios4 configuration check on start \ reload

Posted: Wed Mar 12, 2014 1:30 pm
by sreinhardt
Does your /etc/init.d/nagios have checkconfig="true"? If so it does do a config verification, however any output is redirected to a file for logging (/tmp/.configtest.XXXXXXXX)

Re: Nagios4 configuration check on start \ reload

Posted: Fri Mar 14, 2014 2:05 pm
by thetechguy
This is how my /etc/init.d/nagios file is set..

Code: Select all

reload() {
        echo -n $"Reloading $prog: "
        killproc -p ${pidfile} $exec -HUP
        RETVAL=$?
        echo
}
I am not sure if the previous Admin set it up this way or not but on the old Nagios 3.05b box the reload looks like this.

Code: Select all

reload|force-reload)
                printf "Running configuration check..."
                $NagiosBin -v $NagiosCfgFile > /dev/null 2>&1;
                if [ $? -eq 0 ]; then
                        echo "done."
                        if test ! -f $NagiosRunFile; then
                                $0 start
                        else
                                pid_nagios
                                if status_nagios > /dev/null; then
                                        printf "Reloading nagios configuration..."
                                        killproc_nagios nagios -HUP
                                        echo "done"
                                else
                                        $0 stop
                                        $0 start
                                fi
                        fi
                else
                        echo " CONFIG ERROR!  Reload aborted.  Check your Nagios configuration."
                        exit 1
                fi
                ;;

        *)
                echo "Usage: nagios {start|stop|restart|reload|force-reload|status|check}"
                exit 1
                ;;

esac

# End of this script
On the 3.05b version - when a reload command was executed, the config files were checked for errors and if there were any problems it would not reload .

Looks like I would need to change the current version reload settings to match that of the old reload settings to accomplish this?

Let me know if this is correct.

Thank you

Jon

Re: Nagios4 configuration check on start \ reload

Posted: Fri Mar 14, 2014 4:14 pm
by sreinhardt
I would tend to agree, the 3.05 one looks correct. As a side note, the init scripts are a part of several bug fixes that are being worked on or have already been completed for core.

Re: Nagios4 configuration check on start \ reload

Posted: Mon Mar 24, 2014 8:51 am
by thetechguy
I upgraded to 4.0.4 last week and noticed right away that the configuration check that I was used to seeing in 3.0b5 upon a nagios service reload was working again in the new version.

Code: Select all

[root@nagiosvm ~]# service nagios reload
Running configuration check...Reloading nagios configuration...done
Thank you

Jon

Re: Nagios4 configuration check on start \ reload

Posted: Mon Mar 24, 2014 9:28 am
by tmcdonald
Good to hear. I'll be closing this thread now, but feel free to open another if you need assistance in the future.