Fine tuning your Fresh Nagios Installation

Now that you installed Nagios you are not done.  To get rid of all those pesky errors that pop up once installing Nagios you need to be patient and work through them one by one.

Fixing the error: check_all_disks  .gvfs is not accessible Permission denied

  Let's address first the most annoying problem of the /root/.gvfs filesystem is "not accessible:Permission denied"  You can either unmount the filesystem as a temporary workaround but once you reboot or mount the filesystem again the problem returns.  Secondly, you can change permissions of the .gvfs filesystem or my personal favorite is to just ignore the filesystem since I don't use it and we are already monitoring the /root filesystem anyway. Navigate to /etc/nagios-plugins/config and open the disk.cfg file with your favorite editor. Change the command_line to:
 /usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -e -R $ARG3$ -A -i .gvfs
The new flags:
 -A, --all
     Explicitly select all paths. This is equivalent to -R '.*'
 -i, --ignore-ereg-path=PATH, --ignore-ereg-partition=PARTITION
     Regular expression to ignore selected path or partition (may be repeated)
  In the /etc/nagios3/conf.d directory edit the localhost_nagios2.cfg  Find the service check_all_disks and change the check_command to:
  Once you complete the files make sure to check the config before continuing
> nagios3 -v /etc/nagios3/nagios.cfg
Once you pass the pre-flight check restart Nagios
> sudo service nagios3 restart

Fixing the Unknow missing -l parameter and no service/process defined errors

  Ok something is clearly wrong if you get these kind of errors for your windows host… UNKNOWN – missing -l parameters UNKNOWN – no service/process specified CRITICAL – Socet timeout after 10 seconds   This indicates that there’s something wrong in my nagios configuration files. Check the nt plugin:
cat /etc/nagios-plugins/nt.cfg
Looks ok but it really isn’t. There’s problems in the command. Let’s make some fixes: Text version for your copypaste needs:
define command {
         command_name    check_nt
         command_line    /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$ -v $ARG1$ $ARG2$
Check your config again and restart the service:
sudo nagios3 -v /etc/nagios3/nagios.cfg
  After the pre-flight checks good restart the Nagios service:
sudo service nagios3 restart
  Depending how impatient you are for the results you can either wait several minutes for the service to recheck each process or you can go inside each service and under the Service Commands click Re-schedule the next check for this service. After completing hit the Services button on the right side of the screen a few times and you should be golden. Thanks to awaseroot for the great article which was the best resource to fix this issue.

External Commands not working on your Nagios system?

Have no fear.  Follow the very clear instructions here -  If it still doesn't work be sure to check your permissions of both the /var/lib/nagios3 directory and the /var/lib/nagios3/rw directory.  If in doubt change the permissions to 775 on both directories just to see if it works and set it back to the requested permissions in the instructions once you get it working. Happy Nagios Monitoring!


Comments powered by Disqus