Maintenance

From JonDonym Wiki
(Difference between revisions)
Jump to: navigation, search
 
(13 intermediate revisions by one user not shown)
Line 1: Line 1:
[[Category:MixBetreiberLinux]] [[Category:MixBetreiberFreeBSD]]
+
[[Category:MixOpLinux]] [[Category:MixOpFreeBSD]]
&nbsp;&nbsp;[[tahoe-lafs-setup-de|<- zurück]] | [[MixBetreiber|Übersicht]] | [[Bearbeitung von Abuses|weiter ->]]
+
<iimg>[[Maintenance]]![[Image:en2.png]]</iimg><iimg>[[Monitoring_mit_Nagios]]![[Image:de2.png]]</iimg>&nbsp;&nbsp;&nbsp;[[Tahoe-lafs-setup|<- prev]] | [[MixOperatorTutorials|Content]] | [[In Case of Inquiries ...|next ->]]
  
== Monitoring des Mix-Servers mit Nagios ==
+
== Mix server monitoring using Nagios ==
Für das Monitoring des Mix-Servers steht ein Nagios-Plugin zur Verfügung. Es nutzt die Monitoring-Schnittstelle des Mix-Servers. Diese Schnittstelle ist im Mix-Server zu aktivieren. Bei der [[Mix Installation (Sourcen für Linux)|Installation der Mix-Software]] ist die Option "''--enable-server_monitoring''" zu aktivieren und in der [[Mix-Server_Konfiguration]] ist im ''Step 2'' die Monitoring-Schnittstelle (Netzwerk Interface und Port) zu konfigurieren.
+
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 [[Mix_Installation_for_other_Linux_based_systems|installation of the mix software]] the option "''--enable-server_monitoring''" has to be added. Additonally, while [[Mix_Server_Configuration_Guide|configuring the mix server]] in ''Step 2'' the monitoring interface (i.e. the network interface and the port) has to be specified.
  
Das Nagios-Plugin findet man in den Sourcen des Mix im Unterverzeichnis ''misc/nagios'' oder es kann hier herunter geladen werden [https://svn.jondos.de/svn/proxytest/proxytest/branches/stable/misc/nagios/check-mix-server check-mix-server]. Das Script ist im Nagios Plugin Verzeichnis zu speichern und die Berechtigungen sind als ausführbar zu setzen.
+
The Nagios plugin may be found in the mix source directory in the subdirectory ''misc/nagios'' or it can be downloaded from [https://svn.jondos.de/svn/proxytest/proxytest/branches/stable/misc/nagios/check-mix-server here]. The script has to be saved within the Nagios plugin directory and must be made executable.
  
Das Script ''check-mix-server'' ist in Perl geschrieben. Es nutzt die Perl-Module ''Nagios::Plugin'' und ''XML::Simple''. Diese Module sind zusätzlich zu installieren. Man kann die von der Distribution zur Verfügung gestellten Module nutzen und mit dem Paketmanager installieren. Für Debian/Ubuntu tut ''aptitude'' alles nötige:
+
This script, ''check-mix-server'', is written in Perl and is using the ''Nagios::Plugin'' and ''XML::Simple'' modules. 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:
 
  <code>> sudo aptitude install libxml-simple-perl libnagios-plugin-perl</code>
 
  <code>> sudo aptitude install libxml-simple-perl libnagios-plugin-perl</code>
  
Alternativ kann man die Perl-Module aus dem CPAN installieren:
+
As an alternative the required modules may be installed from the CPAN:
  
 
  <code>> sudo perl -MCPAN -e shell
 
  <code>> sudo perl -MCPAN -e shell
Line 19: Line 19:
  
 
==== Usage ====
 
==== Usage ====
Der Aufruf des Plugin ''check-mix-server'' erfüllt die Anforderungen der Guidelines für Nagios-Plugins. Informationen zu den Aufruf-Parametern erhlält man mit den Optionen ''--help'' oder in Kurzform mit ''--usage''.
+
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''.
 
  <code>> check-mix-server -?
 
  <code>> check-mix-server -?
 
  Usage: check-mix-server -H|--hostname <host> [-p|--port <port>] [ -v|--verbose ] [-t <timeout>]                                   
 
  Usage: check-mix-server -H|--hostname <host> [-p|--port <port>] [ -v|--verbose ] [-t <timeout>]                                   
Line 40: Line 40:
 
   Show details for command-line debugging (can repeat up to 3 times)</code>
 
   Show details for command-line debugging (can repeat up to 3 times)</code>
  
* '''--hostname''' | '''-H''' ist ein notwendiger Parameter. Es ist die IP-Adresse oder der Hostname anzugeben.  
+
* '''--hostname''' | '''-H''': This is a necessary parameter. The IP address or the hostname has to be specified.
* '''--port''' | '''-p''' Als Monitoring.Port wird standardmäßig Port 8080 genutzt. Wenn die Mix-Konfiguration von diesem Standard abweicht kann ein anderer Port mit diesem Parameter angegeben werden.  
+
* '''--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.
+
* '''--timeout''' | '''-t''': The timeout has as a default value 15 sec but can be changed without problem using this parameter (e.g. down to 5 sec).
  
==== Return Werte ====
+
==== Return Values ====
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:
+
The plugin/script ''check-mix-server'' checks the state of the mix server and its respective cascade. If both are in the state ''OK'' the plugin returns ''OK'' as well. If there occurs a warning or a critical state during one of the tests the plugin is returning the error.
 +
 
 +
Example 1: If everything is working as it should:
 
  <code>> check-mix-server -H 123.123.123.123
 
  <code>> check-mix-server -H 123.123.123.123
 
  MIXSERVER OK - mix is operating, first mix online</code>
 
  MIXSERVER OK - mix is operating, first mix online</code>
  
Ist der Mix-Server nicht erreichbar, liefet das Script den Return-Wert ''"4"'' und folgende Fehlermeldung:
+
Example 2: If the mix server is not reachable the script/plugin returns the value ''"4"'' and the following error message:
 
  <code>> check-mix-server -H 123.123.123.123
 
  <code>> check-mix-server -H 123.123.123.123
 
  MIXSERVER UNKNOWN -  An error occured while trying to connect to mix.</code>
 
  MIXSERVER UNKNOWN -  An error occured while trying to connect to mix.</code>
  
Für den Mix-Server werden folgende Zustände unterschieden:
+
Concerning the mix server the following states are distinguished:
 
{| class="wikitable" border="1" cellpadding="4" style="text-indent:4px; margin:0em 1em 1em 0;  border:1px #666 solid; border-collapse:collapse;"
 
{| class="wikitable" border="1" cellpadding="4" style="text-indent:4px; margin:0em 1em 1em 0;  border:1px #666 solid; border-collapse:collapse;"
  !Zustand
+
  !State
 
  !Level
 
  !Level
 
  !Return Value
 
  !Return Value
 
  |-
 
  |-
  |Mix wird initialisiert
+
  |Mix is getting initialized
  |Ok
+
  |OK
 
  |0
 
  |0
 
  |-
 
  |-
  |Mix arbeitet
+
  |Mix is working
  |Ok
+
  |OK
 
  |0
 
  |0
 
  |-
 
  |-
  |Mix ist beim restart
+
  |Mix is restarting
  |Ok
+
  |OK
 
  |0
 
  |0
 
  |-
 
  |-
Line 76: Line 78:
 
  |}
 
  |}
  
Für den Status der Kaskade werden folgende Zustände unterschieden:
+
Regarding the cascade the following states are available:
 
{| class="wikitable" border="1" cellpadding="4" style="text-indent:4px; margin:0em 1em 1em 0;  border:1px #666 solid; border-collapse:collapse;"
 
{| class="wikitable" border="1" cellpadding="4" style="text-indent:4px; margin:0em 1em 1em 0;  border:1px #666 solid; border-collapse:collapse;"
  !Zustand
+
  !State
 
  !Level
 
  !Level
 
  !Return Value
 
  !Return Value
 
  |-
 
  |-
  |Mix initialisiert
+
  |Mix initialized
  |Ok
+
  |OK
 
  |0
 
  |0
 
  |-
 
  |-
  |Mix ist mit Nachfolger/Vorgänger verbunden
+
  |Mix is connected with predecessor/successor
  |Ok
+
  |OK
 
  |0
 
  |0
 
  |-
 
  |-
  |Mix Online  (Kaskade arbeitetsfähig)
+
  |Mix is online (the cascade may be used)
  |Ok
+
  |OK
 
  |0
 
  |0
 
  |}
 
  |}

Latest revision as of 14:08, 12 April 2011

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 modules. 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

Usage

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
--extra-opts=[section][@file]                                                                                                   
  Read options from an ini file. See http://nagiosplugins.org/extra-opts 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: The timeout has as a default value 15 sec but can be changed without problem using this parameter (e.g. down to 5 sec).

Return Values

The plugin/script check-mix-server checks the state of the mix server and its respective cascade. If both are in the state OK the plugin returns OK as well. If there occurs a warning or a critical state during one of the tests the plugin is returning the error.

Example 1: If everything is working as it should:

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

Example 2: If the mix server is not reachable the script/plugin returns the value "4" and the following error message:

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

Concerning the mix server the following states are distinguished:

State Level Return Value
Mix is getting initialized OK 0
Mix is working OK 0
Mix is restarting OK 0
segmentation fault CRITICAL 3

Regarding the cascade the following states are available:

State Level Return Value
Mix initialized OK 0
Mix is connected with predecessor/successor OK 0
Mix is online (the cascade may be used) OK 0
Personal tools