Page 1 of 2

update nagios core 3.5 to 4.0.2

Posted: Tue Feb 25, 2014 1:52 pm
by Khmerlinux
Hello,

I am new to Linux and Nagios. I got my first Nagios 3.5 installed on CentOS 6.5 up and running, so proud of myself, and I want to update to Nagios Core 4.0.2. I have few questions to ask.
1. When I installed Nagios 3.5 I did the following:
# yum install nagios

Where Nagios3.5 installed from and what is the default directory the Nagios installed too?
I have download Nagios core 4.0.2 onto download directory. How can I install it so that it will default to the old Nagios directory.

Everything is working now I just want to update to the latest version.

Thanks,

Khmerlinux

Re: update nagios core 3.5 to 4.0.2

Posted: Tue Feb 25, 2014 2:26 pm
by slansing
Since the yum repo's are probably not updated to 4.0+ yet, you will need to compile it by hand, time to take your next step! :)

This document should assist you in the most painless way possible, just make sure to follow the sections specified for your distribution!:

http://assets.nagios.com/downloads/nagi ... Source.pdf

If you have any questions what so ever don't hesitate to ask! Since you installed using yum, it is likely you are on Centos/Rhel, in which case nagios should have been installed to:

Code: Select all

/usr/local/nagios/

Re: update nagios core 3.5 to 4.0.2

Posted: Tue Feb 25, 2014 2:39 pm
by Khmerlinux
Hi Slansing,

Yes you are correct I installed using Centos/Rhel. I just crashed the Nagios after I installed. All the hard work I put in the past 8 hours now gone to the toilet.
I did the following:
download Nagios Core-4.0.2
tar -xvf nagios-4.0.2.tar.gz
cd nagios-4.0.2
./configure --with-command-group=nagcmd
make all
make install

Now I am no longer able to access the website http://localhost/nagios :(.

Can you point me some direction how to fix it.

Thanks you.

Re: update nagios core 3.5 to 4.0.2

Posted: Tue Feb 25, 2014 2:47 pm
by slansing
Don't worry! We will salvage it.
Have you restarted nagios?:

Code: Select all

service nagios restart

Code: Select all

service httpd restart
Are you seeing a blank page in your browser, and apache splash page, or an error code?

Are you sure localhost is the correct address? Are you running nagios on the same local system as your browser?

If you still cannot access the interface using the correct address, and restarting those services can you post the output of:

Code: Select all

tail -30 /var/log/httpd/error_log
Thanks!

Re: update nagios core 3.5 to 4.0.2

Posted: Tue Feb 25, 2014 2:56 pm
by Khmerlinux
Yes I have restart the service. On the browser I got "unable to connect to localhost"
service nagios restart
service httpd restart
Got the following errors:

failed to stopping httpd
starting httpd: Syntax error on line 42 of /etc/httpd/conf.d/nagios.conf: Invalid command "New", perhaps misspelled or defined by a module not included in the server configuration.

Re: update nagios core 3.5 to 4.0.2

Posted: Tue Feb 25, 2014 3:03 pm
by Khmerlinux
Hi slansing,

I got it work now but it is not update to the 4.0.2. I kind getting in to linux now. What did I do wrong?

Thank you slansing.

Khmerlinux

Re: update nagios core 3.5 to 4.0.2

Posted: Tue Feb 25, 2014 4:37 pm
by abrist
Try running the compile and install again. We will save the output to a text file:

Code: Select all

cd nagios-4.0.2
./configure --with-command-group=nagcmd >> /tmp/build.log
make all >> /tmp/build.log
make install >> /tmp/build.log
make install-webconf  >> /tmp/build.log
make install-exfoliation  >> /tmp/build.log
Attach the /tmp/build.log file to your next post.

Re: update nagios core 3.5 to 4.0.2

Posted: Tue Feb 25, 2014 5:24 pm
by Khmerlinux
Hi abrist,

I run as you suggest and here is the build.log

________________________________________________________________________

Code: Select all

checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether make sets $(MAKE)... yes
checking for strip... /usr/bin/strip
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking regex.h usability... yes
checking regex.h presence... yes
checking for regex.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking socket.h usability... no
checking socket.h presence... no
checking for socket.h... no
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for sys/types.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking for sys/wait.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for sys/stat.h... (cached) yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
checking sys/msg.h usability... yes
checking sys/msg.h presence... yes
checking for sys/msg.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking uio.h usability... no
checking uio.h presence... no
checking for uio.h... no
checking for unistd.h... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking for an ANSI C-conforming const... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... yes
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking return type of signal handlers... void
checking for uid_t in sys/types.h... yes
checking type of array argument to getgroups... gid_t
checking for va_copy... yes
checking for vsnprintf... yes
checking for snprintf... yes
checking for asprintf... yes
checking for vasprintf... yes
checking for C99 vsnprintf... yes
checking for library containing getservbyname... none required
checking for library containing connect... none required
checking for initgroups... yes
checking for setenv... yes
checking for strdup... yes
checking for strstr... yes
checking for strtoul... yes
checking for unsetenv... yes
checking for type of socket size... size_t
checking for library containing nanosleep... none required
checking for mail... /bin/mail
checking for glibc at least version 2.4... yes
checking sys/epoll.h usability... yes
checking sys/epoll.h presence... yes
checking for sys/epoll.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for main in -liconv... no
checking for gdImagePng in -lgd (order 1)... no
checking for gdImagePng in -lgd (order 2)... yes
GD library was found!
checking for gdImageCreateTrueColor in -lgd... yes
checking ltdl.h usability... no
checking ltdl.h presence... no
checking for ltdl.h... no
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for dlopen in -ldl... yes
checking for extra flags needed to export symbols...  -Wl,-export-dynamic
checking for linker flags for loadable modules... -shared
checking for traceroute... /bin/traceroute
checking for type va_list... yes
checking for perl... /usr/bin/perl
configure: creating ./config.status
config.status: creating Makefile
config.status: creating lib/Makefile
config.status: creating subst
config.status: creating pkginfo
config.status: creating base/Makefile
config.status: creating common/Makefile
config.status: creating contrib/Makefile
config.status: creating cgi/Makefile
config.status: creating html/Makefile
config.status: creating module/Makefile
config.status: creating worker/Makefile
config.status: creating worker/ping/Makefile
config.status: creating xdata/Makefile
config.status: creating daemon-init
config.status: creating t/Makefile
config.status: creating t-tap/Makefile
config.status: creating include/config.h
config.status: include/config.h is unchanged
config.status: creating lib/snprintf.h
config.status: lib/snprintf.h is unchanged
config.status: creating lib/iobroker.h
config.status: lib/iobroker.h is unchanged

Creating sample config files in sample-config/ ...


*** Configuration summary for nagios 4.0.2 11-25-2013 ***:

 General Options:
 -------------------------
        Nagios executable:  nagios
        Nagios user/group:  nagios,nagios
       Command user/group:  nagios,nagios
             Event Broker:  yes
        Install ${prefix}:  /usr/local/nagios
    Install ${includedir}:  /usr/local/nagios/include/nagios
                Lock file:  ${prefix}/var/nagios.lock
   Check result directory:  ${prefix}/var/spool/checkresults
           Init directory:  /etc/rc.d/init.d
  Apache conf.d directory:  /etc/httpd/conf.d
             Mail program:  /bin/mail
                  Host OS:  linux-gnu
          IOBroker Method:  epoll

 Web Interface Options:
 ------------------------
                 HTML URL:  http://localhost/nagios/
                  CGI URL:  http://localhost/nagios/cgi-bin/
 Traceroute (used by WAP):  /bin/traceroute


Review the options above for accuracy.  If they look okay,
type 'make all' to compile the main program and CGIs.

cd ./base && make
make[1]: Entering directory `/root/Downloads/nagios-4.0.2/base'
make -C ../lib
make[2]: Entering directory `/root/Downloads/nagios-4.0.2/lib'
gcc -g -O2 -DHAVE_CONFIG_H -c squeue.c -o squeue.o
gcc -g -O2 -DHAVE_CONFIG_H -c kvvec.c -o kvvec.o
gcc -g -O2 -DHAVE_CONFIG_H -c iocache.c -o iocache.o
gcc -g -O2 -DHAVE_CONFIG_H -c iobroker.c -o iobroker.o
gcc -g -O2 -DHAVE_CONFIG_H -c bitmap.c -o bitmap.o
gcc -g -O2 -DHAVE_CONFIG_H -c dkhash.c -o dkhash.o
gcc -g -O2 -DHAVE_CONFIG_H -c runcmd.c -o runcmd.o
gcc -g -O2 -DHAVE_CONFIG_H -c nsutils.c -o nsutils.o
gcc -g -O2 -DHAVE_CONFIG_H -c fanout.c -o fanout.o
gcc -g -O2 -DHAVE_CONFIG_H -c pqueue.c -o pqueue.o
gcc -g -O2 -DHAVE_CONFIG_H -c worker.c -o worker.o
gcc -g -O2 -DHAVE_CONFIG_H -c skiplist.c -o skiplist.o
gcc -g -O2 -DHAVE_CONFIG_H -c nsock.c -o nsock.o
gcc -g -O2 -DHAVE_CONFIG_H -c nspath.c -o nspath.o
ar cr libnagios.a squeue.o kvvec.o iocache.o iobroker.o bitmap.o dkhash.o runcmd.o nsutils.o fanout.o pqueue.o worker.o skiplist.o nsock.o nspath.o
make[2]: Leaving directory `/root/Downloads/nagios-4.0.2/lib'
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE -o nagios nagios.o broker.o nebmods.o ../common/shared.o nerd.o query-handler.o workers.o checks.o config.o commands.o events.o flapping.o logging.o macros-base.o netutils.o notifications.o sehandlers.o utils.o retention-base.o xretention-base.o comments-base.o xcomments-base.o objects-base.o xobjects-base.o statusdata-base.o xstatusdata-base.o perfdata-base.o xperfdata-base.o downtime-base.o  -Wl,-export-dynamic   -lm  -ldl  ../lib/libnagios.a
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE -o nagiostats nagiostats.c  -lm  ../lib/libnagios.a
make[1]: Leaving directory `/root/Downloads/nagios-4.0.2/base'
cd ./cgi && make
make[1]: Entering directory `/root/Downloads/nagios-4.0.2/cgi'
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o avail.cgi avail.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a 
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o cmd.cgi cmd.c extcmd_list.o ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a   
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o config.cgi config.c  ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a 
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o extinfo.cgi extinfo.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a   
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o history.cgi history.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a 
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o notifications.cgi notifications.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a 
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o outages.cgi outages.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a  
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o showlog.cgi showlog.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a 
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o status.cgi status.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a  
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o statuswml.cgi statuswml.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a 
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o summary.cgi summary.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a 
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o tac.cgi tac.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a  
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o statuswrl.cgi statuswrl.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a -lm 
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o statusmap.cgi statusmap.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a -lgd  -lpng -ljpeg -lz -lm 
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o trends.cgi trends.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a -lgd  -lpng -ljpeg -lz -lm 
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o histogram.cgi histogram.c ../common/shared.o getcgi.o cgiutils.o cgiauth.o macros-cgi.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o xstatusdata-cgi.o comments-cgi.o downtime-cgi.o ../lib/libnagios.a -lgd  -lpng -ljpeg -lz -lm 
make[1]: Leaving directory `/root/Downloads/nagios-4.0.2/cgi'
cd ./html && make
make[1]: Entering directory `/root/Downloads/nagios-4.0.2/html'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/Downloads/nagios-4.0.2/html'
if [ xyes = xyes ]; then \
		cd ./module && make; \
	fi
make[1]: Entering directory `/root/Downloads/nagios-4.0.2/module'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/Downloads/nagios-4.0.2/module'
cd ./worker && make all
make[1]: Entering directory `/root/Downloads/nagios-4.0.2/worker'
cd ./ping && make all
make[2]: Entering directory `/root/Downloads/nagios-4.0.2/worker/ping'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/Downloads/nagios-4.0.2/worker/ping'
make[1]: Leaving directory `/root/Downloads/nagios-4.0.2/worker'

*** Compile finished ***

If the main program and CGIs compiled without any errors, you
can continue with installing Nagios as follows (type 'make'
without any arguments for a list of all possible options):

  make install
     - This installs the main program, CGIs, and HTML files

  make install-init
     - This installs the init script in /etc/rc.d/init.d

  make install-commandmode
     - This installs and configures permissions on the
       directory for holding the external command file

  make install-config
     - This installs *SAMPLE* config files in /usr/local/nagios/etc
       You'll have to modify these sample files before you can
       use Nagios.  Read the HTML documentation for more info
       on doing this.  Pay particular attention to the docs on
       object configuration files, as they determine what/how
       things get monitored!

  make install-webconf
     - This installs the Apache config file for the Nagios
       web interface

  make install-exfoliation
     - This installs the Exfoliation theme for the Nagios
       web interface

  make install-classicui
     - This installs the classic theme for the Nagios
       web interface


*** Support Notes *******************************************

If you have questions about configuring or running Nagios,
please make sure that you:

     - Look at the sample config files
     - Read the documentation on the Nagios Library at:
           http://library.nagios.com

before you post a question to one of the mailing lists.
Also make sure to include pertinent information that could
help others help you.  This might include:

     - What version of Nagios you are using
     - What version of the plugins you are using
     - Relevant snippets from your config files
     - Relevant error messages from the Nagios log file

For more information on obtaining support for Nagios, visit:

       http://support.nagios.com

*************************************************************

Enjoy.

cd ./base && make install
make[1]: Entering directory `/root/Downloads/nagios-4.0.2/base'
make install-basic
make[2]: Entering directory `/root/Downloads/nagios-4.0.2/base'
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/bin
/usr/bin/install -c -m 774 -o nagios -g nagios nagios /usr/local/nagios/bin
/usr/bin/install -c -m 774 -o nagios -g nagios nagiostats /usr/local/nagios/bin
make[2]: Leaving directory `/root/Downloads/nagios-4.0.2/base'
make strip-post-install
make[2]: Entering directory `/root/Downloads/nagios-4.0.2/base'
/usr/bin/strip /usr/local/nagios/bin/nagios
/usr/bin/strip /usr/local/nagios/bin/nagiostats
make[2]: Leaving directory `/root/Downloads/nagios-4.0.2/base'
make[1]: Leaving directory `/root/Downloads/nagios-4.0.2/base'
cd ./cgi && make install
make[1]: Entering directory `/root/Downloads/nagios-4.0.2/cgi'
make install-basic
make[2]: Entering directory `/root/Downloads/nagios-4.0.2/cgi'
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/sbin
for file in *.cgi; do \
		/usr/bin/install -c -m 775 -o nagios -g nagios $file /usr/local/nagios/sbin; \
	done
make[2]: Leaving directory `/root/Downloads/nagios-4.0.2/cgi'
make strip-post-install
make[2]: Entering directory `/root/Downloads/nagios-4.0.2/cgi'
for file in *.cgi; do \
		/usr/bin/strip /usr/local/nagios/sbin/$file; \
	done
make[2]: Leaving directory `/root/Downloads/nagios-4.0.2/cgi'
make[1]: Leaving directory `/root/Downloads/nagios-4.0.2/cgi'
cd ./html && make install
make[1]: Entering directory `/root/Downloads/nagios-4.0.2/html'
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/media
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/stylesheets
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/contexthelp
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/docs
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/docs/images
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/js
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/images
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/images/logos
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/includes
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/includes/rss
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/includes/rss/extlib
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/share/ssi
/usr/bin/install -c -m 664 -o nagios -g nagios robots.txt /usr/local/nagios/share
rm -f /usr/local/nagios/share/index.html
rm -f /usr/local/nagios/share/main.html
rm -f /usr/local/nagios/share/side.html
for file in *.php; \
	do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share; done
for file in stylesheets/*.css; \
	do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/stylesheets; done
for file in contexthelp/*.html; \
	do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/contexthelp; done
for file in js/*.js; \
	do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/js; done
for file in images/*.gif; \
	do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/images; done
for file in images/*.jpg; \
	do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/images; done
for file in images/*.png; \
	do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/images; done
for file in images/*.ico; \
	do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/images; done
for file in images/logos/*.*; \
	do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/images/logos; done
for file in includes/*.*; \
	do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/includes; done
for file in includes/rss/*.*; \
	do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/includes/rss; done
for file in includes/rss/extlib/*.*; \
	do /usr/bin/install -c -m 664 -o nagios -g nagios $file /usr/local/nagios/share/includes/rss/extlib; done
make[1]: Leaving directory `/root/Downloads/nagios-4.0.2/html'
make install-exfoliation	
make[1]: Entering directory `/root/Downloads/nagios-4.0.2'
cp -rf contrib/exfoliation/stylesheets/* /usr/local/nagios/share/stylesheets
cp -rf contrib/exfoliation/images/* /usr/local/nagios/share/images

*** Exfoliation theme installed ***
NOTE: Use 'make install-classicui' to revert to classic Nagios theme

make[1]: Leaving directory `/root/Downloads/nagios-4.0.2'
make install-basic
make[1]: Entering directory `/root/Downloads/nagios-4.0.2'
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/libexec
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/var
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/var/archives
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/var/spool/checkresults

*** Main program, CGIs and HTML files installed ***

You can continue with installing Nagios as follows (type 'make'
without any arguments for a list of all possible options):

  make install-init
     - This installs the init script in /etc/rc.d/init.d

  make install-commandmode
     - This installs and configures permissions on the
       directory for holding the external command file

  make install-config
     - This installs sample config files in /usr/local/nagios/etc

make[1]: Leaving directory `/root/Downloads/nagios-4.0.2'
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf

*** Nagios/Apache conf file installed ***

cp -rf contrib/exfoliation/stylesheets/* /usr/local/nagios/share/stylesheets
cp -rf contrib/exfoliation/images/* /usr/local/nagios/share/images

*** Exfoliation theme installed ***
NOTE: Use 'make install-classicui' to revert to classic Nagios theme
Moderator note: Please use code tags when posting long output like this.

Re: update nagios core 3.5 to 4.0.2

Posted: Tue Feb 25, 2014 5:42 pm
by abrist
Looks good, I missed a few commands:

Code: Select all

make install-commandmode
make install-init
Restart nagios and httpd:

Code: Select all

service nagios restart
service httpd restart
Now try to browse to the nagios webpage. If it does not work, post the output of:

Code: Select all

tail -25 /var/log/httpd/error_log

Re: update nagios core 3.5 to 4.0.2

Posted: Tue Feb 25, 2014 6:00 pm
by Khmerlinux
After I follow your instruction to run
make install-commandmode
make install-init
service nagios restart
service httpd restart

I able to connect to http://localhost/nagios but it will not accept the username and password. Have the update change the username and password? If it is what is the default username and password to login.

below is the error log.
____________________________________________________
[root@localhost ~]# service nagios stop
Stopping nagios: done.
[root@localhost ~]# make install-commandmode
make: *** No rule to make target `install-commandmode'. Stop.
[root@localhost ~]# cd Downloads
[root@localhost Downloads]# cd nagios-4.0.2
[root@localhost nagios-4.0.2]# make install-commandmode
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/var/rw
chmod g+s /usr/local/nagios/var/rw

*** External command directory configured ***

[root@localhost nagios-4.0.2]# make install-init
/usr/bin/install -c -m 755 -d -o root -g root /etc/rc.d/init.d
/usr/bin/install -c -m 755 -o root -g root daemon-init /etc/rc.d/init.d/nagios

*** Init script installed ***

[root@localhost nagios-4.0.2]# service nagios restart

Nagios Core 4.0.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 11-25-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Error: Cannot open main configuration file '/usr/local/nagios/etc/nagios.cfg' for reading!
Error processing main config file!

[root@localhost nagios-4.0.2]# service nagios start
nagios is stopped
[root@localhost nagios-4.0.2]# service nagios start
nagios is stopped
[root@localhost nagios-4.0.2]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@localhost nagios-4.0.2]# tail -25 /var/log/httpd/error_log
[Tue Feb 25 14:29:32 2014] [error] [client 127.0.0.1] (2)No such file or directory: Could not open password file: /usr/local/nagios/etc/htpasswd.users
[Tue Feb 25 14:29:32 2014] [error] [client 127.0.0.1] access to /nagios/ failed, reason: verification of user id 'nagiosadmin' not configured
[Tue Feb 25 14:29:41 2014] [error] [client 127.0.0.1] (2)No such file or directory: Could not open password file: /usr/local/nagios/etc/htpasswd.users
[Tue Feb 25 14:29:41 2014] [error] [client 127.0.0.1] access to /nagios/ failed, reason: verification of user id 'nagiosadmin' not configured
[Tue Feb 25 14:29:58 2014] [error] [client 127.0.0.1] File does not exist: /var/www/html/favicon.ico
[Tue Feb 25 14:29:58 2014] [error] [client 127.0.0.1] File does not exist: /var/www/html/favicon.ico
[Tue Feb 25 14:30:36 2014] [error] [client 216.4.233.100] (2)No such file or directory: Could not open password file: /usr/local/nagios/etc/htpasswd.users
[Tue Feb 25 14:30:36 2014] [error] [client 216.4.233.100] access to /nagios failed, reason: verification of user id 'nagiosadmin' not configured
[Tue Feb 25 14:30:49 2014] [error] [client 216.4.233.100] (2)No such file or directory: Could not open password file: /usr/local/nagios/etc/htpasswd.users
[Tue Feb 25 14:30:49 2014] [error] [client 216.4.233.100] access to /nagios failed, reason: verification of user id 'nagiosadmin' not configured
[Tue Feb 25 14:30:56 2014] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Tue Feb 25 14:30:57 2014] [error] [client 216.4.233.100] (2)No such file or directory: Could not open password file: /usr/local/nagios/etc/htpasswd.users
[Tue Feb 25 14:30:57 2014] [error] [client 216.4.233.100] access to /nagios failed, reason: verification of user id 'nagiosadmin' not configured
[Tue Feb 25 14:31:02 2014] [error] [client 216.4.233.100] File does not exist: /var/www/html/favicon.ico
[Tue Feb 25 14:31:02 2014] [error] [client 216.4.233.100] File does not exist: /var/www/html/favicon.ico
[Tue Feb 25 14:35:56 2014] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Tue Feb 25 14:40:56 2014] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Tue Feb 25 14:45:56 2014] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Tue Feb 25 14:50:56 2014] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Tue Feb 25 14:55:03 2014] [notice] caught SIGTERM, shutting down
[Tue Feb 25 14:55:04 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Tue Feb 25 14:55:04 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Feb 25 14:55:04 2014] [notice] Digest: generating secret for digest authentication ...
[Tue Feb 25 14:55:04 2014] [notice] Digest: done
[Tue Feb 25 14:55:04 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[root@localhost nagios-4.0.2]#