Page 2 of 4

Re: New Nagios 4 installation will not start up

Posted: Tue Feb 11, 2014 5:13 pm
by Bigpaddy_Irl
Before I even get off to a start I get the following errors

root@NAGIOS:~# sudo apt-get install wget install build-essential apache2 php5-gd wget libgd2-xpm libgd2-xpm-dev libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package install
E: Unable to locate package libgd2-xpm

Re: New Nagios 4 installation will not start up

Posted: Tue Feb 11, 2014 5:25 pm
by slansing
Okay, so looking into your command it shows why you are getting that error, there is not a package named 'install' and googling around I found that the libgd2 package was renamed. Try:

Code: Select all

sudo apt-get install wget build-essential apache2 php5-gd libgd2-xpm-dev libapache2-mod-php5
Though libgd2-xpm should still exist, at least up to Ubuntu 13.04.. it is probably going to be required.

Re: New Nagios 4 installation will not start up

Posted: Tue Feb 11, 2014 5:34 pm
by Bigpaddy_Irl
another error;

root@NAGIOS:~# usermod -a -G nagcmd apache
usermod: user 'apache' does not exist

I am following all this by the book, can you see my frustration here :(

Re: New Nagios 4 installation will not start up

Posted: Tue Feb 11, 2014 5:38 pm
by Bigpaddy_Irl
Running pre-flight check on configuration data...

Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 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
root@NAGIOS:/home/paddy/downloads/nagios-4.0.2# /etc/init.d/nagios start
/etc/init.d/nagios: 20: .: Can't open /etc/rc.d/init.d/functions
root@NAGIOS:/home/paddy/downloads/nagios-4.0.2# sudo /etc/init.d/nagios start
/etc/init.d/nagios: 20: .: Can't open /etc/rc.d/init.d/functions
root@NAGIOS:/home/paddy/downloads/nagios-4.0.2#

Re: New Nagios 4 installation will not start up

Posted: Tue Feb 11, 2014 5:56 pm
by slansing
Okay, so lets move on from that point. It already looks like you deviated from following the document based on your directories, be sure to follow it to the letter, don't try alternate directories. I'm not sure why you are showing a config verification, did you skip ahead and finish compiling? In either case, run the following and let me know if you get/see any errors:

From the /tmp directory:

Code: Select all

tar zxvf nagios-4.0.2.tar.gz
tar zxvf nagios-plugins-1.5.tar.gz
cd nagios
Then:

Code: Select all

./configure --with-command-group=nagcmd
./configure --with-nagios-group=nagios --with-command-group=nagcmd -–with-mail=/usr/bin/sendmail
Then:

Code: Select all

make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
And:

Code: Select all

cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
If you make it here with no errors, let us know. If you already compiled don't worry, you can do it again with the above commands.

Re: New Nagios 4 installation will not start up

Posted: Tue Feb 11, 2014 7:36 pm
by Bigpaddy_Irl
I have started again from scratch with another new Ubuntu copy.

I am getting this far.....

Code: Select all

root@NAGIOS-2:/tmp/nagios-4.0.2# 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

Just before this part though one bit confuses me in the manual

"Change to the new Nagios directory and install the packages:
cd nagios"

When I do this, I get the error that there is no such directory, so I just go to the nagios-4.0.2 directory instead.

Is this ok, or is this why I am seeing the above error?

Re: New Nagios 4 installation will not start up

Posted: Wed Feb 12, 2014 10:33 am
by sreinhardt
I think what we need to do, is continue to work on one install of the OS and nagios until it can begin working, resetting the entire system gets very confusing for us as to where you are and what has actually been done on your system. Also ubuntu is just fine for installation if that is your preferred distro, however if it's not an issue for you CentOS would probably be much simpler for all involved.

As for your present errors, the name of the directory you build and install from, doesn't really matter too much. Nagios vs nagios-4.0.2 is perfectly fine for our uses. As for the httpd folder issues, have you installed apache yet, and do you have the folder structure that the install would like? If not you likely need to set some configuration variables to specify where your binaries and web files need to go, as the install does default to centos\rhel standards.

Code: Select all

ll -dl /etc/httpd/conf.d/
ll -dl /etc/httpd/
ll -l /etc/httpd

Re: New Nagios 4 installation will not start up

Posted: Sun Feb 16, 2014 6:26 pm
by Bigpaddy_Irl
Ok I took your advise and installed a fresh copy of CentOs 6.5 on my VM, and then installed Nagios-4.0.2 on top of it using the instructions here;

http://www.tecmint.com/install-nagios-in-linux/

Everything went ok with no errors, I even verified my Nagios.cfg file and it was ok, but I am not getting a web login screen.
I think it is apache is the problem, but I am not sure how to diagnose any further from here........

Re: New Nagios 4 installation will not start up

Posted: Sun Feb 16, 2014 7:36 pm
by Bigpaddy_Irl
Apache is starting up for me, but I do see these errors in the logs which I do not understand, and googling brings back way to many alternative fixes.

[Mon Feb 17 00:31:25 2014] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/

Re: New Nagios 4 installation will not start up

Posted: Mon Feb 17, 2014 12:16 pm
by slansing
Well the best way to fix the issue is to try the fixes suggested. Before you start on that, were you sure to configure the web interface?:

Code: Select all

service httpd stop

make install-webconf

htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

service httpd start
A heads up for your next install, if you do plan to install Nagios on multiple systems, you should consider using our documentation rather than googling for a guide, as thousands have followed it successfully.