monit-dev
[Top][All Lists]
Advanced

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

current development version of device/file/directory stuff (preview/test


From: Martin Pala
Subject: current development version of device/file/directory stuff (preview/testing)
Date: Tue, 03 Jun 2003 11:17:27 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314

Hi,

current development version of new functionality is in the attachment.

TODO:
- documentation
- size test for file
- owner uid and gid test for file and directory
- cleanup of permission test for file and directory (ready but it isn't yet nice code)

Most of the functionality is ready (device stuff finished, file and directory stuff is to be finished).

Device stuff was tested on solaris8 and linux. It won't work on FreeBSD, state of AIX, HP/UX and MACOS is uknown (need to be ported). I tested it with ext3, ufs and vfat filesystems.

INCOMPATIBLE CHANGES IN COMPARISION WITH MONIT <= 3.x:

1.) new basic syntax is:

CHECK {DEVICE|DIRECTORY|FILE|PROCESS} service_name PATH /depends/on/context

For PROCESS service monitoring task it is possible to use PIDFILE statement instead of PATH too (as in previous versions).

User will need to change the configuration according to above syntax, for example:

check apache with pidfile /usr/local/apache/logs/httpd.pid

to

check process apache with pidfile /usr/local/apache/logs/httpd.pid


I think this is the best way to add new stuff (most clean), though it involves incompatible configuration change. I think we can afford it because of major version change allows to make major changes. We can provide configuration migration script, which will rewrite old configuration to new one.

If you don't agree, we will need to find other way.


2.) because monit is able to monitor not only processes now, i changed tag $PROGRAM of statement mail-format to $SERVICE. This is next incompatible change, but i think it is needed, because PROGRAM is strange tag for device, file or directory => it will be more easy to understand for users (at least new users :)


Example configuration:

check process slapd with pidfile /var/run/slapd.pid
start program = "/etc/init.d/ldap start"
stop program = "/etc/init.d/ldap stop"
port 389 protocol ldap3
cpuusage > 80.0 5 restart
alert address@hidden
mode active
depends on datafs

check device rootfs path /dev/hda6
if space usage > 99 % then alert
if inode usage > 500000 then alert
alert address@hidden
group database
mode passive

check device datafs path /dev/hda1
start program = "/bin/mount /dev/hda1 /data"
stop program = "/bin/umount /dev/hda1"
if space usage > 80 % then alert
if space usage > 99 % then stop
if inode usage > 80 % then alert
if inode usage > 99 % then stop
alert address@hidden
group database

check file su path /bin/su
checksum /bin/su
permission 4755
#uid  root #not implemented yet
#gid  root #not implemented yet
alert address@hidden

check file datafile path /data/testfile
permission 0700
#uid  root #not implemented yet
#gid  root #not implemented yet
#if size > 100 MB then alert #not implemented yet
#if size > 150 MB then stop #not implemented yet
alert address@hidden

check directory bin path /bin
permission 0755
#uid  root #not implemented yet
#gid  root #not implemented yet
alert address@hidden



In the case that 'datafs' will be full (>99%), monit will stop it, which takes down gracefully its dependant ldap server before it will cause data corruption because of lack of space or inodes.


I'll be happy if you want to test it + send me feedback. I'm sorry but i don't have HP/UX, FreeBSD, AIX and MACOS, so i can't prepare new stuff for these systems.


Martin

Attachment: dfd.patch.gz
Description: GNU Zip compressed data


reply via email to

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