7 votes

Monit: how do you stop monit from running the exec statement every time the test fails?

The behaivor of 'exec' action (with repeating each time) changed from Monit version 5.16 https://mmonit.com/monit/changes/ The exec action is now executed only once on state change, the same ...
Dmitry Dubovitsky's user avatar
5 votes

monit send email does not work

You can use a remote mail server. Here are my sample configs which worked. It sends alerts to my gmail through a remote smtp server. I think you still use Gmail as an smtp relay as well. #configure ...
David Okwii's user avatar
4 votes

Why Monit does not work with my MySQL configuration file?

On Ubuntu 20.04 LTS, I found that pid-file and socket were commented out in /etc/mysql/mysql.conf.d/mysqld.cnf. I uncommented those two lines then restarted mysql with service mysql restart and monit ...
Tyler's user avatar
  • 211
4 votes

Monit fails to start process

Fixed. This doesn't work start program = "/etc/init.d/java-service start" This did work start program = "/bin/bash -c '/etc/init.d/java-service start'" Monit Documentation. https://mmonit.com/wiki/...
user371087's user avatar
4 votes

monit Sendmail: Cannot switch to SSL

On Ubuntu 20.04 LTS with Monit 5.26.0, I was trying to get Monit to send mail with Mailgun and the reason it wasn't working was tlsv1 should have been tls. According to this wiki page, monit 5.17 or ...
Tyler's user avatar
  • 211
4 votes
Accepted

no httpd connection for monit started from systemd

It seems you have to specify at least one between the allow and credentials directives. In my case I solved the issue simply adding the ALLOW directive SET HTTPD PORT 2812 USE ADDRESS 127.0.0.1 ...
Davide Cavestro's user avatar
4 votes

Monit, checking URL with basic Auth but username has @ in it

Monit cannot parse %40 to @ But it supports HTTP headers For example the URL: https://[email protected]:[email protected] should be converted to Authorization: Basic ...
Hieu Huynh's user avatar
4 votes

Forbidden Invalid CSRF Token +monit

monit implement double-submit cookie pattern to protect from csrf attacks, it send a cookie called securitytoken with post requests, but up to (at least) version 1.20 didn't take into account the ...
Alex's user avatar
  • 141
4 votes

Monit can't detect MySQL

Tyler answers on another question about this: On Ubuntu 20.04 LTS, I found that pid-file and socket were commented out in /etc/mysql/mysql.conf.d/mysqld.cnf. I uncommented those two lines then ...
Jonas WebDev's user avatar
4 votes
Accepted

How do I find the PID file for a process given the PID number?

There is no such thing. A process may not even have a PID file. It is not required for a process to create one. If a process creates a PID file it may do so anywhere that it has permission to write to....
Michael Hampton's user avatar
3 votes

monit send email does not work

On Ubuntu 20.04 LTS with Monit 5.26.0, I was trying to get Monit to send mail with Mailgun and the reason it wasn't working was tlsv1 should have been tls. According to this wiki page, monit 5.17 or ...
Tyler's user avatar
  • 211
3 votes

Syntax error: when using "check program" in monit

The functionality to use parameters in the command was first introduced in Monit 5.7; https://mmonit.com/monit/changes/ You need to upgrade to a newer version of Monit.
user3445590's user avatar
3 votes
Accepted

Restart process using monit, when the checksum of a file changed

Simply put action restart check process prosody with pidfile /var/run/prosody/prosody.pid depends certificate_file start program "/etc/init.d/prosody start" stop program "/etc/init.d/...
DevOps's user avatar
  • 730
3 votes
Accepted

monit - "else if succeeded then exec"

Succeed action is only executed after a fail event is solved (i.e. when going from state fail to state success), not when things behave as expected.
DevOps's user avatar
  • 730
3 votes

monit restart process periodically

I don't feel like this is the right way to use monit. Anyway, you can try the following snippet of configuration: check process dummy with pidfile /var/lib/dummy.pid start program = "/path/to/...
Khaled's user avatar
  • 36.9k
3 votes
Accepted

monit, let's encrypt, and file permissions

Monit is quite strange in that it expects the private key and TLS certificate chain to be concatenated into a single file specified by pemfile, so you can't use certificates retrieved with certbot ...
Michael Hampton's user avatar
3 votes

monit, let's encrypt, and file permissions

As of Monit v5.27.0, released 2020-06-29, you can now pass in pemchain and pemkey parameters pointing to the separate files that Let's Encrypt generates. Quoting from the documentation: As an ...
JoeNahmias's user avatar
3 votes
Accepted

linux : monit : iptables

For CentOS 6 and earlier you're correct about it using iptables. CentOS 7 uses firewalld. To monitor either using Monit you can use PROGRAM-STATUS-TEST. There are several methods to ascertain the ...
kenlukas's user avatar
  • 3,206
3 votes
Accepted

Monit "can't find filesystem"

Monit requires the actual mountpoint to be specified. If you're trying to get the root filesystem, you should use /. check device root with path / if SPACE usage > 85% then alert
ewwhite's user avatar
  • 198k
2 votes

Disable Monit alerts when PID changed

Another option is disabling alerts on set alert [email protected] not on { instance, action } This way you will not receive alerts for monit restart (instance) nor alerts for all services start/...
timurb's user avatar
  • 347
2 votes

monitoring nfs with monit

I’m directly using the df test without a specific script: check program nfs-var with path "/bin/df -t nfs4 /var" if status != 0 then alert if status = 1 then exec "/bin/mount /var"
Alarig's user avatar
  • 21
2 votes

How to find the .pid file for a given process

Another approach I took: I have a database server running in embedded mode, and the data are within the containing application's directory. The database has something like a .pid file, but it calls ...
Ondra Žižka's user avatar
2 votes

Make monit wait longer before thinking something is dead

The current version of Monit (5.16) supports a timeout for the start scripts with the syntax: <START | STOP | RESTART> [PROGRAM] = "program" [[AS] UID <number | string>] [[AS] ...
jeteon's user avatar
  • 160
2 votes

monit hostname is always localhost

In monitrc edit/add the line: check system vps1.sender.com and vps1.sender.com will be shown as the host on the email
omushpapa's user avatar
  • 121
2 votes

Monit — Daemonize non-daemon process?

Easy way is to deamonize your non-deamon proces. That is, create shell script: #!/bin/sh /usr/local/bin/your_program < /dev/null & And then use that script as a daemon to run. It will start ...
Matija Nalis's user avatar
  • 2,508
2 votes
Accepted

Monitoring zabbix server (itself) externally

So here's what I ended up doing: Wrote a fairly simple Python script which uses pyzabbix to interrogate Zabbix for the set of "triggers" currently failing (see snippet below). This runs periodically ...
sxc731's user avatar
  • 317
2 votes
Accepted

Monit is reporting low memory use

memory use isn't 14Gb. That adds in filesystem cache memory. See the following website for more info. Short info is Linux will use all memory on the system to make commonly used files quickly ...
Mike's user avatar
  • 22.5k
2 votes

Debian: How to upgrade MONIT correctly?

You should almost never try mixing and matching a package installed via apt with packages you manually install form a tar.gz or some other 3rd party package format. Debian basically freezes it he ...
Zoredache's user avatar
  • 132k
2 votes
Accepted

Does monit restart service if service was told to stop via systemd?

Monit will apply logic set, so if you tell monit to start PostgresSQL if down, monit will try to start it up, indefirently from stop method (legit, crash etc..) During maintenance, it is best to ...
DevOps's user avatar
  • 730
2 votes

Centos Monit ulimit not working

I needed to set ulimit -n 500000 in the init file.
jaseUK's user avatar
  • 173

Only top scored, non community-wiki answers of a minimum length are eligible