Xymon Mailing List Archive search

test for existence of directory on Windows

6 messages in this thread

list Neil Simmonds · Wed, 21 Mar 2012 10:08:09 -0000 ·
I'm trying to set up a test to check for the existence of certain
directories on windows. We have automated transfers that run but our
users sometimes delete or move the directories by mistake causing the
transfers to fail.

 
I've configured client-local.cfg and analysis.cfg and the test is
working, however if the directory is empty it alerts at yellow and says

 
"Could not determine size of directory E:\dirtest"

 
I'd like to either fix it so that it correctly recognises the directory
exists or stop the yellow alert somehow,

 
I thought of perhaps using "delayyellow=file:10000000 which would give
me about 20 years before it would turn yellow but this is not ideal.

 
Has anyone had this issue and perhaps found a fix?

 
Name & Registered Office: EXPRESS GIFTS LIMITED, 2 GREGORY ST, HYDE, CHESHIRE, ENGLAND, SK14 4TH, Company No. 00718151.
Express Gifts Limited is authorised and regulated by the Financial Services Authority
NOTE:  This email and any information contained within or attached in a separate file is confidential and intended solely for the Individual to whom it is addressed. The information or data included is solely for the purpose indicated or previously agreed. Any information or data included with this e-mail remains the property of Findel PLC and the recipient will refrain from utilising the information for any purpose other than that indicated and upon request will destroy the information and remove it from their records.  Any views or opinions presented are solely those of the author and do not necessarily represent those of Findel PLC. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. No warranties or assurances are made in relation to the safety and content of this e-mail and any attachments.  No liability is accepted for any consequences arising from it. Findel Plc reserves the right to monitor all e-mail communications through its internal and external networks. If you have received this email in error please notify our IT helpdesk on +44(0) 1254 303030
list Malcolm Hunter · Wed, 21 Mar 2012 11:29:37 +0100 ·
quoted from Neil Simmonds
----- Original Message -----
From: Neil Simmonds
Sent: 03/21/12 10:08 AM
To: xymon at xymon.com
Subject: [Xymon] test for existence of directory on Windows

I'm trying to set up a test to check for the existence of certain
directories on windows. We have automated transfers that run but our
users sometimes delete or move the directories by mistake causing the
transfers to fail.

 

I've configured client-local.cfg and analysis.cfg and the test is
working, however if the directory is empty it alerts at yellow and says

 

"Could not determine size of directory E:\dirtest"

 

I'd like to either fix it so that it correctly recognises the directory
exists or stop the yellow alert somehow,

 

I thought of perhaps using "delayyellow=file:10000000 which would give
me about 20 years before it would turn yellow but this is not ideal.
You could create a small hidden file in the folder - then it's never empty.

Malcolm
--
BBWin Development - The Windows client for Big Brother and Xymon

http://bbwin.sourceforge.net
http://xymon.sourceforge.net
list Carl Inglis · Wed, 21 Mar 2012 10:57:50 +0000 ·
Personally I have a hidden share for the directory (san_flag$) and use the shares test script that I found on  DeadCat - http://communities.quest.com/docs/DOC-6259. That way if the directory has gone awol, then the test fails and I get the appropriate warning.

Not sure if that would work for you, since you have users interacting with the directory; although it might make them think twice before deleting or moving the directory if they get a warning that the directory is shared. :)

Regards,

Carl


[Rakon Logo]

Carl Inglis
Systems Administrator

Rakon UK Limited
Dowsett House, Sadler Road, Lincoln LN6 3RS, United Kingdom
Tel: +XX (X)XXXX XXXXXX | Fax:+XX (X) XXXX XXXXXX | Mob: +44 (0) 7786 552915
user-96685bdc864b@xymon.invalid | www.rakon.com

[Winner of the NZ Hi-Tech Awards 2011 - Hi-Tech Company of the Decade]
Winner of the 2010 Lincolnshire Business of the Year Award

This message together with any attachments contains confidential information and may be
subject to privilege. If you are not the intended recipient you may not distribute it in any
way, you must notify the sender immediately and delete any copies of the message along
with its attachments.
quoted from Neil Simmonds
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Neil Simmonds
Sent: 21 March 2012 10:08
To: xymon at xymon.com
Subject: [Xymon] test for existence of directory on Windows

I'm trying to set up a test to check for the existence of certain directories on windows. We have automated transfers that run but our users sometimes delete or move the directories by mistake causing the transfers to fail.

I've configured client-local.cfg and analysis.cfg and the test is working, however if the directory is empty it alerts at yellow and says

"Could not determine size of directory E:\dirtest"

I'd like to either fix it so that it correctly recognises the directory exists or stop the yellow alert somehow,

I thought of perhaps using "delayyellow=file:10000000 which would give me about 20 years before it would turn yellow but this is not ideal.

Has anyone had this issue and perhaps found a fix?

Name & Registered Office: EXPRESS GIFTS LIMITED, 2 GREGORY ST, HYDE, CHESHIRE, ENGLAND, SK14 4TH, Company No. 00718151.
Express Gifts Limited is authorised and regulated by the Financial Services Authority
NOTE: This email and any information contained within or attached in a separate file is confidential and intended solely for the Individual to whom it is addressed. The information or data included is solely for the purpose indicated or previously agreed. Any information or data included with this e-mail remains the property of Findel PLC and the recipient will refrain from utilising the information for any purpose other than that indicated and upon request will destroy the information and remove it from their records. Any views or opinions presented are solely those of the author and do not necessarily represent those of Findel PLC. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. No warranties or assurances are made in relation to the safety and content of this e-mail and any attachments. No liability is accepted for any consequences arising from it. Findel Plc reserves the right to monitor all e-mail communications through its internal and external networks. If you have received this email in error please notify our IT helpdesk on +44(0) 1254 303030


Rakon UK Ltd is a limited company registered in England and Wales.
Registered Office: Dowsett House, Sadler Road, Lincoln LN6 3RS
Company Registration Number: 5128090.

Please be aware that Rakon UK Limited may monitor email traffic data
including the date, time, subject line, sender and recipients for the
purposes of security and usage monitoring. Automated monitoring
systems may also be applied to ascertain whether incoming/outgoing
emails are likely to contain viruses, other destructive devices or
inappropriate content.
list Ulric Eriksson · Wed, 21 Mar 2012 12:31:37 +0100 ·

 On Wed, 21 Mar 2012 10:08:09 -0000, Neil Simmonds wrote:
"Could not determine size of directory E:dirtest"
 What happens if you add a trailing slash after the directory name?

 Ulric
list Neil Simmonds · Wed, 21 Mar 2012 13:34:00 -0000 ·
-----Original Message-----
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On
Behalf Of user-de31148ebe0c@xymon.invalid
Sent: 21 March 2012 11:32
To: xymon at xymon.com
Subject: Re: [Xymon] test for existence of directory on Windows
quoted from Neil Simmonds


 On Wed, 21 Mar 2012 10:08:09 -0000, Neil Simmonds wrote:
"Could not determine size of directory E:dirtest"
 What happens if you add a trailing slash after the directory name?

 Ulric
It appears to ignore the trailing slash. Still gives the same message
and doesn't show the slash on the Xymon page.
quoted from Carl Inglis

Name & Registered Office: EXPRESS GIFTS LIMITED, 2 GREGORY ST, HYDE, CHESHIRE, ENGLAND, SK14 4TH, Company No. 00718151.
Express Gifts Limited is authorised and regulated by the Financial Services Authority
NOTE:  This email and any information contained within or attached in a separate file is confidential and intended solely for the Individual to whom it is addressed. The information or data included is solely for the purpose indicated or previously agreed. Any information or data included with this e-mail remains the property of Findel PLC and the recipient will refrain from utilising the information for any purpose other than that indicated and upon request will destroy the information and remove it from their records.  Any views or opinions presented are solely those of the author and do not necessarily represent those of Findel PLC. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. No warranties or assurances are made in relation to the safety and content of this e-mail and any attachments.  No liability is accepted for any consequences arising from it. Findel Plc reserves the right to monitor all e-mail communications through its internal and external networks. If you have received this email in error please notify our IT helpdesk on +44(0) 1254 303030
list Jeremy Laidman · Thu, 22 Mar 2012 10:45:35 +1100 ·
On Thu, Mar 22, 2012 at 12:34 AM, Neil Simmonds
<user-8188d25e65e4@xymon.invalid> wrote:
[snip]

In Windows (and DOS), the pseudo-file "NUL" exists in every directory.
 So perhaps look for "E:\dirtest\NUL" and see if that "exists".

J