syntax for dir size check when using wildcards
list Charles Goyard
Hi, I have a number of application whose number or names are subject to change. Each of them has a var/ dir in the directory structure. Something like (the example is plain dumb, but it's an example) : /var/svn/projects/hobbit-4.2-beta/db /var/svn/project/hobbitexts/db /var/svn/projects/hobbithttp/db So to monitor the sizes of every single module db's directory, I added : client-local.cfg : dir:/var/svn/projects/*/db the client returns the expected data : 6737 /var/svn/projects/hobbit-4.2-beta/db/revs 0 /var/svn/projects/hobbit-4.2-beta/db/transactions 81 /var/svn/projects/hobbit-4.2-beta/db/revprops 6835 /var/svn/projects/hobbit-4.2-beta/db 160 /var/svn/projects/hobbithttp/db/revs 0 /var/svn/projects/hobbithttp/db/transactions 24 /var/svn/projects/hobbithttp/db/revprops 202 /var/svn/projects/hobbithttp/db 217 /var/svn/projects/hobbitexts/db/revs 0 /var/svn/projects/hobbitexts/db/transactions 141 /var/svn/projects/hobbitexts/db/revprops 375 /var/svn/projects/hobbitexts/db But if I add this in hobbit-clients.cfg it does not work : DIR %^/var/svn/projects/.+/db$ red size<300 Try also with only : DIR %db$ red size<300 not luck. So I changed client-local.cfg to: dir:/var/svn/projects/ still not working. So, does the regex matches only on the dirname that show in the [dir:] section ? -- Charles Goyard - user-98f9625a7a59@xymon.invalid - (+33) 1 45 38 01 31
list Henrik Størner
▸
On Thu, Aug 03, 2006 at 12:24:24PM +0200, Charles Goyard wrote:
/var/svn/projects/hobbit-4.2-beta/db /var/svn/project/hobbitexts/db /var/svn/projects/hobbithttp/db So to monitor the sizes of every single module db's directory, I added : client-local.cfg : dir:/var/svn/projects/*/db
Nope, that is wrong. If you want to use wildcards then you must run a local client command to generate the directory names. In your case, something like dir:`ls -d /var/svn/projects/*/db` should do it. The difference is that when using a command like that, each of the directories end up in a separate section in the client message. And the directory size checking is done once per section, where it just checks the last line (because the ones above are supposed to be just subdirs of the directory you really want to check). Regards, Henrik
list Charles Goyard
Henrik Stoerner a écrit :
client-local.cfg : dir:/var/svn/projects/*/dbdir:`ls -d /var/svn/projects/*/db` should do it.
Well, it just works, thanks ! -- Charles Goyard - user-98f9625a7a59@xymon.invalid - (+33) 1 45 38 01 31