Fine tuning your Fresh Nagios Installation

Fine tuning your Fresh Nagios Installation
Photo by Luke Chesser / Unsplash

Now that you have installed Nagios, you are not done.  To get rid of all those pesky errors that pop up once you install 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 first address 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:

check_disk!20%!10%!/root.gvfs

 

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 unknown missing -l parameter and no service/process defined errors

 

Ok something is clearly wrong if you get these errors for your windows host…

UNKNOWN – missing -l parameters

UNKNOWN – no service/process specified

unknown – 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.cfgNagios

Looks ok, but it isn’t. There are problems with the command. Let’s make some fixes:

Source: awaseroot

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, 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 awaserootAfter completing, hit the Services button on the right side of the screen a few times, and you should be golden. For the great article which was the best resource to fix this issue.

Are external Commands not working on your Nagios system?

Have no fear.  Follow the self-explanatory instructions here: http://askubuntu.com/questions/145518/how-do-i-install-nagios 

If it still doesn't work, check your permissions of 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!

Follow me

If you liked this article, Follow Me on Twitter to stay updated!