Guide for installing 4.0.7 on Ubuntu 14.04

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.
shaunie1975
Posts: 7
Joined: Mon Feb 18, 2013 7:27 am

Guide for installing 4.0.7 on Ubuntu 14.04

Post by shaunie1975 »

Hi Guys,

Is there a easy to follow guide for installing Nagios Core 4.0.7 on Ubuntu 14.04?
When I installed Ubuntu I opted to install LAMP at the same time.

I then ran update and upgrade a few times and a system reboot.

However when I get to the make install-webconf I get the below error:

Code: Select all

root@ubuntu:/tmp/nagios-4.0.7# make install-webconf
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf
/usr/bin/install: cannot create regular file â/etc/httpd/conf.d/nagios.confâ: No such file or directory
make: *** [install-webconf] Error 1
From initial searches its something to do with Nagios using an older version of Apache2 where the directory structure is different.

I am no expert with nagios or Linux so please be gentle if you can help.

Thanks
Shaun
shaunie1975
Posts: 7
Joined: Mon Feb 18, 2013 7:27 am

Re: Guide for installing 4.0.7 on Ubuntu 14.04

Post by shaunie1975 »

Ok so I got passed that part by creating the missing directories.

Now installed the plugins but when it comes to the chkconfig
I get an error that the command is not recognised. Has this been removed from 14.04?
Can I install it?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Guide for installing 4.0.7 on Ubuntu 14.04

Post by slansing »

Hi Shaunie, what guide are you using to install Core and the plugins? I'd recommend this one:

http://assets.nagios.com/downloads/nagi ... Source.pdf
shaunie1975
Posts: 7
Joined: Mon Feb 18, 2013 7:27 am

Re: Guide for installing 4.0.7 on Ubuntu 14.04

Post by shaunie1975 »

Hi Slansing,

That is the guide I'm using however I'm installing 4.0.7 and pluggin 2.0.3
On Ubuntu 14.04 server.

Thanks
shaunie1975
Posts: 7
Joined: Mon Feb 18, 2013 7:27 am

Re: Guide for installing 4.0.7 on Ubuntu 14.04

Post by shaunie1975 »

Ok So I got around the chkconfig error by installing:
sysv-rc-conf

restarted apache2 and even the whole server. Now when I try an goto http://<serverip>/nagios i get page not found :(
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Guide for installing 4.0.7 on Ubuntu 14.04

Post by slansing »

Hmm, looks like apache may not be running, what is the output of:

Code: Select all

/etc/init.d/apache2 status

/etc/init.d/apache2 stop

/etc/init.d/apache2 start
When you browse to just:

Code: Select all

http://addr.of.server/
Does it show the apache splash page?
shaunie1975
Posts: 7
Joined: Mon Feb 18, 2013 7:27 am

Re: Guide for installing 4.0.7 on Ubuntu 14.04

Post by shaunie1975 »

Hi Slansing,

Here is the ouput:

Code: Select all

eto@ubuntu:~$ /etc/init.d/apache2 status
 * apache2 is running

eto@ubuntu:~$ /etc/init.d/apache2 stop
 * Stopping web server apache2                                                   *
eto@ubuntu:~$

eto@ubuntu:~$ /etc/init.d/apache2 start
 * Starting web server apache2                                                   *
eto@ubuntu:~$
Browsing to http://<address of server> lans me on the 'Apache2 Ubuntu Default Page'

When I look in /var/www/ the only folder there is html which has the index.html file, I believe this just the default apache2 page?

Thanks
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Guide for installing 4.0.7 on Ubuntu 14.04

Post by tmcdonald »

Ubuntu has a different directory structure than RHEL or CentOS.
shaunie1975 wrote:Ok so I got passed that part by creating the missing directories.
Can you post or PM the httpd nagios conf file that should be present in that directory? Apache probably does not know where it is so it cannot load the Nagios webpage.

Ubuntu uses /etc/apache2 and RHEL/CentOS use /etc/httpd so you may have to copy over some files.
Former Nagios employee
emislivec
Posts: 52
Joined: Tue Feb 25, 2014 10:06 am

Re: Guide for installing 4.0.7 on Ubuntu 14.04

Post by emislivec »

shaunie1975 wrote:Browsing to http://<address of server> lans me on the 'Apache2 Ubuntu Default Page'

When I look in /var/www/ the only folder there is html which has the index.html file, I believe this just the default apache2 page?
That is the default splash page, so we know Apache is up and serving pages. I think the problem comes down to the earlier installation error:
shaunie1975 wrote:However when I get to the make install-webconf I get the below error:

Code: Select all

root@ubuntu:/tmp/nagios-4.0.7# make install-webconf
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf
/usr/bin/install: cannot create regular file â/etc/httpd/conf.d/nagios.confâ: No such file or directory
make: *** [install-webconf] Error 1
On Debian or Ubuntu it should be "/etc/apache2/conf.d/nagios.conf" instead of "/etc/httpd/conf.d/nagios.conf". When you created the "/etc/httpd/conf.d/" it let the "make install-webconf" complete successfully, but Apache doesn't know anything about that directory or file.

We can tell ./configure where to install nagios.conf so apache will see it: add "--with-httpd-conf=/etc/apache2/conf.d/nagios.conf" to the end of the ./configure command you ran earlier. For example:

Code: Select all

./configure --with-command-group=nagcmd --with-httpd-conf=/etc/apache2/conf.d
Then make and install like before.
shaunie1975
Posts: 7
Joined: Mon Feb 18, 2013 7:27 am

Re: Guide for installing 4.0.7 on Ubuntu 14.04

Post by shaunie1975 »

Hi Guys,

So I have got the http://serverip/nagios page to load.

I ran the ./configure as

Code: Select all

./configure --with-command-group=nagcmd --with-httpd-conf=/etc/apache2/conf.d
which didnt work so then I ran it as

Code: Select all

./configure --with-command-group=nagcmd --with-httpd-conf=/etc/apache2
Which still didnt work. I then added the contents of

Code: Select all

/etc/apache2/nagios.conf
to the end of

Code: Select all

/etc/apache2/apache2.conf
Now when I login I see the nagios core and the logo then below that i see a red X and not running next to it.

Thanks
Locked