Can't start nagios if apache is in custom location

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.
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

Can't start nagios if apache is in custom location

Post by vinothsethuram »

I couldn't start nagios due to apache's custom location.


service nagios start
/etc/init.d/nagios: 20: .: Can't open /etc/rc.d/init.d/functions

Can you please help to start nagios?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Can't start nagios if apache is in custom location

Post by abrist »

vinothsethuram wrote:I couldn't start nagios due to apache's custom location.
The error you are receiving is due to missing LSB init functions, not a custom apache location. What distribution are you running?
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.
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

Re: Can't start nagios if apache is in custom location

Post by vinothsethuram »

abrist wrote:
vinothsethuram wrote:I couldn't start nagios due to apache's custom location.
The error you are receiving is due to missing LSB init functions, not a custom apache location. What distribution are you running?
Ubuntu 13.10
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Can't start nagios if apache is in custom location

Post by abrist »

I presume you are running core 4. There have been issues with debian systems and the init scripts. See the following thread:
http://support.nagios.com/forum/viewtop ... nit#p76464
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.
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

Re: Can't start nagios if apache is in custom location

Post by vinothsethuram »

I executed below command

apt-get install daemon.

But confused with hack script. Which File I need to edit and where is the contents be copied or replaced?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Can't start nagios if apache is in custom location

Post by slansing »

You need to follow the other post in that thread which links back to the altered nagios init script.

http://support.nagios.com/forum/viewtop ... =20#p64091

It is a drop in replacement for the nagios init script.
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

Re: Can't start nagios if apache is in custom location

Post by vinothsethuram »

After replacing the script, I am getting error

sudo service nagios restart
$Stopping nagios:
$Starting nagios:


But nagios dashboard is not working .. http://ipaddress/nagios/ is giving following error

Not Found

The requested URL /nagios/ was not found on this server.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Can't start nagios if apache is in custom location

Post by abrist »

Restart httpd:

Code: Select all

service httpd restart
Or:

Code: Select all

service apache2 restart
Do you have a vhost file for nagios?

Code: Select all

ls -la /etc/httpd/conf.d
Or:

Code: Select all

ls -la /etc/apache2/sites-available/
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.
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

Re: Can't start nagios if apache is in custom location

Post by vinothsethuram »

abrist wrote:Restart httpd:

Code: Select all

service httpd restart
Or:

Code: Select all

service apache2 restart
Do you have a vhost file for nagios?

Code: Select all

ls -la /etc/httpd/conf.d
Or:

Code: Select all

ls -la /etc/apache2/sites-available/

service apache2 command executed fine. But still getting page not found error.

log for ls -la /etc/httpd/conf.d


total 12
drwxr-xr-x 3 root root 4096 Nov 19 16:30 .
drwxr-xr-x 3 root root 4096 Nov 19 16:30 ..
drwxr-xr-x 2 root root 4096 Nov 25 05:27 nagios.conf

log for ls -la /etc/apache2/sites-available/

total 20
drwxr-xr-x 2 root root 4096 Nov 21 03:53 .
drwxr-xr-x 8 root root 4096 Nov 21 03:53 ..
-rw-r--r-- 1 root root 1327 Jul 24 06:45 000-default.conf
-rw-r--r-- 1 root root 6432 Jul 20 16:44 default-ssl.conf
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Can't start nagios if apache is in custom location

Post by abrist »

Lets copy the nagios vhost fole to sites-available:

Code: Select all

cp /etc/httpd/conf.d/nagios.conf /etc/apache2/sites-available/
And then restart apache:

Code: Select all

service apache2 restart
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.
Locked