Benutzer-Werkzeuge

Webseiten-Werkzeuge


monitoringunipager

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Letzte Überarbeitung Beide Seiten der Revision
monitoringunipager [2018/01/16 14:47]
dh3wr
monitoringunipager [2019/09/26 16:26]
admin
Zeile 1: Zeile 1:
-====== Monitoring of Unipager Transmitters on the unipager ​itself ====== +====== Monitoring of Unipager Transmitters on the Unipager ​itself ====== 
-Ein entsprechendes Plugin für die Websocket-Schnittstelle kann unter [[https://​github.com/​rwth-afu/​UniPagerNagios|https://​github.com/​rwth-afu/​UniPagerNagios]] heruntergeladen werden.+===== Overview =====
  
-Zur Installation ​mit+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  [[monitoringnagios|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: 
 +<​file>​ 
 +# '​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$ 
 +
 +</​file>​ 
 + 
 +  * 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: 
 +<​file>​ 
 +# 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 
 +        } 
 +</​file>​ 
 + 
 +The result should be like this: 
 +{{ ::​monitoring:​nagios_json_connection_and_queue.png?​direct&​800 |}} 
 + 
 +===== Websocket Solution ===== 
 +{{:​icons:​warning.png?​direct |}}{{ :​icons:​warning.png?​direct|}}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|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. 
 +<​code>​sudo apt-get install nagios-nrpe-server</​code>​ 
 + 
 +Zur Installation ​des Check-Plugins zunächst das Repository herunterladen:​ 
 +<​code>​git clone https://​github.com/​rwth-afu/​UniPagerNagios.git</​code>​. 
 + 
 +==== C++-Version ==== 
 +Mit
 <​code>​ <​code>​
-git clone https://​github.com/​rwth-afu/​UniPagerNagios.git 
 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 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+cd UniPagerNagios/cplusplus
 make make
 </​code>​ </​code>​
Zeile 19: Zeile 85:
 </​code>​ </​code>​
  
 +==== 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.
  
-Anschließend den Nagios ​NRPE-Server installieren,​ siehe auch  +==== Generelle Einstellungen für NRPE ==== 
-<​code>​sudo apt-get install nagios-nrpe-server</​code>​ +Die Datei ''​/​etc/​nagios/​nrpe.cfg'' ​entsprechen anpassen, insbesondere:​
- +
-Die Datei ///​etc/​nagios/​nrpe.cfg// entsprechen anpassen, insbesondere:​+
 <​code>​allowed_hosts=127.0.0.1,​44.225.x.y</​code>​ <​code>​allowed_hosts=127.0.0.1,​44.225.x.y</​code>​
  
-Die Datei ///​etc/​nagios/​nrpe.d/​check_unipager.cfg// erstellen mit Inhalt+Die Datei ''​/​etc/​nagios/​nrpe.d/​check_unipager.cfg'' ​erstellen mit Inhalt
 <​code>​sudo nano /​etc/​nagios/​nrpe.d/​check_unipager.cfg</​code>​ <​code>​sudo nano /​etc/​nagios/​nrpe.d/​check_unipager.cfg</​code>​
 <​file>​command[check_unipager]=/​usr/​lib/​nagios/​plugins/​check_unipager -H localhost</​file>​ <​file>​command[check_unipager]=/​usr/​lib/​nagios/​plugins/​check_unipager -H localhost</​file>​
  
-ACHTUNG: Nur bei Zugriff von //localhost// aus braucht man ab der Version 0.7.1 von [[unipager|UniPager]] kein Passwort.+ACHTUNG: Nur bei Zugriff von ''​localhost'' ​aus braucht man ab der Version 0.7.1 von [[unipager|UniPager]] kein Passwort.
  
 Dann den nagios-nrpe-server neu starten: Dann den nagios-nrpe-server neu starten:
 <​code>​service nagios-nrpe-server restart</​code>​ <​code>​service nagios-nrpe-server restart</​code>​
  
-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 Hostnamen ​//c9000.db0sda.ampr.org.cfg// und dem Inhalt+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 Hostnamen''​c9000.db0sda.ampr.org.cfg'' ​und dem Inhalt
 <​file>​ <​file>​
 define host{ define host{
Zeile 58: Zeile 124:
  
 Die hostgroup, host_name, alias und IP müssen natürlich angepasst werden. Einmal nagios neustarten und schon wird der Status überwacht. 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.txt · Zuletzt geändert: 2019/09/26 16:37 von dh3wr