After upgrading from Nagios 4.0 to 4.0.1, I attempted to manually reschedule a check of all services on a particular host, I received the following error:
Error: Could not open command file ‘/usr/local/nagios/var/rw/nagios.cmd’ for update!
The source of the problem turned out to be a permissions issue with the nagios.cmd file, which I fixed with the following commands:
chown nagios.nagcmd /usr/local/nagios/var/rw chmod g+rwx /usr/local/nagios/var/rw chmod g+s /usr/local/nagios/var/rw
I restarted Nagios, and everything worked again!