LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Nagios Not working !!!! (http://www.linuxquestions.org/questions/linux-server-73/nagios-not-working-606761/)

ajeetraina 12-14-2007 10:20 AM

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)

Rush_898 12-14-2007 10:37 AM

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.

dguitar 12-14-2007 02:12 PM

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.

ajeetraina 12-16-2007 07:35 AM

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??

JimBass 12-16-2007 10:44 AM

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

ajeetraina 12-17-2007 01:10 AM

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.

ajeetraina 12-17-2007 01:55 AM

Quote:

Originally Posted by ajeetraina (Post 2992932)
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.

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

ajeetraina 12-17-2007 03:18 AM

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

dguitar 12-17-2007 01:55 PM

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.

ajeetraina 12-18-2007 12:16 AM

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
--------------------------------------------------------------------

dguitar 12-18-2007 10:36 AM

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.


All times are GMT -5. The time now is 06:30 PM.