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
...
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 ...
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 ...
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/...
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 ...
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
...
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 ...
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 ...
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 ...
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....
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 ...
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.
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/...
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.
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/...
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 ...
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 ...
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 ...
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
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/...
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"
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 ...
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] ...
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
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 ...
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 ...
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 ...
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 ...
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 ...
2
votes
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
monit × 394monitoring × 114
linux × 76
ubuntu × 40
mysql × 17
centos × 16
debian × 15
apache-2.2 × 14
nginx × 11
system-monitoring × 11
daemon × 8
node.js × 7
process × 7
postfix × 6
bash × 6
centos7 × 6
nagios × 6
service × 6
ruby × 6
php × 5
unix × 5
ubuntu-14.04 × 5
log-files × 5
ubuntu-12.04 × 5
pid × 5