[Eisfair] check_mk vs. nrpe?

Kay Martinen kay at martinen.de
Do Mär 14 12:21:25 CET 2019


Am 14.03.2019 um 11:04 schrieb Ansgar Püster:
> 
> Peter hatte ja in der Antwort (als PM) auf deinen
> Beitrag Jürgen bzw. mich genannt.

Ja. Das ihr beide im CC standet sah ich jetzt erst. Arbeitet denn einer
von euch an etwas davon?


> Ich vermute, dass du check_MK als Server nutzt und
> versuchst das Eisfair-Paket nrpe als Agent zu nutzen.

Das ist Richtig. Die RAW-Edition 1.4

> Ich habe noch nie check_MK (auch nicht die kostenlose
> RAW Edition) als Check_MK-Server eingesetzt.
> Vor langer Zeit habe ich mal einen Check_MK-Agent
> für Windows mit Nagios als Server genutzt.

Und das hat offenbar funktioniert, trotz unterschiedlicher Portnummern?
Ich weiß inzwischen das man die auf beiden Seiten anpassen kann.

Kann sein das es veraltet ist aber m.W. ist Check_MK nur ein WebUI
Frontend das sowohl für nagios als auch icinga passt die im grunde das
gleiche machen aber geforkte projekte sind. Die aber zueinander
kompatibel sein wollen/sollen.

> Inhaltlich:
> Meines Wissens unterstützt Check_MK-Server _nicht_
> das nagios-nrpe-plugin. Statt dessen existiert ein
> Check_MK-Agent mit dem Namen check_mk_agent.

Existiert und "kann" wohl am meisten (Werte + Inventory u.s.w.) und ist
außerdem der Default den man aber IMHO nur umständlich raus
konfigurieren kann.

Es gibt im Server auch einiges mit Nagios-Bezug aber das naheliegendste
schien 'mrpe' zu sein der wohl genau so eine brücke zu sein scheint.
Ich hab allerdings noch nicht raus bekommen wie ich das korrekt einsetze.

> 
> Dieser Agent ist m.W. auch Bestandteil der
> RAW Edition.

Da sind viele dabei! .deb .rpm und ein noarch ganz oben in der liste.

> Die Installation des .rpm Paketes ist auch für
> "Exotische Linux-Distributionen" (siehe Webseite)
> möglich!

Dann brauche ich vermutlich 'alien' oder etwas anderes. Ich hab noch nie
versucht fremde oder quellpakete in einem EIS zu installieren. Von
Debian erinnere ich das die regelmäßig an der Paketverwaltung vorbei
gingen und langfristig probleme erzeugen.

> Ohne die "lange Fehlermeldung" und ggf. die Debug-Ausgaben
> (NRPE_DEBUG="yes") ist in deiner konkreten Situation
> wohl keine Analyse möglich. Siehe aber auch meine
> grundsätzlichen Bedenken oben.

Erster Versuch mit check_mk den nrpe zu erreichen (ohne debuglog) hier
die "Lange Fehlermeldung".

> Exception: Traceback (most recent call last):
> File "/omd/sites/intern/share/check_mk/web/htdocs/wato.py", line 2704, in ajax_diag_host
> result = check_mk_automation(host.site_id(), "diag-host", [hostname, _test] + args)
> File "/omd/sites/intern/share/check_mk/web/htdocs/watolib.py", line 5979, in check_mk_automation
> return check_mk_local_automation(command, args, indata, stdin_data, timeout)
> File "/omd/sites/intern/share/check_mk/web/htdocs/watolib.py", line 6012, in check_mk_local_automation
> outdata = p.stdout.read()
> File "/omd/sites/intern/share/check_mk/web/htdocs/htmllib.py", line 2930, in handle_request_timeout
> self.request_timeout())
> RequestTimeout: Your request timed out after 110 seconds. This issue may be related to a local configuration problem or a request which works with a too large number of objects. But if you think this issue is a bug, please send a crash report.

Ich verstehe nur "Timeout". Aber nicht warum.

Debuglog aktiviert und neustart von nrpe auf dem zu überwachenden Server:

> Mar 14 11:49:35 mediabox nrpe[2978]: Caught SIGTERM - shutting down...
> Mar 14 11:49:35 mediabox nrpe[2978]: Daemon shutdown
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[check_hdb1]=/usr/local/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hdb1
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[check_users]=/usr/local/nagios/plugins/check_users -w 5 -c 10
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[check_load]=/usr/local/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[check_zombie_procs]=/usr/local/nagios/plugins/check_procs -w 5 -c 10 -s Z
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[check_total_procs]=/usr/local/nagios/plugins/check_procs -w 150 -c 200
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[check_hdb2]=/usr/local/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hdb2
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[check_hdb1]=/usr/local/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hdb1
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[check_sda2]=/usr/local/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda2
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[check_sda1]=/usr/local/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda1
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[check_sdb1]=/usr/local/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sdb1
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[check_sdd1]=/usr/local/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sdd1
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[check_sdc1]=/usr/local/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sdc1
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[get_nrpe_config]=/usr/local/nagios/plugins/get_nrpe_config.sh
> Mar 14 11:49:39 mediabox nrpe[3873]: Added command[get_extended_nrpe_config]=/usr/local/nagios/plugins/get_extended_nrpe_config.sh
> Mar 14 11:49:39 mediabox nrpe[3873]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
> Mar 14 11:49:39 mediabox nrpe[3875]: Starting up daemon
> Mar 14 11:49:39 mediabox nrpe[3875]: SETUP_WAIT_CONN FOR: IPv4 address: 0.0.0.0 ((null))
> Mar 14 11:49:39 mediabox nrpe[3875]: Server listening on 0.0.0.0 port 6556.
> Mar 14 11:49:39 mediabox nrpe[3875]: SETUP_WAIT_CONN FOR: IPv4 address: :: ((null))
> Mar 14 11:49:39 mediabox nrpe[3875]: Server listening on :: port 6556.
> Mar 14 11:49:39 mediabox nrpe[3875]: Listening for connections on port 6556
> Mar 14 11:49:39 mediabox nrpe[3875]: Allowing connections from: 192.168.1.10

Zweiter versuch den nrpe zu erreichen:

> Exception: Traceback (most recent call last):
> File "/omd/sites/intern/share/check_mk/web/htdocs/wato.py", line 2704, in ajax_diag_host
> result = check_mk_automation(host.site_id(), "diag-host", [hostname, _test] + args)
> File "/omd/sites/intern/share/check_mk/web/htdocs/watolib.py", line 5979, in check_mk_automation
> return check_mk_local_automation(command, args, indata, stdin_data, timeout)
> File "/omd/sites/intern/share/check_mk/web/htdocs/watolib.py", line 6012, in check_mk_local_automation
> outdata = p.stdout.read()
> File "/omd/sites/intern/share/check_mk/web/htdocs/htmllib.py", line 2930, in handle_request_timeout
> self.request_timeout())
> RequestTimeout: Your request timed out after 110 seconds. This issue may be related to a local configuration problem or a request which works with a too large number of objects. But if you think this issue is a bug, please send a crash report.

Es taucht hier nicht auf aber Port 6556 IST konfiguriert in check_mk.
Steht im Fenster neben dieser Meldung.


Ausgaben in /var/log/messages (nrpe-Debug=Yes)

> Mar 14 11:52:17 mediabox nrpe[5330]: CONN_CHECK_PEER: checking if host is allowed: 192.168.1.10 port 62122
> Mar 14 11:52:18 mediabox nrpe[5330]: Connection from 192.168.1.10 port 62122
> Mar 14 11:52:18 mediabox nrpe[5330]: is_an_allowed_host (AF_INET): is host >192.168.1.10< an allowed host >192.168.1.10<
> Mar 14 11:52:18 mediabox nrpe[5330]: is_an_allowed_host (AF_INET): host is in allowed host list!
> Mar 14 11:52:18 mediabox nrpe[5330]: Host address is in allowed_hosts

Mehr kommt da nicht. Spätere meldungen gehören nicht mehr dazu (cron u.a.)

Status des nrpe abgefragt, zwei PIDs gemeldet. Diese sind:

> mediabox # ps -axu |grep 5330
> nagios    5330  0.0  0.3   5760  3136 ?        SN   11:52   0:00 /usr/bin/nrpe -c /etc/nagios/nrpe.cfg -d
> mediabox # ps -axu |grep 3875
> nagios    3875  0.0  0.2   5628  2280 ?        SNs  11:49   0:00 /usr/bin/nrpe -c /etc/nagios/nrpe.cfg -d

Der nrpe ist auf Standalone konfiguriert. Eigentlich sollte er nur
einmal laufen, denke ich. Nur bei der alternative (xinetd) könnte er pro
Aufruf ein 2. mal starten. Oder startet der pro CPU einen (hier: Atom
Dualcore)?

Edit: Es scheint als ob der nrpe dennoch mit jedem Aufruf eine neue
instanz startet die dann auch liegen bleibt. Ob sie nach einer weile
stirbt, beendet oder zum zombie wird muß ich noch abwarten. Ein neustart
killt sie jedenfalls alle bis auf den neu gestarteten.


Kay


Mehr Informationen über die Mailingliste Eisfair