Benutzer-Werkzeuge

Webseiten-Werkzeuge


monitoringunipager

Dies ist eine alte Version des Dokuments!


Monitoring of Unipager Transmitters on the Unipager itself

Overview

There are three variantes of Nagios plugins available.

  • Solution with JSON Status output of Unipager directly (since Version 1.0.0)
  • Websocket based with C++ programm
  • Websocket based with Python programm

Also Daniel Dibbets DL6FZ provided a Template for Zabbix. See below for more info.

If you have already Unipager V 1.0.0 or newer installed, the JSON output solution is highly recommended due to performance issues.

Up-to-date Solution with JSON Output

This approach uses the same check_http_json Nagios plugin as here. For further information on installation refere to this site. No nagios-nrpe-server is needed (although it makes sense to use it for temperature monitoring, disk space, etc.)

Add to your commands.cfg the following lines:

# 'check_unipager_connected' command definition
define command{
        command_name    check_unipager_connected
        command_line    /usr/lib/nagios/plugins/check_http_json -H '$HOSTNAME$' -P $ARG1$ -p status -Q "connected,True"
}

# 'check_unipager_queue' command definition
define command{
        command_name    check_unipager_queue
        command_line    /usr/lib/nagios/plugins/check_http_json -H '$HOSTNAME$' -P $ARG1$ -p status -w queue,$ARG2$ -c queue,$ARG3$
}
  • ARG1: Port of the HTTP Server of Unipager, default is 8073
  • ARG2: Number of POCSAG transmissions in queue to be exceeded for status warning
  • ARG3: Number of POCSAG transmission in queue to be exceeded for status critical

Create a service description for the new commands:

# Define a service to check if unipager is connected to a Node
define service{
        use                             generic-service-rwthafu
        host_name                       c9000.db0sda.ampr.org
        service_description             UniPager Connection to DAPNET Core
        check_command                   check_unipager_connected!8073
        }

# Define a service to check if unipager queue is too full
define service{
        use                             generic-service-rwthafu
        host_name                       c9000.db0sda.ampr.org
        service_description             UniPager Queue
        check_command                   check_unipager_queue!8073!100!150
        }

The result should be like this:

Websocket Solution

The websocket methods are superseeded by the JSON method. Please use the new one. The following documentation is for historical reasons only.

Ein entsprechendes Plugin für die Websocket-Schnittstelle kann unter https://github.com/rwth-afu/UniPagerNagios heruntergeladen werden. Es gibt 2 Varianten:

  • C++ Version (Viele Abhängigkeiten)
  • Pyhton2 Version (Einfache Installation)

Dazu muss der Nagios NRPE-Server installiert werden.

sudo apt-get install nagios-nrpe-server

Zur Installation des Check-Plugins zunächst das Repository herunterladen:

git clone https://github.com/rwth-afu/UniPagerNagios.git

.

C++-Version

Mit

sudo apt-get install libssl-dev libboost-dev libjson-spirit-dev libboost-system-dev libboost-coroutine-dev libboost-context-dev libboost-thread-dev libboost-program-options-dev
cd UniPagerNagios/cplusplus
make

das Programm kompilieren und die gebaute Datei build/unipagernagios mittels

sudo cp ./build/unipagernagios /usr/lib/nagios/plugins/check_unipager

ins Zielverzeichnis kopieren. Dann noch dem Benutzer root zuweisen, sowie ausführbar machen

sudo chown root:root /usr/lib/nagios/plugins/check_unipager
sudo chmod 755 /usr/lib/nagios/plugins/check_unipager

Pyhton2-Version

There is in the same Git-repository a pyhton2 version to do the same. You can find the code in python/check_unipager . The setup is almost the same as for the C++ version. As this method is overseeded by the JSON approach, there is no further documentation here for the moment.

Generelle Einstellungen für NRPE

Die Datei /etc/nagios/nrpe.cfg entsprechen anpassen, insbesondere:

allowed_hosts=127.0.0.1,44.225.x.y

Die Datei /etc/nagios/nrpe.d/check_unipager.cfg erstellen mit Inhalt

sudo nano /etc/nagios/nrpe.d/check_unipager.cfg
command[check_unipager]=/usr/lib/nagios/plugins/check_unipager -H localhost

ACHTUNG: Nur bei Zugriff von localhost aus braucht man ab der Version 0.7.1 von UniPager kein Passwort.

Dann den nagios-nrpe-server neu starten:

service nagios-nrpe-server restart

Auf dem Haupt-Nagios-Server kann man dann mit den NRPE-Plugin den Status abfragen. Dazu erstellt man eine Datei in /etc/nagios3/conf.d mit z.B. dem Hostnamenc9000.db0sda.ampr.org.cfg und dem Inhalt

define host{
        use                     generic-host            ; Name of host template to use
        host_name               c9000.db0sda.ampr.org
        alias                   c9000.db0sda
        address                 44.225.164.26
        hostgroups              db0sda, ssh-servers, raspberrypi
        }


# Define a service to check if rustpager is connected to a Core
define service{
        use                     generic-service
        host_name               c9000.db0sda.ampr.org
        service_description     UniPager Connection to DAPNET Core
        check_command           check_nrpe_1arg!check_unipager
        }

Die hostgroup, host_name, alias und IP müssen natürlich angepasst werden. Einmal nagios neustarten und schon wird der Status überwacht.

Zabbix Template for Unipager

Daniel Dibbets DL6FZ provided a template for Zabbix to monitor the unipager program.

6 Items are observed:

  • Connected
  • Master
  • Queue
  • Version
  • Calls RX
  • Calls TX

3 Triggers are integrated:

  • Not Connected
  • Queue > 500
  • Queue > 1000

Data is gathered from Status JSON (http:{HOST.NAME}:8073/status) Zabbix will build history and delta information concerning the numberical values.

monitoringunipager.1569508009.txt.gz · Zuletzt geändert: 2019/09/26 16:26 von admin