Filippo Zanardo's Blog

to blog or not to blog

Nagios XenServer

with 4 comments

I use nagios to check my server, and most of the time i use xenserver 5.5 on them, so i have to trick up the machine to work with nagios and i use an example to check hardware raid on it.

Let’s start first of all execute this command, this download yum priorities and the rpm needed by rpmforge:

wget -c http://mirror.centos.org/centos-5/5.3/os/i386/CentOS/yum-priorities-1.1.16-13.el5.centos.noarch.rpm
wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

then install it

rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm

Then install some lib needed for nagios, and finally install nagios-plugins nrpe and xinetd.

yum -y install compat-libstdc++-296 compat-libstdc++-33
yum install nagios-plugins nagios-nrpe xinetd

i use a central nagios server and i check raid via nrpe, if u don’t know what is nrpe read this:
nrpe documentation

basically:

NRPE allows you to remotely execute Nagios plugins on other Linux/Unix machines. This allows you to monitor remote machine metrics (disk usage, CPU load, etc.). NRPE can also communicate with Windows agent addons like NSClient++, so you can check metrics on remote Windows machines as well.

next modify the file /etc/xinet.d/nrpe updating this line:

disable = no
only_from = 127.0.0.1 192.168.0.100 #this is the ip of the nagios machine

allow nagios to run some script modify /etc/sudoers like:

nagios ALL=(ALL) NOPASSWD: ALL

this is not so secure on remote machine, modify to suit your needs, i use on lan machine.

next let xinetd start on startup

chkconfig xinetd on
service xinetd start

For example i sue hp prolaint server, so i explain how i check hardware raid on them, first install this rpm:

hp rpm

next i use this plugin to check raid:

raid check

modify nrpe config file (/etc/nagios/nrpe.cfg) adding this line:

command[check_raid]=/usr/lib/nagios/libexec/check_cciss -v

Finally we done set up the machine, and we can check his hardware raid on nagios central server, with the nrpe-plugin, my command on central nagios is:

$user1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

and i use it in a service with

check_nrpe|check_raid

Cheers!

p.s. if someone is interested in nagios or in a particular argument related, post your wish and later i can blog on this.

Advertisements

Written by pipposan

December 1, 2009 at 19:11

Posted in Nagios, XenServer

Tagged with , ,

4 Responses

Subscribe to comments with RSS.

  1. Hi,

    I have a problem.

    On yum install nagios-plugins nagios-nrpe this is the output:

    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * rpmforge: fr2.rpmfind.net
    Setting up Install Process
    No package xinetd available.
    Resolving Dependencies
    –> Running transaction check
    —> Package nagios-nrpe.i386 0:2.12-1.el5.rf set to be updated
    —> Package nagios-plugins.i386 0:1.4.14-1.el5.rf set to be updated
    –> Processing Dependency: fping for package: nagios-plugins
    –> Processing Dependency: perl(Net::SNMP) for package: nagios-plugins
    –> Running transaction check
    —> Package fping.i386 0:2.4-1.b2.3.el5.rf set to be updated
    —> Package perl-Net-SNMP.noarch 0:5.2.0-1.2.el5.rf set to be updated
    –> Processing Dependency: perl(Socket6) >= 0.19 for package: perl-Net-SNMP
    –> Processing Dependency: perl(Digest::HMAC) for package: perl-Net-SNMP
    –> Processing Dependency: perl(Digest::SHA1) for package: perl-Net-SNMP
    –> Processing Dependency: perl(Crypt::DES) for package: perl-Net-SNMP
    –> Running transaction check
    —> Package perl-Crypt-DES.i386 0:2.05-3.2.el5.rf set to be updated
    —> Package perl-Digest-SHA1.i386 0:2.12-2.el5.rf set to be updated
    —> Package perl-Net-SNMP.noarch 0:5.2.0-1.2.el5.rf set to be updated
    –> Processing Dependency: perl(Digest::HMAC) for package: perl-Net-SNMP
    —> Package perl-Socket6.i386 0:0.23-1.el5.rf set to be updated
    –> Finished Dependency Resolution
    perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch from rpmforge has depsolving problems
    –> Missing Dependency: perl(Digest::HMAC) is needed by package perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch (rpmforge)
    Error: Missing Dependency: perl(Digest::HMAC) is needed by package perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch (rpmforge)
    You could try using –skip-broken to work around the problem
    You could try running: package-cleanup –problems
    package-cleanup –dupes
    rpm -Va –nofiles –nodigest
    The program package-cleanup is found in the yum-utils package.

    I’m on xenserver 5.6

    Another things… After install yum-priorities, you should edit the repo and add priority=1 to base repo, and priority=10 to the rpmforge one. You may follow this how-to:

    http://wiki.centos.org/AdditionalResources/Repositories/RPMForge

    Maurs

    July 14, 2010 at 12:49

    • try to execute yum search xinetd, maybe the name change recently

      pipposan

      July 14, 2010 at 18:44

  2. Take a look at command line pls… it’s a dependency problem. The command line is

    yum install nagios-plugins nagios-nrpe

    So, no a xinetd problem.

    Maurs

    July 15, 2010 at 13:03

    • Perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch from rpmforge has depsolving problems
      –> Missing Dependency: perl(Digest::HMAC) is needed by package perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch (rpmforge)

      install this package “perl(Digest::HMAC)” and your ready to go.
      yum install perl-Digest-HMAC

      pipposan

      July 15, 2010 at 14:25


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: