Monit für Tintenfisch

662
Julian

Ich versuche, mit monit meinen Squid-Server zu überwachen. Ich habe Squid Server auf Raspbian Stretch mit apt-get installiert. Der Squid-Dienst wurde unter /etc/init.d/squid installiert und ich habe überprüft, ob die PID-Datei unter /var/run/squid.pid existiert.

Wenn ich noch Sudo Monit starte, starte alles was ich bekomme

There is no service named "squid" 

Ich habe monit installiert, indem ich es als root kompilierte und es wie folgt zu systemd hinzufügte: https://mmonit.com/wiki/Monit/Systemd

Hier ist meine in / etc / monitrc erstellte Monit-Datei

set daemon 60 set logfile syslog facility log_daemon set idfile /tmp/monit.id set statefile /tmp/monit.state set mailserver localhost set alert systems@abcd.net set httpd port 2812 and #use address localhost # only accept connection from localhost allow localhost # allow localhost to connect to the server and allow admin:monit # require user 'admin' with password 'monit'  check process squid with pidfile /var/run/squid.pid group proxy start program = "/etc/init.d/squid start" stop program = "/etc/init.d/squid stop" if failed host localhost port 3128 send "GET /monit-check HTTP/1.0\r\n\r\n" expect "HTTP/[0-9\.] 400 .*\r\n" for 5 cycles then restart 

Ausgabe von service squid status:

● squid.service - LSB: Squid HTTP Proxy version 3.x Loaded: loaded (/etc/init.d/squid; generated; vendor preset: enabled) Active: active (running) since Tue 2018-01-16 12:23:25 UTC; 2h 1min ago Docs: man:systemd-sysv-generator(8) Process: 24781 ExecStop=/etc/init.d/squid stop (code=exited, status=0/SUCCESS) Process: 24928 ExecStart=/etc/init.d/squid start (code=exited, status=0/SUCCESS) Main PID: 24970 (squid) CPU: 3.718s CGroup: /system.slice/squid.service ├─24968 /usr/sbin/squid -YC -f /etc/squid/squid.conf ├─24970 (squid-1) -YC -f /etc/squid/squid.conf ├─24971 (logfile-daemon) /var/log/squid/access.log ├─24984 (pinger) └─25378 (basic_ncsa_auth) /etc/squid/squid_passwd  Jan 16 12:23:24 raspberrypi systemd[1]: Starting LSB: Squid HTTP Proxy version 3.x... Jan 16 12:23:25 raspberrypi squid[24968]: Squid Parent: will start 1 kids Jan 16 12:23:25 raspberrypi squid[24968]: Squid Parent: (squid-1) process 24970 started Jan 16 12:23:25 raspberrypi squid[24928]: Starting Squid HTTP Proxy: squid. Jan 16 12:23:25 raspberrypi systemd[1]: squid.service: PID file /var/run/squid.pid not readable (yet?) after start: No sJan 16 12:23:25 raspberrypi systemd[1]: squid.service: Supervising process 24970 which is not our child. We'll most likeJan 16 12:23:25 raspberrypi systemd[1]: Started LSB: Squid HTTP Proxy version 3.x. 
0
Die Fehlermeldung scheint Squid als Dienst zu wollen. Funktioniert der Service-Tintenfisch-Status? Sie sollten dies als root-Benutzer oder über sudo tun. mvw vor 6 Jahren 0
Der Service scheint gut zu funktionieren, die Ausgabe wurde oben aktualisiert Julian vor 6 Jahren 0

0 Antworten auf die Frage