Re: "for X cycles" has no effect

2016-10-22 Thread Martin Pala
The action is executed on state change only. If you need to execute it each 
cycle the error remains, you can use the repeat option ... the "EXEC" action 
description in monit manual: 
https://mmonit.com/monit/documentation/monit.html#ACTION


> On 21 Oct 2016, at 00:21, jobhunt...@aol.com wrote:
> 
> When I disable logging and change the CPU test to:
> 
> "if cpu > 1% for 3 cycles then exec "/usr/bin/logger 'cpu usage exceeded 1%'"
> 
> I get the log message after it fails 3 consecutive times.  If it then fails a 
> 4th consecutive time, there is no log message.  There is not another log 
> message until the first time it fails after it succeeds, even though it has 
> not failed 3 consecutive times at that point.
> 
> Is this the expected behavior with Monit 5.19.0?
> 
> 
> 
> 
> 


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


Re: "for X cycles" has no effect

2016-10-20 Thread jobhunts02
When I disable logging and change the CPU test to:

"if cpu > 1% for 3 cycles then exec "/usr/bin/logger 'cpu usage exceeded 1%'"

I get the log message after it fails 3 consecutive times.  If it then fails a 
4th consecutive time, there is no log message.  There is not another log 
message until the first time it fails after it succeeds, even though it has not 
failed 3 consecutive times at that point.

Is this the expected behavior with Monit 5.19.0?






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


Re: "for X cycles" has no effect

2016-10-18 Thread Martin Pala
You can disable logging (remove "set logfile") and use the "exec" action 
instead to write error message, when limit is exceeded.



> On 18 Oct 2016, at 23:21, jobhunt...@aol.com wrote:
> 
> I was confused about the difference between logging the limit exceeded and 
> alerts.
> 
> I want only the alerts to be logged.  I do not want the alerts emailed.
> 
> Is there a way to configure Monit to log alerts but not log when the limits 
> are exceeded?
> 
> 
> 
> On Oct 17, 2016, at 11:44 AM, Martin Pala  > wrote:
> 
>> The error message is logged each cycle the limit is exceeded - that is 
>> normal.
>> 
>> The cycles limit is related to the action - in your case it's alert action, 
>> but there is no alert target in your configuration file, so no action is 
>> performed after 5 cycles (the service will just enter the error state).
>> 
>> You can check that the cpu usage error is not set during the first four 
>> cycles using for example "monit status". If you want to get notification 
>> after 5 cycles (and see the alert action logged too), you need to add "set 
>> alert " statement and "set mailserver"
>> 
>> 
>> 
>>> On 17 Oct 2016, at 19:40, jobhunt...@aol.com  
>>> wrote:
>>> 
>>> I changed monitrc so that all checks are after 5 cycles and see the same 
>>> behavior, i.e., there is a cpu usage alert after 5 seconds and every 5 
>>> seconds thereafter.
>>> 
>>> set daemon  5
>>> set logfile syslog
>>> set pidfile /home/jones/monit_code/.monit.pid
>>> set idfile  /home/jones/monit_code/.monit.id
>>> set statefile /home/jones/monit_code/.monit.state
>>> check device var with path /var
>>> if space usage > 95% for 5 cycles then alert
>>> check device etc with path /etc
>>> if space usage > 95% for 5 cycles then alert
>>> check system $HOST
>>> if memory usage > 85% for 5 cycles then alert
>>> if cpu usage (user) > 75% for 5 cycles then alert
>>> if cpu usage (system) > 65% for 5 cycles then alert
>>> if cpu > 0% for 5 cycles then alert
>>> 
>>> 
>>> On Oct 17, 2016, at 3:21 AM, Martin Pala >> > wrote:
>>> 
 Thanks for data.
 
 I think the cpu usage alert was triggered by one of other cpu usage tests, 
 which you have in your monit configuration file:
 
 if cpu usage (user) > 75% for 1 cycles then alert
 if cpu usage (system) > 65% for 1 cycles then alert
 if cpu > 0% for 5 cycles then alert
 
 There are three independent tests in the config:
 
 1.) "cpu usage (user)"
 2.) "cpu usage (system)"
 3.) "cpu"
 
 The CPU test #3 (with no options) will check total CPU usage (usr% + sys% 
 + wait%). Tests #1 test usr% only, and #2 tests sys% only.
 
 Only the check #3 has the 5 cycles constraint, the other will alert during 
 first cycle.
 
 Best regards,
 Martin
 
 
> On 13 Oct 2016, at 21:16, jobhunt...@aol.com  
> wrote:
> 
> Using the precompiled binary,monit-5.19.0-linux-x86.tar.gz, I see the 
> same behavior.
> 
> 
> On Oct 10, 2016, at 10:41 AM, jobhunt...@aol.com 
>  wrote:
> 
>> monitrc is attached.
>>> 
>>> $ bin/monit -vI -c monitrc
>>> Runtime constants:
>>>  Control file   = /home/jones/monit519/monitrc
>>>  Log file   = syslog
>>>  Pid file   = /home/jones/monit_code/.monit.pid
>>>  Id file= /home/jones/monit_code/.monit.id
>>>  State file = /home/jones/monit_code/.monit.state
>>>  Debug  = True
>>>  Log= True
>>>  Use syslog = True
>>>  Is Daemon  = True
>>>  Use process engine = True
>>>  Limits = {
>>> =   programOutput: 512 B
>>> =   sendExpectBuffer:  256 B
>>> =   fileContentBuffer: 512 B
>>> =   httpContentBuffer: 1024 kB
>>> =   networkTimeout:5 s
>>> = }
>>>  Poll time  = 5 seconds with start delay 0 seconds
>>>  Start monit httpd  = False
>>> 
>>> The service list contains the following entries:
>>> 
>>> Filesystem Name   = var
>>>  Path = /var
>>>  Monitoring mode  = active
>>>  On reboot= start
>>>  Filesystem flags = if changed then alert
>>>  Space usage limit= if greater than 95.0% then alert
>>> 
>>> Filesystem Name   = etc
>>>  Path = /etc
>>>  Monitoring mode  = active
>>>  On reboot= start
>>>  Filesystem flags = if changed then alert
>>>  Space usage limit= if greater than 95.0% then alert
>>> 
>>> System Name   = localhost.localdomain
>>>  Monitoring mode  = active
>>>  On re

Re: "for X cycles" has no effect

2016-10-18 Thread jobhunts02
I was confused about the difference between logging the limit exceeded and 
alerts.

I want only the alerts to be logged.  I do not want the alerts emailed.

Is there a way to configure Monit to log alerts but not log when the limits are 
exceeded?



> On Oct 17, 2016, at 11:44 AM, Martin Pala  wrote:
> 
> The error message is logged each cycle the limit is exceeded - that is normal.
> 
> The cycles limit is related to the action - in your case it's alert action, 
> but there is no alert target in your configuration file, so no action is 
> performed after 5 cycles (the service will just enter the error state).
> 
> You can check that the cpu usage error is not set during the first four 
> cycles using for example "monit status". If you want to get notification 
> after 5 cycles (and see the alert action logged too), you need to add "set 
> alert " statement and "set mailserver"
> 
> 
> 
>> On 17 Oct 2016, at 19:40, jobhunt...@aol.com wrote:
>> 
>> I changed monitrc so that all checks are after 5 cycles and see the same 
>> behavior, i.e., there is a cpu usage alert after 5 seconds and every 5 
>> seconds thereafter.
>> 
>> set daemon  5
>> set logfile syslog
>> set pidfile /home/jones/monit_code/.monit.pid
>> set idfile  /home/jones/monit_code/.monit.id
>> set statefile /home/jones/monit_code/.monit.state
>> check device var with path /var
>> if space usage > 95% for 5 cycles then alert
>> check device etc with path /etc
>> if space usage > 95% for 5 cycles then alert
>> check system $HOST
>> if memory usage > 85% for 5 cycles then alert
>> if cpu usage (user) > 75% for 5 cycles then alert
>> if cpu usage (system) > 65% for 5 cycles then alert
>> if cpu > 0% for 5 cycles then alert
>> 
>> 
>>> On Oct 17, 2016, at 3:21 AM, Martin Pala  wrote:
>>> 
>>> Thanks for data.
>>> 
>>> I think the cpu usage alert was triggered by one of other cpu usage tests, 
>>> which you have in your monit configuration file:
>>> 
>>> if cpu usage (user) > 75% for 1 cycles then alert
>>> if cpu usage (system) > 65% for 1 cycles then alert
>>> if cpu > 0% for 5 cycles then alert
>>> 
>>> There are three independent tests in the config:
>>> 
>>> 1.) "cpu usage (user)"
>>> 2.) "cpu usage (system)"
>>> 3.) "cpu"
>>> 
>>> The CPU test #3 (with no options) will check total CPU usage (usr% + sys% + 
>>> wait%). Tests #1 test usr% only, and #2 tests sys% only.
>>> 
>>> Only the check #3 has the 5 cycles constraint, the other will alert during 
>>> first cycle.
>>> 
>>> Best regards,
>>> Martin
>>> 
>>> 
 On 13 Oct 2016, at 21:16, jobhunt...@aol.com wrote:
 
 Using the precompiled binary,monit-5.19.0-linux-x86.tar.gz, I see the same 
 behavior.
 
 
> On Oct 10, 2016, at 10:41 AM, jobhunt...@aol.com wrote:
> 
> monitrc is attached.
>> 
>> $ bin/monit -vI -c monitrc
>> Runtime constants:
>>  Control file   = /home/jones/monit519/monitrc
>>  Log file   = syslog
>>  Pid file   = /home/jones/monit_code/.monit.pid
>>  Id file= /home/jones/monit_code/.monit.id
>>  State file = /home/jones/monit_code/.monit.state
>>  Debug  = True
>>  Log= True
>>  Use syslog = True
>>  Is Daemon  = True
>>  Use process engine = True
>>  Limits = {
>> =   programOutput: 512 B
>> =   sendExpectBuffer:  256 B
>> =   fileContentBuffer: 512 B
>> =   httpContentBuffer: 1024 kB
>> =   networkTimeout:5 s
>> = }
>>  Poll time  = 5 seconds with start delay 0 seconds
>>  Start monit httpd  = False
>> 
>> The service list contains the following entries:
>> 
>> Filesystem Name   = var
>>  Path = /var
>>  Monitoring mode  = active
>>  On reboot= start
>>  Filesystem flags = if changed then alert
>>  Space usage limit= if greater than 95.0% then alert
>> 
>> Filesystem Name   = etc
>>  Path = /etc
>>  Monitoring mode  = active
>>  On reboot= start
>>  Filesystem flags = if changed then alert
>>  Space usage limit= if greater than 95.0% then alert
>> 
>> System Name   = localhost.localdomain
>>  Monitoring mode  = active
>>  On reboot= start
>>  CPU usage limit  = if greater than 0.0% for 5 cycles then alert
>>  CPU system limit = if greater than 65.0% then alert
>>  CPU user limit   = if greater than 75.0% then alert
>>  Memory usage limit   = if greater than 85.0% then alert
>> 
>> ---
>> pidfile '/home/jones/monit_code/.monit.pid' does not exist
>> Starting Monit 5.19.0 daemon
>

Re: "for X cycles" has no effect

2016-10-17 Thread Martin Pala
The error message is logged each cycle the limit is exceeded - that is normal.

The cycles limit is related to the action - in your case it's alert action, but 
there is no alert target in your configuration file, so no action is performed 
after 5 cycles (the service will just enter the error state).

You can check that the cpu usage error is not set during the first four cycles 
using for example "monit status". If you want to get notification after 5 
cycles (and see the alert action logged too), you need to add "set alert 
" statement and "set mailserver"



> On 17 Oct 2016, at 19:40, jobhunt...@aol.com wrote:
> 
> I changed monitrc so that all checks are after 5 cycles and see the same 
> behavior, i.e., there is a cpu usage alert after 5 seconds and every 5 
> seconds thereafter.
> 
> set daemon  5
> set logfile syslog
> set pidfile /home/jones/monit_code/.monit.pid
> set idfile  /home/jones/monit_code/.monit.id
> set statefile /home/jones/monit_code/.monit.state
> check device var with path /var
> if space usage > 95% for 5 cycles then alert
> check device etc with path /etc
> if space usage > 95% for 5 cycles then alert
> check system $HOST
> if memory usage > 85% for 5 cycles then alert
> if cpu usage (user) > 75% for 5 cycles then alert
> if cpu usage (system) > 65% for 5 cycles then alert
> if cpu > 0% for 5 cycles then alert
> 
> 
> On Oct 17, 2016, at 3:21 AM, Martin Pala  > wrote:
> 
>> Thanks for data.
>> 
>> I think the cpu usage alert was triggered by one of other cpu usage tests, 
>> which you have in your monit configuration file:
>> 
>> if cpu usage (user) > 75% for 1 cycles then alert
>> if cpu usage (system) > 65% for 1 cycles then alert
>> if cpu > 0% for 5 cycles then alert
>> 
>> There are three independent tests in the config:
>> 
>> 1.) "cpu usage (user)"
>> 2.) "cpu usage (system)"
>> 3.) "cpu"
>> 
>> The CPU test #3 (with no options) will check total CPU usage (usr% + sys% + 
>> wait%). Tests #1 test usr% only, and #2 tests sys% only.
>> 
>> Only the check #3 has the 5 cycles constraint, the other will alert during 
>> first cycle.
>> 
>> Best regards,
>> Martin
>> 
>> 
>>> On 13 Oct 2016, at 21:16, jobhunt...@aol.com  
>>> wrote:
>>> 
>>> Using the precompiled binary,monit-5.19.0-linux-x86.tar.gz, I see the same 
>>> behavior.
>>> 
>>> 
>>> On Oct 10, 2016, at 10:41 AM, jobhunt...@aol.com 
>>>  wrote:
>>> 
 monitrc is attached.
> 
> $ bin/monit -vI -c monitrc
> Runtime constants:
>  Control file   = /home/jones/monit519/monitrc
>  Log file   = syslog
>  Pid file   = /home/jones/monit_code/.monit.pid
>  Id file= /home/jones/monit_code/.monit.id
>  State file = /home/jones/monit_code/.monit.state
>  Debug  = True
>  Log= True
>  Use syslog = True
>  Is Daemon  = True
>  Use process engine = True
>  Limits = {
> =   programOutput: 512 B
> =   sendExpectBuffer:  256 B
> =   fileContentBuffer: 512 B
> =   httpContentBuffer: 1024 kB
> =   networkTimeout:5 s
> = }
>  Poll time  = 5 seconds with start delay 0 seconds
>  Start monit httpd  = False
> 
> The service list contains the following entries:
> 
> Filesystem Name   = var
>  Path = /var
>  Monitoring mode  = active
>  On reboot= start
>  Filesystem flags = if changed then alert
>  Space usage limit= if greater than 95.0% then alert
> 
> Filesystem Name   = etc
>  Path = /etc
>  Monitoring mode  = active
>  On reboot= start
>  Filesystem flags = if changed then alert
>  Space usage limit= if greater than 95.0% then alert
> 
> System Name   = localhost.localdomain
>  Monitoring mode  = active
>  On reboot= start
>  CPU usage limit  = if greater than 0.0% for 5 cycles then alert
>  CPU system limit = if greater than 65.0% then alert
>  CPU user limit   = if greater than 75.0% then alert
>  Memory usage limit   = if greater than 85.0% then alert
> 
> ---
> pidfile '/home/jones/monit_code/.monit.pid' does not exist
> Starting Monit 5.19.0 daemon
> 'localhost.localdomain' Monit 5.19.0 started
> 'var' succeeded getting filesystem statistics for '/var'
> 'var' filesystem flags has not changed
> 'var' space usage test succeeded [current space usage=32.2%]
> 'etc' succeeded getting filesystem statistics for '/etc'
> 'etc' filesystem flags has not changed
> 'etc' space

Re: "for X cycles" has no effect

2016-10-17 Thread jobhunts02
I changed monitrc so that all checks are after 5 cycles and see the same 
behavior, i.e., there is a cpu usage alert after 5 seconds and every 5 seconds 
thereafter.

set daemon  5
set logfile syslog
set pidfile /home/jones/monit_code/.monit.pid
set idfile  /home/jones/monit_code/.monit.id
set statefile /home/jones/monit_code/.monit.state
check device var with path /var
if space usage > 95% for 5 cycles then alert
check device etc with path /etc
if space usage > 95% for 5 cycles then alert
check system $HOST
if memory usage > 85% for 5 cycles then alert
if cpu usage (user) > 75% for 5 cycles then alert
if cpu usage (system) > 65% for 5 cycles then alert
if cpu > 0% for 5 cycles then alert


> On Oct 17, 2016, at 3:21 AM, Martin Pala  wrote:
> 
> Thanks for data.
> 
> I think the cpu usage alert was triggered by one of other cpu usage tests, 
> which you have in your monit configuration file:
> 
> if cpu usage (user) > 75% for 1 cycles then alert
> if cpu usage (system) > 65% for 1 cycles then alert
> if cpu > 0% for 5 cycles then alert
> 
> There are three independent tests in the config:
> 
> 1.) "cpu usage (user)"
> 2.) "cpu usage (system)"
> 3.) "cpu"
> 
> The CPU test #3 (with no options) will check total CPU usage (usr% + sys% + 
> wait%). Tests #1 test usr% only, and #2 tests sys% only.
> 
> Only the check #3 has the 5 cycles constraint, the other will alert during 
> first cycle.
> 
> Best regards,
> Martin
> 
> 
>> On 13 Oct 2016, at 21:16, jobhunt...@aol.com wrote:
>> 
>> Using the precompiled binary,monit-5.19.0-linux-x86.tar.gz, I see the same 
>> behavior.
>> 
>> 
>>> On Oct 10, 2016, at 10:41 AM, jobhunt...@aol.com wrote:
>>> 
>>> monitrc is attached.
 
 $ bin/monit -vI -c monitrc
 Runtime constants:
  Control file   = /home/jones/monit519/monitrc
  Log file   = syslog
  Pid file   = /home/jones/monit_code/.monit.pid
  Id file= /home/jones/monit_code/.monit.id
  State file = /home/jones/monit_code/.monit.state
  Debug  = True
  Log= True
  Use syslog = True
  Is Daemon  = True
  Use process engine = True
  Limits = {
 =   programOutput: 512 B
 =   sendExpectBuffer:  256 B
 =   fileContentBuffer: 512 B
 =   httpContentBuffer: 1024 kB
 =   networkTimeout:5 s
 = }
  Poll time  = 5 seconds with start delay 0 seconds
  Start monit httpd  = False
 
 The service list contains the following entries:
 
 Filesystem Name   = var
  Path = /var
  Monitoring mode  = active
  On reboot= start
  Filesystem flags = if changed then alert
  Space usage limit= if greater than 95.0% then alert
 
 Filesystem Name   = etc
  Path = /etc
  Monitoring mode  = active
  On reboot= start
  Filesystem flags = if changed then alert
  Space usage limit= if greater than 95.0% then alert
 
 System Name   = localhost.localdomain
  Monitoring mode  = active
  On reboot= start
  CPU usage limit  = if greater than 0.0% for 5 cycles then alert
  CPU system limit = if greater than 65.0% then alert
  CPU user limit   = if greater than 75.0% then alert
  Memory usage limit   = if greater than 85.0% then alert
 
 ---
 pidfile '/home/jones/monit_code/.monit.pid' does not exist
 Starting Monit 5.19.0 daemon
 'localhost.localdomain' Monit 5.19.0 started
 'var' succeeded getting filesystem statistics for '/var'
 'var' filesystem flags has not changed
 'var' space usage test succeeded [current space usage=32.2%]
 'etc' succeeded getting filesystem statistics for '/etc'
 'etc' filesystem flags has not changed
 'etc' space usage test succeeded [current space usage=32.2%]
 'localhost.localdomain' cpu usage check succeeded [current cpu usage=0.0%]
 'localhost.localdomain' cpu system usage check skipped (initializing)
 'localhost.localdomain' cpu user usage check skipped (initializing)
 'localhost.localdomain' mem usage check succeeded [current mem usage=37.8%]
 'var' succeeded getting filesystem statistics for '/var'
 'var' filesystem flags has not changed
 'var' space usage test succeeded [current space usage=32.2%]
 'etc' succeeded getting filesystem statistics for '/etc'
 'etc' filesystem flags has not changed
 'etc' space usage test succeeded [current space usage=32.2%]
 'localhost.localdomain' cpu usage of 2.4% matches resource limit [cpu 
 usage>0.0%]
 'localhost.localdomain' cpu system usage check succee

Re: "for X cycles" has no effect

2016-10-17 Thread Martin Pala
Thanks for data.

I think the cpu usage alert was triggered by one of other cpu usage tests, 
which you have in your monit configuration file:

if cpu usage (user) > 75% for 1 cycles then alert
if cpu usage (system) > 65% for 1 cycles then alert
if cpu > 0% for 5 cycles then alert

There are three independent tests in the config:

1.) "cpu usage (user)"
2.) "cpu usage (system)"
3.) "cpu"

The CPU test #3 (with no options) will check total CPU usage (usr% + sys% + 
wait%). Tests #1 test usr% only, and #2 tests sys% only.

Only the check #3 has the 5 cycles constraint, the other will alert during 
first cycle.

Best regards,
Martin


> On 13 Oct 2016, at 21:16, jobhunt...@aol.com wrote:
> 
> Using the precompiled binary,monit-5.19.0-linux-x86.tar.gz, I see the same 
> behavior.
> 
> 
> On Oct 10, 2016, at 10:41 AM, jobhunt...@aol.com  
> wrote:
> 
>> monitrc is attached.
>>> 
>>> $ bin/monit -vI -c monitrc
>>> Runtime constants:
>>>  Control file   = /home/jones/monit519/monitrc
>>>  Log file   = syslog
>>>  Pid file   = /home/jones/monit_code/.monit.pid
>>>  Id file= /home/jones/monit_code/.monit.id
>>>  State file = /home/jones/monit_code/.monit.state
>>>  Debug  = True
>>>  Log= True
>>>  Use syslog = True
>>>  Is Daemon  = True
>>>  Use process engine = True
>>>  Limits = {
>>> =   programOutput: 512 B
>>> =   sendExpectBuffer:  256 B
>>> =   fileContentBuffer: 512 B
>>> =   httpContentBuffer: 1024 kB
>>> =   networkTimeout:5 s
>>> = }
>>>  Poll time  = 5 seconds with start delay 0 seconds
>>>  Start monit httpd  = False
>>> 
>>> The service list contains the following entries:
>>> 
>>> Filesystem Name   = var
>>>  Path = /var
>>>  Monitoring mode  = active
>>>  On reboot= start
>>>  Filesystem flags = if changed then alert
>>>  Space usage limit= if greater than 95.0% then alert
>>> 
>>> Filesystem Name   = etc
>>>  Path = /etc
>>>  Monitoring mode  = active
>>>  On reboot= start
>>>  Filesystem flags = if changed then alert
>>>  Space usage limit= if greater than 95.0% then alert
>>> 
>>> System Name   = localhost.localdomain
>>>  Monitoring mode  = active
>>>  On reboot= start
>>>  CPU usage limit  = if greater than 0.0% for 5 cycles then alert
>>>  CPU system limit = if greater than 65.0% then alert
>>>  CPU user limit   = if greater than 75.0% then alert
>>>  Memory usage limit   = if greater than 85.0% then alert
>>> 
>>> ---
>>> pidfile '/home/jones/monit_code/.monit.pid' does not exist
>>> Starting Monit 5.19.0 daemon
>>> 'localhost.localdomain' Monit 5.19.0 started
>>> 'var' succeeded getting filesystem statistics for '/var'
>>> 'var' filesystem flags has not changed
>>> 'var' space usage test succeeded [current space usage=32.2%]
>>> 'etc' succeeded getting filesystem statistics for '/etc'
>>> 'etc' filesystem flags has not changed
>>> 'etc' space usage test succeeded [current space usage=32.2%]
>>> 'localhost.localdomain' cpu usage check succeeded [current cpu usage=0.0%]
>>> 'localhost.localdomain' cpu system usage check skipped (initializing)
>>> 'localhost.localdomain' cpu user usage check skipped (initializing)
>>> 'localhost.localdomain' mem usage check succeeded [current mem usage=37.8%]
>>> 'var' succeeded getting filesystem statistics for '/var'
>>> 'var' filesystem flags has not changed
>>> 'var' space usage test succeeded [current space usage=32.2%]
>>> 'etc' succeeded getting filesystem statistics for '/etc'
>>> 'etc' filesystem flags has not changed
>>> 'etc' space usage test succeeded [current space usage=32.2%]
>>> 'localhost.localdomain' cpu usage of 2.4% matches resource limit [cpu 
>>> usage>0.0%]
>>> 'localhost.localdomain' cpu system usage check succeeded [current cpu 
>>> system usage=0.8%]
>>> 'localhost.localdomain' cpu user usage check succeeded [current cpu user 
>>> usage=1.4%]
>>> 'localhost.localdomain' mem usage check succeeded [current mem usage=37.8%]
>>> 'var' succeeded getting filesystem statistics for '/var'
>>> 'var' filesystem flags has not changed
>>> 'var' space usage test succeeded [current space usage=32.2%]
>>> 'etc' succeeded getting filesystem statistics for '/etc'
>>> 'etc' filesystem flags has not changed
>>> 'etc' space usage test succeeded [current space usage=32.2%]
>>> 'localhost.localdomain' cpu usage of 2.0% matches resource limit [cpu 
>>> usage>0.0%]
>>> 'localhost.localdomain' cpu system usage check succeeded [current cpu 
>>> system usage=0.6%]
>>> 'localhost.localdomain' cpu user usage check succeeded [current cpu user 
>>> usage=1.1%]
>>> 'localhost.localdomain' mem usage chec

Re: "for X cycles" has no effect

2016-10-13 Thread jobhunts02
Using the precompiled binary,monit-5.19.0-linux-x86.tar.gz, I see the same 
behavior.


> On Oct 10, 2016, at 10:41 AM, jobhunt...@aol.com wrote:
> 
> monitrc is attached.
>> $ bin/monit -vI -c monitrc
>> Runtime constants:
>>  Control file   = /home/jones/monit519/monitrc
>>  Log file   = syslog
>>  Pid file   = /home/jones/monit_code/.monit.pid
>>  Id file= /home/jones/monit_code/.monit.id
>>  State file = /home/jones/monit_code/.monit.state
>>  Debug  = True
>>  Log= True
>>  Use syslog = True
>>  Is Daemon  = True
>>  Use process engine = True
>>  Limits = {
>> =   programOutput: 512 B
>> =   sendExpectBuffer:  256 B
>> =   fileContentBuffer: 512 B
>> =   httpContentBuffer: 1024 kB
>> =   networkTimeout:5 s
>> = }
>>  Poll time  = 5 seconds with start delay 0 seconds
>>  Start monit httpd  = False
>> 
>> The service list contains the following entries:
>> 
>> Filesystem Name   = var
>>  Path = /var
>>  Monitoring mode  = active
>>  On reboot= start
>>  Filesystem flags = if changed then alert
>>  Space usage limit= if greater than 95.0% then alert
>> 
>> Filesystem Name   = etc
>>  Path = /etc
>>  Monitoring mode  = active
>>  On reboot= start
>>  Filesystem flags = if changed then alert
>>  Space usage limit= if greater than 95.0% then alert
>> 
>> System Name   = localhost.localdomain
>>  Monitoring mode  = active
>>  On reboot= start
>>  CPU usage limit  = if greater than 0.0% for 5 cycles then alert
>>  CPU system limit = if greater than 65.0% then alert
>>  CPU user limit   = if greater than 75.0% then alert
>>  Memory usage limit   = if greater than 85.0% then alert
>> 
>> ---
>> pidfile '/home/jones/monit_code/.monit.pid' does not exist
>> Starting Monit 5.19.0 daemon
>> 'localhost.localdomain' Monit 5.19.0 started
>> 'var' succeeded getting filesystem statistics for '/var'
>> 'var' filesystem flags has not changed
>> 'var' space usage test succeeded [current space usage=32.2%]
>> 'etc' succeeded getting filesystem statistics for '/etc'
>> 'etc' filesystem flags has not changed
>> 'etc' space usage test succeeded [current space usage=32.2%]
>> 'localhost.localdomain' cpu usage check succeeded [current cpu usage=0.0%]
>> 'localhost.localdomain' cpu system usage check skipped (initializing)
>> 'localhost.localdomain' cpu user usage check skipped (initializing)
>> 'localhost.localdomain' mem usage check succeeded [current mem usage=37.8%]
>> 'var' succeeded getting filesystem statistics for '/var'
>> 'var' filesystem flags has not changed
>> 'var' space usage test succeeded [current space usage=32.2%]
>> 'etc' succeeded getting filesystem statistics for '/etc'
>> 'etc' filesystem flags has not changed
>> 'etc' space usage test succeeded [current space usage=32.2%]
>> 'localhost.localdomain' cpu usage of 2.4% matches resource limit [cpu 
>> usage>0.0%]
>> 'localhost.localdomain' cpu system usage check succeeded [current cpu system 
>> usage=0.8%]
>> 'localhost.localdomain' cpu user usage check succeeded [current cpu user 
>> usage=1.4%]
>> 'localhost.localdomain' mem usage check succeeded [current mem usage=37.8%]
>> 'var' succeeded getting filesystem statistics for '/var'
>> 'var' filesystem flags has not changed
>> 'var' space usage test succeeded [current space usage=32.2%]
>> 'etc' succeeded getting filesystem statistics for '/etc'
>> 'etc' filesystem flags has not changed
>> 'etc' space usage test succeeded [current space usage=32.2%]
>> 'localhost.localdomain' cpu usage of 2.0% matches resource limit [cpu 
>> usage>0.0%]
>> 'localhost.localdomain' cpu system usage check succeeded [current cpu system 
>> usage=0.6%]
>> 'localhost.localdomain' cpu user usage check succeeded [current cpu user 
>> usage=1.1%]
>> 'localhost.localdomain' mem usage check succeeded [current mem usage=37.8%]
>> 'var' succeeded getting filesystem statistics for '/var'
>> 'var' filesystem flags has not changed
>> 'var' space usage test succeeded [current space usage=32.2%]
>> 'etc' succeeded getting filesystem statistics for '/etc'
>> 'etc' filesystem flags has not changed
>> 'etc' space usage test succeeded [current space usage=32.2%]
>> 'localhost.localdomain' cpu usage of 2.0% matches resource limit [cpu 
>> usage>0.0%]
>> 'localhost.localdomain' cpu system usage check succeeded [current cpu system 
>> usage=0.6%]
>> 'localhost.localdomain' cpu user usage check succeeded [current cpu user 
>> usage=0.9%]
>> 'localhost.localdomain' mem usage check succeeded [current mem usage=37.8%]
>> 'var' succeeded getting filesystem statistics for '/var'
>> 'var' filesystem flags has not changed
>> 'var' spa

Re: "for X cycles" has no effect

2016-10-10 Thread jobhunts02
monitrc is attached.








$ bin/monit -vI -c monitrc
Runtime constants:
 Control file   = /home/jones/monit519/monitrc
 Log file   = syslog
 Pid file   = /home/jones/monit_code/.monit.pid
 Id file    = /home/jones/monit_code/.monit.id
 State file = /home/jones/monit_code/.monit.state
 Debug  = True
 Log    = True
 Use syslog = True
 Is Daemon  = True
 Use process engine = True
 Limits = {
    =   programOutput: 512 B
    =   sendExpectBuffer:  256 B
    =   fileContentBuffer: 512 B
    =   httpContentBuffer: 1024 kB
    =   networkTimeout:    5 s
    = }
 Poll time  = 5 seconds with start delay 0 seconds
 Start monit httpd  = False

The service list contains the following entries:

Filesystem Name   = var
 Path = /var
 Monitoring mode  = active
 On reboot    = start
 Filesystem flags = if changed then alert
 Space usage limit    = if greater than 95.0% then alert

Filesystem Name   = etc
 Path = /etc
 Monitoring mode  = active
 On reboot    = start
 Filesystem flags = if changed then alert
 Space usage limit    = if greater than 95.0% then alert

System Name   = localhost.localdomain
 Monitoring mode  = active
 On reboot    = start
 CPU usage limit  = if greater than 0.0% for 5 cycles then alert
 CPU system limit = if greater than 65.0% then alert
 CPU user limit   = if greater than 75.0% then alert
 Memory usage limit   = if greater than 85.0% then alert

---
pidfile '/home/jones/monit_code/.monit.pid' does not exist
Starting Monit 5.19.0 daemon
'localhost.localdomain' Monit 5.19.0 started
'var' succeeded getting filesystem statistics for '/var'
'var' filesystem flags has not changed
'var' space usage test succeeded [current space usage=32.2%]
'etc' succeeded getting filesystem statistics for '/etc'
'etc' filesystem flags has not changed
'etc' space usage test succeeded [current space usage=32.2%]
'localhost.localdomain' cpu usage check succeeded [current cpu usage=0.0%]
'localhost.localdomain' cpu system usage check skipped (initializing)
'localhost.localdomain' cpu user usage check skipped (initializing)
'localhost.localdomain' mem usage check succeeded [current mem usage=37.8%]
'var' succeeded getting filesystem statistics for '/var'
'var' filesystem flags has not changed
'var' space usage test succeeded [current space usage=32.2%]
'etc' succeeded getting filesystem statistics for '/etc'
'etc' filesystem flags has not changed
'etc' space usage test succeeded [current space usage=32.2%]
'localhost.localdomain' cpu usage of 2.4% matches resource limit [cpu usage>0.0%]
'localhost.localdomain' cpu system usage check succeeded [current cpu system usage=0.8%]
'localhost.localdomain' cpu user usage check succeeded [current cpu user usage=1.4%]
'localhost.localdomain' mem usage check succeeded [current mem usage=37.8%]
'var' succeeded getting filesystem statistics for '/var'
'var' filesystem flags has not changed
'var' space usage test succeeded [current space usage=32.2%]
'etc' succeeded getting filesystem statistics for '/etc'
'etc' filesystem flags has not changed
'etc' space usage test succeeded [current space usage=32.2%]
'localhost.localdomain' cpu usage of 2.0% matches resource limit [cpu usage>0.0%]
'localhost.localdomain' cpu system usage check succeeded [current cpu system usage=0.6%]
'localhost.localdomain' cpu user usage check succeeded [current cpu user usage=1.1%]
'localhost.localdomain' mem usage check succeeded [current mem usage=37.8%]
'var' succeeded getting filesystem statistics for '/var'
'var' filesystem flags has not changed
'var' space usage test succeeded [current space usage=32.2%]
'etc' succeeded getting filesystem statistics for '/etc'
'etc' filesystem flags has not changed
'etc' space usage test succeeded [current space usage=32.2%]
'localhost.localdomain' cpu usage of 2.0% matches resource limit [cpu usage>0.0%]
'localhost.localdomain' cpu system usage check succeeded [current cpu system usage=0.6%]
'localhost.localdomain' cpu user usage check succeeded [current cpu user usage=0.9%]
'localhost.localdomain' mem usage check succeeded [current mem usage=37.8%]
'var' succeeded getting filesystem statistics for '/var'
'var' filesystem flags has not changed
'var' space usage test succeeded [current space usage=32.2%]
'etc' succeeded getting filesystem statistics for '/etc'
'etc' filesystem flags has not changed
'etc' space usage test succeeded [current space usage=32.2%]
'localhost.localdomain' cpu usage of 2.4% matches resource limit [cpu usage>0.0%]
'localhost.localdomain' cpu system usage check succeeded [current cpu system usage=0.7%]
'localhost.localdomain' cpu user usage check succeeded [current cpu user usage

Re: "for X cycles" has no effect

2016-10-08 Thread Martin Pala
Hello,

please send your monit configuration file, run monit in debug mode and provide 
output:

monit -vI

Best regards,
Martin



> On 8 Oct 2016, at 03:05, jobhunt...@aol.com wrote:
> 
> With "set daemon 5," I changed it to:
> 
> if cpu > 0% for 5 cycles then alert
> 
> Oct  7 17:46:09 localhost monit[30479]: Starting Monit 5.19.0 daemon
> Oct  7 17:46:09 localhost monit[30479]: 'localhost.localdomain' Monit 5.19.0 
> started
> Oct  7 17:46:14 localhost monit[30479]: 'localhost.localdomain' cpu usage of 
> 3.2% matches resource limit [cpu usage>0.0%]
> 
> Monit started at 17:46:09.  I would expect to get the first alert at 17:46:34 
> (after 5 cycles of 5 seconds), but I get it after 5 seconds, and alerts every 
> 5 seconds thereafter.
> 
> 
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: "for X cycles" has no effect

2016-10-07 Thread jobhunts02
With "set daemon 5," I changed it to:

if cpu > 0% for 5 cycles then alert

Oct  7 17:46:09 localhost monit[30479]: Starting Monit 5.19.0 daemon
Oct  7 17:46:09 localhost monit[30479]: 'localhost.localdomain' Monit 5.19.0 
started
Oct  7 17:46:14 localhost monit[30479]: 'localhost.localdomain' cpu usage of 
3.2% matches resource limit [cpu usage>0.0%]

Monit started at 17:46:09.  I would expect to get the first alert at 17:46:34 
(after 5 cycles of 5 seconds), but I get it after 5 seconds, and alerts every 5 
seconds thereafter.



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

Re: "for X cycles" has no effect

2016-10-07 Thread Paul Theodoropoulos

On 10/7/16 15:03, jobhunt...@aol.com wrote:

When I add "for X cycles" to my statements in monitrc, e.g.,

if cpu usage > 95% for 5 cycles then alert

It has no effect.  It alerts every cycle as if it was "for 1 cycles."

Is there something else I need to do for the limit to be reached multiple times 
 before alerting?

I am running monit-5.19.0 on Linux 3.19.8.


The CPU resource test doesn't use the word 'usage' in it - it's either just

if cpu > 95% [etc] or
if total cpu([user|system|wait]) > 95% [etc]

I found cpu too sensitive most of the time in my  use-case, and stick 
with just loadavg -


if loadavg (5min) is greater than 3.0 for 2 cycles then alert

that gives you a smooth(er) window against to test if the system is 
really under continuous load or just dealing with a very brief spike or 
spikes.



--
Paul Theodoropoulos
www.anastrophe.com

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