Nagios 4.1.1: fixing the Nagios - "Could not open command file /usr/local/nagios/var/rw/nagios.cmd’ for update"

Nagios - Could not open command file /usr/local/nagios/var/rw/nagios.cmd’ for update














Whenever we are trying to disable/enable  active check for a service through a Nagios web interface, but we can't make it.

The Nagios instance is running and configured on a Centos 6.7 distribution
Each time when we try to stop the service we get this message
:  Could not open command file ‘/usr/local/nagios/var/rw/nagios.cmd’ for update!
Please follow these steps to fix this issue

 We have to stop the nagios and apache services


# service httpd stop

# service nagios stop

We needed to add the users nagios and apache to nagcmd group

# usermod -a -G nagcmd nagios

# usermod -a -G nagcmd apache

# usermod -a -g nagios apache

Change the permission of the folder where the nagios.cmd are there

# chown nagios:nagcmd /usr/local/nagios/var/rw

We needed to change start the nagios services

# service nagios start 

We needed to change the permissions of the nagios user and nagcmd group to the

# chown nagios:nagcmd /usr/local/nagios/var/rw/nagios.cmd
Restart the nagios services and start the apache services

# service httpd start

# service nagios start

Hope this will fix the isses 

Please check this while running this commands 

ls -l /usr/local/nagios/var/rw







We needed to check the SElinux if it is enforced change it to permissive, to check the SElinux status

sestatus 


To change the SElinux temperorary

# getenforce
setenforce 0
# service nagios restart


To change permenent

vi /etc/sysconfig/selinux


# SELINUX=permissive



Comments

Popular posts from this blog

Observium: Configuring Microsoft Windows 2008 Server SNMP Agent

AWS: Introduction to AWS (Amazon Web Services)

System/Server Health Status using PowerShell