Permissions Error (Could not stat() comman d file )

Pascal Miquet p.miquet at hafiba.fr
Tue Dec 10 17:44:19 CET 2002


Chris,

Using a RH8.0 distro, I've at least the same problem, and the same Idea
to use a RH7.3 rather the 8.0, cause on my laptop all things tested is
running fine.
Should use the GD function at least, but nagios and addons works pretty
good on an RH7.3

I didn't checks on RH for updates....
Regards
Pascal Miquet

Le mar 10/12/2002 à 14:13, Chris Losch a écrit :
> It would seem I'm paying for running on the b-leading-edge again.
> 
> Unless anyone has got Nagios successfully working on RH 8 and APACHE 2,
> looks like i'm going to revert to RH7.3 and Apache 1.3.
> I can't see anything wrong with the setup, yet it doesn't work. 
> The last thing I'm going to attempt is running a STRACE on httpd and nagios,
> as suggested by Greg Potter, to see if i can spot anything in there... if
> not.. well... 1st things 1st.
> 
> Will post an update after lunch (hey, we have to have priorities!)
> Chris
> 
> -----Original Message-----
> From: Pascal Miquet [mailto:p.miquet at hafiba.fr]
> Sent: 10 December 2002 10:00
> To: Chris Losch
> Cc: 'Jon Lyons'; 'nagios-users at lists.sourceforge.net'
> Subject: RE: [Nagios-users] RE: Permissions Error (Could not stat()
> comman d file )
> 
> 
> For me on a RH8.0,
> APACHE 2.0.40-8
> Nagios 1.0
> Plugins 1.3 beta 2
> 
> I've got on the process info section:
> It appears as though Nagios is not running, so commands are temporarily
> unavailable... 
> 
> And according to Execution command, I can't commit specified commands.
> Seems to be a CGI authentication.
> 
> Note that the previous version is running fine on my laptop with RH7.3
> 
> Regards
> 
> 
> Le lun 09/12/2002 à 18:05, Chris Losch a écrit :
> > Jon, 
> > I am 99% sure, (from what I read in the ps -ef output, and httpd.conf)
> >  
> > Relevant part from httpd.conf
> > ------------------------------------------
> > # If you wish httpd to run as a different user or group, you must run
> > # httpd as root initially and it will switch.
> > #
> > # User/Group: The name (or #number) of the user/group to run httpd as.
> > #  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
> > #  . On HPUX you may not be able to use shared memory as nobody, and the
> > #    suggested workaround is to create a user www and use that user.
> > #  NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
> > #  when the value of (unsigned)Group is above 60000;
> > #  don't use Group #-1 on these systems!
> > #
> > User apache
> > Group apache
> >  
> >  
> > I've even tried changing Group to 'nagiocmd', no luck with that either.
> >  
> > NOTE This is APACHE 2 as supplied by REDHAT 8 CD's
> > Server version: Apache/2.0.40
> >  
> > Thanks for your suggestion anyway,
> >  
> > I'm starting to wonder if this is an issue with Nagios on Apache2, has
> > anyone else got this working successfully?
> >  
> > Chris
> > 
> > -----Original Message-----
> > From: Jon Lyons [mailto:jlyons30 at yahoo.com]
> > Sent: 09 December 2002 15:28
> > To: Chris Losch; 'Terry Inzauro'
> > Cc: 'nagios-users at lists.sourceforge.net'
> > Subject: Re: [Nagios-users] RE: Permissions Error (Could not stat()
> command
> > file )
> > 
> > 
> > 
> > Are you sure apache is running as "apache" and not "www"? 
> > 
> > 
> >  Chris Losch <Chris.Losch at newham.gov.uk> wrote: 
> > 
> > 
> > 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 
> > 
> 
> 
> **********************************************************************
> 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.
> **********************************************************************
> 




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list