Tag: Command update error file null
Cause analysis, Nginx does not support post.
Workaround, Recompile Nagios
1, VI/NAGIOS-4.0.8/CGI/CMD.C
Find printf ("<form method= 'post' action= '%s ' >\n", command_cgi);
Post modified to get
2, re-make, do not need to install
Copy the new cmd.cgi to replace the old
CP nagios-4.0.8/cgi/cmd.cgi/usr/local/nagios/sbin/cmd.cgi
3.error:could not open command file '/usr/local/nagios/var/rw/nagios.cmd ' for update!, with this error message, after searching, get the answer:Http://blog.sina.com.cn/s/blog_6eee530801010ade.html
Modify the Nagios startup script/etc/init.d/nagios
start)
echo-n "Starting Nagios:"
$NagiosBin-v $NagiosCfgFile >/dev/null 2>&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----added this sentence
Exit 0
This article is from the "Linux related sharing" blog, make sure to keep this source http://2860664.blog.51cto.com/2850664/1571716
/NAGIOS/CGI-BIN/CMD.CGI cannot open