Permissions Error (Could not stat() command file )

Chris Losch Chris.Losch at newham.gov.uk
Mon Dec 9 15:43:49 CET 2002


Change of Subject line, things were getting confused....
----
 
 
It was worth a try, still didnt work though *sigh*
 
Just in case I'm missing something.
 
ls -la /usr/local/nagios/var/rw
-----------------------------------------
total 8
drwxrwS---    2 nagios   nagiocmd     4096 Dec  6 17:20 .
drwxrwxr-x    4 nagios   nagios       4096 Dec  9 14:37 ..
prw-rwx---    1 nagios   nagiocmd        0 Dec  6 17:20 nagios.cmd (after
chmod'ing with Terry Inzauro's suggestion - see below, default group perms
are rw-) 
 
/etc/group (relevant bits)
----------------
apache:x:48:
nobody:x:99:
nagios:x:500:
nagiocmd:x:501:nagios,nobody,apache
 
ps -ef | grep httpd  output
-------------------------
root     10311     1  0 Dec06 ?        00:00:02 /usr/sbin/httpd
apache   14958 10311  0 14:28 ?        00:00:00 /usr/sbin/httpd
apache   14959 10311  0 14:28 ?        00:00:00 /usr/sbin/httpd
apache   14960 10311  0 14:28 ?        00:00:00 /usr/sbin/httpd
apache   14961 10311  0 14:28 ?        00:00:00 /usr/sbin/httpd
apache   14962 10311  0 14:28 ?        00:00:00 /usr/sbin/httpd
apache   14963 10311  0 14:28 ?        00:00:00 /usr/sbin/httpd
apache   14964 10311  0 14:28 ?        00:00:00 /usr/sbin/httpd
apache   14965 10311  0 14:28 ?        00:00:00 /usr/sbin/httpd
apache   15022 10311  0 14:28 ?        00:00:00 /usr/sbin/httpd
root     16310 15956  0 14:34 pts/3    00:00:00 grep httpd
 
ps -ef | grep nagios
---------------------------
nagios    8504     1  0 Dec06 ?        00:03:52 /usr/local/nagios/bin/nagios
-d
(lots, but all the same)
 
I'm not wrong in thinking that the httpd is running under the APACHE user,
am I? 
 
Thanks
Chris

 
 -----Original Message-----
From: Terry Inzauro [mailto:tinzauro at axiomintegration.com]
Sent: 06 December 2002 19:27
To: Chris Losch
Subject: RE: [Nagios-users] RE: Permissions Error


I think the nagios user,the apache user need to have write access rwx access
to that file.  make sure that each of the respective users have the
necessary perms.  or just add the nagios user to the group owner in the
/etc/group file. 

worth a try? 

Terry Inzauro 


On Fri, 2002-12-06 at 11:31, Chris Losch wrote: 

I'm afraid its a case of been there, done that... 
  
but just in case I did something wrong, I tried again... 
  
Stopped Nagios and $INSTALLPATH/var/rw/nagios.cmd  disappeared (as it should
- see I even tried reading the manual :-D ) 
Used the /etc/rc.d/init/nagios script to start it,
$INSTALLPATH/var/rw/nagios.cmd re-appears with the default permissions 
  
prw-rw----    1 nagios   nagiocmd        0 Dec  6 17:20 nagios.cmd 
  
CHMOD'd 777 it, still receiving the same error when attempting the command. 
  
Have even tried restarting the httpd :( which runs under the 'apache' user,
which is part of the nagiocmd group. 
  
Incidently the parent (rw) directory has the permissions, 
  
drwxrwS---    2 nagios   nagiocmd     4096 Dec  6 17:20 rw 
  
Maybe someone will spot where im going wrong. 
Anyway, have a good weekend all. 
Chris 

-----Original Message----- 
From: Terry Inzauro [mailto:tinzauro at axiomintegration.com] 
Sent: 06 December 2002 15:12 
To: Chris Losch 
Cc: nagios-users at lists.sourceforge.net 
Subject: RE: [Nagios-users] RE: Permissions Error 


I cam across the same error once.  If there was a nagios process running,
kill it.  If there is a $INSTALLPATH/var/rw/nagios.cmd file, delete it.
Next, start nagios with the /etc/rc.d/init/nagios script.  Then try the
request again.  If does the same thing. try chmodddddding the
$INSTALLPATH/var/rw/nagios.cmd file for something like 777, then work it
backwards from there. 

Terry Inzauro 


On Fri, 2002-12-06 at 06:41, Chris Losch wrote: 

FYI, 

I have just built up a clean install of Redhat 8, and Nagios1.0 
I have got Authentication setup and working ok (I can view cgi's), however I
am unable to send commands from the Web Pages to Nagios (Scheduling Checks
etc.) 

I am recieving the error 

  Error: Could not stat() command file
'/usr/local/nagios/var/rw/nagios.cmd'! 
  The external command file may be missing, Nagios may not be running,
and/or Nagios may not be checking external commands. 

  An error occurred while attempting to commit your command for processing. 
:( 

If possible I would suggest you backup the config CGI's (hosts services etc)
and start over, it seems to be easier than troubleshooting. 

Chris... yup another Chris. 

Just for reference I've included the bits below so you can cross reference
your config files. 

cgi.cfg 
------- 
authorized_for_system_information=xxxx,nagiosadmin, 
authorized_for_system_commands=xxxx,nagiosadmin, 
authorized_for_configuration_information=xxxx,nagiosadmin, 
authorized_for_all_hosts=xxxx,nagiosadmin, 
authorized_for_all_host_commands=xxxx,nagiosadmin, 
authorized_for_all_services=xxxx,nagiosadmin, 
authorized_for_all_service_commands=xxxx,nagiosadmin, 

.htaccess (in /usr/local/nagios/share/ and  /usr/local/nagios/sbin/) 
--------- 
AuthName "Nagios Access" 
AuthType Basic 
AuthUserFile /usr/local/nagios/etc/htpasswd.users 

/usr/local/nagios/etc/htpasswd.users 
------------------------------------ 
nagiosadmin:<encrypted> 

/etc/httpd/conf/httpd.conf (added the following, otherwise, no changes from
default) 
-------------------------- 
ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/ 
<Directory "/usr/local/nagios/sbin/"> 
    AllowOverride AuthConfig 
    Options ExecCGI 
    Order allow,deny 
    Allow from all 
</Directory> 

Alias /nagios/ /usr/local/nagios/share/ 
<Directory "/usr/local/nagios/share"> 
    Options None 
    AllowOverride AuthConfig 
    Order allow,deny 
    Allow from all 
</Directory> 

/etc/local/nagios/etc/contacts.cfg 
---------------------------------- 
define contact { 
contact_name                   nagiosadmin 
alias                          Nagios Admin 
service_notification_period    24x7 
host_notification_period       24x7 
service_notification_options   w,u,c,r 
host_notification_options      d,u,r 
service_notification_commands  notify-by-email,notify-by-epager 
host_notification_commands     host-notify-by-email,host-notify-by-epager 
email                          nagios-admin at localhost.localdomain 
pager                          pagenagios-admin at localhost.localdomain 
} 

/etc/local/nagios/etc/nagios.cfg 
--------------------------------- 
# 
# nagios.cfg - Config file for Nagios (www.nagios.org) 
# 
# Written by Nagat. Manually editing this file is a bad idea since Nagat
will 
# overwrite it. Delete the nagatobj.dat file in the nagios/etc directory to 
# reread the Nagios configuration. 
# 
log_file=/usr/local/nagios/var/nagios.log 
cfg_file=/usr/local/nagios/etc/checkcommands.cfg 
cfg_file=/usr/local/nagios/etc/misccommands.cfg 
cfg_file=/usr/local/nagios/etc/contactgroups.cfg 
cfg_file=/usr/local/nagios/etc/contacts.cfg 
cfg_file=/usr/local/nagios/etc/dependencies.cfg 
cfg_file=/usr/local/nagios/etc/escalations.cfg 
cfg_file=/usr/local/nagios/etc/hostgroups.cfg 
cfg_file=/usr/local/nagios/etc/hosts.cfg 
cfg_file=/usr/local/nagios/etc/services.cfg 
cfg_file=/usr/local/nagios/etc/timeperiods.cfg 
resource_file=/usr/local/nagios/etc/resource.cfg 
status_file=/usr/local/nagios/var/status.log 
nagios_user=nagios 
nagios_group=nagios 
check_external_commands=1 
command_check_interval=-1 
command_file=/usr/local/nagios/var/rw/nagios.cmd 
comment_file=/usr/local/nagios/var/comment.log 
downtime_file=/usr/local/nagios/var/downtime.log 
lock_file=/usr/local/nagios/var/nagios.lock 
temp_file=/usr/local/nagios/var/nagios.tmp 
log_rotation_method=d 
log_archive_path=/usr/local/nagios/var/archives 
use_syslog=1 
log_notifications=1 
log_service_retries=1 
log_host_retries=1 
log_event_handlers=1 
log_initial_states=0 
log_external_commands=1 
log_passive_service_checks=1 
inter_check_delay_method=s 
service_interleave_factor=s 
max_concurrent_checks=0 
service_reaper_frequency=10 
sleep_time=1 
service_check_timeout=60 
host_check_timeout=30 
event_handler_timeout=30 
notification_timeout=30 
ocsp_timeout=5 
perfdata_timeout=5 
retain_state_information=1 
state_retention_file=/usr/local/nagios/var/status.sav 
retention_update_interval=60 
use_retained_program_state=0 
interval_length=60 
use_agressive_host_checking=0 
execute_service_checks=1 
accept_passive_service_checks=1 
enable_notifications=1 
enable_event_handlers=1 
process_performance_data=0 
obsess_over_services=0 
check_for_orphaned_services=0 
check_service_freshness=1 
freshness_check_interval=60 
aggregate_status_updates=1 
status_update_interval=15 
enable_flap_detection=0 
low_service_flap_threshold=5.0 
high_service_flap_threshold=20.0 
low_host_flap_threshold=5.0 
high_host_flap_threshold=20.0 
date_format=euro 
illegal_object_name_chars=`~!$%^&*|'"<>?,()= 
illegal_macro_output_chars=`~$&|'"<> 
admin_email=nagios 
admin_pager=pagenagios 









-----Original Message----- 
From: Chris Fairbanks [  <mailto:ChrisF at winterlink.net>
mailto:ChrisF at winterlink.net] 
Sent: 06 December 2002 07:22 
To: Chris Fairbanks; wrnash; Potter, G M (Greg); Nagios-users (E-mail) 
Cc: Robertson, Brown 
Subject: RE: [Nagios-users] RE: Permissions Error 


Another interesting tibit, I tired disabling use_authentication and 
setting up a default user, but I still get the same issues. 

        Thanks 
        Chris 


-----Original Message----- 
From: Chris Fairbanks 
Sent: Thursday, December 05, 2002 10:47 PM 
To: wrnash; Potter, G M (Greg); Nagios-users (E-mail) 
Cc: Robertson, Brown 
Subject: RE: [Nagios-users] RE: Permissions Error 


My httpasswd.users file and everything is setup totally correctly and 
use_authentication=1 is set.  I have also tried setting all the 
authorized_for's = * but to no avail.  From the sounds of it, it looks 
like this might be an issue with RH8.0 or Apache 2.0.40 that ships 
default with RH8.0.  Is there anyone on this list that has Nagios 
working on RH8.0? 

        Thanks, 
        Chris 




********************************************************************** 
Important: 
This e-mail is intended for the above named person only and should be 
treated as confidential. If this has come to you in error you should take 
no action based on it, nor should you copy or show it to anyone; 
please telephone us immediately. 
********************************************************************** 



Terry Inzauro 
Systems Engineer 	

Email:        <mailto:tinzauro at axiomintegration.com>
tinzauro at axiomintegration.com

Phone:      402.345.5500

Fax:        402.345.5501

US Mail:      <http://www.axiomintegration.com/> Axiom Integration, Inc.

              <http://www.axiomintegration.com> One Owen Pkwy

              <http://www.axiomintegration.com> 2200 Abbott Drive

              <http://www.axiomintegration.com/> Carter Lake, IA
<http://www.usps.gov/ncsc/lookups/lookups.htm> 51510


Terry Inzauro 
Systems Engineer 	

Email:        <mailto:tinzauro at axiomintegration.com>
tinzauro at axiomintegration.com

Phone:      402.345.5500

Fax:        402.345.5501

US Mail:     Axiom Integration, Inc. <http://www.axiomintegration.com/> 

             One Owen Pkwy <http://www.axiomintegration.com> 

             2200 Abbott Drive <http://www.axiomintegration.com> 

             Carter Lake, IA <http://www.axiomintegration.com/>   51510
<http://www.usps.gov/ncsc/lookups/lookups.htm> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20021209/f9a3b90b/attachment.html>


More information about the Users mailing list