Questions tagged [monit]

monit is a free, open source process supervision tool for Unix and Linux.

Monit is a free open source utility for managing and monitoring processes, programs, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.

389 questions
2
votes
0 answers

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-data start program = "/bin/systemctl start…
Danduk82
  • 178
  • 2
  • 9
2
votes
1 answer

Is there a feature built into Docker for monitoring and ensuring containers are always running?

My first thought would be Monit, which I use to monitor other processes. Is there a different way of doing this in the Docker universe? I wish to monitor both the Docker daemon and specific containers.
Sarke
  • 411
  • 1
  • 5
  • 12
2
votes
1 answer

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 ever dies it gets restarted. The varnish section in…
skmbr
  • 43
  • 3
2
votes
1 answer

How can I restart "monit" when it stops or crashes?

I am setting up a server and have just installed "monit" to monitor processes and restart them (and alert me) when certain conditions are met. It works great. My question is what happens when monit itself dies? Is there a correct way of ensuring…
Phil
  • 157
  • 2
  • 7
2
votes
1 answer

Secure Monit 5.6 httpd on Ubuntu Trusty

I'm trying to securely install the monit on Ubuntu 14.04 Trusty. The default packaged version is 5.6. From what I can see, monit is basically unusable without the httpd service enabled (ie you can't start, restart or stop monitoring a service). Is…
robd
  • 141
  • 1
  • 1
  • 5
2
votes
2 answers

Monit reports "failed to stop" before timeout

I am starting and stopping a process via monit with the following syntax: stop program = "..." with timeout 90 seconds Everything works well, except that Monit always reports failed to stop after exactly one minute: From /var/log/monit.log: [EST…
Manuel Meurer
  • 263
  • 1
  • 3
  • 12
2
votes
1 answer

monit: how send email like alert

I'd like to customize an alert message for the following condition: if cpu > 75% for 2 cycles then exec "command|mail -s subject test@example.com" to monitrc config file how can I add that command? check process apache with pidfile…
watchmansky
  • 769
  • 4
  • 10
  • 17
2
votes
1 answer

Monitor a process using monit in ubuntu

On my server I have started a service using a script created by myself. I want to monitor that process using monit. I didn't see any .pid file for that process in the /var/run directory. How can I monitor that process using monit?
2
votes
1 answer

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 that will create a pagerduty alert. My Monit file…
roloenusa
  • 121
  • 1
  • 2
2
votes
1 answer

How to make Monit "check process" conditional?

I have a monit script that does something like this: check process sidekiq_1 with pidfile /tmp/pids/sidekiq_1.pid start program = "/bin/bash -l -c 'bundle exec sidekiq start" as uid jim and gid jim with timeout 250 seconds stop program =…
Niels Kristian
  • 358
  • 1
  • 3
  • 13
2
votes
1 answer

Bash script match grep output and send message

I am developing a script for monit status checking so I can send OK status messages to NagiOS NSCA server (passive checks). The problem I am having is that my bash script still sends messages if the scripts grep function does not include anything…
cr0c
  • 958
  • 4
  • 16
  • 35
2
votes
2 answers

turn off monit text alerts at night

I have monit running 24/7/365 and sending alerts to an e-mail address and text messages to a phone equally. However I would now like to stop the phone text msgs at night so they don't wake me up. I can't just silence my phone because we are on call…
Ron
  • 21
  • 2
2
votes
3 answers

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

How do you stop monit from running the exec statement every time the test fails? The statement in my monitrc is: check filesystem tmpfs with path /var if space > 90% then exec "/usr/bin/logger -p…
Terminal
  • 43
  • 1
  • 5
2
votes
1 answer

How to redirect the output of an exec command to the monit log?

Is it possible to redirect the output of an exec command to the monit log? check host example.org with address example.org if failed port 80 protocol http for 2 cycles then exec "/root/cloudflare.py >> /var/log/monit.log" This doesn't seem…
John Mee
  • 2,548
  • 1
  • 24
  • 27
2
votes
1 answer

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.e. network errors, remote server hiccup etc) and…
riffraff
  • 125
  • 6