While installing the Nagios 4.0.2 from tarball I got this issue Error: Could not open command file ‘/usr/local/nagios/var/rw/nagios.cmd’ for update!. The problem was clearly stating about permission issue.Hence we have to only modify the permission and restart the nagios service.
The problem was occurring when I was clicking on Re-schedule the next check of this service actually it is related to commands which can be run from Nagios Dashboard.
Do the following steps:
chmod 666 /usr/local/nagios/var/rw/nagios.cmd chown nagios.nagcmd /usr/local/nagios/var/rw chmod u+rwx /usr/local/nagios/var/rw chmod g+rwx /usr/local/nagios/var/rw chmod g+s /usr/local/nagios/var/rw
Now restart the nagios
After resolving the issue,below given is screenshot reference