Martin Pala <address@hidden> writes:
Control language clean-up is possible, e.g. allow all "file" related
tests (like 'checksum', 'timestamp', etc.) in just "file" service
type. These test then could be simplified - the 'path' part could be
removed, because the path will be specified in 'file service'
definition. For example replace :
checksum /usr/local/apache/bin/httpd and expect the sum
8f7f419955cefa0b33a2ba316cba3659
with
checksum and expect the sum 8f7f419955cefa0b33a2ba316cba3659
More complex example:
---
check process apache with path /usr/local/apache/logs/httpd.pid
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
depends on apache_rc
depends on apache_binary
depends on apache_conf
...
check file apache_rc with path /etc/init.d/httpd
checksum and expect the sum 1a6d429254cafa8b34c2bb317cba2118
if timestamp changed the alert
perm 755 # just example
check file apache_binary with path /usr/local/apache/bin/httpd
checksum and expect the sum 8f7f419955cefa0b33a2ba316cba3659
if timestamp changed the alert
perm 755 # just example
check file apache_conf with path /etc/httpd/conf/httpd.conf
if timestamp changed the reload
size < 10 MB
perm 755 # just example
---
This looks very nice, but..
If any of these files is removed, action is taken by monit.
Though such configuration is clean, logical and object oriented, i
think it is probably usefull to have present shortcut and allow to
define file related test in other service types as well.
the checksum test should be kept for process-services because it's
directly connected to the process in that a process is not checked
anymore by monit if any of its programs was changed. BTW, I haven't
tested the above configuration, will it actually work with the current
monit? If so, it's cooool :)