From JonDonym Wiki
Revision as of 14:57, 11 April 2011 by Geko (Talk | contribs)
Jump to: navigation, search

En2.png De2.png    <- prev | Content | next ->

Mix server monitoring using Nagios

There is a Nagios plugin available to monitor a mix server. It is using the monitoring interface provided by the mix server itself and has to be activated in the mix server first. During the installation of the mix software the option "--enable-server_monitoring" has to be added. Additonally, while configuring the mix server in Step 2 the monitoring interface (i.e. the network interface and the port) has to be specified.

The Nagios plugin may be found in the mix source directory in the subdirectory misc/nagios or it can be downloaded from here. The script has to be saved within the Nagios plugin directory and must be made executable.

This script, check-mix-server, is written in Perl and is using the Nagios::Plugin and XML::Simple moduels. These modules must be installed as well. If they are provided by the (Linux) distribution they may be installed by the packet manager. Using Debian/Ubuntu aptitude is doing all the things necessary:

> sudo aptitude install libxml-simple-perl libnagios-plugin-perl

As an alternative the required modules may be installed from the CPAN:

> sudo perl -MCPAN -e shell
cpan> install XML::Simple
cpan> install Nagios::Plugin
cpan> quit


Calling the script/plugin check-mix-server is conforming to all requirements outlined in the guidelines for Nagios plugins. Information about available parameters can be obtained by executing the script with the options --help or, to get an abbreviated version, --usage.

> check-mix-server -?
Usage: check-mix-server -H|--hostname <host> [-p|--port <port>] [ -v|--verbose ] [-t <timeout>]                                  
-?, --usage                                                                                                                     
  Print usage information                                                                                                       
-h, --help
  Print detailed help screen                                                                                                    
-V, --version
  Print version information
  Read options from an ini file. See for usage
-H, --hostname=HOST                                                                                                         
  Hostname or IP address of the mix server (required)
-p, --port=INTEGER
  Monitoring port of your mix server (default: 8080)
-t, --timeout=INTEGER
  Seconds before plugin times out (default: 15)
-v, --verbose
  Show details for command-line debugging (can repeat up to 3 times)
  • --hostname | -H: This is a necessary parameter. The IP address or the hostname has to be specified.
  • --port | -p: Port 8080 is used as the default monitoring port. If the mix configuration differs in this regard an other port may be declared using this parameter.
  • --timeout | -t Der Timeout hat Nagios-typisch den Default-Wert 15sec, kann aber problemlos auf 5sec reduziert werden.

Return Werte

Das Plugin check-mix-server prüft den Zustand des Mix-Server und die Kaskade. Wenn beide Funktionen den Zustand Ok haben, liefert auch das Plugin Ok. Tritt bei einem der beiden Tests ein Warnung oder ein kritischer Zustand auf, liefert das Plugin den Fehler. Wenn alles funktioniert:

> check-mix-server -H
MIXSERVER OK - mix is operating, first mix online

Ist der Mix-Server nicht erreichbar, liefet das Script den Return-Wert "4" und folgende Fehlermeldung:

> check-mix-server -H
MIXSERVER UNKNOWN -  An error occured while trying to connect to mix.

Für den Mix-Server werden folgende Zustände unterschieden:

Zustand Level Return Value
Mix wird initialisiert Ok 0
Mix arbeitet Ok 0
Mix ist beim restart Ok 0
segmentation fault CRITICAL 3

Für den Status der Kaskade werden folgende Zustände unterschieden:

Zustand Level Return Value
Mix initialisiert Ok 0
Mix ist mit Nachfolger/Vorgänger verbunden Ok 0
Mix Online (Kaskade arbeitetsfähig) Ok 0
Personal tools