Ups, I did it again – when I upgraded to Debian GNU/Linux 5 (lenny) and Nagios3 I stumbled about this nagios error when I try to send directs commands via the web-interface:
Error: Could not stat() command file ‘/var/lib/nagios3/rw/nagios.cmd’!
In “/etc/nagios3/nagios.cfg” the “check_external_commands=1″ was already set. So there was something more required to make it run on Debian…
Deep in my memory I know that there was a debian way to solve this user right related problem. This time I’ll write it down here – perhaps I’ll find it more easily when I upgrade to Debian GNU/Linux 6.0 (codenamed squeeze) and/or Nagios4.
/etc/init.d/nagios3 stop
dpkg-statoverride –update –add nagios www-data 2710 /var/lib/nagios3/rw
dpkg-statoverride –update –add nagios nagios 751 /var/lib/nagios3
/etc/init.d/nagios3 start

#1 by Jared - September 23rd, 2009 at 17:33
Good note.. I found this page as I was having the same feeling about how to fix this. Just one correction though.. the two command switches require 2 dashes not one. ie –update –add
#2 by Tijn Lambrechtsen - Februar 13th, 2010 at 01:42
Heya Lars, thnx a million 4 sharin’ this. Got it goin’ ;c)
Metta Mudita
#3 by Fatman - Februar 22nd, 2010 at 13:08
Thanks Lars, this is a really great tip.
#4 by Chris - September 8th, 2010 at 16:29
Watch out for copy-and-paste fail. The –update and –add above does not actually have two – characters.
#5 by jason b - Dezember 4th, 2010 at 20:39
Wow thank you so much I’ve been trying to figure this out !
Your awesome
#6 by Sten - Mai 31st, 2011 at 13:41
Now I realise they don’t come out as double ones on thw webpage. Anyway, they are double.
#7 by Mohamed Faye - August 1st, 2011 at 14:58
Thanks so much for the post it really help me so much. i added you on my twitter.
#8 by josh - November 9th, 2011 at 21:37
Very nice!!! I wish all the problems of nagios could be fixed that easily! great write up!