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.

382 questions
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
  • 6
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
  • 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
  • 749
  • 4
  • 9
  • 16
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
  • 2
  • 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
  • 1,116
  • 3
  • 15
  • 32
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,298
  • 1
  • 23
  • 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
2
votes
1 answer

M/Monit how to see current disk space?

In the admin interface of M/Monit under Reports -> Analytics I can chose to show Space %. How can I make the Monit clients submit this info? Is there a way to display Disk Space percentage on the Status page besides %Cpu and %Mem? I have found…
kev
  • 261
  • 1
  • 5
  • 13
2
votes
1 answer

monit with ssl (https)

I recently installed monit (on debian) and everything is working fine. Now I would like to enable ssl support. I did what I found in the documentation: set httpd port 2812 ssl enable pemfile /etc/ssl/certs/ssl-cert-snakeoil.pem Now not only can…
Georg Pfolz
  • 125
  • 2
  • 7
2
votes
1 answer

Monit "is alive" check of PostgreSQL tends to fail during a run of pg_dump, is there a better way?

I use pg_dump for my primary backup, once every three hours. I also use monit. When monit checks if PostgreSQL is alive during the pg_dump run, it sometimes times out, and restarts postgres. This results in failed backup. What to do? Move to…
Terry G Lorber
  • 565
  • 2
  • 7
  • 12