Nagios4 configuration check on start \ reload

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
thetechguy
Posts: 25
Joined: Wed Feb 12, 2014 5:05 pm

Nagios4 configuration check on start \ reload

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios4 configuration check on start \ reload

Post by slansing »

What distro is this installed on, and was it installed by a package manager, or source?
thetechguy
Posts: 25
Joined: Wed Feb 12, 2014 5:05 pm

Re: Nagios4 configuration check on start \ reload

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nagios4 configuration check on start \ reload

Post 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)
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
thetechguy
Posts: 25
Joined: Wed Feb 12, 2014 5:05 pm

Re: Nagios4 configuration check on start \ reload

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nagios4 configuration check on start \ reload

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
thetechguy
Posts: 25
Joined: Wed Feb 12, 2014 5:05 pm

Re: Nagios4 configuration check on start \ reload

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios4 configuration check on start \ reload

Post 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.
Former Nagios employee
Locked