Xymon Mailing List Archive search

Testing files

3 messages in this thread

list Jaap Winius · Thu, 12 Jul 2018 17:36:36 +0000 ·
Hi folks,

According to  http://xymon.sourceforge.net/xymon/help/manpages/man5/client-local.cfg.5.htm  it's possible to add file configuration entries to  /etc/xymon/client-local.cfg. For example, to check for the existence  of a file called /tmp/krb5cc_0 on host.example.com, I'd add this stanza:

   [bap1.umrk.nl]
   file:/tmp/krb5cc_0

That works. However, the above mentioned manpage also says this about  file configuration entries:

"A file monitoring entry is used to watch the meta-data of a file:  Owner, group, size, permissions, checksum etc."

Meta data? How is that done? Except for some hash settings, no  examples are given. To check to see if the example file is always less  than 3600 seconds old, I would think something like this would be  necessary:

   [bap1.umrk.nl]
   file:/tmp/krb5cc_0 mtime<3600

Or possibly:

   [bap1.umrk.nl]
   file:/tmp/krb5cc_0:mtime<3600

But, these don't seem to work: Xymon still only reports that the file exists.

Would anyone mind explaining what the correct syntax is for this file  test and perhaps other ones like it (e.g. for owner, group, file size,  permissions)?

Thanks,

Jaap
list Galen Johnson · Thu, 12 Jul 2018 13:41:01 -0400 ·
Look at the analysis,cfg file or man page for how to do what you're
asking.  That is where you add your file tests.  The client-local.cfg makes
the files available to be monitored.
quoted from Jaap Winius

On Thu, Jul 12, 2018 at 1:36 PM Jaap Winius <user-16708c3648e1@xymon.invalid> wrote:
Hi folks,

According to

http://xymon.sourceforge.net/xymon/help/manpages/man5/client-local.cfg.5.htm

it's possible to add file configuration entries to
/etc/xymon/client-local.cfg. For example, to check for the existence
of a file called /tmp/krb5cc_0 on host.example.com, I'd add this stanza:

   [bap1.umrk.nl]
   file:/tmp/krb5cc_0

That works. However, the above mentioned manpage also says this about
file configuration entries:

"A file monitoring entry is used to watch the meta-data of a file:
Owner, group, size, permissions, checksum etc."

Meta data? How is that done? Except for some hash settings, no
examples are given. To check to see if the example file is always less
than 3600 seconds old, I would think something like this would be
necessary:

   [bap1.umrk.nl]
   file:/tmp/krb5cc_0 mtime<3600

Or possibly:

   [bap1.umrk.nl]
   file:/tmp/krb5cc_0:mtime<3600

But, these don't seem to work: Xymon still only reports that the file
exists.

Would anyone mind explaining what the correct syntax is for this file
test and perhaps other ones like it (e.g. for owner, group, file size,
permissions)?

Thanks,

Jaap

list Damien Martins · Fri, 13 Jul 2018 08:49:15 +0300 ·
Hi Jaap,


A very long time ago, I did this kind of dirty thing:

file:`find /var/lock/ -maxdepth 1 -type f -name backup.lock -mmin +60`
I'm not proud of, but it works... So you can adapt easily with the "find" command features.


Regards,
quoted from Jaap Winius


Le 12/07/2018 à 20:36, Jaap Winius a écrit :
Hi folks,

According to http://xymon.sourceforge.net/xymon/help/manpages/man5/client-local.cfg.5.htm it's possible to add file configuration entries to /etc/xymon/client-local.cfg. For example, to check for the existence of a file called /tmp/krb5cc_0 on host.example.com, I'd add this stanza:

  [bap1.umrk.nl]
  file:/tmp/krb5cc_0

That works. However, the above mentioned manpage also says this about file configuration entries:

"A file monitoring entry is used to watch the meta-data of a file: Owner, group, size, permissions, checksum etc."

Meta data? How is that done? Except for some hash settings, no examples are given. To check to see if the example file is always less than 3600 seconds old, I would think something like this would be necessary:

  [bap1.umrk.nl]
  file:/tmp/krb5cc_0 mtime<3600

Or possibly:

  [bap1.umrk.nl]
  file:/tmp/krb5cc_0:mtime<3600

But, these don't seem to work: Xymon still only reports that the file exists.

Would anyone mind explaining what the correct syntax is for this file test and perhaps other ones like it (e.g. for owner, group, file size, permissions)?

Thanks,

Jaap

-- 

Cordialement,
Damien Martins