monit-dev
[Top][All Lists]
Advanced

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

LANGUAGE CHANGES - service templates


From: Martin Pala
Subject: LANGUAGE CHANGES - service templates
Date: Wed, 06 Aug 2003 10:54:38 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030711

According to new syntax, it could be usefull to simplify file/device/directory 
related tests and restrict them to file/device/directory. In such case it won't 
be needed to specify 'path' because the statement's test will be related to 
path specified in service definition. I implemented 'size' statement this way 
(currently 'file' exclusive directive):

check file myfile with path /foo/bar
 if size > 100 MB then alert


=> the test is related to /foo/bar file. If you need another 'file' tests, you 
will specify them in their own checks.


For example 'timestamp' or 'checksum' statements could be changed in the same 
sense. It can be allowed only in file/device/directory monitoring services 
types and don't require explicit path.

For example instead of:

check file myfile with path /foo/bar
 if timestamp /foo/bar > 1 day then alert
 if checksum /foo/bar and expect the sum 123456
 if size > 100 MB then alert

we can write:

check file myfile with path /foo/bar
 if timestamp > 1 day then alert
 if checksum and expect the sum 123456
 if size > 100 MB then alert


---

More complex example (it will involve more check statements in comparision with 
present solution, but it provides very powerfull options):


check stored with pidfile /msg-foo/config/pidfile.store
 start program  "/usr/iplanet/msg-ims-1/start-msg store"
 stop program  "/usr/iplanet/msg-ims-1/stop-msg store"
 depend stored_ckp
 depend stored_lcu
 depend stored_per
 depend stored_bin

check file stored_ckp with path /msg-foo/config/stored.ckp
 if failed timestamp > 1 minute then alert

check file stored_lcu with path /msg-foo/config/stored.lcu
 if failed timestamp > 5 minutes then alert

check file stored_per with path /msg-foo/config/stored.per
 if failed timestamp > 1 hour then alert

check file stored_bin with path /msg-foo/bin/stored
 if failed checksum and expect the sum 123456 then stop
 if failed permission 755 then stop
 if failed uid iplanet then stop
 if failed gid iplanet then stop
 if failed size != 655476 then stop


Timestamp, checksum and probably other file/device/directory directives need 
not to be supported under process. In such case it will involve incompatible 
change, but because we already did some such changes, it could be better to 
make all changes and language cleanup now, then make another incompatible 
changes in the future. With IF/THEN/ELSE syntax it can provide good language 
base for the future.

We have now generic monitoring service template (currently process/file/directory/device) which 
could be extended for new types. It is similar to OOP templates - there is one common 
"predecessor class" containing common inherited atributes (such as start, stop, alert, 
timeout, etc.) and "descendants classes" with context related extensions (size, checksum, 
timestamp). Each monitoring service type can support all related attributes which are logical for 
it.

We can use dependency between particular services to create the tree which will 
describe the system properly.


What do you think?

Martin






reply via email to

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