Git Product home page Git Product logo

monit's People

Contributors

alexarwine avatar asomers avatar cgzones avatar danielfojt avatar demahum avatar duke-bartholomew avatar eltopo avatar guillemj avatar harrigan avatar hippolin avatar jasperla avatar jlduran avatar jyoung15 avatar mrchucho avatar mschenck avatar neheb avatar rdnelson avatar rixvet avatar si458 avatar skirpichev avatar socolin avatar szepeviktor avatar tildeslash avatar vovinacci avatar yazgoo avatar

Watchers

 avatar  avatar

monit's Issues

monit reports wrong status

(bitbucket issue 810)
This CHECK PROGRAM generates random successes and failures, using bash's $RANDOM to trigger divide by 0.
As you see, in case of SUCCESS, MONIT_EVENT still shows 'Status failed'
In fact, it always shows this status. The UI paints accordingly.


Relevant configuration:
     43      CHECK PROGRAM NodeManager WITH PATH "/bin/bash -c 'echo $(( 1/($RANDOM%2) ))'"
     44        IF STATUS = 0 THEN EXEC "/bin/bash -c '/bin/env | grep MONIT| cat - <(echo SUCCESS;echo)'"  
     45        REPEAT EVERY 1 CYCLES
     46
     47        IF STATUS !=0 THEN EXEC "/bin/bash -c '/bin/env | grep MONIT| cat - <(echo FAILURE;echo)'"
     48        REPEAT EVERY 1 CYCLES

[dab@d129668-005:/home/dab] /home/dab/scripts/monit -c /home/dab/UserDirs/dba/dev/utils/monit.conf -v | egrep -v 'proc file|system statistic|M/Monit'
M/Monit enabled but no httpd allowed -- please add 'set httpd' statement
Runtime constants:
 Control file       = /home/dab/UserDirs/dba/dev/utils/monit.conf
 Log file           = (not defined)
 Pid file           = /home/dab/.monit.pid
 Id file            = /local/data/scratch/monit.id
 State file         = /local/data/scratch/monit.state
 Debug              = True
 Log                = False
 Use syslog         = False
 Is Daemon          = True
 Use process engine = True
 Limits             = {
                    =   programOutput:     512 B
                    =   sendExpectBuffer:  256 B
                    =   fileContentBuffer: 512 B
                    =   httpContentBuffer: 1 kB
                    =   networkTimeout:    5 s
                    =   programTimeout:    30 s
                    =   stopTimeout:       10 s
                    =   startTimeout:      10 s
                    =   restartTimeout:    10 s
                    = }
 On reboot          = start
 Poll time          = 3 seconds with start delay 0 seconds
 Mail from          = Monit Support <[email protected]>
 Mail reply to      = [email protected]
 Mail subject       = $SERVICE $EVENT at $DATE
 Mail message       = Monit $ACTION $SERVI..(truncated)
 Start monit httpd  = False

The service list contains the following entries:

System Name           = d341369-005
 Monitoring mode      = active
 On reboot            = start
 Every                = Check service every 1 cycles

Program Name          = NodeManager
 Path                 = /bin/bash -c echo $(( 1/($RANDOM%2) ))
 Monitoring mode      = active
 On reboot            = start
 Program timeout      = terminate the program if not finished within 30 s
 Status               = if exit value != 0 then exec '/bin/bash -c /bin/env | grep MONIT| cat - <(echo FAILURE;echo)' repeat every 1 cycle(s)
 Status               = if exit value = 0 then exec '/bin/bash -c /bin/env | grep MONIT| cat - <(echo SUCCESS;echo)' repeat every 1 cycle(s)

-------------------------------------------------------------------------------
pidfile '/home/dab/.monit.pid' does not exist
Starting Monit 5.25.3 daemon
'd341369-005' Monit 5.25.3 started
'NodeManager' program started
'NodeManager' status succeeded (0) -- 1
'NodeManager' status failed (0) -- 1
'NodeManager' exec: '/bin/bash -c /bin/env | grep MONIT| cat - <(echo SUCCESS;echo)'
MONIT_PROGRAM_STATUS=0
MONIT_DATE=Tue, 29 Jan 2019 11:47:44
MONIT_HOST=d341369-005
MONIT_EVENT=Status failed
MONIT_SERVICE=NodeManager
MONIT_DESCRIPTION=status failed (0) -- 1
SUCCESS

'NodeManager' program started
'NodeManager' status failed (1) -- /bin/bash: 1/(5532%2) : division by 0 (error token is ") ")
'NodeManager' exec: '/bin/bash -c /bin/env | grep MONIT| cat - <(echo FAILURE;echo)'
'NodeManager' status succeeded (1) -- /bin/bash: 1/(5532%2) : division by 0 (error token is ") ")
'NodeManager' program started
MONIT_PROGRAM_STATUS=1
MONIT_DATE=Tue, 29 Jan 2019 11:47:47
MONIT_HOST=d341369-005
MONIT_EVENT=Status failed
MONIT_SERVICE=NodeManager
MONIT_DESCRIPTION=status failed (1) -- /bin/bash: 1/(5532%2) : division by 0 (error token is ") ")
FAILURE

'NodeManager' status succeeded (0) -- 1
'NodeManager' status failed (0) -- 1
'NodeManager' exec: '/bin/bash -c /bin/env | grep MONIT| cat - <(echo SUCCESS;echo)'
MONIT_PROGRAM_STATUS=0
MONIT_DATE=Tue, 29 Jan 2019 11:47:50
MONIT_HOST=d341369-005
MONIT_EVENT=Status failed
MONIT_SERVICE=NodeManager
MONIT_DESCRIPTION=status failed (0) -- 1
SUCCESS

'NodeManager' program started
'NodeManager' status succeeded (0) -- 1
'NodeManager' status failed (0) -- 1
'NodeManager' exec: '/bin/bash -c /bin/env | grep MONIT| cat - <(echo SUCCESS;echo)'
MONIT_PROGRAM_STATUS=0
MONIT_DATE=Tue, 29 Jan 2019 11:47:53
MONIT_HOST=d341369-005
MONIT_EVENT=Status failed
MONIT_SERVICE=NodeManager
MONIT_DESCRIPTION=status failed (0) -- 1
SUCCESS

monit -v mode overpowers with useless info

example, even with an all but empty configuration (nothing being monitored), monit -v dumps this stuff every second, filling the log and obstructing the useful info.
Without -v it's silent and doesn't output anything.
This is the stuff I need, and it's only available with -v:

'LongRunningCheck' status check deferred - waiting on program to exit
'LongRunningCheck' status succeeded (0) -- no output
'LongRunningCheck' program started
'LongRunningCheck' status check deferred - waiting on program to exit

Below is the stuff I want to get rid of:

  1. Why is it looking for all procs running on the system, when not asked to do so?

  2. Does it expect to be running as root? (Docs don't say it)

  3. Is there a way to turn it off?

Cannot open proc file '/proc/9011/io' -- Permission denied
Cannot read proc file '/proc/9011/attr/current' -- Invalid argument
Cannot open proc file '/proc/9012/io' -- Permission denied
Cannot read proc file '/proc/9012/attr/current' -- Invalid argument
Cannot open proc file '/proc/9013/io' -- Permission denied
Cannot read proc file '/proc/9013/attr/current' -- Invalid argument
Cannot open proc file '/proc/9017/io' -- Permission denied
Cannot read proc file '/proc/9017/attr/current' -- Invalid argument
Cannot open proc file '/proc/902/io' -- Permission denied
Cannot read proc file '/proc/902/attr/current' -- Invalid argument
Cannot open proc file '/proc/909/io' -- Permission denied
Cannot read proc file '/proc/909/attr/current' -- Invalid argument
Cannot open proc file '/proc/912/io' -- Permission denied
Cannot read proc file '/proc/912/attr/current' -- Invalid argument
Cannot open proc file '/proc/915/io' -- Permission denied
Cannot read proc file '/proc/915/attr/current' -- Invalid argument
Cannot read proc file '/proc/9348/attr/current' -- Invalid argument
Cannot open proc file '/proc/940/io' -- Permission denied
Cannot read proc file '/proc/940/attr/current' -- Invalid argument
Cannot open proc file '/proc/941/io' -- Permission denied
Cannot read proc file '/proc/941/attr/current' -- Invalid argument
Cannot open proc file '/proc/943/io' -- Permission denied
Cannot read proc file '/proc/943/attr/current' -- Invalid argument
Cannot open proc file '/proc/946/io' -- Permission denied
Cannot read proc file '/proc/946/attr/current' -- Invalid argument
Cannot open proc file '/proc/952/io' -- Permission denied
Cannot read proc file '/proc/952/attr/current' -- Invalid argument
Cannot open proc file '/proc/958/io' -- Permission denied
Cannot read proc file '/proc/958/attr/current' -- Invalid argument
Cannot read proc file '/proc/9647/attr/current' -- Invalid argument
Cannot open proc file '/proc/9669/io' -- Permission denied
Cannot read proc file '/proc/9669/attr/current' -- Invalid argument
Cannot open proc file '/proc/9700/io' -- Permission denied
Cannot read proc file '/proc/9700/attr/current' -- Invalid argument
Cannot open proc file '/proc/9702/io' -- Permission denied
Cannot read proc file '/proc/9702/attr/current' -- Invalid argument
Cannot open proc file '/proc/9730/io' -- Permission denied
Cannot read proc file '/proc/9730/attr/current' -- Invalid argument
Cannot open proc file '/proc/9759/io' -- Permission denied
Cannot read proc file '/proc/9759/attr/current' -- Invalid argument

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.