monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to check the uptime of a Ruby process.


From: Martin Pala
Subject: Re: How to check the uptime of a Ruby process.
Date: Mon, 30 Jul 2012 16:58:22 +0200

Ubuntu is usually behind the latest Monit version - they sync just on new distro release and not necessarily to latest version.

You can either compile Monit 5.4 it from source (the "make install" puts the binary as /usr/local/bin/monit) or can get the pre-compiled monit which can be used as drop-in replacement of the original binary:
http://www.mmonit.com/monit/download/

Regards,
Martin


On Jul 30, 2012, at 4:53 PM, pippo pippo <address@hidden> wrote:

Hi Martin.

My Monit is version 5.3.2.

This is strange because I installed Monit 2 days ago through the Ubuntu command apt-get install monit.

How can I upgrade my Monit version?

Bye.

K84PD5


Da: Martin Pala <address@hidden>
A: pippo pippo <address@hidden>
Cc: This is the general mailing list for monit <address@hidden>
Inviato: Lunedì 30 Luglio 2012 15:51
Oggetto: Re: How to check the uptime of a Ruby process.

The config loads fine on my testing system (monit 5.4) … as mentioned, the uptime test was added in monit 5.4 - please can you verify you have the correct monit version?:

  monit -V

Regards,
Martin

On Jul 30, 2012, at 12:17 PM, pippo pippo <address@hidden> wrote:

Hi Martin.

I try to do this with the following code:

set daemon 5
check process ruby
matching "^Rack: /home/capistrano/railsapp/current?|^Passenger ApplicationSpawner: /home/capistrano/railsapp/current?"
if mem > 75% then alert
if mem > 75% then exec "/bin/bash -c 'kill -s SIGTERM $MONIT_PROCESS_PID'"
if cpu > 75% then alert
if cpu > 75% then exec "/bin/bash -c 'kill -s SIGTERM $MONIT_PROCESS_PID'"
if uptime > 45 minutes then alert

But I have the following code:

/etc/monit/conf.d/ruby.monit:8: Error: syntax error 'uptime'

K84PD5


Da: Martin Pala <address@hidden>
A: pippo pippo <address@hidden>; This is the general mailing list for monit <address@hidden>
Inviato: Lunedì 30 Luglio 2012 12:01
Oggetto: Re: How to check the uptime of a Ruby process.

Hi,

you can use the uptime test (available since monit 5.4):

check process ruby ...
if uptime > 45 minutes then alert


Regards,
martin


On Jul 30, 2012, at 11:55 AM, pippo pippo <address@hidden> wrote:

Hi.

I'm using Monit (version 5.4) to check the uptime of Ruby process on my Ubuntu Server 12.04 LTS 32 bit.

Ruby doesn't have a PID file, so I find/check ruby process through the following monit code/configuration:

check process ruby
matching "^Rack: /home/capistrano/railsapp/current?|^Passenger ApplicationSpawner: /home/capistrano/railsapp/current?"

Now I need to check uptime and if is greater then 45 minutes I must to alert. How can I do this?

Thanks in advance.

Regards.

K85PD5
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general








reply via email to

[Prev in Thread] Current Thread [Next in Thread]