Xymon Mailing List Archive search

testing folder modified date on winderz?

5 messages in this thread

list John Rothlisberger · Tue, 17 Jan 2012 18:30:57 +0000 ·
Has anyone created an external script for BBWin which would be able to check the modification date of a folder on a Windows server?

I am looking for something similar to the FILE test where mtime<NNN but for a folder/directory.

Thanks,
John
John Rothlisberger
IT Strategy, Infrastructure & Security - Technology Growth Platform
TGP for Business Process Outsourcing
Accenture
XXX.XXX.XXXX office


Subject to local law, communications with Accenture and its affiliates including telephone calls and emails (including content), may be monitored by our systems for the purposes of security and the assessment of internal compliance with Accenture policy.

www.accenture.com
list Josh Luthman · Tue, 17 Jan 2012 13:55:10 -0500 ·
Doesn't FILE work for directories?

Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX
quoted from John Rothlisberger


On Tue, Jan 17, 2012 at 1:30 PM,  <user-7adce57665bb@xymon.invalid> wrote:
Has anyone created an external script for BBWin which would be able to check
the modification date of a folder on a Windows server?


I am looking for something similar to the FILE test where mtime<NNN but for
a folder/directory.


Thanks,

John


John Rothlisberger

IT Strategy, Infrastructure & Security - Technology Growth Platform

TGP for Business Process Outsourcing

Accenture

XXX.XXX.XXXX office


Subject to local law, communications with Accenture and its affiliates
including telephone calls and emails (including content), may be monitored
by our systems for the purposes of security and the assessment of internal
compliance with Accenture policy.

www.accenture.com

list John Rothlisberger · Tue, 17 Jan 2012 19:38:21 +0000 ·
No, when I use the FILE spec on a directory/folder it says "File is missing" along with an "Error: Access denied".

But, to show that it's not actually a permission problem I checked a file within the directory/folder and that tests works with the FILE spec as expected.
signature


Thanks,
John
John Rothlisberger
IT Strategy, Infrastructure & Security - Technology Growth Platform
TGP for Business Process Outsourcing
Accenture
XXX.XXX.XXXX office

-----Original Message-----

quoted from Josh Luthman
From: Josh Luthman [mailto:user-4c45a83f15cb@xymon.invalid]
Sent: Tuesday, January 17, 2012 12:55 PM
To: Rothlisberger, John R.
Cc: xymon at xymon.com
Subject: Re: [Xymon] testing folder modified date on winderz?

Doesn't FILE work for directories?

Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX


On Tue, Jan 17, 2012 at 1:30 PM,  <user-7adce57665bb@xymon.invalid> wrote:
Has anyone created an external script for BBWin which would be able to
check the modification date of a folder on a Windows server?


I am looking for something similar to the FILE test where mtime<NNN
but for a folder/directory.


Thanks,

John

____
John Rothlisberger

IT Strategy, Infrastructure & Security - Technology Growth Platform

TGP for Business Process Outsourcing

Accenture

XXX.XXX.XXXX office

____

Subject to local law, communications with Accenture and its affiliates
including telephone calls and emails (including content), may be
monitored by our systems for the purposes of security and the
assessment of internal compliance with Accenture policy.


www.accenture.com

Subject to local law, communications with Accenture and its affiliates including telephone calls and emails (including content), may be monitored by our systems for the purposes of security and the assessment of internal compliance with Accenture policy.

www.accenture.com
list Jeremy Laidman · Wed, 18 Jan 2012 17:45:34 +1100 ·
quoted from John Rothlisberger
On Wed, Jan 18, 2012 at 6:38 AM,  <user-7adce57665bb@xymon.invalid> wrote:
No, when I use the FILE spec on a directory/folder it says "File is missing" along with an "Error: Access denied".
I use file on a directory and it works for me.  However, I specify the
directory using backticks, along with the directories contents, but I
don't know how that would change anything.  What I'm doing is checking
if someone changed the group ownership for entries (files or
subdirectories) in the directory "/var/named/", so that different
users in the same group can edit the files.  My client-local.cfg has:

[myhost]
file:`/bin/ls -a /var/named/ | sed
'/^\.$/d;/^\.\.$/d;/^lost+found$/d;s|^|/var/named/|'`:2048

This gives me lots of entries in my client data, each one showing the
perms, ownership, size, and so on.  One of them is:

[file:/var/named/master]
type:40000 (directory)
mode:2775 (drwxrwsr-x)
linkcount:3
owner:65535 (d619539)
group:44 (named)
size:4096
clock:1326866742 (2012/01/18-17:05:42)
atime:1326866742 (2012/01/18-17:05:42)
ctime:1326783927 (2012/01/17-18:05:27)
mtime:1326783927 (2012/01/17-18:05:27)

Then in my analysis.cfg I have this:

HOST=%^myhost
        FILE %/var/named/(\.[^\.]*|[^\.].*) yellow groupid=named

which detects when the group name is incorrect on any dirent not
starting with "..", and sets "file" to yellow.  I just tested this and
it works.

Cheers
Jeremy
list John Rothlisberger · Wed, 18 Jan 2012 12:49:26 +0000 ·
Testing a directory mod date on a *nix platform would be a piece of cake.

I did say this was for a folder that resides on a windows server.
signature

Thanks,
John
John Rothlisberger
IT Strategy, Infrastructure & Security - Technology Growth Platform
TGP for Business Process Outsourcing
Accenture
XXX.XXX.XXXX office
-----Original Message-----

quoted from Jeremy Laidman
From: Jeremy Laidman [mailto:user-71895fb2e44c@xymon.invalid]
Sent: Wednesday, January 18, 2012 12:46 AM
To: Rothlisberger, John R.
Cc: xymon at xymon.com
Subject: Re: [Xymon] testing folder modified date on winderz?

On Wed, Jan 18, 2012 at 6:38 AM,  <user-7adce57665bb@xymon.invalid> wrote:
No, when I use the FILE spec on a directory/folder it says "File is missing" along
with an "Error: Access denied".
I use file on a directory and it works for me.  However, I specify the directory using
backticks, along with the directories contents, but I don't know how that would
change anything.  What I'm doing is checking if someone changed the group
ownership for entries (files or
subdirectories) in the directory "/var/named/", so that different users in the same
group can edit the files.  My client-local.cfg has:

[myhost]
file:`/bin/ls -a /var/named/ | sed
'/^\.$/d;/^\.\.$/d;/^lost+found$/d;s|^|/var/named/|'`:2048

This gives me lots of entries in my client data, each one showing the perms,
ownership, size, and so on.  One of them is:

[file:/var/named/master]
type:40000 (directory)
mode:2775 (drwxrwsr-x)
linkcount:3
owner:65535 (d619539)
group:44 (named)
size:4096
clock:1326866742 (2012/01/18-17:05:42)
atime:1326866742 (2012/01/18-17:05:42)
ctime:1326783927 (2012/01/17-18:05:27)
mtime:1326783927 (2012/01/17-18:05:27)

Then in my analysis.cfg I have this:

HOST=%^myhost
        FILE %/var/named/(\.[^\.]*|[^\.].*) yellow groupid=named

which detects when the group name is incorrect on any dirent not starting with "..",
and sets "file" to yellow.  I just tested this and it works.

Cheers
Jeremy

Subject to local law, communications with Accenture and its affiliates including telephone calls and emails (including content), may be monitored by our systems for the purposes of security and the assessment of internal compliance with Accenture policy.

www.accenture.com