Nagios Notes

Here's my Nagios status page (http://linux2/nagios/cgi-bin/status.cgi).

Get Nagios at You'll need both the base nagios package as well as nagios-plugins. On 9-17-2006, I got nagios-2.5-1.el4.rf.i386.rpm and nagios-plugins-1.4.2-1.2.el4.rf.i386.rpm.

A rpm -qip nagios-plugins-1.4.2-1.2.el4.rf.i386.rpm command said

... you may need additional packages. Depending on what plugins you
use, the following packages may be required:

    bind-utils, mysql, net-snmp-utils, ntp, openldap,
    openssh-clients, openssl, postgresql-libs
    qstat, radiusclient, samba-client, sendmail
The only one that sounded interesting and that was in the standard RHEL v4 CDs, was net-snmp-utils (the pre-req of net-snmp was already installed), so I installed this package.

Nagios installed cleanly, but nagios-plugins required all these pre-reqs

so I had to go get them all and install.
These Nagios directions sound relavent 'cause they're Redhat v4 specific, but they're not too appropriate 'cause I'm installing from pre-built rpm files rather than compiling from the source.

I added a nagiosadmin id to my /etc/nagios/htpasswd.users file.

   htpasswd -c  /etc/nagios/htpasswd.users nagiosadmin
   New password: global
   Re-type new password: global
Adding password for user nagiosadmin

I had to go through /etc/nagios/cgi.cfg file and change and/or un-comment the following lines:


I updated /etc/nagios/minimal.cfg to

NRPE - Nagios Remote Plug-in Executor

NRPE is Nagios's way of executing things on remote hosts. It consists of a check_nrpe binary that goes in your Nagios server's /usr/lib/nagios/plugins directory, and a nrpe binary that goes on each machine that Nagios will monitor. You can get the latest nrpe from the Nagios Exchange server's NRPE page (not Nagio Sex Change, Rick).

I downloaded 2.0, did the typical

   zip -d < nrpe-2.0.tar.gz | tar xvf -
   cd nrpe-2.0
   make all
and got this message.
   *** Compile finished ***

   If the NRPE daemon and client compiled without any errors, you
   can continue with installation.  The NRPE daemon and client
   binaries are located in the src/ subdirectory.

    ** If this is your monitoring host **

        - Copy the check_nrpe client to the directory that
          contains your Nagios plugins.
        - Create a command definition in your Nagios config
          file for the NRPE client.  See the README file for
          more info on doing this.

    ** If this host will be running the NRPE daemon **

        - Copy the nrpe daemon to /usr/sbin, /usr/local/nagios
          or wherever you feel it fits best.
        - Copy the sample nrpe.cfg config file to /etc,
          /usr/local/nagios or wherever you feel it fits best.
        - Modify the /etc/services file and configure NRPE to
          run under inetd, xinetd, or as a standalone daemon.
          See the README file for more info on doing this.

Configuring Nagios Monitor Machine

On linux2, my Nagios server,

Configuring each Nagios Client Machine

On each Linux client machine,

   scp -p root@linux2:nrpe-2.0/src/nrpe /usr/bin
   scp -p root@linux2:nrpe-2.0/nrpe.cfg /etc
   adduser -u 401 nagios
   vi /etc/xinetd.d/nrpe
making it
   # description: NRPE (Nagios Remote Plug-in Executor)
   service nrpe
     flags           = REUSE
     socket_type     = stream
     wait            = no
     user            = nagios
     server          = /usr/bin/nrpe
     server_args     = -c /etc/nrpe.cfg --inetd
     log_on_failure  += USERID
     disable         = no
     only_from       =

To install the Nagios plug-ins, on each remote host,

   mkdir /mnt/linux
   mount linux2:/home/linux /mnt/linux
   cd /mnt/linux/extras/
   rpm -Uvh nagios-plugins-1.4.2-1.2.el4.rf.i386.rpm  \
            perl-Net-SNMP-5.2.0-1.2.el4.rf.noarch.rpm \
            fping-2.4-1.b2.2.el4.rf.i386.rpm          \
            perl-Crypt-DES-2.05-3.2.el4.rf.i386.rpm   \
   umount /mnt/linux
   vi /etc/services
and added this line
   nrpe            5666/tcp        # NRPE - Nagios Remote Plug-in Executor
And finally,
   service xinetd reload

Using Nagios

To get to my nagios monitor page (from an internal machine of course), go to http://linux2/nagios/cgi-bin/status.cgi. You'll need to authenticate as nagiosadmin/global.
This page was last updated: Monday, 02-Oct-2006 20:41:39 Pacific Daylight Time