Tuesday, 16 February 2010

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

Fix:

chmod 777 /usr/local/nagios/var/rw/nagios.cmd

3 comments:

  1. Isnt it that every time you restart nagios.. nagios.cmd file is recreated and you will loose this fix....

    ReplyDelete
  2. Generally speaking; this error is caused by incorrect permissions (read: group ownership) on the overarching directory. You can fix it by..

    (This assumes nagios belongs to the group nagcmd)

    update group in your nagios cfg before first starting nagios
    sed -i 's/nagios_group=nagios/nagios_group=nagcmd/' /usr/local/nagios/etc/nagios.cfg



    If the directory was already created; either delete it so it will be created with correct group ownership on nagios restart (Assuming nagios.cfg is updated); or manually update it with

    chown nagios.nagcmd /usr/local/nagios/var/rw

    ReplyDelete
  3. Guys,

    This means the the nagios.cmd file doesn't has a permission to execute from the WEB i.e., apache. do the following and restart the Nagios and Apache/httpd
    /etc/group

    nagios:x:500:nagios,apache
    nagcmd:x:501:nagios,apache

    your are done..

    ReplyDelete