Monit - cannot start Monit service or monit reload - "cannot signal the monit daemon process"

220 Views Asked by At

running monit 5.30 on Rocky 8.7

Linux vpn-uk2 4.18.0-372.9.1.el8.x86_64

monit control file syntax is valid,

heres control file

set daemon 5 # Poll at 5-second intervals
set logfile /var/log/monit.log
set eventqueue basedir /home/monit/tmp slots 1000
set mmonit http://monit:monit@server1:19840/collector

set httpd port 19841
    allow localhost
    allow 127.0.0.1
    allow monit:monit

check filesystem vpn-uk2-/ with path /
    if space usage > 95% then alert
    if space usage > 90% then alert
    if space usage > 85% then alert
    if space usage > 80% then alert
    if space usage > 75% then alert

if I try to start systemd monit service, or run "monit reload" as monit user, I get

[2022-11-24T06:57:22+0000] error    : Cannot connect to [localhost]:19841 -- Cannot assign requested address
[2022-11-24T06:57:27+0000] info     : Reinitializing monit daemon
[2022-11-24T06:57:27+0000] error    : Cannot signal the monit daemon process -- Operation not permitted

selinux is turned off.

Not sure what the error msg means, logs are not providing any meaningful information.

whats weird is that I have same exact monit config deployed via Saltstack to other hosts, same OS, etc, but not getting this error on other hosts

(nothing in kernel log either)

2

There are 2 best solutions below

0
perfecto25 On

I deleted .monit.pid file from the service accounts home dir, restarted service and now its up.

/home/monit/.monit.pid

0
lutzmad On

Back to your question

Cannot connect to [localhost]:19841 -- Cannot assign requested address

The monitor is not able to find an address to connect to.

set httpd port 19841
    use address 127.0.0.1
    allow localhost
    allow 127.0.0.1
    allow monit:monit

Try to add "use address" and the local host address and restart the monit process.

A suggestion only, Lutz