Si Error: Could not open command file '/usr/local/nagios/var/rw/nagios.cmd’ for update

/etc/init.d/nagios stop
chown -R nagios:www-data /usr/local/nagios/var/rw
/etc/init.d/nagios start