Questions tagged [monit]
monit is a free, open source process supervision tool for Unix and Linux.
102
questions with no upvoted or accepted answers
4
votes
1
answer
3k
views
How to suppress monit alert if restart successful?
We only want to be alerted if the service fails to restart. Is this possible?
That is if, on the first check the service is down then restart it and don't bother to send us an alert; but if the ...
4
votes
0
answers
285
views
Monit will not start my node js app
I have a problem with Monit that I use for monitoring of my Node.js app. I just moved from a single core machine to a multi core one. On both of them I run Ubuntu 11.10. On the old one this was ...
4
votes
0
answers
652
views
monit reporting “connection failure” when actually a “content failure”?
I have a monit rule which looks like this:
check host example.com with address example.com
if failed url http://example.com/status
content == "ok"
then alert
group example.com
But when ...
3
votes
2
answers
437
views
Pause monitorig of Monit on server update
I have a problem with monitoring services by Monit.
Monitoring works well. Too well.
When I execute system update... possibly update of MySQL or Apache etc. needs to be service down. Updating ...
3
votes
1
answer
620
views
Monit Alert with Multiple URLs
I've got a monit setup to http check several subdomains of an http server.
Currently, they are multiple check host statements that look like this:
CHECK HOST a.example.com with address 1.2.3.4
if ...
3
votes
0
answers
1k
views
mysql service status doesn't show started when it is started by monit
I installed monit on my Ubuntu 14.04 server and configured it to monitor mysql with the below config in monitrc.
check process mysqld with pidfile /var/run/mysqld/mysqld.pid
start program = "/etc/...
2
votes
1
answer
762
views
How can I make monit poll more often during a state change?
I'm using Monit to monitor various processes that need to be up and running as a group for a web site to work properly. To bring up or bring down the site, there's a definite order by which the ...
2
votes
0
answers
59
views
aggregation of monit alerts per cycle
I have a dozen of identical services configured in monit.
When I enable alerts for check process on these services and alert condition arises in all of the services I receive a dozen of identical ...
2
votes
1
answer
271
views
On restart, start with "monitor all" enabled
I have monit enabled and monitoring one of my applications, where
if the application restarts more than 4 times in 10 cycles, I stop
it, and run a script (which, among other action, also does ...
2
votes
0
answers
648
views
monit: add NOALERT in an IF construct
On debian jessie, I have configured monit to check for HAproxy particular port forwardings, and to restart it if failed like this:
check process haproxy with pidfile /run/haproxy.pid
group www-...
2
votes
1
answer
282
views
Varnish failing intermittently for no obvious reason
For the last few years we have been running Varnish as a cache and load balancer in front of several apache servers serving several thousand websites.
We also use monit to ensure that if varnish ...
2
votes
1
answer
9k
views
monit does not run script after "if does not exist" check
I'm having trouble with monit. I have setup monitoring with monit. However, I'm having trouble with a check for the process running. If the process is not running, i want to run an specific script ...
2
votes
1
answer
1k
views
monitoring error rate with monit
Is there a way to tell monit to alert me if there are more than X errors (e.g. lines matching "ERROR") in a log file in a certain time?
My use case would be: errors sometimes appear in my log file (i....
2
votes
0
answers
997
views
Monit unable to start sidekiq on Opsworks server
I have used AWS Opsworks to create some servers. I have Sidekiq running as part of my Rails application. When I deploy Sidekiq restarts nicely.
I am configuring Monit to watch the pid and start and ...
2
votes
2
answers
2k
views
Monit won't run
I have two identical EC2 instances (the second is a replica of the first), running Gentoo.
The first instance has monit running which monitors a single process and some system resources and functions ...
2
votes
1
answer
764
views
Kill runaway Phusion Passenger child processes with monit?
Is there any way to monitor and kill Phusion child processes that are using too much memory or cpu with monit?
There are many examples for Apache, but since Phusion runs in its own process, runaway ...
1
vote
0
answers
249
views
Monitoring php command line worker with Monit Ubuntu 20
Problems monitoring php script using pid method.
We have a Laravel worker script that must be kept running on the server:
php /data/git/site/directory/artisan queue:work --daemon when this is run on ...
1
vote
1
answer
893
views
Getting Monit Web Interface and CLI to work on Ubuntu server
I have a hard time getting monit to work on my Ubuntu 18.04.4.
I've installed monit via sudo apt install monit, then I've enabled httpd like this:
set httpd port 2812 and
use address localhost
...
1
vote
1
answer
99
views
can I limit how often monit will alert?
Sometimes monit spams alerts faster than the devops can read them. It's not false alarms, things have gone crazy. But yet there is no need to spray alerts all over the place, a few would be sufficient ...
1
vote
0
answers
348
views
Can `monit` send alerts to an HTTP endpoint (instead of email only)?
I'd like to configure Monit to deliver 'fail' and 'success' notifications via its alerting system; the global alerting system seems only to support email notifications, and there doesn't seem to be a ...
1
vote
1
answer
103
views
2 identical VPS (Ubuntu 18.04): Postfix - Alerts from Monit to Google mail is not working
Let's start from beginning. I have a two identical VPS servers with Ubuntu 18.04 OS and Monit installed on both. I configured mailserver on the monit (for sending alerts) configuration as a localhost ...
1
vote
1
answer
264
views
Send additional (custom) data to m/monit
I use monit (https://mmonit.com/monit/) for system monitoring.
Also I use my own "backend" instead of m/monit and I want to receive additional data from the monit instances.
For example, is it ...
1
vote
1
answer
874
views
monitoring mongodb with monit
I cannot get the most basic script working on monitoring mongodb on ubuntu 16.04 monit 5.16
check process mongod with pidfile /var/run/mongod.pid
group database
start program = "/usr/sbin/service ...
1
vote
0
answers
481
views
Restart Monit service upon multiple conditions
I have a service monitored by monit, and I would like to restart it if it meets either one of two distinct conditions:
if memory usage is >15%
if memory usage is >5% AND the current system time is ...
1
vote
1
answer
1k
views
monit check http response header
unfortunately, the documentation is not clear about the HTTP content.
https://mmonit.com/monit/documentation/monit.html#HTTP
i want to monitor a specific response header, not the content itself, ...
1
vote
0
answers
308
views
Is there a way to include some text into monit's alert message?
I plan to use program check, with it's exit code I can force monit to send alert mail message, ok. But how to include into that message some output produced by checking program?
I could modify ...
1
vote
0
answers
558
views
monit lists apache as 'not monitored'
Trying to get monit to monitor apache. No matter what I do I can't get it to work. It reports as 'not monitored'.
I've checked that the pid I am using is the root apache process.
Running apache 2.24
...
1
vote
1
answer
2k
views
How to configure monit, check process to start program when only filesystem is available?
I want monit to check specific process and start it only when the depending filesystem is available.
check process Tomcat with pidfile /path/to/tomcat/TOMCAT.PID
depends on abc
start ...
1
vote
3
answers
2k
views
Prevent monit from checking while restarting
We have the following monit config which restarts tomcat if unable to connect to it:
check host Tomcat-Foo with address localhost
stop program = "/usr/bin/systemctl stop tomcat.service"
start ...
1
vote
0
answers
89
views
Alert on simultaneous failure of multiple monit services
We're using Monit to check our web servers. When the check fails (or succeeds) the corresponding compontent on a status page is updated via a shell script like this:
check host web-a-https with ...
1
vote
1
answer
572
views
Send monit alert to log file instead of email
I am using monit for several processes. But I do not want to sent an email when there is an issue, whereas I need it to log it to a file.
Can this be done?
OS: Ubuntu 14.04
Monit: 5.6
Current ...
1
vote
0
answers
144
views
how do I set monit to non-daemon mode
I'm trying to get monit to just excite the monitrc script once and then exit.
I've tried
monit -v -Ic /tmp/monitrc
but when I look at the output it says:
Runtime constants:
Control file =...
1
vote
0
answers
1k
views
why basic auth loops when using nginx and monit
I was trying to configure nginx so that http://example.com/monit will access http://127.0.0.1:2812, which is the url monit is listening.
Two authentication was set, via nginx(nginx.conf file) and ...
1
vote
0
answers
555
views
How to get monit to only alert once when a check fails, not when it comes back successful?
Apologies if this is the same question as How to suppress monit alert if restart successful?, but it appears like it might be different, so I'm asking again..
We want to have a monit alert check when ...
1
vote
0
answers
105
views
Is there any way to have monit not try to restart a process?
I have monit watching a process and killing it if it's running for too long. I do not want this process to be automatically restarted, however. I don't have a start program specified, but each cycle, ...
1
vote
0
answers
2k
views
using monit to control node.js pm2 response time
I want to use monit for ability to reload pm2 node.js site if response is longer than 2 seconds.
This is my monit config /etc/monit/monitrc:
check process pm2 with pidfile "/root/.pm2/pids/...
1
vote
1
answer
906
views
Logrotate for node.js app deployed using monit and upstart
I deployed a web application in node.js by following the guide: Deploying Node.js With Upstart and Monit .
The app produces some log via console.log(). In the upstart script, it's redirected to a log ...
1
vote
0
answers
365
views
monit, unable to start node.js script
I need to run my stats collecting daemon & send alerts, when it is down. I tried thousands of variants.. and last was:
check process collect-stats with pidfile /var/run/nodeutils/collect-stats....
1
vote
1
answer
2k
views
Issues in monitoring apache tomcat server using Monit
I have installed Monit using the following command in Ubuntu Linux 12.04.1 server
sudo apt-get install monit
My main goal in using Monit is to restart my - MySQL and Apache tomcat services ...
1
vote
0
answers
429
views
Restarting a program with monit
Hopefully someone can help me out with this:
I am running a game server that crashes with a segfault every 3 hours, I am trying to get a restart script working but I'm a complete noob when it comes to ...
1
vote
1
answer
1k
views
How to run a shell script before restarting a service in Monit in case of a crash
I am using Monit 5.3.2 in my Linux box. I am monitoring some services using Monit.
I want to run a script before the running the restart command.
I have used the below conditions for the same.
if ...
1
vote
0
answers
343
views
Monit 5.3.2 not working on Ubuntu 12.04 x86_64
I have monit working on several servers but when I install it on Ubuntu 12.04 64-bit server I get the following error reported in the log file and monitoring doesn't work.
[EDT Jun 24 21:26:20] error ...
1
vote
1
answer
932
views
Rewrite URLs with Apache (to be used in combination with mod_proxy)
I'm using Apache and mod_proxy to provide access to the Monit GUI over HTTP. So far my configuration is as follows:
ProxyRequests Off
<Proxy *>
Order deny,allow
...
1
vote
0
answers
666
views
Monit unable to send email alerts
I have set monit to send email if my java listener failed on port 8000. I have tried to close the listner and run monit validate below is the errors I got.
monit validate
'cs8000' process is not ...
0
votes
1
answer
20
views
specifying multiple mail formats in a monit file
I have a very long monit file, with different rules.
For certain rules, I want to send an email (with a specific format) to multiple email addresses.
I thought about using a Message Format, but we ...
0
votes
1
answer
121
views
Monit and MySQL/MariaDB Checksum
I have Monit monitoring MariaDB but when a minor MariaDB update is rolled out Monit fails to monitor as the Checksum has changed:
Checksum failed Service mysql_bin
Description: checksum failed, ...
0
votes
1
answer
25
views
Monit: exec a command but don't alert
I use monit to start a program when a webserver is not accessible.
.monitrc:
check host MyServer with address MyServer
if failed port 80 protocol http then exec "/home/michael/monit/...
0
votes
1
answer
353
views
What is the correct way to check monit status/summary success/failure
I have monit utility on production for monitoring several daemons (our micro-services). I'm trying to figure the best way to unmonitor/monitor my daemons while updating them. So, basically I need ...
0
votes
1
answer
99
views
Setting up Slack Alerts for Monit monitoring MySQL
Trying to set up Slack alerts for Monit and MySQL/MariaDB but stuck in writing a MySQL check script. I have the monit successfully working if MySQL is stopped and receive email alerts - but want the ...
0
votes
2
answers
102
views
Trigger a monit reload after unattended upgrades
I have run into an issue when combining monit with Ubuntu/Debian unattended upgrades. Monit monitors services and binaries, and flags changes, restarts processes, etc as needed. However, when a ...