Nagios and GVFS problem

1. Nagios on RHEL or Fedora

install packages:

  • on Fedora8 - install nagios and complete set of plugins:
yum install -y nagios nagios-plugins-all nagios-plugins-ifstatus
               nagios-plugins-ifoperstatus nagios-plugins-snmp-disk-proc<

this will install

and additional software: fping, perl-Crypt-DES, perl-Digest-HMAC, perl-Net-SNMP, qstat

  • on RHEL4 - install nagios 2.12 using apt</dag<:
apt-get install -y nagios nagios-plugins nagios-nrpe
                   nagios-plugins-setuid nagios-plugins-nrpe<

Configure apache:

  • disable default apache configuration
cd /etc/httpd/conf.d
mv nagios.conf nagios.conf.disable<
  • verify the nagios locations of apache config< - directory locations differ between systems
    • on FC8 i386 directories are: /usr/lib/nagios/cgi-bin/ /usr/share/nagios/html/
    • on RHEL4 x86_64 directories are: /usr/lib64/nagios/cgi /usr/share/nagios
  • create wiki links<

Install windows agent:

Configure nagios:

  • download and unpack /etc/nagios from v1.tgz< or v2.tgz<
  • adjust configuration to your taste
  • verify config files
nagios -v /etc/nagios/nagios.cfg<
  • start service
chkconfig nagios on
service nagios restart<

Note that Nagios checks SSH on server using commonplace port 22inspite of the  port numbering trick<.

2. Nagios on Ubuntu

Install the packages

apt-get install -y apache2 nagios2 nagios-plugins-basic<

Create the password file

htpasswd -c -b /etc/nagios2/htpasswd.users nagiosadmin nagiosadmin<

Pinging of a VPN address (e.g. 10.20.3.2) would not work after that. Change /etc/nagios2/conf.d/host-gateway_nagios2.cfg:

host_name gateway
address 10.20.3.2<

Create configuration file for webserver /etc/nagios2/conf.d/server.cfg:

Note that we define a special check_ssh_nonstd command to check the SSH health on server. In our setup it is required because of the port numbering trick<.

Now verify the configuration and restart Nagios

nagios2 -v /etc/nagios2/nagios.cfg
/etc/init.d/nagios2 restart
/etc/init.d/apache2 restart<

Point your web browser to the nagios page, in our case http://ttk.ourdom.com/nagios2

3. GVFS problem on Ubuntu

Installed on Ubuntu 8, Nagios manifests the following error message

DISK CRITICAL - /home/support/.gvfs is not accessible: Permission denied<

My investigation showed that this problem appears due to special permissions set by FUSE< on the .gvfs directory: nobody, even root cannot access it. It is only used internally by FUSE. This problem is discussed in the relevant ubuntu bug report<. Workaround for nagios is discussed here<. We use the "-i ignored_path" key of the check_disk plugin.

So, in my case I modified /etc/nagios2/conf.d/localhost_nagios2.cfg in the following way:

define command{
  command_name  check_all_disks_plus
  command_line  /usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -u GB -A -i .gvfs
  }

define service{
  use                  generic-service
  host_name            localhost
  service_description  Disk Space
  check_command        check_all_disks_plus!20%!10%
  }<

4. Contact e-mail

Finally, I needed to let Nagios contact administrators via mail server, in my case the CommuniGate< mailer installed on the SOHO server. I performed these steps:

  1. Add nagios-tk as a postmaster alias in CGPro
  2. Change host name in /etc/nagios2/conf.d/localhost_nagios2.cfg to tk.home
  3. Use [email protected] as contact email in /etc/nagios2/conf.d/contacts_nagios2.cfg

Of course, server and mail naming conventions in your setup will be different.

 

Вложения