LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 12-14-2007, 09:20 AM   #1
ajeetraina
Member
 
Registered: Jun 2007
Location: India
Distribution: Ubuntu,Red Hat, Fedora
Posts: 292

Rep: Reputation: 30
Nagios Not working !!!!


Hello,

I was trying to install the NAgios on RHEL 4.0 and the steps I followed refrred to http://nagios.sourceforge.net/docs/3...rt-fedora.html and I did all the steps except [make install-webconf].Anyway I installed all the other steps from this link.Restarted apache and nagios without any issue.But now when I open http://localhost/nagios its not working.the log file:



[1197644830] LOG VERSION: 2.0
[1197644830] Finished daemonizing... (New PID=3637)
[1197644830] Error: Could not create external command file '/usr/local/nagios/var/rw/nagios.cmd' as named pipe: (2) -> No such file or directory. If this file already exists and you are sure that another copy of Nagios is not running, you should delete this file.
[1197644830] Bailing out due to errors encountered while trying to initialize the external command file... (PID=3637)
[1197644987] Nagios 3.0b7 starting... (PID=3706)
[1197644987] Local time is Fri Dec 14 20:39:47 IST 2007
[1197644987] LOG VERSION: 2.0
[1197644987] Finished daemonizing... (New PID=3707)
[1197644987] Error: Could not create external command file '/usr/local/nagios/var/rw/nagios.cmd' as named pipe: (2) -> No such file or directory. If this file already exists and you are sure that another copy of Nagios is not running, you should delete this file.
[1197644987] Bailing out due to errors encountered while trying to initialize the external command file... (PID=3707)
 
Old 12-14-2007, 09:37 AM   #2
Rush_898
Member
 
Registered: Mar 2004
Distribution: debian...
Posts: 31

Rep: Reputation: 16
I had this problem one time and it was a permissions issue with nagios writing to the cmd file. Can you check your systems logs to see if there is anything in there? Also look at the permissions of the directory that the cmd file is in.
 
Old 12-14-2007, 01:12 PM   #3
dguitar
Member
 
Registered: Jun 2005
Location: Portland, ME
Distribution: Slackware 13, CentOS 5.3, FBSD 7.2, OBSD 4.6, Fedora 11
Posts: 122

Rep: Reputation: 17
Any reason you didn't install from RPM? If you are installing Nagios on an RPM based system, you really should use the RPM... Unless you need to configure something out of the norm.

Also if you are installing this on a Production machine, to montior Production machines; I'd suggest using 2.10 instead of going to the 3.0 branch which is still in Beta.

Edit:
Well - I guess you didn't use the RPM because you were following that link.

You should use the RPM which can be downloaded from the nagios Web site.

Last edited by dguitar; 12-14-2007 at 01:15 PM. Reason: Bad reading on my part
 
Old 12-16-2007, 06:35 AM   #4
ajeetraina
Member
 
Registered: Jun 2007
Location: India
Distribution: Ubuntu,Red Hat, Fedora
Posts: 292

Original Poster
Rep: Reputation: 30
I remember that when I ran these commands:
make install
make install-init
make install-config

It ran without any issue.But the last one :
make install-commandmode <-------------
dint worked at all.

I saw the directory and there is nothing called rw in the directory;

usr/local/nagios/var/rw/nagios.cmd
Any Hint???

Din't worked.What I think is this may be the issue?
Also, the command [make install-webconf] dint work.

Pls Help??
 
Old 12-16-2007, 09:44 AM   #5
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
There should be a directory, /usr/local/nagios/var/rw. If You don't have an rw directory, then make one! Then touch the file nagios.cmd within that directory, and change the ownership recursively of the rw directory to be owned by the nagios user and group.

Peace,
JimBass
 
Old 12-17-2007, 12:10 AM   #6
ajeetraina
Member
 
Registered: Jun 2007
Location: India
Distribution: Ubuntu,Red Hat, Fedora
Posts: 292

Original Poster
Rep: Reputation: 30
Nagios Browser Not working????

I tried to make rw directory and nagios.cmd and restart the service..now Happily it shows no error during the nagios startup which it was showing missing earlier.
---------------------------------------------------------------------
[1197870233] Nagios 3.0b7 starting... (PID=20260)
[1197870233] Local time is Mon Dec 17 11:13:53 IST 2007
[1197870233] LOG VERSION: 2.0
[1197870233] Finished daemonizing... (New PID=20261)
[1197870234] Caught SIGTERM, shutting down...
[1197870234] Successfully shutdown... (PID=20261)
[1197870234] Nagios 3.0b7 starting... (PID=20316)
[1197870234] Local time is Mon Dec 17 11:13:54 IST 2007
[1197870234] LOG VERSION: 2.0
[1197870234] Finished daemonizing... (New PID=20317)
[1197870236] Caught SIGTERM, shutting down...
[1197870236] Successfully shutdown... (PID=20317)
[1197870236] Nagios 3.0b7 starting... (PID=20372)
[1197870236] Local time is Mon Dec 17 11:13:56 IST 2007
[1197870236] LOG VERSION: 2.0
[1197870236] Finished daemonizing... (New PID=20373)
[1197870346] SERVICE ALERT: localhost;HTTP;WARNING;SOFT;1;HTTP WARNING: HTTP/1.1 403 Forbidden
[1197870406] SERVICE ALERT: localhost;HTTP;WARNING;SOFT;2;HTTP WARNING: HTTP/1.1 403 Forbidden
[1197870466] SERVICE ALERT: localhost;HTTP;WARNING;SOFT;3;HTTP WARNING: HTTP/1.1 403 Forbidden
[1197870526] SERVICE ALERT: localhost;HTTP;WARNING;HARD;4;HTTP WARNING: HTTP/1.1 403 Forbidden
[1197870978] Caught SIGTERM, shutting down...
[1197870978] Successfully shutdown... (PID=20373)
[1197870978] Nagios 3.0b7 starting... (PID=7314)
[1197870978] Local time is Mon Dec 17 11:26:18 IST 2007
[1197870978] LOG VERSION: 2.0
[1197870978] Finished daemonizing... (New PID=7315)
[root@jhett var]#
-------------------------------------------------------------------


The webpage http://localhost/nagios is not working.Also,the command make install-webconf dint work as no directory by name webconf is there under conf.d directory
Any entry to be modified in httpd.conf file.

Last edited by ajeetraina; 12-17-2007 at 12:12 AM.
 
Old 12-17-2007, 12:55 AM   #7
ajeetraina
Member
 
Registered: Jun 2007
Location: India
Distribution: Ubuntu,Red Hat, Fedora
Posts: 292

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by ajeetraina View Post
I tried to make rw directory and nagios.cmd and restart the service..now Happily it shows no error during the nagios startup which it was showing missing earlier.
---------------------------------------------------------------------
[1197870978] LOG VERSION: 2.0
[1197870978] Finished daemonizing... (New PID=7315)
[1197874264] Caught SIGTERM, shutting down...
[1197874264] Successfully shutdown... (PID=7315)
[1197874264] Nagios 3.0b7 starting... (PID=8193)
[1197874264] Local time is Mon Dec 17 12:21:04 IST 2007
[1197874264] LOG VERSION: 2.0
[1197874264] Finished daemonizing... (New PID=8194)
[root@jhett var]# tail -f nagios.log
[1197870978] Nagios 3.0b7 starting... (PID=7314)
[1197870978] Local time is Mon Dec 17 11:26:18 IST 2007
[1197870978] LOG VERSION: 2.0
[1197870978] Finished daemonizing... (New PID=7315)
[1197874264] Caught SIGTERM, shutting down...
[1197874264] Successfully shutdown... (PID=7315)
[1197874264] Nagios 3.0b7 starting... (PID=8193)
[1197874264] Local time is Mon Dec 17 12:21:04 IST 2007
[1197874264] LOG VERSION: 2.0
[1197874264] Finished daemonizing... (New PID=8194)

-------------------------------------------------------------------

The webpage http://localhost/nagios is not working.Also,the command make install-webconf dint work as no directory by name webconf is there under conf.d directory
Any entry to be modified in httpd.conf file.
-----------------------------------------------------------------------

Last edited by ajeetraina; 12-17-2007 at 01:48 AM. Reason: Latest Logs after creating rw directory
 
Old 12-17-2007, 02:18 AM   #8
ajeetraina
Member
 
Registered: Jun 2007
Location: India
Distribution: Ubuntu,Red Hat, Fedora
Posts: 292

Original Poster
Rep: Reputation: 30
Further Details:

--------------------
The Verification OF nagios:

[root@jhett ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios 3.0b7
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 11-23-2007
License: GPL

Reading configuration data...

Running pre-flight check on configuration data...

Checking services...
Checked 8 services.
Checking hosts...
Checked 1 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 24 commands.
Checking time periods...
Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
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
 
Old 12-17-2007, 12:55 PM   #9
dguitar
Member
 
Registered: Jun 2005
Location: Portland, ME
Distribution: Slackware 13, CentOS 5.3, FBSD 7.2, OBSD 4.6, Fedora 11
Posts: 122

Rep: Reputation: 17
So you are still getting the issue with no nagios.cmd in the rw folder?

Run ls -l on /usr/local/nagios/var

Make sure your nagios user owns all the files

When you go to http://localhost/nagios/ - Do you get a page cannot be displayed? Or Do you see a 'Whoops...'?

Nagios should be able to create a nagios.cmd, but it might not have the right permissions to do that.
 
Old 12-17-2007, 11:16 PM   #10
ajeetraina
Member
 
Registered: Jun 2007
Location: India
Distribution: Ubuntu,Red Hat, Fedora
Posts: 292

Original Poster
Rep: Reputation: 30
Its still not working.I provided :
#chown -R nagios:nagios /usr/local/nagios/var/*
And tried to run :
#htmlview http://localhost/nagios
It says that :
--------------------------------------------------------------------
The requested URL /nagios directory was not found in this server
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Apache/2.0.52 (Red Hat) Server at Localhost port 80
--------------------------------------------------------------------
 
Old 12-18-2007, 09:36 AM   #11
dguitar
Member
 
Registered: Jun 2005
Location: Portland, ME
Distribution: Slackware 13, CentOS 5.3, FBSD 7.2, OBSD 4.6, Fedora 11
Posts: 122

Rep: Reputation: 17
You'll need to run a chown -R nagios.nagios /usr/local/nagios

Are you sure the web part of nagios is configured correctly? Seems like that isn't configured correctly.

You should have a file in /etc/httpd/conf.d/ called nagios.conf - OR you need add the Nagios stuff to the http.conf

By default, you should have apache looking in the conf.d folder for more conf's. You can check this by:

cat /etc/httpd/conf/httpd.conf | grep conf.d
You should get back this line:
Include conf.d/*.conf

Make sure it isn't commented out.

This is the default of what nagios entry for apache (you might need to change this for your needs)

Code:
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin

<Directory "/usr/local/nagios/sbin">
    Options ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /usr/local/nagios/etc/htpasswd.users
    Require valid-user
</Directory>

Alias /nagios /usr/local/nagios/share

<Directory "/usr/local/nagios/share">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /usr/local/nagios/etc/htpasswd.users
    Require valid-user
</Directory>
If you didn't have a nagios.conf or didn't have the nagios stuff in your httpd.conf, and you just added it. You will need to restart Apache.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lm-sensors not working with nagios hondo Linux - Server 9 11-17-2010 03:54 PM
E-mail notifications not working with nagios hondo Linux - Server 3 10-28-2007 12:42 PM
apt-get remove nagios-text not working namit Linux - Software 0 09-22-2007 06:28 PM
Nagios cgis not working in fedora core 3? Jamesk5 Linux - Software 9 04-29-2005 06:26 AM
Nagios GD related CGIs not working! masterJ Linux - Software 3 01-05-2005 11:39 AM


All times are GMT -5. The time now is 04:19 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration