monit-dev
[Top][All Lists]
Advanced

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

Re: monitrc erroneous line numbering off by one


From: Martin Pala
Subject: Re: monitrc erroneous line numbering off by one
Date: Wed, 11 Feb 2004 21:28:59 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040122 Debian/1.6-1

Hi,

i tried it, it seems that the erroneous line number reporting is broken. It reports bad line nember for all false options, which i tried.

In the attachment are two examples - little bit modified Peter Holdaway's monitrc (it is dumb version which is able to go through parser without modification independent on the system) and another simple one. If you will configure monit --without-resource, you will obtain:


I.

unicorn:~/cvs/monit# ./monit -vIc ../monitrc.pholdaway
monit: Adding credenitials for user 'admin'.
monit: error: Hostname 'localhosttttttttttt' did not resolve at line 17
monit: error: Cannot activate service check at line 20
(The process status engine was disabled. On certain systems you must
        run monit as root to utilize this feature)
monit: error: The number of cycles must be greater then 0 in line 20

... where:
- allow localhosttttttttttt error is off by 7 lines
- disabled process status engine support related error is off by 1 line
- bad cycles specification error (<0) is off by one line



II.

unicorn:~/cvs/monit# ./monit -vIc ../monitrc.mp
monit: error: Hostname 'localhosttttttt' did not resolve at line 6

... where monitrc.mp:
- allow localhosttttttttttt error is off by 1 lines


I looked on it, it seems that there are two errors:

1.) "off by one" is caused in p.y, where the line reported is given as "lineno-1" value. When changed to "lineno", the result was correct. This error is fixed in cvs now.

2.) parser increments the line position (lineno) by all empty and comment lines following the invalid line, which is reported. Can some flex guru look on it? Both attached configurations still produces this kind of error.


Thanks :)
Martin


-------- Original Message --------
Subject: Error report off by one.
Date: Mon, 9 Feb 2004 16:49:52 -0800
From: Peter Holdaway <address@hidden>
To: <address@hidden>


Hi,

  With reference to the previous monitrc I sent you. When running as an
unprivileged user I see...

address@hidden $ ./monit -v -c /etc/monitrc
monit: Adding credenitials for user 'admin'.
monit: error: Cannot activate service check at line 23
(The process status engine was disabled. On certain systems you must
        run monit as root to utilize this feature)
monit: error: Cannot activate service check at line 36
(The process status engine was disabled. On certain systems you must
        run monit as root to utilize this feature)
monit: error: Cannot activate service check at line 48
(The process status engine was disabled. On certain systems you must
        run monit as root to utilize this feature)
monit: error: Cannot activate service check at line 61
(The process status engine was disabled. On certain systems you must
        run monit as root to utilize this feature)
monit: error: Cannot activate service check at line 74
(The process status engine was disabled. On certain systems you must
        run monit as root to utilize this feature)
monit: error: Cannot activate service check at line 87
(The process status engine was disabled. On certain systems you must
        run monit as root to utilize this feature)


Where an extract from monitrc is...

     19
     20
     21 check process AppManager with pidfile "/var/lxs/run/AppManager.pid"
     22     start program = "/opt/lxs/bin/lxs.sh start AppManager"
     23     stop program = "/opt/lxs/bin/lxs.sh stop AppManager"
     24     if memory > 200 MB for 5 cycles then restart
     25     group lxs
     26     depends on AppManager_monit
     27 #    alert address@hidden
     28


Cheers

  Peter
set daemon  60
set logfile /var/log/monit
set mailserver smtp.chello.cz
set mail-format { from: address@hidden }
set httpd port 2812 address localhost allow localhosttttttt
                   
check device cdrom with path /dev/hdc
  start "/bin/mount /dev/hdc /cdrom"
  stop  "/bin/bash -c '/bin/umont /dev/hdc; /usr/bin/eject;'"
  if failed uid root then alert
  if failed gid disk then alert
  if failed permission 660 then alert
  alert address@hidden
                                                              
check device disk1 with path /
  alert address@hidden
                                                                       
check host redhat with address rhn.redhat.com
  if failed port 80 protocol http  and request "/help/about.pxt" and timeout 10 
seconds then unmonitor
  alert address@hidden
################################################################################
#
# LXS
#

set daemon 20                   # Poll at 20 second intervals
set logfile "/var/log/monit.log"
set httpd port 2812             # Make monit start it's web-server
  allow admin:access            # http basic auth 'admin' with password 'access'
  allow localhosttttttttttt

################################################################################
#
# Group lxs
#


check process AppManager with pidfile "/var/run/AppManager.pid"
        start program = "/bin/true"
        stop program = "/bin/true"
        if memory > 200 MB for 0 cycles then restart
        group lxs
        depends on AppManager_monit

check file AppManager_monit with path "/var/run/AppManager.monit"
        if timestamp > 2 minutes then restart


reply via email to

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