MonitorPi – Nagios, Centreon, Check_MK, Nagvis auf dem Raspberry Pi 2

raspberry-pi-2-770x577Es ist mal wieder so weit, es gibt ein Update in Sachen Monitoring. Viele kennen mit Sicherheit den kleinen Raspberry Pi, eigentlich als dritte Welt-PC gedacht – aber unter den Bastlern ebenfalls ein Hit geworden. Ich habe ja schon mehrere Beiträge zum Pi hier geschrieben, aber seit dem Raspberry Pi 2 gibt es noch ganz andere Anwendungsfelder die durch die größere Leistung möglich werden.
So auch das Projekt „MonitorPi“, dass den RaspberryPi in eine Überwachungszentrale verwandelt, die inklusive Zubehör preislich auch unter 100€ liegt.
MonitorPi ist eine fertige Appliance von mir – die mit den beliebtesten Monitoring-Tools vorinstalliert ist.
Was ist alles enthalten und vorinstalliert ? (Ready 2 use)
– Nagios 3.5.1 Nagios
– Centreon 2.6.0centreon_logo
– Centreon-Broker 2.8.2
– Check_MK (Livestatus) 1.2.6.p2check_mk.200
– Nagvis 1.8.2
– Nagios Plugins 2.0.3nagvis
Was wird benötigt ?
Raspberry Pi 2
– mind. 8 GB Speicherkarte (Je schneller desto besser. Class 10 = top)
Win32DiskImager
[stextbox id=“info“]MonitorPi basiert auf der aktuellen Debian Wheezy Distribution die es auch via raspberrypi.org zum Download gibt. (2015-02-16-raspbian-wheezy.img)
Nur habe ich sie noch vollständig aktualisiert. Stand: 04.05.2015[/stextbox]
Wie wird MonitorPi installiert ?
Ganz einfach: Ihr ladet euch die aktuelle Image-Datei herunter und bespielt diese auf eine micro-SD-Karte.
Dies geht mit dem Win32DiskImager wie im Bild beschrieben:
win32diskimager
 [stextbox id=“alert“]Achtung: Alle Daten auf der SD Karte werden gelöscht![/stextbox]
Anschließend den Rasperry Pi 2 mit der SD-Karte booten, er versucht automatisch eine IP via DHCP zu beziehen, und zeigt diese nach dem Boot an.
Wie sehen die unterschiedlichen Monitoring-Tools aus ?


Wie erreiche ich die Tools ?
Alle Tools sind Web-Applikationen, die per Browser aufgerufen werden. Die Url’s sind wie folgt:

NagiosUrl: http://%IP%/nagios
Benutzername: nagiosadmin
Passwort: constey
NagvisUrl: http://%IP%/nagvis
Benutzername: admin
Passwort: admin
CentreonUrl: http://%IP%/centreon
Benutzername: admin
Passwort: constey
Check_MKUrl: http://%IP%/check_mk
Benutzername: nagiosadmin
Passwort: constey
phpMyAdmin (Mysql)Url: http://%IP%/phpmyadmin
Benutzername: root
Passwort: constey

Die Zugangsdaten zum Anmelden an der Konsole oder via SSH sind:
Benutzername: pi
Passwort: raspberry
Ansonsten ist das Passwort immer „constey“, also zum Beispiel für die einzelnen Benutzer oder Mysql-Datenbank-Benutzer.
Download:
Hier gibt es das Image in gezippter Form zum Download 2015-05-04-wheezy-monitorPI-constey-2 (ca. 1.8 GB)
[EXPAND Prüfsummen-Information]—————————
Prüfsummen-Information
—————————
Name: 2015-05-04-wheezy-monitorPI-constey-2.zip
Größe: 1872300662 Bytes (1785 MB)
CRC32: 9ACC060B
CRC64: CC7A670EBC2EF5E0
SHA256: 71D79E6F9FBD9BD68618029F008C77AE488FCE251932B2754D76B2CB2FB5D483
SHA1: FF7AD402D6116BEC4B8D8528223D265D6BB1700A
[/Expand]
FAQ:
Warum ist nicht Nagios 4 installiert?
Zum einen gibt es noch die ein oder anderen Kompatibilitätsprobleme mit Centreon, wer auch noch andere Module benutzen möchte, stößt eventuell ebenfalls auf Kompatibilitätsprobleme. Wer dennoch aktualisieren will kann das natürlich gerne tun.
Wo liegen die Quelldateien ?
Alle Quelldateien liegen unter /home/pi/sources.
MonitorPi-Sources
Wo liegen die wichtigsten Programme ?
Ich habe die Anwendungen in der Regel immer mit Standardwerten kompiliert. Aber hier einige Pfade:
Nagios: /usr/local/nagios
Nagios Plugins: /usr/local/nagios/libexec
Centreon: /usr/local/centreon/

Raspberry Pi als Nagios Poller installieren und in Centreon aufnehmen

300px-RaspberryPiEin kleiner Raspberry Pi bietet sich ja quasi als Nagios Poller an, wenn man ein kleines, günstiges und stromsparendes Gerät zum Überwachen von Servern, PC’s,  Druckern, oder vielem mehr sucht.
Ich beschreibe hier wie man einen zweiten Nagios-Server in eine bestehende Nagios / Centreon Umgebung aufnehmen kann. Wie man Nagios bzw. auch mit der wesentlich einfacheren Konfigurationsoberfläche Centreon installieren kann habe ich bereits beschrieben. Da hat sich bis auf ein paar Versionsnummern auch nichts verändert. Daher verweise ich an den passenden Stellen auf meinen alten Beitrag.
Wer einfach nur Nagios auf einem Raspyberry installieren will, kann hier auch einfach bis Punkt 2 folgen. Einfach am Ende Centreon nicht mitinstallieren.
Als Grundsystem für den Raspberry wird wegen der Einfachheit ein Debian RAW-Image verwendet. Dieses könnt ihr euch hier herunterladen: http://www.raspberrypi.org/downloads
Achtung: Die NDOUtils funktionieren nicht im Zusammenspiel mit dem „hard float“ Raspberry Image. Wenn ihr die NDOutils einsetzt müsst ihr die „Soft-float“ Debian Version verwenden.
(Ich verwende noch die NDOutils!)

Bis auf die Abhängigkeiten ist fast alles identisch zur normalen Installation von Nagios – wie ich es schon hier beschrieb.
1. Abhängigkeiten Installieren

apt-get install apache2 libapache2-mod-php5 build-essential libgd2-xpm-dev mysql-client gcc make g++ lsb-release libssl-dev

2. Nagios + Plugins herunterladen und installieren
Könnt ihr aus dem Beitrag hier entnehmen: https://constey.de/2012/06/how-to-install-nagios-centreon-nagvis-check_mk-ubuntu-12-04-server/
(
Wenn man nur Nagios installieren will, ohne Centreon – ist man hier fertig.)
3. Zusätzlichen centreon Benutzer anlegen
Da der Centreon Central Server mit dem User centreon arbeitet, und diesen auch für den Austausch von Config-Dateien etc. verwendet, muss dieser auch hier angelegt werden.

/usr/sbin/useradd -m -s /bin/bash centreon
passwd centreon

4. Noch den Centreon User in die Nagios Gruppen aufnehmen

/usr/sbin/usermod -G nagcmd centreon
/usr/sbin/usermod -G nagios centreon

5. SSH Authentifizierung per Keyfile einrichten & in Centreon aufnehmen
Haltet euch hier an die Doku von Centreon. Diese ist sehr gut, und bebildert.
http://en.doc.centreon.com/DistributedArchitecture
In der Sudo Konfiguration muss der centreon Benutzer ebenfalls analog dem nagios Benutzer berechtigt werden:

centreon   ALL=NOPASSWD: /etc/init.d/nagios restart
centreon   ALL=NOPASSWD: /etc/init.d/nagios stop
centreon   ALL=NOPASSWD: /etc/init.d/nagios start
centreon   ALL=NOPASSWD: /etc/init.d/nagios reload
centreon   ALL=NOPASSWD: /usr/sbin/nagiostats
centreon   ALL=NOPASSWD: /usr/sbin/nagios *

Außerdem muss der Schritt: „Setting up key authentication using SSH“ noch mit dem centreon Benutzer ausgeführt werden. Also:

su centreon
ssh-keygen
(alles mit Enter bestätigen (kein Kennwort!)
ssh-copy-id -i ~/.ssh/id_rsa.pub centreon@{IP_ADDRESS}

Hat man nun den Poller im Centreon angelegt, wie in der Doku hier beschrieben, kann man Testweise einen Host anlegen, der von dem neuen Poller abgefragt werden soll.
Anschließend unter Configuration -> Monitoring Engines, die Konfiguration exportieren und den neuen Poller neustarten lassen.
Wichtige Infos zum Debuggen findet man in den Logfiles von Centreon. Ein Beispiel für ein funktionierenden Poller:

vi /usr/local/centreon/log/centcore.log
2013-06-18 14:22:01 - Info: copied rotated file for instance 5
2013-06-18 14:34:54 - Start: Send config files on poller 5
2013-06-18 14:35:05 - End: Send config files on poller 5
2013-06-18 14:35:18 - Init Script : 'sudo /etc/init.d/nagios restart' On poller 101.1.39 (5)
2013-06-18 14:35:18 - Engine : Running configuration check...done.
2013-06-18 14:35:18 - Engine : Stopping nagios: .done.
2013-06-18 14:35:18 - Engine : Starting nagios: done.
2013-06-19 00:00:42 - Info: copied rotated file for instance 5
Timeout, server 10.0.199.39 not responding.^M
2013-06-20 00:01:00 - Info: copied rotated file for instance 5
Timeout, server 10.0.199.39 not responding.^M
2013-06-20 23:59:49 - Info: copied rotated file for instance 5

Sollten die neu angelegten Hosts zwar in der Centreon Konfiguration sein, aber nicht unter Monitoring auftauchen muss geprüft werden, ob der ndoutils Dienst korrekt läuft.
Dazu das Nagios-Log auf dem Poller checken:

vi /usr/local/nagios/var/nagios.log
[1371558916] Nagios 3.5.0 starting... (PID=7777)
[1371558916] Local time is Tue Jun 18 14:35:16 CEST 2013
[1371558916] LOG VERSION: 2.0
[1371558916] ndomod: NDOMOD 1.5.2 (06-08-2012) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[1371558916] ndomod: Successfully connected to data sink. 0 queued items to flush.
[1371558916] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.

 

VMware ESXi 5 mit Nagios/Centreon überwachen

VMware bietet mit seinem vSphere Client bzw. des vSphere Webclient eine schönes Tool zur Verwaltung der ESX Farm. Dort kann man sich auch die Performancewerte zu CPU, Ram, HDD, Netzwerk anschauen, Graphen erzeugen und vieles mehr…. Wer jetzt aber ein bestehendes System zum Monitoren hat, freut sich mit Sicherheit darüber, dort auch alle Systeme aufnehmen zu können.
Da seit dem ESX3 die SNMP Funktionalität bzw. alle nützlichen Attribute daraus gänzlich entfernt wurden, bleibt zum Abfragen nur die PowerCLI bzw. die Perl SDK. Wie das funktioniert beschreibe ich hier:
Als erstes die aktuellste VMware vSphere Perl SDK installieren. Momentan 5.1.0 – gibt’s bei VMware.
Entpacken:

tar xvf VMware-vSphere-Perl-SDK-5.1.0-780721.x86_64.tar.gz

Umgebungsvariablen setzen: (WICHTIG – ohne geht’s nicht!)

export http_proxy=
export ftp_proxy=

Installer ausführen:

sudo ./vmware-install.pl

Perl Module installieren:

perl -MCPAN -e shell

Anschließend für die unten aufgelisteten Module jeweils machen:

install XML::Simple
XML::Simple
Nagios::Plugin
Class::MethodMaker
URI
LWP
HTML::Parser

Das Nagios Plugin / Script herunterladen: check_vmware_api
Jetzt noch die SSL Überprüfung vom LWP Modul zu deaktivieren. Ich empfehle folgendes noch in den Kopfbereich des check_vmware_api Scriptes hinzuzufügen:

$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;

Alternativ kann man die Einstellung auch Global vornehmen:

sudo vim /usr/share/perl5/LWP/Protocol/https.pm

In der Datei nach der Zeile:

$ssl_opts{SSL_verify_mode} ||= 1;

suchen und diese durch folgende ersetzen:

$ssl_opts{SSL_verify_mode} ||= 0;

Ansonsten bekommt ihr eventuell folgende Fehlermeldung:

CHECK_ESX3.PL CRITICAL - Server version unavailable at 'https://MYESX:443/sdk/vimService.wsdl' at /usr/lib/perl5/5.10.0/VMware/VICommon.pm line 545.

Zum Testen kann man sich nun mal den Gesamtverbrauch an CPU Ressourcen in MHZ ausgeben lassen:

root@SERVER:/# /usr/local/nagios/libexec/check_esx3.pl -D vcenter.domain.info -u user@domain.info -p password -l cpu -s usagemhz
CHECK_ESX3.PL OK - cpu usagemhz=31792.00 MHz | cpu_usagemhz=31792.00Mhz;;

Insgesamt gibt es sehr viele Optionen, die komplette Liste gibts hier:
[EXPAND check_vmware_api Befehle]
check_esx3.pl 0.7.0
This nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY.
It may be used, redistributed and/or modified under the terms of the GNU
General Public Licence (see http://www.fsf.org/licensing/licenses/gpl.txt).
VMWare Infrastructure plugin
Usage: check_esx3.pl -D <data_center> | -H <host_name> [ -C <cluster_name> ] [ -N <vm_name> ]
-u -p | -f
-l [ -s ] [ -T ] [ -i ]
[ -x <black_list> ] [ -o <additional_options> ]
[ -t ] [ -w <warn_range> ] [ -c <crit_range> ]
[ -V ] [ -h ]
-?, –usage
Print usage information
-h, –help
Print detailed help screen
-V, –version
Print version information
–extra-opts=[section][@file]
Read options from an ini file. See http://nagiosplugins.org/extra-opts
for usage and examples.
-H, –host=
ESX or ESXi hostname.
-C, –cluster=
ESX or ESXi clustername.
-D, –datacenter=
Datacenter hostname.
-N, –name=
Virtual machine name.
-u, –username=
Username to connect with.
-p, –password= Password to use with the username.
-f, –authfile= Authentication file with login and password. File syntax :
username=
password= -w, –warning=THRESHOLD
Warning threshold. See
http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT
for the threshold format.
-c, –critical=THRESHOLD
Critical threshold. See
http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT
for the threshold format.
-l, –command=COMMAND
Specify command type (CPU, MEM, NET, IO, VMFS, RUNTIME, …)
-s, –subcommand=SUBCOMMAND
Specify subcommand
-S, –sessionfile=SESSIONFILE
Specify a filename to store sessions for faster authentication
-x, –exclude=<black_list>
Specify black list
-o, –options=<additional_options>
Specify additional command options (quickstats, …)
-T, –timestamp=
Timeshift in seconds that could fix issues with „Unknown error“. Use values like 5, 10, 20, etc
-i, –interval=
Sampling Period in seconds. Basic historic intervals: 300, 1800, 7200 or 86400. See config for any changes.
Supports literval values to autonegotiate interval value: r – realtime interval, h – historical interval specified by position.
Default value is 20 (realtime). Since cluster does not have realtime stats interval other than 20(default realtime) is mandatory.
-M, –maxsamples=
Maximum number of samples to retrieve. Max sample number is ignored for historic intervals.
Default value is 1 (latest available sample).
–trace=
Set verbosity level of vSphere API request/respond trace
-t, –timeout=INTEGER
Seconds before plugin times out (default: 30)
-v, –verbose
Show details for command-line debugging (can repeat up to 3 times)
Supported commands(^ – blank or not specified parameter, o – options, T – timeshift value, b – blacklist) :
VM specific :
* cpu – shows cpu info
+ usage – CPU usage in percentage
+ usagemhz – CPU usage in MHz
+ wait – CPU wait time in ms
+ ready – CPU ready time in ms
^ all cpu info(no thresholds)
* mem – shows mem info
+ usage – mem usage in percentage
+ usagemb – mem usage in MB
+ swap – swap mem usage in MB
+ swapin – swapin mem usage in MB
+ swapout – swapout mem usage in MB
+ overhead – additional mem used by VM Server in MB
+ overall – overall mem used by VM Server in MB
+ active – active mem usage in MB
+ memctl – mem used by VM memory control driver(vmmemctl) that controls ballooning
^ all mem info(except overall and no thresholds)
* net – shows net info
+ usage – overall network usage in KBps(Kilobytes per Second)
+ receive – receive in KBps(Kilobytes per Second)
+ send – send in KBps(Kilobytes per Second)
^ all net info(except usage and no thresholds)
* io – shows disk I/O info
+ usage – overall disk usage in MB/s
+ read – read latency in ms (totalReadLatency.average)
+ write – write latency in ms (totalWriteLatency.average)
^ all disk io info(no thresholds)
* runtime – shows runtime info
+ con – connection state
+ cpu – allocated CPU in MHz
+ mem – allocated mem in MB
+ state – virtual machine state (UP, DOWN, SUSPENDED)
+ status – overall object status (gray/green/red/yellow)
+ consoleconnections – console connections to VM
+ guest – guest OS status, needs VMware Tools
+ tools – VMWare Tools status
+ issues – all issues for the host
^ all runtime info(except con and no thresholds)
Host specific :
* cpu – shows cpu info
+ usage – CPU usage in percentage
o quickstats – switch for query either PerfCounter values or Runtime info
+ usagemhz – CPU usage in MHz
o quickstats – switch for query either PerfCounter values or Runtime info
^ all cpu info
o quickstats – switch for query either PerfCounter values or Runtime info
* mem – shows mem info
+ usage – mem usage in percentage
o quickstats – switch for query either PerfCounter values or Runtime info
+ usagemb – mem usage in MB
o quickstats – switch for query either PerfCounter values or Runtime info
+ swap – swap mem usage in MB
o listvm – turn on/off output list of swapping VM’s
+ overhead – additional mem used by VM Server in MB
+ overall – overall mem used by VM Server in MB
+ memctl – mem used by VM memory control driver(vmmemctl) that controls ballooning
o listvm – turn on/off output list of ballooning VM’s
^ all mem info(except overall and no thresholds)
* net – shows net info
+ usage – overall network usage in KBps(Kilobytes per Second)
+ receive – receive in KBps(Kilobytes per Second)
+ send – send in KBps(Kilobytes per Second)
+ nic – makes sure all active NICs are plugged in
^ all net info(except usage and no thresholds)
* io – shows disk io info
+ aborted – aborted commands count
+ resets – bus resets count
+ read – read latency in ms (totalReadLatency.average)
+ write – write latency in ms (totalWriteLatency.average)
+ kernel – kernel latency in ms
+ device – device latency in ms
+ queue – queue latency in ms
^ all disk io info
* vmfs – shows Datastore info
+ (name) – free space info for datastore with name (name)
o used – output used space instead of free
o breif – list only alerting volumes
o regexp – whether to treat name as regexp
o blacklistregexp – whether to treat blacklist as regexp
b – blacklist VMFS’s
T (value) – timeshift to detemine if we need to refresh
^ all datastore info
o used – output used space instead of free
o breif – list only alerting volumes
o blacklistregexp – whether to treat blacklist as regexp
b – blacklist VMFS’s
T (value) – timeshift to detemine if we need to refresh
* runtime – shows runtime info
+ con – connection state
+ health – checks cpu/storage/memory/sensor status
o listitems – list all available sensors(use for listing purpose only)
o blackregexpflag – whether to treat blacklist as regexp
b – blacklist status objects
+ storagehealth – storage status check
o blackregexpflag – whether to treat blacklist as regexp
b – blacklist status objects
+ temperature – temperature sensors
o blackregexpflag – whether to treat blacklist as regexp
b – blacklist status objects
+ sensor – threshold specified sensor
+ maintenance – shows whether host is in maintenance mode
+ list(vm) – list of VMWare machines and their statuses
+ status – overall object status (gray/green/red/yellow)
+ issues – all issues for the host
b – blacklist issues
^ all runtime info(health, storagehealth, temperature and sensor are represented as one value and no thresholds)
* service – shows Host service info
+ (names) – check the state of one or several services specified by (names), syntax for (names):,,…,
^ show all services
* storage – shows Host storage info
+ adapter – list bus adapters
b – blacklist adapters
+ lun – list SCSI logical units
b – blacklist LUN’s
+ path – list logical unit paths
b – blacklist paths
^ show all storage info
* uptime – shows Host uptime
o quickstats – switch for query either PerfCounter values or Runtime info
* device – shows Host specific device info
+ cd/dvd – list vm’s with attached cd/dvd drives
o listall – list all available devices(use for listing purpose only)
DC specific :
* cpu – shows cpu info
+ usage – CPU usage in percentage
o quickstats – switch for query either PerfCounter values or Runtime info
+ usagemhz – CPU usage in MHz
o quickstats – switch for query either PerfCounter values or Runtime info
^ all cpu info
o quickstats – switch for query either PerfCounter values or Runtime info
* mem – shows mem info
+ usage – mem usage in percentage
o quickstats – switch for query either PerfCounter values or Runtime info
+ usagemb – mem usage in MB
o quickstats – switch for query either PerfCounter values or Runtime info
+ swap – swap mem usage in MB
+ overhead – additional mem used by VM Server in MB
+ overall – overall mem used by VM Server in MB
+ memctl – mem used by VM memory control driver(vmmemctl) that controls ballooning
^ all mem info(except overall and no thresholds)
* net – shows net info
+ usage – overall network usage in KBps(Kilobytes per Second)
+ receive – receive in KBps(Kilobytes per Second)
+ send – send in KBps(Kilobytes per Second)
^ all net info(except usage and no thresholds)
* io – shows disk io info
+ aborted – aborted commands count
+ resets – bus resets count
+ read – read latency in ms (totalReadLatency.average)
+ write – write latency in ms (totalWriteLatency.average)
+ kernel – kernel latency in ms
+ device – device latency in ms
+ queue – queue latency in ms
^ all disk io info
* vmfs – shows Datastore info
+ (name) – free space info for datastore with name (name)
o used – output used space instead of free
o breif – list only alerting volumes
o regexp – whether to treat name as regexp
o blacklistregexp – whether to treat blacklist as regexp
b – blacklist VMFS’s
T (value) – timeshift to detemine if we need to refresh
^ all datastore info
o used – output used space instead of free
o breif – list only alerting volumes
o blacklistregexp – whether to treat blacklist as regexp
b – blacklist VMFS’s
T (value) – timeshift to detemine if we need to refresh
* runtime – shows runtime info
+ list(vm) – list of VMWare machines and their statuses
+ listhost – list of VMWare esx host servers and their statuses
+ listcluster – list of VMWare clusters and their statuses
+ tools – VMWare Tools status
b – blacklist VM’s
+ status – overall object status (gray/green/red/yellow)
+ issues – all issues for the host
b – blacklist issues
^ all runtime info(except cluster and tools and no thresholds)
* recommendations – shows recommendations for cluster
+ (name) – recommendations for cluster with name (name)
^ all clusters recommendations
Cluster specific :
* cpu – shows cpu info
+ usage – CPU usage in percentage
+ usagemhz – CPU usage in MHz
^ all cpu info
* mem – shows mem info
+ usage – mem usage in percentage
+ usagemb – mem usage in MB
+ swap – swap mem usage in MB
o listvm – turn on/off output list of swapping VM’s
+ memctl – mem used by VM memory control driver(vmmemctl) that controls ballooning
o listvm – turn on/off output list of ballooning VM’s
^ all mem info(plus overhead and no thresholds)
* cluster – shows cluster services info
+ effectivecpu – total available cpu resources of all hosts within cluster
+ effectivemem – total amount of machine memory of all hosts in the cluster
+ failover – VMWare HA number of failures that can be tolerated
+ cpufainess – fairness of distributed cpu resource allocation
+ memfainess – fairness of distributed mem resource allocation
^ only effectivecpu and effectivemem values for cluster services
* runtime – shows runtime info
+ list(vm) – list of VMWare machines in cluster and their statuses
+ listhost – list of VMWare esx host servers in cluster and their statuses
+ status – overall cluster status (gray/green/red/yellow)
+ issues – all issues for the cluster
b – blacklist issues
^ all cluster runtime info
* vmfs – shows Datastore info
+ (name) – free space info for datastore with name (name)
o used – output used space instead of free
o breif – list only alerting volumes
o regexp – whether to treat name as regexp
o blacklistregexp – whether to treat blacklist as regexp
b – blacklist VMFS’s
T (value) – timeshift to detemine if we need to refresh
^ all datastore info
o used – output used space instead of free
o breif – list only alerting volumes
o blacklistregexp – whether to treat blacklist as regexp
b – blacklist VMFS’s
T (value) – timeshift to detemine if we need to refresh
Copyright (c) 2008 op5
[/Expand]
Das check_vmware_api Script fügt ihr nun im Nagios bzw. Centreon unter Commands/Checks hinzu, unter Angabe der gewollten Parameter, wodurch ihr dann auch die Service Checks erstellen könnt.
centreon-command-esxi
In den Graphen sieht es dann so aus:
esxi-nagios-cpu

Howto: Aktualisierung von Centreon 2.3.9 auf 2.4.0

Seit ein paar Tagen gibt’s eine neue Centreon Version mit einem etwas überarbeitetem Design.
Es können nun eigene Widgets erstellt und hinzugefügt werden, was mit Sicherheit nett ist, wenn es mal ein paar gibt 🙂
Desweiteren natürlich einige Bug-Fixes etc….
Ich beschreibe hier wie man auf einem Ubuntu 10.10 mit der bisherigen Version 2.3.9 auf die aktuelle Version kommt.
1. Centreon herunterladen & entpacken

cd /tmp/
wget http://download.centreon.com/index.php?id=4264 -C centreon-2.4.0.tar.gz
tar xzfv centreon-2.4.0.tar.gz

2. Config Dateien lokalisieren

root@SERVER:/tmp/centreon-2.4.0# find / -name "instCent*"
/etc/centreon/instCentPlugins.conf
/etc/centreon/instCentWeb.conf
/etc/centreon/instCentStorage.conf
/etc/centreon/instCentCore.conf

3. Upgrade starten

root@SERVER:/tmp/centreon-2.4.0# ./install.sh -u /etc/centreon/

[EXPAND Setup Log]
###############################################################################
# #
# Centreon (www.centreon.com) #
# Thanks for using Centreon #
# #
# v2.4.0 #
# #
# infos@centreon.com #
# #
# Make sure you have installed and configured #
# sudo – sed – php – apache – rrdtool – mysql #
# #
###############################################################################
————————————————————————
Checking all needed binaries
————————————————————————
rm OK
cp OK
mv OK
/bin/chmod OK
/bin/chown OK
echo OK
more OK
mkdir OK
find OK
/bin/grep OK
/bin/cat OK
/bin/sed OK
————————————————————————
Detecting old installation
————————————————————————
Finding configuration file in: /etc/centreon OK
You seem to have an existing Centreon.
Do you want to use the last Centreon install parameters ?
[y/n], default to [y]:
> y
Using: /etc/centreon/instCentCore.conf
/etc/centreon/instCentPlugins.conf
/etc/centreon/instCentStorage.conf
/etc/centreon/instCentWeb.conf
Do you want to install : Centreon Web Front
[y/n], default to [n]:
> y
Do you want to install : Centreon CentCore
[y/n], default to [n]:
> y
Do you want to install : Centreon Nagios Plugins
[y/n], default to [n]:
> y
Do you want to install : Centreon Snmp Traps process
[y/n], default to [n]:
> y
Convert variables for upgrade:
————————————————————————
Start CentWeb Installation
————————————————————————
Where is your Centreon binaries directory
default to [/usr/local/centreon/bin]
>
Path /usr/local/centreon/bin OK
Where is your Centreon data informations directory
default to [/usr/local/centreon/data]
>
Do you want me to create this directory ? [/usr/local/centreon/data]
[y/n], default to [n]:
> y
Path /usr/local/centreon/data OK
/usr/bin/perl OK
Finding Apache user : www-data
Finding Apache group : www-data
What is the Centreon group ? [centreon]
default to [centreon]
>
Do you want me to create this group ? [centreon]
[y/n], default to [n]:
> y
What is the Centreon user ? [centreon]
default to [centreon]
> y
Do you want me to create this user ? [y]
[y/n], default to [n]:
> y
What is the Broker user ? (optional)
>
What is the Monitoring engine log directory
>
You select slash…
What is the Monitoring engine log directory
> /var/log/
Where is your monitoring plugins (libexec)
default to [/usr/lib/nagios/plugins]
> /usr/local/nagios/libexec
Path /usr/local/nagios/libexec
Add group centreon to user www-data
Add group centreon to user nagios
Add group nagios to user www-data
Add group nagios to user y
——————————————-
Configure Sudo
——————————————-
What is the Monitoring engine init.d script
> /etc/init.d/nagios
Where is the configuration directory for br
> /usr/local/nagios/etc/
Where is the init script for broker module daemon ?
>
is not a valid file. CRITICAL
Where is the init script for broker module daemon ?
> /etc/init.d/nagios
Your sudo has been configured previously
Do you want me to reconfigure your sudo ? (WARNING)
[y/n], default to [n]:
> y
Configuring Sudo OK
————————————————————————
Configure Apache server
————————————————————————
Create ‚/etc/apache2/conf.d/centreon.conf‘ OK
Configuring Apache OK
Do you want to reload your Apache ?
[y/n], default to [n]:
> y
Reloading Apache service OK
Preparing Centreon temporary files
Change right on /usr/local/centreon/log OK
Change right on /etc/centreon OK
Change macros for insertBaseConf.sql OK
Change macros for sql update files OK
Change macros for php files OK
Change right on /usr/local/nagios/etc OK
Disconnect users from WebUI
All users are disconnected OK
Copy CentWeb in system directory
Install CentWeb (web front of centreon) OK
Change right for install directory
Change right for install directory OK
Install libraries OK
Write right to Smarty Cache OK
Copying libinstall OK
Change macros for centreon.cron OK
Install Centreon cron.d file OK
Change macros for centAcl.php OK
Change macros for downtimeManager.php OK
Change macros for eventReportBuilder.pl OK
Change macros for dashboardBuilder.pl OK
Install cron directory OK
Change right for eventReportBuilder.pl OK
Change right for dashboardBuilder.pl OK
Change macros for centreon.logrotate OK
Install Centreon logrotate.d file OK
Prepare export-mysql-indexes OK
Install export-mysql-indexes OK
Prepare import-mysql-indexes OK
Install import-mysql-indexes OK
Prepare indexes schema OK
Install indexes schema OK
————————————————————————
Pear Modules
————————————————————————
Check PEAR modules
PHP Warning: PHP Startup: Unable to load dynamic library ‚/usr/lib/php5/20090626/sqlite.so‘ – /usr/lib/php5/20090626/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
PEAR 1.4.9 1.9.4 OK
DB 1.7.6 1.7.13 OK
DB_DataObject 1.8.4 1.9.5 OK
DB_DataObject_FormBuilder 1.0.0RC4 1.0.1 OK
MDB2 2.0.0 2.4.1 OK
Date 1.4.6 1.4.7 OK
HTML_Common 1.2.2 1.2.5 OK
HTML_QuickForm 3.2.5 3.2.12 OK
HTML_QuickForm_advmultiselect 1.1.0 1.5.1 OK
HTML_Table 1.6.1 1.8.3 OK
Archive_Tar 1.1 1.3.7 OK
Auth_SASL 1.0.1 1.0.4 OK
Console_Getopt 1.2 1.3.0 OK
Net_SMTP 1.2.8 1.5.0 OK
Net_Socket 1.0.1 1.0.10 OK
Net_Traceroute 0.21 0.21.3 OK
Net_Ping 2.4.1 2.4.5 OK
Validate 0.6.2 0.8.4 OK
XML_RPC 1.4.5 1.5.4 OK
SOAP 0.10.1 0.12.0 OK
Log 1.9.11 1.12.5 OK
Archive_Zip 0.1.2 0.1.2 OK
All PEAR modules OK
————————————————————————
Centreon Post Install
————————————————————————
Create /usr/local/centreon/www/install/install.conf.php OK
Create /etc/centreon/instCentWeb.conf OK
Convert variables for upgrade:
————————————————————————
Start CentStorage Installation
————————————————————————
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved…
install www/install/createTablesCentstorage.sql OK
CentStorage status Directory already exists PASSED
CentStorage metrics Directory already exists PASSED
Change macros for centstorage binary OK
Install CentStorage binary OK
Install library for centstorage OK
Change right : /var/run/centreon OK
Change macros for centstorage init script OK
Replace CentCore default script Macro OK
Do you want me to install CentStorage init script ?
[y/n], default to [n]:
> y
CentStorage init script installed OK
CentStorage default script installed OK
Do you want me to install CentStorage run level ?
[y/n], default to [n]:
> y
System start/stop links for /etc/init.d/centstorage already exist.
CentStorage stop FAIL
Change macros for logAnalyser OK
Install logAnalyser OK
Change macros for logAnalyser-cbroker OK
Install logAnalyser-cbroker OK
Change macros for nagiosPerfTrace OK
Install nagiosPerfTrace OK
Change macros for purgeLogs OK
Install purgeLogs OK
Change macros for purgeCentstorage OK
Install purgeCentstorage OK
Change macros for centreonPurge.sh OK
Install centreonPurge.sh OK
Change macros for centstorage.cron OK
Install CentStorage cron OK
Change macros for centstorage.logrotate OK
Install Centreon Storage logrotate.d file OK
Create /etc/centreon/instCentStorage.conf OK
Convert variables for upgrade:
————————————————————————
Start CentCore Installation
————————————————————————
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved…
Change CentCore Macro OK
Copy CentCore in binary directory OK
Change right : /var/run/centreon OK
Change right : /var/lib/centreon OK
Change macros for centcore.logrotate OK
Install Centreon Core logrotate.d file OK
Replace CentCore init script Macro OK
Replace CentCore default script Macro OK
Do you want me to install CentCore init script ?
[y/n], default to [n]:
> y
CentCore init script installed OK
CentCore default script installed OK
Do you want me to install CentCore run level ?
[y/n], default to [n]:
> y
System start/stop links for /etc/init.d/centcore already exist.
Create /etc/centreon/instCentCore.conf OK
Convert variables for upgrade:
————————————————————————
Start CentPlugins Installation
————————————————————————
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved…
Change macros for CentPlugins OK
Installing the plugins OK
Change right on centreon.conf OK
CentPlugins is installed
————————————————————————
Start CentPlugins Traps Installation
————————————————————————
Finding Apache user : www-data
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved…
Change macros for CentPluginsTraps OK
Change macros for init scripts OK
Installing the plugins Trap binaries OK
Backup all your snmp files OK
Change macros for snmptrapd.conf OK
Change macros for snmptt.ini OK
SNMPTT init script installed OK
SNMPTT default script installed OK
System start/stop links for /etc/init.d/snmptt already exist.
Install : snmptrapd.conf OK
Install : snmp.conf OK
Install : snmptt.ini OK
Install : snmptt OK
Install : snmptthandler OK
Install : snmpttconvertmib OK
Generate SNMPTT configuration OK
Create /etc/centreon/instCentPlugins.conf OK
###############################################################################
# #
# Go to the URL : http://SERVER.domain.info/centreon/ #
# to finish the setup #
# #
# Report bugs at http://forge.centreon.com #
# #
# Thanks for using Centreon. #
# ———————– #
# Contact : infos@centreon.com #
# http://www.centreon.com #
# #
###############################################################################
root@SERVER:/tmp/centreon-2.4.0#
[/EXPAND]
Ich muss ganz ehrlich gestehen – bei den beiden Fragen war ich mir auch nicht ganz sicher – hat bei mir allerdings funktioniert:

Where is the configuration directory for broker ?
Where is the init script for broker module daemon ?

4. Datenbankupgrade durchführen
Das Datenbankupgrade wird über die Webseite durchgeführt, dazu eure Centreon URL aufrufen und den 3 -> Steps folgende.
(Sorry diesmal keine Bilder.) Aber immer 3 x weiter klicken solltet ihr ja schaffen 😉
5. Reboot
Anschließend den Server booten um sicher zu sein, damit auch alles korrekt funktioniert 🙂

Troubleshooting NDOUtils 1.5.2

Nach der Aktualisierung von NDOUtils von 1.4b9 auf 1.5.2 wurde ich mit ein paar Fehlern zugeschmissen.
NDOUtils schreibt die Fehler ins syslog.
Erster Fehler – Tabelle defekt:

Oct  9 07:49:14 SERVER ndo2db: mysql_error: 'Table './ndo/nagios_hostchecks' is marked as crashed and last (automatic?) repair failed'
Oct  9 07:49:14 SERVER ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_hostchecks SET instance_id='1', host_object_id='1161', check_type='0', is_raw_check='0', current_check_attempt='1', max_check_attempts='5', state='0', state_type='1', start_time=FROM_UNIXTIME(1349761720), start_time_usec='784551', end_time=FROM_UNIXTIME(1349761725), end_time_usec='446306', timeout='10', early_timeout='0', execution_time='0.036930', latency='70.784000', return_code='0', output='PING OK - Packet loss = 0%, RTA = 3\.83 ms', long_output='', perfdata='rta=3\.830000ms;3000\.000000;5000\.000000;0\.000000 pl=0%;80;100;0', command_object_id='22', command_args='', command_line='' ON DUPLICATE KEY UPDATE instance_id='1', host_object_id='1161', check_type='0', is_raw_check='0', current_check_attempt='1', max_check_attempts='5', state='0', state_type='1', start_time=FROM_UNIXTIME(1349761720), start_time_usec='784551', end_time=FROM_UNIXTIME(1349761725), end_time_usec='446306', timeout='10', early_timeout='0', execution_time='0.036930', latency='70.784000', return_code='0', output='PING OK - Packet loss = 0%, RTA = 3\.83 ms', long_output='', perfdata='rta=3\.830000ms;3000\.000000;5000\.000000;0\.000000 pl=0%;80;100;0''

Lässt sich am einfachsten via phpmyadmin beheben. Einloggen – Tabellen überprüfen – und anschließend reparieren.

Zweiter Fehler: ndo2db scheint nichts mehr in die queue zu schreiben:

Oct  9 06:36:20 SERVER ndo2db: Message sent to queue.
Oct  9 06:36:20 SERVER ndo2db: Warning: queue send error, retrying...
Oct  9 06:36:21 SERVER ndo2db: Message sent to queue.
Oct  9 06:36:21 SERVER ndo2db: Warning: queue send error, retrying...
Oct  9 06:36:22 SERVER ndo2db: Message sent to queue.
Oct  9 06:36:22 SERVER ndo2db: Warning: queue send error, retrying...

Die Ursache ist wohl ein neues „Feature“ in der neuen Version 1.5.2 von ndoutils welche Nachrichten nun in eine Warteschlange setzt, wenn der Kernel sie nicht annimmt. (Korrigiert mich, wenn ich falsch liegen sollte.)
Abhilfe schafft das hoch setzen der max. Nachrichten:

vi /etc/sysctl.conf
(Einfach am Ende einfügen, falls nicht vorhanden.)
kernel.msgmax = 131072000
kernel.msgmnb = 131072000
kernel.msgmni = 65536000

Danach  habe ich noch ein Reboot gemacht.
(via)

Monitoring Appliance – Nagios, Centreon, Nagvis, Check_MK

Passend zu meinem vorangegangenem Blogpost habe ich hier nun eine fertige Appliance im .ovf Format bereit gestellt.
Als Grundlage dient ein Ubuntu 12.04 LTS wo ich die aktuellen Versionen von Nagios, Centreon, Nagvis und Check_MK vorinstalliert habe.
Damit ist das System nach der Bereitstellung direkt Einsatzbereit und man erspart sich die lange Konfigurations-/Installationszeit.
Da es meine erste Vorlage ist, besteht natürlich noch Verbesserungsbedarf wie z.B.  IP-Konfiguration oder Hostname Änderung beim ersten Login. Tipps & Hinweise nehme ich gerne entgegen 😉
 
Details:
– Ubuntu 12.04 LTS
– Nagios Core    | 3.4.1
– nagios Plugins    | 1.4.15
– Centreon     | 2.3.8
– Check_MK    | 1.2.0p1
– Nagvis        | 1.6.6
Alle notwendigen Informationen findet ihr in der Beiliegenden README.txt
Download ( 1,27 GB)

How to install Nagios, Centreon, Nagvis, Check_MK @ Ubuntu 12.04 Server

Ich arbeite schon seit mehreren Jahren mit Nagios vorallem aber mit der Oberfläche: Centreon. Wer Nagios noch per Shell bedient und somit hunderte Config-Files pflegt müsste Centreon eigentlich lieben.
Eine Oberfläche von der aus alles gesteuert wird. Komfortables anlegen von Hosts, Diensten und allen notwendigen Gruppen. Mit mehreren Klicks – keine Config-Files mehr – diese werden dann durch Centreon automatisch erstellt.
Zur grafischen Anzeige benutze ich Nagvis was noch die Erweiterung check_mk benötigt. Damit lassen sich dann nette Weathermaps erstellen oder den Serverraum in einem Bild mit dem dazugehörigen Host/Service-Status darstellen.
Als Betriebssystem nutze ich ausschließlich nur Ubuntu – daher ist das Komplettpaket „FAN – Fully automated Nagios“ (CentOS) für micht nicht interessant.
Hier ein Howto zur Installation von Nagios, Centreon, Check_MK und Nagvis. In naher Zukunft werde ich auch mal ein .OVF Template erstellen….
Vorraussetzungen:
-> Ubuntu 12.04 Server installiert.
Bevor wir anfangen noch obligatorisch die Updates machen:

apt-get update
apt-get upgrade
apt-get dist-upgrade

Notwendige Abhängigkeiten installieren:

apt-get install gcc make g++ lsb-release tofrodos apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libapache2-mod-python libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli apache2-suexec php-pear php-auth php5-mcrypt mcrypt libapache2-mod-suphp php5-snmp php5-ldap mysql-server rrdtool librrds-perl libconfig-inifiles-perl libcrypt-des-perl libgd-gd2-perl snmp snmpd libnet-snmp-perl libsnmp-perl libgd2-xpm libgd2-xpm-dev bsd-mailx postfix

GGf. Vmware Tools installieren (VMware Tools mounten):

mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
mount: blockorientiertes Gerät /dev/sr0 ist schreibgeschützt, wird eingehängt im Nur-Lese-Modus
tar xzfv /mnt/cdrom/VMwareTools-8.6.5-652272.tar.gz -C /tmp/
root@centreon:~# cd /tmp/vmware-tools-distrib/
./vmware-install.pl

Ich habe die VM-Tools mit Standardeinstellungen installiert. Anschließend Reboot:

shutdown -r now

GGf. Proxy im Wget eintragen:

vi /etc/wgetrc

Installation von Nagios:
Hier gibt es zwei Möglichkeiten. Entweder von Hand installieren, oder die fertigen Packete nutzen. Ich empfehle es von Hand zu installieren, da die Pakete oftmals nicht aktuell sind.
Also finger weg von: apt-get install nagios3 nagios-plugins
Nagios benutzer anlegen:

/usr/sbin/useradd -m -s /bin/bash nagios
passwd nagios

Gruppe anlegen:

/usr/sbin/groupadd nagios

Gruppe hinzufügen:

/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd www-data

Nagios herunterladen:

wget http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios-3.4.1/nagios-3.4.1.tar.gz?r=http%3A%2F%2Fwww.nagios.org%2Fdownload%2Fcore%2Fthanks%2F&amp;ts=1340721679&amp;use_mirror=garr
mv nagios-3.4.1.tar.gz\?r\=http\:%2F%2Fwww.nagios.org%2Fdownload%2Fcore%2Fthanks%2F nagios-3.4.1.tar.gz
tar xzfv nagios-3.4.1.tar.gz
cd nagios/

Nagios Configurieren:

./configure --with-nagios-group=nagios --with-nagios-user=nagios --with-command-group=nagcmd
Creating sample config files in sample-config/ ...

[EXPAND Configuration Log]
*** Configuration summary for nagios 3.4.1 05-11-2012 ***:
General Options:
————————-
Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagcmd
Embedded Perl: no
Event Broker: yes
Install ${prefix}: /usr/local/nagios
Lock file: ${prefix}/var/nagios.lock
Check result directory: ${prefix}/var/spool/checkresults
Init directory: /etc/init.d
Apache conf.d directory: /etc/apache2/conf.d
Mail program: /bin/mail
Host OS: linux-gnu
Web Interface Options:
————————
HTML URL: http://localhost/nagios/
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP):
Review the options above for accuracy. If they look okay,
type ‚make all‘ to compile the main program and CGIs.
root@centreon:/tmp/nagios#
*** Compile finished ***[/EXPAND]
Nagios installieren:

make all
make install
make install-commandmode
make install-config
make install-init
make install-webconf

Nagiosadmin (für Webinterface anlegen):

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

Autostart hinzufügen:

ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios

Nagios-Plugins installieren:

wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz?r=http%3A%2F%2Fwww.nagios.org%2Fdownload%2Fplugins%2F&amp;ts=1340722460&amp;use_mirror=dfn
mv nagios-plugins-1.4.15.tar.gz\?r\=http\:%2F%2Fwww.nagios.org%2Fdownload%2Fplugins%2F nagios-plugins-1.4.15.tar.gz
tar xzfv nagios-plugins-1.4.15.tar.gz
./configure
make
make install

Nagios starten:

/etc/init.d/nagios start

Mal die Webseite aufrufen: http://server/nagios
Benutzer: nagiosadmin
Prüfen ob Statusmap funktioniert.
Bei dem Fehler: The requested URL /nagios/cgi-bin/statusmap.cgi was not found on this server
Nochmal ausführen:

apt-get install libgd2-xpm libgd2-xpm-dev
root@centreon:/tmp/nagios# make cgis
cp /usr/nagios-3.2.3/cgi/*.cgi /usr/local/nagios/sbin
chown nagios:nagios /usr/local/nagios/sbin/*.cgi

Nagios neustarten

/etc/init.d/nagios restart

ndoutils installieren:

wget http://downloads.sourceforge.net/project/nagios/ndoutils-1.x/ndoutils-1.5.2/ndoutils-1.5.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fnagios%2Ffiles%2Fndoutils-1.x%2Fndoutils-1.5.2%2F&amp;ts=1340723870&amp;use_mirror=garr
cd ndoutils-1.5.2/
./configure
make
make install

[EXPAND Setuplog]
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/bin
/usr/bin/install -c -m 755 -o nagios -g nagios ndo2db-3x /usr/local/nagios/bin/ndo2db
/usr/bin/install -c -m 755 -o nagios -g nagios ndomod-3x.o /usr/local/nagios/bin/ndomod.o
/usr/bin/install -c -m 774 -o nagios -g nagios file2sock /usr/local/nagios/bin
/usr/bin/install -c -m 774 -o nagios -g nagios log2ndo /usr/local/nagios/bin
/usr/bin/install -c -m 774 -o nagios -g nagios sockdebug /usr/local/nagios/bin
Hint: NDOUtils Installation against Nagios v3.x
completed.
If you want to install NDOUtils for Nagios v2.x
please type ‚make install-2x
Next step should be the database initialization/upgrade
cd into the db/ directory and either:
./installdb (for a new installation) or:
./upgradedb (for an existing one)
make[1]: Verlasse Verzeichnis ‚/tmp/ndoutils-1.5.2/src‘
Main NDOUtils components installed[/EXPAND]
So nun kann Centeron installiert werden. Beachtet das hier ggf. eine direkte Internetverbindung benötigt wird, da durch das Setup einige PEAR Komponenten aktualisiert werden.
Centreon installieren:

wget http://download.centreon.com/index.php?id=181
mv index.php\?id\=181 centreon.2.3.8.tar.gz
tar xzfv centreon.2.3.8.tar.gz
./install.sh -i

[EXPAND Centreon Setup]
Do you accept GPL license ?
[y/n], default to [n]:
> y
————————————————————————
Please choose what you want to install
————————————————————————
Do you want to install : Centreon Web Front
[y/n], default to [n]:
> y
Do you want to install : Centreon CentCore
[y/n], default to [n]:
> y
Do you want to install : Centreon Nagios Plugins
[y/n], default to [n]:
> y
Do you want to install : Centreon Snmp Traps process
[y/n], default to [n]:
> y
————————————————————————
Start CentWeb Installation
————————————————————————
Where is your Centreon directory?
default to [/usr/local/centreon]
>
Do you want me to create this directory ? [/usr/local/centreon]
[y/n], default to [n]:
> y
Path /usr/local/centreon OK
Where is your Centreon log directory
default to [/usr/local/centreon/log]
>
Do you want me to create this directory ? [/usr/local/centreon/log]
[y/n], default to [n]:
> y
Path /usr/local/centreon/log OK
Where is your Centreon etc directory
default to [/etc/centreon]
>
Do you want me to create this directory ? [/etc/centreon]
[y/n], default to [n]:
> y
Path /etc/centreon OK
Where is your Centreon generation_files directory?
default to [/usr/local/centreon]
>
Path /usr/local/centreon OK
Where is your Centreon variable library directory?
default to [/var/lib/centreon]
>
Do you want me to create this directory ? [/var/lib/centreon]
[y/n], default to [n]:
> y
Path /var/lib/centreon OK
Where is your CentPlugins Traps binary
default to [/usr/local/centreon/bin]
>
Do you want me to create this directory ? [/usr/local/centreon/bin]
[y/n], default to [n]:
> y
Path /usr/local/centreon/bin OK
Where is the RRD perl module installed [RRDs.pm]
default to [/usr/lib/perl5/RRDs.pm]
>
Path /usr/lib/perl5 OK
/usr/bin/rrdtool OK
Where is mail binary
default to [/usr/bin/mail]
> /usr/bin/mailx
/usr/bin/mailx OK
Where is PEAR [PEAR.php]
default to [/usr/share/php/PEAR.php]
>
Path /usr/share/php OK
Where is installed Nagios ?
default to [/usr/local/nagios]
>
Path /usr/local/nagios OK
Where is your nagios config directory
default to [/usr/local/nagios/etc]
>
Path /usr/local/nagios/etc OK
Where is your Nagios var directory ?
default to [/usr/local/nagios/var]
>
Path /usr/local/nagios/var OK
Where is your Nagios plugins (libexec) directory ?
default to [/usr/local/nagios/libexec]
>
Path /usr/local/nagios/libexec OK
Where is your nagios binary ?
default to [/usr/local/nagios/bin/nagios]
>
/usr/local/nagios/bin/nagios OK
Where is your Nagios image directory ?
default to [/usr/local/nagios/share/images/logos]
>
Path /usr/local/nagios/share/images/logos OK
Where is your nagiostats binary ?
default to [/usr/local/nagios/bin/nagiostats]
>
/usr/local/nagios/bin/nagiostats OK
p1_file : /usr/local/nagios/bin/p1.pl OK
/usr/bin/php OK
/usr/bin/perl OK
Finding Apache group : www-data
Finding Apache user : www-data
Finding Nagios user : nagios
Finding Nagios group : nagios
Where is your NDO ndomod binary ?
default to [/usr/sbin/ndomod.o]
> /usr/local/nagios/bin/ndomod.o
/usr/local/nagios/bin/ndomod.o OK
————————————————————————
Configure Sudo
————————————————————————
Where is sudo configuration file
default to [/etc/sudoers]
>
/etc/sudoers OK
Nagios init script OK
Your sudo is not configured
Do you want me to configure your sudo ? (WARNING)
[y/n], default to [n]:
> y
Configuring Sudo OK
————————————————————————
Configure Apache server
————————————————————————
Do you want to add Centreon Apache sub configuration file ?
[y/n], default to [n]:
> y
Create ‚/etc/apache2/conf.d/centreon.conf‘ OK
Configuring Apache OK
Do you want to reload your Apache ?
[y/n], default to [n]:
> y
Reloading Apache service OK
Preparing Centreon temporary files
Change right on /usr/local/centreon/log OK
Change right on /etc/centreon OK
Change right on /usr/local/nagios/share/images/logos OK
Install nagios documentation OK
Change macros for insertBaseConf.sql OK
Change macros for php files OK
Change right on /usr/local/nagios/etc OK
Copy CentWeb in system directory
Install CentWeb (web front of centreon) OK
Install libraries OK
Copying libinstall OK
Change macros for centreon.cron OK
Install Centreon cron.d file OK
Change macros for centAcl.php OK
Change macros for downtimeManager.php OK
Change macros for eventReportBuilder.pl OK
Change macros for dashboardBuilder.pl OK
Install cron directory OK
Change right for eventReportBuilder.pl OK
Change right for dashboardBuilder.pl OK
————————————————————————
Pear Modules
————————————————————————
Check PEAR modules
PEAR 1.4.9 1.9.4 OK
DB 1.7.6 NOK
DB_DataObject 1.8.4 NOK
DB_DataObject_FormBuilder 1.0.0RC4 NOK
MDB2 2.0.0 NOK
Date 1.4.6 NOK
HTML_Common 1.2.2 NOK
HTML_QuickForm 3.2.5 NOK
HTML_QuickForm_advmultiselect 1.1.0 NOK
HTML_Table 1.6.1 NOK
Archive_Tar 1.1 1.3.7 OK
Auth_SASL 1.0.1 NOK
Console_Getopt 1.2 1.3.0 OK
Net_SMTP 1.2.8 NOK
Net_Socket 1.0.1 NOK
Net_Traceroute 0.21 NOK
Net_Ping 2.4.1 NOK
Validate 0.6.2 NOK
XML_RPC 1.4.5 NOK
SOAP 0.10.1 NOK
Log 1.9.11 NOK
Do you want me to install/upgrade your PEAR modules
[y/n], default to [y]:
> y
Upgrading PEAR modules
Installing PEAR modules
DB 1.7.6 OK
DB_DataObject 1.8.4 1.10.0 OK
DB_DataObject_FormBuilder 1.0.0RC4 1.0.2 OK
MDB2 2.0.0 2.4.1 OK
HTML_QuickForm_advmultiselect 1.1.0 1.5.1 OK
HTML_Table 1.6.1 1.8.3 OK
Auth_SASL 1.0.1 1.0.6 OK
Net_SMTP 1.2.8 1.6.1 OK
Net_Traceroute 0.21 0.21.3 OK
Net_Ping 2.4.1 2.4.5 OK
Validate 0.6.2 0.8.5 OK
XML_RPC 1.4.5 1.5.5 OK
SOAP 0.10.1 0.13.0 OK
Log 1.9.11 1.12.7 OK
Check PEAR modules
PEAR 1.4.9 1.9.4 OK
DB 1.7.6 1.7.14 OK
DB_DataObject 1.8.4 1.10.0 OK
DB_DataObject_FormBuilder 1.0.0RC4 1.0.2 OK
MDB2 2.0.0 2.4.1 OK
Date 1.4.6 1.4.7 OK
HTML_Common 1.2.2 1.2.5 OK
HTML_QuickForm 3.2.5 3.2.13 OK
HTML_QuickForm_advmultiselect 1.1.0 1.5.1 OK
HTML_Table 1.6.1 1.8.3 OK
Archive_Tar 1.1 1.3.7 OK
Auth_SASL 1.0.1 1.0.6 OK
Console_Getopt 1.2 1.3.0 OK
Net_SMTP 1.2.8 1.6.1 OK
Net_Socket 1.0.1 1.0.10 OK
Net_Traceroute 0.21 0.21.3 OK
Net_Ping 2.4.1 2.4.5 OK
Validate 0.6.2 0.8.5 OK
XML_RPC 1.4.5 1.5.5 OK
SOAP 0.10.1 0.13.0 OK
Log 1.9.11 1.12.7 OK
All PEAR modules OK
————————————————————————
Centreon Post Install
————————————————————————
Create /usr/local/centreon/www/install/install.conf.php OK
Create /etc/centreon/instCentWeb.conf OK
————————————————————————
Start CentStorage Installation
————————————————————————
Where is your Centreon Run Dir directory?
default to [/var/run/centreon]
>
Do you want me to create this directory ? [/var/run/centreon]
[y/n], default to [n]:
> y
Path /var/run/centreon OK
Where is your CentStorage binary directory
default to [/usr/local/centreon/bin]
>
Path /usr/local/centreon/bin OK
Where is your CentStorage RRD directory
default to [/var/lib/centreon]
>
Path /var/lib/centreon OK
Finding Nagios group : nagios
Finding Nagios user : nagios
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved…
install www/install/createTablesCentstorage.sql OK
Creating Centreon Directory ‚/var/lib/centreon/status‘ OK
Creating Centreon Directory ‚/var/lib/centreon/metrics‘ OK
Change macros for centstorage binary OK
Install CentStorage binary OK
Install library for centstorage OK
Change right : /var/run/centreon OK
Change macros for centstorage init script OK
Do you want me to install CentStorage init script ?
[y/n], default to [n]:
> y
CentStorage init script installed OK
Do you want me to install CentStorage run level ?
[y/n], default to [n]:
> y
update-rc.d: warning: /etc/init.d/centstorage missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
Adding system startup for /etc/init.d/centstorage …
/etc/rc0.d/K30centstorage -> ../init.d/centstorage
/etc/rc1.d/K30centstorage -> ../init.d/centstorage
/etc/rc6.d/K30centstorage -> ../init.d/centstorage
/etc/rc2.d/S40centstorage -> ../init.d/centstorage
/etc/rc3.d/S40centstorage -> ../init.d/centstorage
/etc/rc4.d/S40centstorage -> ../init.d/centstorage
/etc/rc5.d/S40centstorage -> ../init.d/centstorage
Configuration file /etc/centreon/conf.pm not found. Exiting.
CentStorage stop FAIL
Change macros for logAnalyser OK
Install logAnalyser OK
Change macros for nagiosPerfTrace OK
Install nagiosPerfTrace OK
Change macros for purgeLogs OK
Install purgeLogs OK
Change macros for purgeCentstorage OK
Install purgeCentstorage OK
Change macros for centreonPurge.sh OK
Install centreonPurge.sh OK
Change macros for centstorage.cron OK
Install CentStorage cron OK
Create /etc/centreon/instCentStorage.conf OK
————————————————————————
Start CentCore Installation
————————————————————————
Where is your CentCore binary directory
default to [/usr/local/centreon/bin]
>
Path /usr/local/centreon/bin OK
/usr/bin/ssh OK
/usr/bin/scp OK
Finding Nagios group : nagios
Finding Nagios user : nagios
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved…
Change CentCore Macro OK
Copy CentCore in binary directory OK
Change right : /var/run/centreon OK
Change right : /var/lib/centreon OK
Replace CentCore init script Macro OK
Do you want me to install CentCore init script ?
[y/n], default to [n]:
> y
CentCore init script installed OK
Do you want me to install CentCore run level ?
[y/n], default to [n]:
> y
update-rc.d: warning: /etc/init.d/centcore missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
Adding system startup for /etc/init.d/centcore …
/etc/rc0.d/K30centcore -> ../init.d/centcore
/etc/rc1.d/K30centcore -> ../init.d/centcore
/etc/rc6.d/K30centcore -> ../init.d/centcore
/etc/rc2.d/S40centcore -> ../init.d/centcore
/etc/rc3.d/S40centcore -> ../init.d/centcore
/etc/rc4.d/S40centcore -> ../init.d/centcore
/etc/rc5.d/S40centcore -> ../init.d/centcore
Create /etc/centreon/instCentCore.conf OK
————————————————————————
Start CentPlugins Installation
————————————————————————
Where is your CentPlugins lib directory
default to [/var/lib/centreon/centplugins]
>
Do you want me to create this directory ? [/var/lib/centreon/centplugins]
[y/n], default to [n]:
> y
Path /var/lib/centreon/centplugins OK
Finding Nagios user : nagios
Finding Nagios group : nagios
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved…
Change macros for CentPlugins OK
Installing the plugins OK
Change right on centreon.conf OK
CentPlugins is installed
————————————————————————
Start CentPlugins Traps Installation
————————————————————————
Where is your SNMP configuration directory
default to [/etc/snmp]
>
/etc/snmp OK
Where is your SNMPTT binaries directory
default to [/usr/local/centreon/bin/]
>
/usr/local/centreon/bin/ OK
Finding Nagios group : nagios
Finding Apache user : www-data
Preparing Centreon temporary files
/tmp/centreon-setup exists, it will be moved…
Change macros for CentPluginsTraps OK
Installing the plugins Trap binaries OK
Change macros for snmptrapd.conf OK
Change macros for snmptt.ini OK
Install : snmptrapd.conf OK
Install : snmp.conf OK
Install : snmptt.ini OK
Install : snmptt OK
Install : snmpttconvertmib OK
Create /etc/centreon/instCentPlugins.conf OK
###############################################################################
# #
# Go to the URL : http://centreon.domain.info/centreon/ #
# to finish the setup #
# #
# Report bugs at http://forge.centreon.com #
# #
# Thanks for using Centreon. #
# ———————– #
# Contact : infos@centreon.com #
# http://www.centreon.com #
# #
###############################################################################[/EXPAND]
Nun die Webseite aufrufen und mit der Installation weitermachen:

http://centreon.domain.info/centreon/


Anschließend Neustart:

shutdown -r now

Nachträglich die LDAP-Authentifizierung über die Centreon Oberfläche einrichten:

Administration - &gt; Options -&gt; Options -&gt; Ldap

Wenn man nun noch Nagvis installieren will – gehts weiter.
Zuerst muss check_mk installiert werden:

wget http://mathias-kettner.de/download/check_mk-1.2.0p1.tar.gz
tar xzfv check_mk-1.2.0p1.tar.gz
cd check_mk-1.2.0p1
./setup.sh
Hier alles wieder mit Standart-Einstellungen installiert

[EXPAND check_MK Setup]
./setup.sh
Check_MK setup Version: 1.2.0p1
Welcome to Check_MK. This setup will install Check_MK into user defined
directories. If you run this script as root, installation paths below
/usr will be suggested. If you run this script as non-root user paths
in your home directory will be suggested. You may override the default
values or just hit enter to accept them.
Your answers will be saved to /home/centreon/.check_mk_setup.conf and will be
reused when you run the setup of this or a later version again. Please
delete that file if you want to delete your previous answers.
* Found running Nagios process, autodetected 18 settings.
1) Installation directories of check_mk
Executable programs
Directory where to install executable programs such as check_mk itself.
This directory should be in your search path ($PATH). Otherwise you
always have to specify the installation path when calling check_mk:
( default –> /usr/bin):
Check_MK configuration
Directory where check_mk looks for its main configuration file main.mk.
An example configuration file will be installed there if no main.mk is
present from a previous version:
( default –> /etc/check_mk):
Check_MK software
The base directory for the software installation of Check_MK. This
directory will get the subdirectories checks, modules, web, locale and
agents. Note: in previous versions it was possible to specify each of
those directories separately. This is no longer possible:
( default –> /usr/share/check_mk):
documentation
Some documentation about check_mk will be installed here. Please note,
however, that most of check_mk’s documentation is available only online at
http://mathias-kettner.de/check_mk.html:
( default –> /usr/share/doc/check_mk):
check manuals
Directory for manuals for the various checks. The manuals can be viewed
with check_mk -M <CHECKNAME>:
( default –> /usr/share/doc/check_mk/checks):
working directory of check_mk
check_mk will create caches files, automatically created checks and
other files into this directory. The setup will create several subdirectories
and makes them writable by the Nagios process:
( default –> /var/lib/check_mk):
 
2) Configuration of Linux/UNIX Agents
extensions for agents
This directory will not be created on the server. It will be hardcoded
into the Linux and UNIX agents. The agent will look for extensions in the
subdirectories plugins/ and local/ of that directory:
( default –> /usr/lib/check_mk_agent):
configuration dir for agents
This directory will not be created on the server. It will be hardcoded
into the Linux and UNIX agents. The agent will look for its configuration
files here (currently only the logwatch extension needs a configuration file):
( default –> /etc/check_mk):
 
3) Integration with Nagios
Name of Nagios user
The working directory for check_mk contains several subdirectories
that need to be writable by the Nagios user (which is running check_mk
in check mode). Please specify the user that should own those
directories:
( autodetected –> nagios):
User of Apache process
Check_MK WATO (Web Administration Tool) needs a sudo configuration,
such that Apache can run certain commands as root. If you specify
the correct user of the apache process here, then we can create a valid
sudo configuration for you later::
( autodetected –> www-data):
Common group of Nagios+Apache
Check_mk creates files and directories while running as nagios.
Some of those need to be writable by the user that is running the webserver.
Therefore a group is needed in which both Nagios and the webserver are
members (every valid Nagios installation uses such a group to allow
the web server access to Nagios‘ command pipe)::
( autodetected –> nagcmd):
Nagios binary
The complete path to the Nagios executable. This is needed by the
option -R/–restart in order to do a configuration check.:
( autodetected –> /usr/local/nagios/bin/nagios):
Nagios main configuration file
Path to the main configuration file of Nagios. That file is always
named ’nagios.cfg‘. The default path when compiling Nagios yourself
is /usr/local/nagios/etc/nagios.cfg. The path to this file is needed
for the check_mk option -R/–restart:
( autodetected –> /usr/local/nagios/etc/nagios.cfg):
Nagios object directory
Nagios‘ object definitions for hosts, services and contacts are
usually stored in various files with the extension .cfg. These files
are located in a directory that is configured in nagios.cfg with the
directive ‚cfg_dir‘. Please specify the path to that directory
(If the autodetection can find your configuration
file but does not find at least one cfg_dir directive, then it will
add one to your configuration file for your conveniance):
( autodetected –> /usr/local/nagios/etc/check_mk.d):
Nagios startskript
The complete path to the Nagios startskript is used by the option
-R/–restart to restart Nagios.:
( autodetected –> /etc/init.d/nagios):
Nagios command pipe
Complete path to the Nagios command pipe. check_mk needs write access
to this pipe in order to operate:
( autodetected –> /usr/local/nagios/var/rw/nagios.cmd):
Check results directory
Complete path to the directory where Nagios stores its check results.
Using that directory instead of the command pipe is faster.:
( default –> /usr/local/nagios/var/spool/checkresults):
Nagios status file
The web pages of check_mk need to read the file ’status.dat‘, which is
regularily created by Nagios. The path to that status file is usually
configured in nagios.cfg with the parameter ’status_file‘. If
that parameter is missing, a compiled-in default value is used. On
FHS-conforming installations, that file usually is in /var/lib/nagios
or /var/log/nagios. If you’ve compiled Nagios yourself, that file
might be found below /usr/local/nagios:
( autodetected –> /usr/local/nagios/var/status.log):
Path to check_icmp
check_mk ships a Nagios configuration file with several host and
service templates. Some host templates need check_icmp as host check.
That check plugin is contained in the standard Nagios plugins.
Please specify the complete path (dir + filename) of check_icmp:
( autodetected –> /usr/local/nagios/libexec/check_icmp):
 
4) Integration with Apache
URL Prefix for Web addons
Usually the Multisite GUI is available at /check_mk/ and PNP4Nagios
is located at /pnp4nagios/. In some cases you might want to define some
prefix in order to be able to run more instances of Nagios on one host.
If you say /test/ here, for example, then Multisite will be located
at /test/check_mk/. Please do not forget the trailing slash.:
( default –> /):
Apache config dir
Check_mk ships several web pages implemented in Python with Apache
mod_python. That module needs an apache configuration section which
will be installed by this setup. Please specify the path to a directory
where Apache reads in configuration files.:
( autodetected –> /etc/apache2/conf.d):
HTTP authentication file
Check_mk’s web pages should be secured from unauthorized access via
HTTP authenticaion – just as Nagios. The configuration file for Apache
that will be installed contains a valid configuration for HTTP basic
auth. The most conveniant way for you is to use the same user file as
for Nagios. Please enter your htpasswd file to use here:
( autodetected –> /usr/local/nagios/etc/htpasswd.users):
HTTP AuthName
Check_mk’s Apache configuration file will need an AuthName. That
string will be displayed to the user when asking for the password.
You should use the same AuthName as for Nagios. Otherwise the user will
have to log in twice:
( autodetected –> Nagios Access):
 
5) Integration with PNP4Nagios 0.6
PNP4Nagios templates
Check_MK ships templates for PNP4Nagios for most of its checks.
Those templates make the history graphs look nice. PNP4Nagios
expects such templates in the directory pnp/templates in your
document root for static web pages:
( default –> /usr/share/check_mk/pnp-templates):
 
6) Check_MK Livestatus Module
compile livestatus module
This version of Check_mk ships a completely new and experimental
Nagios event broker module that provides direct access to Nagios
internal data structures. This module is called the Check_MK Livestatus
Module. It aims to supersede status.dat and also NDO. Currenty it
is completely experimental and might even crash your Nagios process.
Nevertheless – The Livestatus Module does not only allow extremely
fast access to the status of your services and hosts, it does also
provide live data (which status.dat does not). Also – unlike NDO –
Livestatus does not cost you even measurable CPU performance, does
not need any disk space and also needs no configuration.
Please answer ‚yes‘, if you want to compile and integrate the
Livestatus module into your Nagios. You need ‚make‘ and the GNU
C++ compiler installed in order to do this:
( default –> yes):
check_mk’s binary modules
Directory for architecture dependent binary libraries and plugins
of check_mk:
( default –> /usr/lib/check_mk):
Unix socket for Livestatus
The Livestatus Module provides Nagios status data via a unix
socket. This is similar to the Nagios command pipe, but allows
bidirectional communication. Please enter the path to that pipe.
It is recommended to put it into the same directory as Nagios‘
command pipe:
( default –> /usr/local/nagios/var/rw/live):
Backends for other systems
Directory where to put backends and configuration examples for
other systems. Currently this is only Nagvis, but other might follow
later.:
( default –> /usr/share/check_mk/livestatus):
———————————————————————-
You have chosen the following directories:
Executable programs /usr/bin
Check_MK configuration /etc/check_mk
Check_MK software /usr/share/check_mk
documentation /usr/share/doc/check_mk
check manuals /usr/share/doc/check_mk/checks
working directory of check_mk /var/lib/check_mk
extensions for agents /usr/lib/check_mk_agent
configuration dir for agents /etc/check_mk
Name of Nagios user nagios
User of Apache process www-data
Common group of Nagios+Apache nagcmd
Nagios binary /usr/local/nagios/bin/nagios
Nagios main configuration file /usr/local/nagios/etc/nagios.cfg
Nagios object directory /usr/local/nagios/etc/check_mk.d
Nagios startskript /etc/init.d/nagios
Nagios command pipe /usr/local/nagios/var/rw/nagios.cmd
Check results directory /usr/local/nagios/var/spool/checkresults
Nagios status file /usr/local/nagios/var/status.log
Path to check_icmp /usr/local/nagios/libexec/check_icmp
URL Prefix for Web addons /
Apache config dir /etc/apache2/conf.d
HTTP authentication file /usr/local/nagios/etc/htpasswd.users
HTTP AuthName Nagios Access
PNP4Nagios templates /usr/share/check_mk/pnp-templates
compile livestatus module yes
check_mk’s binary modules /usr/lib/check_mk
Unix socket for Livestatus /usr/local/nagios/var/rw/live
Backends for other systems /usr/share/check_mk/livestatus
Proceed with installation (y/n)? y
(Compiling MK Livestatus…………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………..)
Installation completed successfully.
Please restart Nagios and Apache in order to update/active check_mk’s web pages.
You can access the new Multisite GUI at http://localhost/check_mk/[/EXPAND]
Apache & Nagios neustarten:

service apache2 restart
service nagios3 restart

Prüfen ob Check_MK richtig funktioniert:

http://centreon.domain.info/check_mk/

Ich hatte hier schon öfters den Fehler das der Socket nicht funktioniert
Abhilfe hat folgendes gebracht:

/var/lib/nagios/
chmod 777 rw/ -R
vi /etc/group
Der nagios Gruppe noch www-data hinzufügen.

Nagvis Abhängigkeiten:

apt-get install graphviz graphviz-dev php5-gd php5-mysql php5-cli php5-common sqlite3 php5-sqlite
service apache2 restart

Nagivs installieren:

wget http://downloads.sourceforge.net/project/nagvis/NagVis%201.6/nagvis-1.6.6.tar.gz?r=http%3A%2F%2Fwww.nagvis.org%2Fdownloads&amp;ts=1340725577&amp;use_mirror=ignum
mv nagvis-1.6.6.tar.gz\?r\=http\:%2F%2Fwww.nagvis.org%2Fdownloads nagvis-1.6.6.tar.gz
tar xzfv nagvis-1.6.6.tar.gz
cd nagvis-1.6.6/
./install.sh

[EXPAND Navis Setup]
+——————————————————————————+
| Welcome to NagVis Installer 1.6.6 |
+——————————————————————————+
| This script is built to facilitate the NagVis installation and update |
| procedure for you. The installer has been tested on the following systems: |
| – Debian Etch, Hardy (4.0, 5.0) |
| – Ubuntu Hardy, Intrepid, Jaunty, Karmic, Lucid (8.04 to 10.04) |
| – SuSE Linux Enterprise Server 10 and 11 |
| |
| Similar distributions to the ones mentioned above should work as well. |
| That (hopefully) includes RedHat, Fedora, CentOS, OpenSuSE |
| |
| If you experience any problems using these or other distributions, please |
| report that to the NagVis team. |
+——————————————————————————+
| Do you want to proceed? [y]:
+——————————————————————————+
| Starting installation of NagVis 1.6.6 |
+——————————————————————————+
| OS : Ubuntu 12.04 LTS |
| |
+— Checking for tools ——————————————————-+
| Using packet manager /usr/bin/dpkg found |
| |
+— Checking paths ———————————————————–+
| Please enter the path to the nagios base directory [/usr/local/nagios]:
| nagios path /usr/local/nagios found |
| Please enter the path to NagVis base [/usr/local/nagvis]:
| |
+— Checking prerequisites —————————————————+
| PHP 5.3 found |
| PHP Module: gd 5.3 found |
| PHP Module: mbstring compiled_in found |
| PHP Module: gettext compiled_in found |
| PHP Module: session compiled_in found |
| PHP Module: xml compiled_in found |
| PHP Module: pdo compiled_in found |
| Apache mod_php found |
| Checking Backends. (Available: mklivestatus,ndo2db,ido2db,merlinmy) |
| Do you want to use backend mklivestatus? [y]:
| Do you want to use backend ndo2db? [n]:
| Do you want to use backend ido2db? [n]:
| Do you want to use backend merlinmy? [n]:
| Livestatus Socket (/usr/local/nagios/var/rw/live) MISSING |
| Valid socket formats are: tcp:127.0.0.1:7668 or unix:/path/to/live |
| Please enter your MKLivestatus socket: unix:/var/lib/nagios/rw/live
| Invalid socket format. Take a look above for valid formats. |
| PHP Module: sockets compiled_in found |
| Graphviz 2.26 found |
| Graphviz Module dot 2.26.3 found |
| Graphviz Module neato 2.26.3 found |
| Graphviz Module twopi 2.26.3 found |
| Graphviz Module circo 2.26.3 found |
| Graphviz Module fdp 2.26.3 found |
| SQLite 3.7 found |
| |
+— Trying to detect Apache settings —————————————–+
| Please enter the web path to NagVis [/nagvis]:
| Please enter the name of the web-server user [www-data]:
| Please enter the name of the web-server group [www-data]:
| create Apache config file [y]:
| |
+— Checking for existing NagVis ———————————————+
| |
+——————————————————————————+
| Summary |
+——————————————————————————+
| NagVis home will be: /usr/local/nagvis |
| Owner of NagVis files will be: www-data |
| Group of NagVis files will be: www-data |
| Path to Apache config dir is: /etc/apache2/conf.d |
| Apache config will be created: yes |
| |
| Installation mode: install |
| |
| Do you really want to continue? [y]:
+——————————————————————————+
| Starting installation |
+——————————————————————————+
| Creating directory /usr/local/nagvis… done |
| Creating directory /usr/local/nagvis/var… done |
| Creating directory /usr/local/nagvis/var/tmpl/cache… done |
| Creating directory /usr/local/nagvis/var/tmpl/compile… done |
| Creating directory /usr/local/nagvis/share/var… done |
| Copying files to /usr/local/nagvis… done |
| Creating directory /usr/local/nagvis/etc/profiles… done |
| Creating main configuration file… done |
| Adding MKLivestatus Backend… done |
| Adding webserver group to file_group… done |
| Creating web configuration file… done |
| Setting permissions for web configuration file… done |
| |
| |
| |
+— Setting permissions… —————————————————+
| /usr/local/nagvis/etc/nagvis.ini.php-sample done |
| /usr/local/nagvis/etc done |
| /usr/local/nagvis/etc/maps done |
| /usr/local/nagvis/etc/maps/* done |
| /usr/local/nagvis/etc/automaps done |
| /usr/local/nagvis/etc/automaps/* done |
| /usr/local/nagvis/etc/profiles done |
| /usr/local/nagvis/share/userfiles/images/maps done |
| /usr/local/nagvis/share/userfiles/images/maps/* done |
| /usr/local/nagvis/share/userfiles/images/shapes done |
| /usr/local/nagvis/share/userfiles/images/shapes/* done |
| /usr/local/nagvis/var done |
| /usr/local/nagvis/var/* done |
| /usr/local/nagvis/var/tmpl done |
| /usr/local/nagvis/var/tmpl/cache done |
| /usr/local/nagvis/var/tmpl/compile done |
| /usr/local/nagvis/share/var done |
| |
+——————————————————————————+
| Installation complete |
| |
| You can safely remove this source directory. |
| |
| For later update/upgrade you may use this command to have a faster update: |
| ./install.sh -n /usr/local/nagios -p /usr/local/nagvis -l „unix:/var/lib/nagios/rw/live“ -b mklivestatus -u www-data -g www-data -w /etc/apache2/conf.d -a y
| |
| What to do next? |
| – Read the documentation |
| – Maybe you want to edit the main configuration file? |
| Its location is: /usr/local/nagvis/etc/nagvis.ini.php |
| – Configure NagVis via browser |
| <http://localhost/nagvis/config.php> |
| – Initial admin credentials: |
| Username: admin |
| Password: admin |
+——————————————————————————+[/EXPAND]
Dateien für Troubleshooting:
Nagios Logfile:

/usr/local/nagios/var/nagios.log
/usr/local/nagios/var/status.log

Centreon Logfiles:

/usr/local/centreon/log

Nagvis Configfile:

/usr/local/nagvis/etc/nagvis.ini.php

MKLivestatus socket:

unix:/var/lib/nagios/rw/live

Pfad zu ndomod.o

/usr/local/nagios/bin/ndomod.o

Pfad zu Nagios Plugins:

/usr/local/nagios/libexec

Monitor Ubuntu-Server with Nagios/Centreon & NRPE

Um das Linux System zu Überwachen benötigt es einen Dienst der auf dem Remote-System installiert werden muss. (Wie bei Windows der NSClient)
1. NRPE Installieren (Remote System – zu Überwachende)

apt-get install nagios-plugins nagios-nrpe-server

2. Anschließend die Konfigdatei bearbeiten, und die IP-Adresse des Nagios-Servers eintragen.

/etc/nagios/nrpe_local.cfg
allowed_hosts=127.0.0.1,NAGIOS-IP

 
Ich habe mir an dieser Stelle auch noch ein paar fertige Commands erstellt:

command[check_mysqldb]=/usr/lib/nagios/plugins/check_mysql -H localhost -u nagios -p meinPasswort
command[check_freespace]=/usr/lib/nagios/plugins# ./check_disk -w 10% -c 5% -p /dev/sda1
command[check_http]=/usr/lib/nagios/plugins# ./check_http -w 5 -c 10 -H intranet.domain.info
command[check_http]=/usr/lib/nagios/plugins# ./check_tcp -H localhost -p 80

3. Anschließend den nrpe-daemon starten:

/etc/init.d/nagios-nrpe-server start

 
Nun sollte es möglich sein vom Nagios-Server aus den Server zu erreichen und die Commands abzufragen.

/usr/lib/nagios/plugins/check_nrpe -H 11.1.11.1
NRPE v2.8.1

Bsps. für die Abfrage eines vorher festgelegten Commands:

/usr/lib/nagios/plugins/check_nrpe -H 11.1.11.1 -c check_mysqldb
Uptime: 13142 Threads: 1 Questions: 93701 Slow queries: 1 Opens: 1838 Flush tables: 1 Open tables: 64 Queries per second avg: 7.129

 
Gruß
Constantin