monit-general
[Top][All Lists]
Advanced

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

Re: monit 4.7 and check file existence


From: Jan-Henrik Haukeland
Subject: Re: monit 4.7 and check file existence
Date: Fri, 13 Jan 2006 06:28:10 +0100


On 12. jan. 2006, at 20.48, P Holdaway wrote:

Monit 4.7 now requires the existence of a check file argument for a valid
syntax check?

Yes and the same test is also added for check-directory and check-fifo.

This then prevents monit running, and means the syntax of monitrc is
dependant on the run time environment.

Seems nasty.

Hmm I haven't thought about it like that. This was meant to be an extra check at startup to avoid a string of alerts at runtime if the file is not a file or not there. Mind that should the file disappear when monit is running you will get error alerts as usual and monit will of course not stop. This test is just done at startup.

Since your bring this up, I can see (now) a problem in cases such as if monit is automatically started at boot time you will want monit to start no matter what and that a missing file should not be a show- stopper.

Should we remove this extra test, what do others think?


Ps. The patch below can be used to remove these tests.

--
Jan-Henrik Haukeland
Mobil +47 97141255


Index: p.y
===================================================================
RCS file: /sources/monit/monit/p.y,v
retrieving revision 1.229
diff -d -p -r1.229 p.y
*** p.y 1 Jan 2006 22:44:02 -0000       1.229
--- p.y 13 Jan 2006 05:24:37 -0000
*************** checkproc       : CHECKPROC SERVICENAME
*** 711,719 ****

  checkfile       : CHECKFILE SERVICENAME PATHTOK PATH {
                     check_name($<string>2);
-                    if(!File_isFile($4))
-                      yyerror2("The path in a check file test"
-                               " must point to a file");
createservice(TYPE_FILE, $<string>2, $4, check_file);
                    }
                  ;
--- 711,716 ----
*************** checkdev        : CHECKDEV SERVICENAME P
*** 726,734 ****

  checkdir        : CHECKDIR SERVICENAME PATHTOK PATH {
                     check_name($<string>2);
-                    if(!File_isDirectory($4))
-                      yyerror2("The path in a check directory test"
-                               " must point to a directory");
                     createservice(TYPE_DIRECTORY, $<string>2, $4,
                                   check_directory);
                    }
--- 723,728 ----
*************** checksystem     : CHECKSYSTEM SERVICENAM
*** 751,759 ****

  checkfifo       : CHECKFIFO SERVICENAME PATHTOK PATH {
                     check_name($<string>2);
-                    if(!File_isFifo($4))
-                      yyerror2("The path in a check fifo test"
-                               " must point to a named fifo");
createservice(TYPE_FIFO, $<string>2, $4, check_fifo);
                    }
                  ;
--- 745,750 ----





reply via email to

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