Page 1 of 1

[gelöst] monit: Problem mit lighttdp Konfig

Posted: 2010-10-05 15:16
by native
Ich habe Monit auf einem Server installiert und möchte (u.a.) lighttpd damit überwachen. Lighty ist so konfiguriert, dass nur SSL Verbindungen akzeptiert werden. Meine Monit-Konfig dazu sieht so aus:

Code: Select all

check process lighttpd with pidfile /var/run/lighttpd.pid
group lighttpd
start program = "/etc/init.d/lighttpd start"
stop program = "/etc/init.d/lighttpd stop"
if failed host "https://mail.example.com" port 443 type tcpssl protocol http then restart
if 5 restarts within 5 cycles then timeout
Das funktioniert allerdings nicht, monit meldet den Service als nicht laufend. Tipps, wie ich das zum Laufen bekomme?

Re: monit: Problem mit lighttdp Konfig

Posted: 2010-10-05 20:10
by rudelgurke
Hmmm - Syntax Error ?

Code: Select all

check process lighttpd with pidfile /var/run/lighttpd.pid
group lighttpd
start program = "/etc/init.d/lighttpd start"
stop program = "/etc/init.d/lighttpd stop"
if failed host mail.example.com port 443 type tcpssl protocol http then restart
if 5 restarts within 5 cycles then timeout
"https://mail.example.com" wird wohl als ein Hostname erkannt, nicht als protokoll:hostname - Port und Protokoll übergibst du ja ohnehin.
Schau mal in /var/log/messages bzw. die Alert Mails rein - da dürfte Monit melden wo es hängt. :)

Re: monit: Problem mit lighttdp Konfig

Posted: 2010-10-05 20:20
by native
War tatsächlich ein Syntax error, so konnte es den Host nicht auflösen. Mit der korrigierten Syntax bekomme ich keinen Fehler in den Logfiles, die Alert Mail sagt mir aber:

Code: Select all

'lighttpd' failed protocol test [HTTP] at INET[mail.example.com:443] via TCPSSL
.
Dazu eine Idee?

Re: monit: Problem mit lighttdp Konfig

Posted: 2010-10-05 20:32
by rudelgurke
Zu TCPSSL noch den Typ mit angeben ?

TCPSSL SSLAUTO oder TLSV1 oder ... siehe Manpage :)

und evtl. die md5 checksum vom Zertfikat. Etwas wie:

... TYPE TCPSSL TLSV1 CERTMD5 AB-AB-AB...

Läuft dass und soll Lighty noch PHP Seiten oder ähnliches liefern kann noch ein Request abgesetzt werden. Das Ganze dann:

test.php

Code: Select all

<?php
print ("PHP funzt");
?>
Einmal einen Request darauf und eine Checksum erstellen. Dann:

... TYPE TCPSSL TLSV1 WITH CERTMD5 ... REQUEST /tests/test.php with CHECKSUM ...

Sonst, bei Lighty in die Logs schauen was da von Monit als Request abgesetzt wird.

Re: monit: Problem mit lighttdp Konfig

Posted: 2010-10-08 09:38
by native
Guter Tipp mit den Lighttpd log files: Monit bekommt einen Status 401. Das Verzeichnis ist geschützt, aber erreichbar.

Ich habe es wie folgt versucht:

Code: Select all

if failed host "user:pass0@mail.example.com" port 443 type tcpssl tlsv1 protocol http then restart
Geht aber nicht, Monit bekommt einen Status 401.

Ich habe versucht, den Host wegzulassen und nur zu prüfen, ob Port 443 antwortet, ging aber auch nicht.

Tipps dazu?

Re: monit: Problem mit lighttdp Konfig

Posted: 2010-10-08 09:41
by native
Hab's: auch eine URL kann geprüft werden:

Code: Select all

if failed url https://user:pass@mail.example.com port 443 type tcpssl tlsv1 protocol http then restart