nagios----Error: Could not open command file '/usr/local/nagi (
The permissions on the external command file and/or directorymay be incorrect. Read the FAQs on how to setup properpermissions.An error occurred while attempting to commit your command forprocessing.
这个主要是apache 用户 没有执行权限 /usr/local/nagios/var/rw/nagios.cmd造成。
有不同的解决方法:
1、在启动nagios的时候给nagios.cmd权限
修改nagios的启动脚本/etc/init.d/nagios
start)
echo -n "Starting nagios:"
$NagiosBin -v $NagiosCfgFile > /dev/null2>&1;
if [ $? -eq 0 ]; then
su - $NagiosUser -c "touch $NagiosVarDir/nagios.log$NagiosRetentionFile"
rm -f $NagiosCommandFile
touch $NagiosRunFile
chown $NagiosUser:$NagiosGroup $NagiosRunFile
$NagiosBin -d $NagiosCfgFile
if [ -d $NagiosLockDir ]; then touch$NagiosLockDir/$NagiosLockFile; fi
echo " done."
chmod -R 777$NagiosVarDir/rw ----增加这句话
exit 0
2、将nagios和apache的用户放到一个组。
修改后,需要重启apache哦。
页:
[1]