Apply Configuration does not work after 2.6 upgrade

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: Apply Configuration does not work after 2.6 upgrade

Post by questrad »

Hmm.

From the logs Nagios core is started.
Can you try again and find the PID from:

Code: Select all

==> /usr/local/nagios/var/nagios.log <==
[1426503529] Nagios 4.0.8 starting... (PID=XXX)
?

And see if that PID is exist in processes.


Here is part where it show of shutdown and start of Nagios Core (or you start it manualy?)

Code: Select all

==> /usr/local/nagios/var/nagios.log <==
[1426503528] Caught SIGTERM, shutting down...
[1426503529] Successfully shutdown... (PID=18106)
[1426503529] Event broker module 'NERD' deinitialized successfully.
[1426503529] Event broker module '/usr/lib64/mod_gearman/mod_gearman.o' deinitialized successfully.
[1426503529] ndomod: Shutdown complete.
[1426503529] Event broker module '/usr/local/nagios/bin/ndomod.o' deinitialized successfully.

==> /usr/local/nagiosxi/var/cmdsubsys.log <==
Stopping nagios: .done.

==> /usr/local/nagiosxi/var/sysstat.log <==

==> /usr/local/nagios/var/nagios.log <==
[1426503529] Nagios 4.0.8 starting... (PID=330)
[1426503529] Local time is Mon Mar 16 18:58:49 MYT 2015
[1426503529] LOG VERSION: 2.0
[1426503529] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1426503529] qh: core query handler registered
[1426503529] nerd: Channel hostchecks registered successfully
[1426503529] nerd: Channel servicechecks registered successfully
[1426503529] nerd: Channel opathchecks registered successfully
[1426503529] nerd: Fully initialized and ready to rock!
[1426503529] wproc: Successfully registered manager as @wproc with query handler

==> /usr/local/nagios/var/nagios.log <==
[1426503529] mod_gearman: initialized version 1.4_nagios4 (libgearman 0.25)
[1426503529] Event broker module '/usr/lib64/mod_gearman/mod_gearman.o' initialized successfully.
[1426503529] ndomod: NDOMOD 2.0.0 (02-28-2014) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[1426503529] ndomod: Successfully connected to data sink.  0 queued items to flush.
[1426503529] ndomod registered for process data
[1426503529] ndomod registered for log data'
[1426503529] ndomod registered for system command data'
[1426503529] ndomod registered for event handler data'
[1426503529] ndomod registered for notification data'
[1426503529] ndomod registered for comment data'
[1426503529] ndomod registered for downtime data'
[1426503529] ndomod registered for flapping data'
[1426503529] ndomod registered for program status data'
[1426503529] ndomod registered for host status data'
[1426503529] ndomod registered for service status data'
[1426503529] ndomod registered for adaptive program data'
[1426503529] ndomod registered for adaptive host data'
[1426503529] ndomod registered for adaptive service data'
[1426503529] ndomod registered for external command data'
[1426503529] ndomod registered for aggregated status data'
[1426503529] ndomod registered for retention data'
[1426503529] ndomod registered for contact data'
[1426503529] ndomod registered for contact notification data'
[1426503529] ndomod registered for acknowledgement data'
[1426503529] ndomod registered for state change data'
[1426503529] ndomod registered for contact status data'
[1426503529] ndomod registered for adaptive contact data'
[1426503529] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Apply Configuration does not work after 2.6 upgrade

Post by abrist »

What distro and version are you running on your XI box?
There have been some issues with sudo and the reconfigure script. What is the output of:

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Apply Configuration does not work after 2.6 upgrade

Post by rajasegar »

abrist wrote:What distro and version are you running on your XI box?
There have been some issues with sudo and the reconfigure script. What is the output of:

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
I am running RHEL 6.5 64Bit - 2.6.32-431.11.2.el6.x86_64

Code: Select all

[nagios@nagiosprodxi1 scripts]$ ./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-ch                              eck-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&username=nagiosxi&password=nagiosqldb' -O nagiosql.l                              ogin--2015-03-17 07:09:20--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ânagiosql.loginâ

    [ <=>                                                                                  ] 10,320      --.-K/s   in 0.02s

2015-03-17 07:09:20 (555 KB/s) - ânagiosql.loginâ

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
SETUID ROOT OK
RESETTING PERMS
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-ch                              eck-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&username=nagiosxi&password=nagiosqldb' -O nagiosql.l                              ogin--2015-03-17 07:09:21--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ânagiosql.loginâ

    [ <=>                                                                                  ] 10,320      --.-K/s   in 0.01s

2015-03-17 07:09:22 (981 KB/s) - ânagiosql.loginâ

LOGIN SUCCESSFUL!
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-                              data 'cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2015-03-17 07:09:22--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ânagiosql.export.monitoringâ

    [           <=>                                                                        ] 13,172      4.79K/s   in 9.3s

2015-03-17 07:09:31 (1.39 KB/s) - ânagiosql.export.monitoringâ

WRITE CONFIGS SUCCESSFUL!
OUTPUT:
Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
        Checked 13874 services.
        Checked 1758 hosts.
        Checked 205 host groups.
        Checked 11 service groups.
        Checked 147 contacts.
        Checked 42 contact groups.
        Checked 176 commands.
        Checked 67 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 1758 hosts
        Checked 690 service dependencies
        Checked 0 host dependencies
        Checked 67 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...done.
Stopping nagios: ..done.
Starting nagios: done.
However when I checked the status, nagios was not running, had to use restart then it started up.

Code: Select all

[nagios@nagiosprodxi1 debug]$ service nagios status
nagios is not running
[nagios@nagiosprodxi1 debug]$ service nagios restart
Running configuration check...done.
Stopping nagios: /etc/init.d/nagios: line 67: kill: (4330) - No such process
done.
Starting nagios: done.
[nagios@nagiosprodxi1 debug]$ service nagios status
nagios (pid 21003) is running...

5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Apply Configuration does not work after 2.6 upgrade

Post by rajasegar »

questrad wrote:Hmm.

From the logs Nagios core is started.
Can you try again and find the PID from:

Code: Select all

==> /usr/local/nagios/var/nagios.log <==
[1426503529] Nagios 4.0.8 starting... (PID=XXX)
?

And see if that PID is exist in processes.


Here is part where it show of shutdown and start of Nagios Core (or you start it manualy?)

Code: Select all

==> /usr/local/nagios/var/nagios.log <==
[1426503528] Caught SIGTERM, shutting down...
[1426503529] Successfully shutdown... (PID=18106)
[1426503529] Event broker module 'NERD' deinitialized successfully.
[1426503529] Event broker module '/usr/lib64/mod_gearman/mod_gearman.o' deinitialized successfully.
[1426503529] ndomod: Shutdown complete.
[1426503529] Event broker module '/usr/local/nagios/bin/ndomod.o' deinitialized successfully.

==> /usr/local/nagiosxi/var/cmdsubsys.log <==
Stopping nagios: .done.

==> /usr/local/nagiosxi/var/sysstat.log <==

==> /usr/local/nagios/var/nagios.log <==
[1426503529] Nagios 4.0.8 starting... (PID=330)
[1426503529] Local time is Mon Mar 16 18:58:49 MYT 2015
[1426503529] LOG VERSION: 2.0
[1426503529] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1426503529] qh: core query handler registered
[1426503529] nerd: Channel hostchecks registered successfully
[1426503529] nerd: Channel servicechecks registered successfully
[1426503529] nerd: Channel opathchecks registered successfully
[1426503529] nerd: Fully initialized and ready to rock!
[1426503529] wproc: Successfully registered manager as @wproc with query handler

==> /usr/local/nagios/var/nagios.log <==
[1426503529] mod_gearman: initialized version 1.4_nagios4 (libgearman 0.25)
[1426503529] Event broker module '/usr/lib64/mod_gearman/mod_gearman.o' initialized successfully.
[1426503529] ndomod: NDOMOD 2.0.0 (02-28-2014) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[1426503529] ndomod: Successfully connected to data sink.  0 queued items to flush.
[1426503529] ndomod registered for process data
[1426503529] ndomod registered for log data'
[1426503529] ndomod registered for system command data'
[1426503529] ndomod registered for event handler data'
[1426503529] ndomod registered for notification data'
[1426503529] ndomod registered for comment data'
[1426503529] ndomod registered for downtime data'
[1426503529] ndomod registered for flapping data'
[1426503529] ndomod registered for program status data'
[1426503529] ndomod registered for host status data'
[1426503529] ndomod registered for service status data'
[1426503529] ndomod registered for adaptive program data'
[1426503529] ndomod registered for adaptive host data'
[1426503529] ndomod registered for adaptive service data'
[1426503529] ndomod registered for external command data'
[1426503529] ndomod registered for aggregated status data'
[1426503529] ndomod registered for retention data'
[1426503529] ndomod registered for contact data'
[1426503529] ndomod registered for contact notification data'
[1426503529] ndomod registered for acknowledgement data'
[1426503529] ndomod registered for state change data'
[1426503529] ndomod registered for contact status data'
[1426503529] ndomod registered for adaptive contact data'
[1426503529] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
Nothing was done manually. Started the tail and pressed Apply Configuration and waited 40 sec and sent you the output.

Take a look at line 21102 towards the end of the file, it says Nagios is not running.

Code: Select all

==> /usr/local/nagiosxi/var/sysstat.log <==
nagios is not running
OUTPUT=nagios is not running
RETURNCODE=0
CMDLINE=/etc/init.d/npcd status
NPCD running (pid 18176).
OUTPUT=NPCD running (pid 18176).
RETURNCODE=0
CMDLINE=/etc/init.d/ndo2db status
ndo2db (pid 2830) is running...
OUTPUT=ndo2db (pid 2830) is running...
RETURNCODE=0
DAEMONS:
Array
(
    [nagioscore] => Array
        (
            [daemon] => nagios
            [output] => nagios is not running
            [return_code] => 0
            [status] => 0
        )
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: Apply Configuration does not work after 2.6 upgrade

Post by questrad »

can you please verify you init script for nagios?
permission, content and etc.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Apply Configuration does not work after 2.6 upgrade

Post by rajasegar »

questrad wrote:can you please verify you init script for nagios?
permission, content and etc.

Code: Select all

[nagios@nagiosprodxi1 init.d]$ ls -l n*
-rwxr-xr-x. 1 root root 5889 Apr  3  2014 nagios
-rwxr-xr-x. 1 root root 1206 Mar 13 19:27 nagiosxi
-rwxr-xr-x  1 root root 4463 Jun 26  2014 ndo2db
-rwxr-xr-x. 1 root root 2989 Oct 10  2013 netconsole
-rwxr-xr-x. 1 root root 5428 Oct 10  2013 netfs
-rwxr-xr-x. 1 root root 6334 Oct 10  2013 network
-rwxr-xr-x. 1 root root 6364 Oct 10  2013 nfs
-rwxr-xr-x. 1 root root 3526 Oct 10  2013 nfslock
-rwxr-xr-x. 1 root root 1914 Apr  3  2014 npcd
-rwxr-xr-x. 1 root root 1923 Jul 15  2013 ntpd
-rwxr-xr-x. 1 root root 2043 Jul 15  2013 ntpdate
-rwxr-xr-x. 1 root root 1875 Oct 15  2012 numad

Code: Select all

[nagios@nagiosprodxi1 init.d]$ cat nagios
#!/bin/sh
#
# chkconfig: 345 99 01
# description: Nagios network monitor
#
# File : nagios
#
# Author : Jorge Sanchez Aymar ([email protected])
#
# Changelog :
#
# 1999-07-09 Karl DeBisschop <[email protected]>
#  - setup for autoconf
#  - add reload function
# 1999-08-06 Ethan Galstad <[email protected]>
#  - Added configuration info for use with RedHat's chkconfig tool
#    per Fran Boon's suggestion
# 1999-08-13 Jim Popovitch <[email protected]>
#  - added variable for nagios/var directory
#  - cd into nagios/var directory before creating tmp files on startup
# 1999-08-16 Ethan Galstad <[email protected]>
#  - Added test for rc.d directory as suggested by Karl DeBisschop
# 2000-07-23 Karl DeBisschop <[email protected]>
#  - Clean out redhat macros and other dependencies
# 2003-01-11 Ethan Galstad <[email protected]>
#  - Updated su syntax (Gary Miller)
#
# Description: Starts and stops the Nagios monitor
#              used to provide network services status.
#

status_nagios ()
{

        if test -x $NagiosCGI/daemonchk.cgi; then
                if $NagiosCGI/daemonchk.cgi -l $NagiosRunFile; then
                        return 0
                else
                        return 1
                fi
        else
                if ps -p $NagiosPID > /dev/null 2>&1; then
                        return 0
                else
                        return 1
                fi
        fi

        return 1
}


printstatus_nagios()
{

        if status_nagios $1 $2; then
                echo "nagios (pid $NagiosPID) is running..."
        else
                echo "nagios is not running"
        fi
}


killproc_nagios ()
{

        kill $2 $NagiosPID

}


pid_nagios ()
{

        if test ! -f $NagiosRunFile; then
                echo "No lock file found in $NagiosRunFile"
                exit 1
        fi

        NagiosPID=`head -n 1 $NagiosRunFile`
}


# Source function library
# Solaris doesn't have an rc.d directory, so do a test first
if [ -f /etc/rc.d/init.d/functions ]; then
        . /etc/rc.d/init.d/functions
elif [ -f /etc/init.d/functions ]; then
        . /etc/init.d/functions
fi

prefix=/usr/local/nagios
exec_prefix=${prefix}
NagiosBin=${exec_prefix}/bin/nagios
NagiosCfgFile=${prefix}/etc/nagios.cfg
NagiosStatusFile=${prefix}/var/status.dat
NagiosRetentionFile=${prefix}/var/retention.dat
NagiosCommandFile=${prefix}/var/rw/nagios.cmd
NagiosVarDir=${prefix}/var
NagiosRunFile=${prefix}/var/nagios.lock
#NagiosLockDir=/var/lock/subsys
NagiosLockDir=/usr/local/nagiosxi/var/subsys
NagiosLockFile=nagios
NagiosCGIDir=${exec_prefix}/sbin
NagiosUser=nagios
NagiosGroup=nagios


# Check that nagios exists.
if [ ! -f $NagiosBin ]; then
    echo "Executable file $NagiosBin not found.  Exiting."
    exit 1
fi

# Check that nagios.cfg exists.
if [ ! -f $NagiosCfgFile ]; then
    echo "Configuration file $NagiosCfgFile not found.  Exiting."
    exit 1
fi

# See how we were called.
case "$1" in

        start)
                echo -n "Starting nagios:"
                $NagiosBin -v $NagiosCfgFile > /dev/null 2>&1;
                if [ $? -eq 0 ]; then
# THESE TWO LINES WERE ADDED TO WORK WITH SUDO
                        touch $NagiosVarDir/nagios.log $NagiosRetentionFile
                        chown $NagiosUser $NagiosVarDir/nagios.log $NagiosRetentionFile
#                       su - $NagiosUser -c "touch $NagiosVarDir/nagios.log $NagiosRetentionFile"
                        rm -f $NagiosCommandFile
                        touch $NagiosRunFile
                        chown $NagiosUser:$NagiosGroup $NagiosRunFile
                        $NagiosBin -d $NagiosCfgFile
                        if [ -d $NagiosLockDir ]; then
                            touch $NagiosLockDir/$NagiosLockFile;
                            chown $NagiosUser:$NagiosGroup $NagiosLockDir/$NagiosLockFile;
                        fi
                        echo " done."
                        exit 0
                else
                        echo "CONFIG ERROR!  Start aborted.  Check your Nagios configuration."
                        exit 1
                fi
                ;;

        stop)
                echo -n "Stopping nagios: "

                pid_nagios
                killproc_nagios nagios

                # now we have to wait for nagios to exit and remove its
                # own NagiosRunFile, otherwise a following "start" could
                # happen, and then the exiting nagios will remove the
                # new NagiosRunFile, allowing multiple nagios daemons
                # to (sooner or later) run - John Sellens
                #echo -n 'Waiting for nagios to exit .'
                for i in 1 2 3 4 5 6 7 8 9 10 ; do
                    if status_nagios > /dev/null; then
                        echo -n '.'
                        sleep 1
                    else
                        break
                    fi
                done

                if status_nagios > /dev/null; then
                    echo ''
                    echo 'Warning - nagios did not exit in a timely manner'
                else

                    # Forcefully kill all other nagios processes that might be running, so we don't end up with a wierd setup

                    # Get a list of PIDs for all running Nagios daemons
                    plist=`ps axuw | grep "/usr/local/nagios/bin/nagios -d"  | awk '{print $2}'`
                    #echo "PIDS"
                    #echo $plist
                    for pid in $plist; do
                        #echo "KILL $pid"
                        kill -9 $pid > /dev/null 2>&1
                    done

                    echo 'done.'
                fi

                rm -f $NagiosStatusFile $NagiosRunFile $NagiosLockDir/$NagiosLockFile $NagiosCommandFile
                ;;

        status)
                pid_nagios
                printstatus_nagios nagios
                ;;

        checkconfig)
                printf "Running configuration check..."
                $NagiosBin -v $NagiosCfgFile > /dev/null 2>&1;
                if [ $? -eq 0 ]; then
                        echo " OK."
                else
                        echo " CONFIG ERROR!  Check your Nagios configuration."
                        exit 1
                fi
                ;;

        restart)
                printf "Running configuration check..."
                $NagiosBin -v $NagiosCfgFile > /dev/null 2>&1;
                if [ $? -eq 0 ]; then
                        echo "done."
                        $0 stop
                        $0 start
                else
                        echo " CONFIG ERROR!  Restart aborted.  Check your Nagios configuration."
                        exit 1
                fi
                ;;

        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|checkconfig}"
                exit 1
                ;;

esac

# End of this script

Code: Select all

[nagios@nagiosprodxi1 init.d]$ cat nagiosxi
#!/bin/sh
#
# chkconfig: 345 99 01
# description: NagiosXI subtasks
#
# $Id: nagiosxi,v 1.4 2010/06/14 13:33:48 root Exp $
#

PATH=PATH:/usr/local/bin/
stdserv="sysstat cmdsubsys eventman feedproc nom cleaner reportengine"

# See how we were called.
case "$1" in
        start)
                # Most scripts run frequently
                RETVAL=0
                #for ech in $stdserv; do true
                #       daemon -n $ech -r -u nagios.nagios -a 45 -o /usr/local/nagiosxi/var/${ech}.log -- /usr/bin/php -q /usr/local/nagiosxi/cron/${ech}.php
                #       RETVAL=$(( RETVAL || $? ))
                #done

                # DB maint runs a bit differently
                #daemon -n dbmaint -r -u nagios.nagios -A 1 -L $(( 60 * 5 )) -o /usr/local/nagiosxi/var/dbmaint.log --                  /usr/bin/php -q /usr/local/nagiosxi/cron/dbmaint.php
                #RETVAL=$(( RETVAL || $? ))

                # Recurring downtime script

                ;;
        stop)
                RETVAL=0
                #for ech in $stdserv dbmaint; do true
                #       daemon -n $ech -r --stop -u nagios.nagios
                #       RETVAL=$(( RETVAL || $? ))
                #done
                ;;
        restart)
                RETVAL=0
                ;;
        status)
                RETVAL=0
                #for ech in $stdserv dbmaint; do true
                #       daemon -n $ech -r --running -u nagios.nagios
                #       RETVAL=$(( RETVAL || $? ))
                #done
                ;;
        *)
                echo "Usage: $0 {start|stop|restart|status}"
                RETVAL=1
                ;;
esac
exit $RETVAL


5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Apply Configuration does not work after 2.6 upgrade

Post by rajasegar »

FYI, I have resolved the Monitoring Event Queue and Monitoring Engine Statistics issue.
Removed the sed commands left over from version 1.2 and it is back to normal.
2015-03-17_08-35-55.png
Old command

Code: Select all

define command {
       command_name                  		process-host-perfdata-file-bulk
       command_line                  		sed -i 's/\\n//g' /usr/local/nagios/var/host-perfdata && /bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/xidpe/$TIMET$.perfdata.host
}

define command {
       command_name                  		process-service-perfdata-file-bulk_bak
       command_line                  		sed -i 's/\\n//g' /usr/local/nagios/var/service-perfdata && /bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/xidpe/$TIMET$.perfdata.service
}
New Command

Code: Select all

define command {
       command_name                  		process-host-perfdata-file-bulk
       command_line                  		/bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/xidpe/$TIMET$.perfdata.host
}

define command {
       command_name                  		process-service-perfdata-file-bulk_bak
       command_line                  		/bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/xidpe/$TIMET$.perfdata.service
}
However the Apply Configuration and Service start issue is still there.
You do not have the required permissions to view the files attached to this post.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Apply Configuration does not work after 2.6 upgrade

Post by rajasegar »

Fixed one problem and got another.
All the graphs are dead since I took out the sed command.
This is because of the \n in the perfdata.
I thought this was fixed already?
2015-03-17_14-15-45.png

Code: Select all

[nagios@nagiosprodxi1 /]$ check_gearman -V
check_gearman: version 1.4_nagios4 running on libgearman 0.25
You do not have the required permissions to view the files attached to this post.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: Apply Configuration does not work after 2.6 upgrade

Post by questrad »

put those commands in to shell script file.
example:

vim process-host-perfdata-file-bulk.sh

Code: Select all

#!/bin/sh
/bin/sed -i 's/\\n//g' /usr/local/nagios/var/host-perfdata 
/bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/xidpe/$TIMET$.perfdata.host
vim process-service-perfdata-file-bulk.sh

Code: Select all

#!/bin/sh
/bin/sed -i 's/\\n//g' /usr/local/nagios/var/service-perfdata 
/bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/xidpe/$TIMET$.perfdata.service
Put those files in to same folder that is described in $USER1$

Code: Select all

define command {
       command_name                        process-host-perfdata-file-bulk
       command_line                          $USER1$/process-host-perfdata-file-bulk.sh
}

define command {
       command_name                        process-service-perfdata-file-bulk_bak
       command_line                          $USER1$/rocess-service-perfdata-file-bulk.sh
}
See if there is any diff.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Apply Configuration does not work after 2.6 upgrade

Post by rajasegar »

questrad wrote:put those commands in to shell script file.
example:

vim process-host-perfdata-file-bulk.sh

Code: Select all

#!/bin/sh
/bin/sed -i 's/\\n//g' /usr/local/nagios/var/host-perfdata 
/bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/xidpe/$TIMET$.perfdata.host
vim process-service-perfdata-file-bulk.sh

Code: Select all

#!/bin/sh
/bin/sed -i 's/\\n//g' /usr/local/nagios/var/service-perfdata 
/bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/xidpe/$TIMET$.perfdata.service
Put those files in to same folder that is described in $USER1$

Code: Select all

define command {
       command_name                        process-host-perfdata-file-bulk
       command_line                          $USER1$/process-host-perfdata-file-bulk.sh
}

define command {
       command_name                        process-service-perfdata-file-bulk_bak
       command_line                          $USER1$/rocess-service-perfdata-file-bulk.sh
}
See if there is any diff.
I reverted back and the graphs are ok now but event queue is very low again.
Looking to move all to ramdisk.

I was told sed command is not needed anymore but looks like it is not the case.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
Locked