Installing NRPE via RPM

From Nagios Wiki

(Redirected from Installing NPRE via RPM)
Jump to: navigation, search

Contents

[edit] Overview

This HOWTO will describe how to use rpm to install Nagios' NRPE client on RHEL-based servers. This approach is necessary in the event that you cannot use yum or RPMforge on production RH or CentOS servers.

[edit] RPM

Before you can install Nagios, you must first d/l the appropriate rpm for your distro (Red Hat, Fedora, CentOS) and architecture (32/64 bit, etc).

  • nagios-plugins RPM packages for Red Hat, CentOS and Fedora
  • Depending on which plugins you want to use, you may have to add the following relevant RPMs: bind-utils, mysql, net-snmp-utils, ntp, openldap, openssh-clients, openssl, postgresql-libs qstat, radiusclient, samba-client, sendmail (beyond the scope of this HOWTO)

[edit] Installing RPMs on Monitored Server

Once you have wget'd the appropriate RPM, install the RPMs in the following order: fping, Net-SNMP, nagios-plugins, nagios-nrpe

  • Install fping
    • rpm -ivh fping-2.4-1.b2.0.el2.rf.i386.rpm
  • Install Net-SNMP
    • perl -MCPAN -e shell #This will give you a cpan shell to install perl modules
    • install Net::SNMP
  1. At the cpan shell, type this command to install the needed perl module
  2. Note that you you will prompted to setup cpan if this is your first time
  3. Press enter to select the default value for the cpan setup.
  4. In the setup of cpan, select atleast 3 good mirrors cpan will grab files from
  5. the selection will be space delimited
  • Install nagios plugins:
    • rpm -ivh nagios-plugins-1.4-2.0.el2.rf.i386.rpm
  • Install nrpe
    • rpm -ivh nagios-nrpe-2.0-3.rhel2.1.dag.i386.rpm
  • configure /etc/nagios/nrpe.cfg
    • vi /etc/nagios.cfg, then change your NRPE file handlers (e.g. command[check_load]=/path/to/plugins). Then add the relevant check_nrpe check (e.g. check_nrpe -c check_load ...) one your main Nagios server.
  • (optional) If you already have another properly configured nrpe.cfg file from another server, then copy it over using secure copy (scp).
    • scp root@box.domain.com:/etc/nagios/nrpe.cfg /etc/nagios (if not work, check firewall settings: e.g. iptables -L)
  • start the service with one of the following commands
    • /etc/init.d/nrpe start # "Linux way" of starting services
    • service nrpe start
  • start nrpe upon each boot
    • chkconfig --level 235 nrpe on

[edit] On Nagios Server

  • test the plugin via check_nrpe at the command line (e.g.)
    • cd /usr/lib/nagios/plugins
    • ./check_nrpe -H RHELbox.domain.com -c check_whatever (note: check_whatever is the name of the NRPE file handler you defined in the /etc/nrpe.cfg file on your RHEL box)
  • If have problems connecting to nrpe, make sure RHEL box port is open and that you are using the right password (-s).
    • e.g. telnet rhelbox.domain.com 12489
  • Once this tests out, then add appropriate check to your /etc/nagios/localhosts.cfg (or equiv).
Personal tools
Advertisement