Teil 1: Icinga 1.5 Überwachung der virtuellen Linux KVMs (Basis Proxmox) via NRPE

Ein neuer Tag, ein neues Tutorial.

Ich habe mir vorgenommen, meine KVMs in Proxmox von Icinga via NRPE überwachen zu lassen. Wie ihr dies macht, möchte ich euch kurz näher bringen.

Auf dem Hostsystem (Proxmox auf Debian basis, auf welchem auch Icinga installiert ist) müsst ihr zuerst nrpe aus den sourcen installieren und kompilieren

cd /usr/src
wget "https://git.icinga.org/?p=icinga-nrpe.git;a=snapshot;h=HEAD;sf=tgz" -O nrpe.tgz --no-check-certificate
tar xzf nrpe.tgz
cd icinga-nrpe
apt-get install openssl libssl-dev
./configure
make all
make install-plugin

Lasst uns noch eben testen, ob NRPE ordentlich installiert wurde:

Prozess starten:

/usr/src/icinga-nrpe/src/nrpe -n -c /usr/src/icinga-nrpe/sample-config/nrpe.cfg -d

NRPE Version prüfen:

/usr/local/icinga/libexec/check_nrpe -H 127.0.0.1 -n

Hier sollte jetzt soetwas erscheinen:

icingahost:/usr/src/icinga-nrpe# /usr/local/icinga/libexec/check_nrpe -H 127.0.0.1 -n

NRPE v2.12

Wenn das passt, stoppen wir den Daemon Prozess wieder mittels:

kill `ps -ef | grep "sample-config/nrpe.cfg" | grep -v grep | awk '{print $2}'`

Jetzt gehts auf das Remotesystem. Bei mir ein Ubuntu 11.04 64 Bit.

apt-get install openssl libssl-dev
adduser icinga # Icinga PW egal
cd /usr/src/
scp -pr <IP_von_Icinga_Hostserver>:/$PWD/icinga-nrpe .
cd icinga-nrpe
make distclean
./configure
make all

Jetzt noch die Datei „/usr/src/icinga-nrpe/sample-config/nrpe.cfg“ wie folgt abändern:

# ALLOWED HOST ADDRESSES
# This is an optional comma-delimited list of IP address or hostnames
# that are allowed to talk to the NRPE daemon.
#
# Note: The daemon only does rudimentary checking of the client's IP
# address.  I would highly recommend adding entries in your /etc/hosts.allow
# file to allow only the specified host to connect to the port
# you are running this daemon on.
#
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd

allowed_hosts=<IP_von_Icinga_Hostserver>

Soweit so gut… jetzt wieder auf das Hostsystem mit Icinga. Wir starten wieder den NRPE Daemon

/usr/src/icinga-nrpe/src/nrpe -n -c /usr/src/icinga-nrpe/sample-config/nrpe.cfg -d

Und testen mit dem Remotehost:

/usr/local/icinga/libexec/check_nrpe -H  -n

Jetzt sollte folgende Ausgabe erscheinen

NRPE v2.12

Hinweis: Ich nutze IPTables und musste noch den Port freigeben, der in der Datei „cat /usr/src/icinga-nrpe/sample-config/nrpe.cfg |grep port“ definiert ist.

vi /etc/defaults/iptables

# Allow NRPE from remot hosts

-A INPUT -p tcp -m multiport --dport 5666 -j ACCEPT

Und wir stoppen wieder auf dem Remotehost den Daemon:

kill `ps -ef | grep "sample-config/nrpe.cfg" | grep -v grep | awk '{print $2}'`

Puh… Soweit so gut. Host und Remotehost sind soweit NRPE fähig.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Pflichtfelder sind mit * gekennzeichnet.

*
*
Du kannst folgende <abbr title="HyperText Markup Language">HTML</abbr>-Tags und -Attribute verwenden: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>