2017-01-21 Monit Summary

How weird. I just restarted Monit and it doesn’t get back up. What happened? It looks a lot like this issue.

this issue

In the log:

[CET Jan 21 13:58:14] info     : 'sibirocobombus' Monit started
[CET Jan 21 13:58:14] error    : Cannot initialize SSL server certificate handler -- error:140A90A1:SSL routines:func(169):reason(161)
[CET Jan 21 13:58:14] error    : HTTP server: Could not initialize SSL engine
[CET Jan 21 13:58:14] error    : Monit HTTP server not available

From the command line:

alex@sibirocobombus:~$ sudo monit summary
SSL read timeout error
Error connecting to the monit daemon

But then:

alex@sibirocobombus:~$ monit -V
This is Monit version 5.9
Copyright (C) 2001-2014 Tildeslash Ltd. All Rights Reserved.

Also, this hangs after a screen of output:

alex@sibirocobombus:~$ openssl s_client -debug -connect 127.0.0.1:2812
CONNECTED(00000003)
write to 0x73d350 [0x73ded0] (289 bytes => 289 (0x121))
...
0110 - 03 01 03 02 03 03 02 01-02 02 02 03 00 0f 00 01   ................
0120 - 01                                                .
^C

Uhm... Wait. I think I confused two directories. In fact what happened was that I moved the port my SSH server is listening on from the default (22) to a different one. But I had forgotten to fix my monit config file. And when I tried to fix the config file, I changed a config file in `/etc/monit/monitrc.d/` instead of the *real* config file in `/etc/monit/conf.d/`.

But it’s fixed, now (with a security-by-obscurity new port):

check process sshd with pidfile /var/run/sshd.pid
  group system
  group sshd
  start program = "/etc/init.d/ssh start"
  stop  program = "/etc/init.d/ssh stop"
  if failed host localhost port 12345 with proto ssh then restart
  if 5 restarts with 5 cycles then timeout
  depend on sshd_bin
  depend on sftp_bin
  depend on sshd_rc
  depend on sshd_rsa_key
  depend on sshd_dsa_key

...

Restarting munin now works as intended. 🙂

​#Administration ​#Debian ​#Monit