﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Ipswitch Forums / Ipswitch Products / WhatsUp Gold  / Checking a Network Path / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Ipswitch Forums</description><link>http://forums.ipswitch.com/</link><webMaster>forums@ipswitch.com</webMaster><lastBuildDate>Tue, 14 Oct 2008 01:52:06 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Checking a Network Path</title><link>http://forums.ipswitch.com/Topic43585-14-1.aspx</link><description>Ignore if you read this, I spoke too soon and can't delete the post.&lt;/P&gt;&lt;P&gt;:crying:</description><pubDate>Mon, 09 Jun 2008 11:54:21 GMT</pubDate><dc:creator>tomkivlin</dc:creator></item><item><title>RE: Checking a Network Path</title><link>http://forums.ipswitch.com/Topic43585-14-1.aspx</link><description>I actually ended up doing something very similar, except it maps the network path as a local drive, then checks the existence of the drive letter. It's definitely not perfect, and it's constantly reporting it as "down" but as long as it doesn't get to "down at least 5 minutes", we won't get paged. I'll test your script to see if it can handle UNC paths, because that would be very much preferable.</description><pubDate>Mon, 12 May 2008 07:54:59 GMT</pubDate><dc:creator>omatsei</dc:creator></item><item><title>RE: Checking a Network Path</title><link>http://forums.ipswitch.com/Topic43585-14-1.aspx</link><description>[quote][b]omatsei (5/8/2008)[/b][hr]I know this has been discussed, but I haven't found the other threads to be very helpful. We have several NAS boxes and network shares that are mission critical, and we'd like to monitor them through WUG. We don't even really care about drive space... we only care that the drives are on the network. I know I can create an active script to monitor the existence of a folder, which seems to be the right way to go, but since WUG runs as a local service and not a domain account (which is something we really don't want), it doesn't have permission to access the network drive, so it reports that it doesn't exist. However, we have set up a domain account that WUG uses to monitor Windows services that should have access to the network drives, so we'd like to use that. That account info is stored as Windows Credentials. In pseudocode, this is what I've been trying to figure out how to tell either JScript or VBScript to do:&lt;br&gt;&lt;br&gt;username = Windows Credentials username&lt;br&gt;password = Windows Credentials password&lt;br&gt;&lt;br&gt;if (folderexists('\\\\fileserver\\path', username, password)) {&lt;br&gt;   Success!&lt;br&gt;} else {&lt;br&gt;   Fail!&lt;br&gt;}&lt;br&gt;&lt;br&gt;In theory, it sounds very easy to do, I just can't figure out the actual script to do it. I can get the username and password in JScript, but not in VBScript. However, I can't figure out how to pass the username and password to any function that could check the existence of the folder. Anyone have any advice?[/quote]&lt;br&gt;&lt;br&gt;Try this script:&lt;br&gt;&lt;br&gt;sysAddress = Context.GetProperty("Address")&lt;br&gt;sysAdminUser = Context.GetProperty("CredWindows:DomainAndUserid")&lt;br&gt;sysAdminPass = Context.GetProperty("CredWindows:Password")&lt;br&gt;Context.LogMessage "Checking " &amp; sysAddress &amp; " for folder 'c:\program files'."&lt;br&gt;&lt;br&gt;Set objLocator = CreateObject( "WbemScripting.SWbemLocator" )&lt;br&gt;Set objWMIService = objLocator.ConnectServer(sysAddress, "root/cimv2", sysAdminUser , sysAdminPass)&lt;br&gt;objWMIService.Security_.impersonationlevel = 3&lt;br&gt;Set wbemFolderSet = objWMIService.ExecQuery ( _&lt;br&gt;"Select * from Win32_Directory where Name = 'c:\\program files'")&lt;br&gt;&lt;br&gt;If IsNull(wbemFolderSet) Then&lt;br&gt;Context.LogMessage "wbemFolderSet is null"&lt;br&gt;Context.SetResult 1, "Failed to poll the reference variables."&lt;br&gt;Else&lt;br&gt;If wbemFolderSet.Count Then&lt;br&gt;For Each wbemFolder In wbemFolderSet&lt;br&gt;FolderExists = True&lt;br&gt;Context.LogMessage "Folder 'c:\program files' exists."&lt;br&gt;Next&lt;br&gt;Context.SetResult 0, "Polled folder successfully."&lt;br&gt;Else&lt;br&gt;Context.SetResult 1, "Folder 'c:\program files' does not exist."&lt;br&gt;End If&lt;br&gt;End If&lt;br&gt;&lt;br&gt;Set wbemFolderSet = Nothing&lt;br&gt;Set objWMIService = Nothing&lt;br&gt;Set objLocator = Nothing&lt;br&gt;&lt;br&gt;I tried using a variable to do the test, so that you would only need to change the actual file name in one place, but for some reason, it wouldn't work, so I left it hard-coded in the script.</description><pubDate>Fri, 09 May 2008 10:59:24 GMT</pubDate><dc:creator>rhugh</dc:creator></item><item><title>RE: Checking a Network Path</title><link>http://forums.ipswitch.com/Topic43585-14-1.aspx</link><description>its been a while, but I think if you set your check up as a passive monitor (drop the username/password in your script) you can associate your creds with that action. &lt;P&gt; </description><pubDate>Thu, 08 May 2008 14:23:29 GMT</pubDate><dc:creator>DonC</dc:creator></item><item><title>Checking a Network Path</title><link>http://forums.ipswitch.com/Topic43585-14-1.aspx</link><description>I know this has been discussed, but I haven't found the other threads to be very helpful. We have several NAS boxes and network shares that are mission critical, and we'd like to monitor them through WUG. We don't even really care about drive space... we only care that the drives are on the network. I know I can create an active script to monitor the existence of a folder, which seems to be the right way to go, but since WUG runs as a local service and not a domain account (which is something we really don't want), it doesn't have permission to access the network drive, so it reports that it doesn't exist. However, we have set up a domain account that WUG uses to monitor Windows services that should have access to the network drives, so we'd like to use that. That account info is stored as Windows Credentials. In pseudocode, this is what I've been trying to figure out how to tell either JScript or VBScript to do:&lt;br&gt;&lt;br&gt;username = Windows Credentials username&lt;br&gt;password = Windows Credentials password&lt;br&gt;&lt;br&gt;if (folderexists('\\\\fileserver\\path', username, password)) {&lt;br&gt;   Success!&lt;br&gt;} else {&lt;br&gt;   Fail!&lt;br&gt;}&lt;br&gt;&lt;br&gt;In theory, it sounds very easy to do, I just can't figure out the actual script to do it. I can get the username and password in JScript, but not in VBScript. However, I can't figure out how to pass the username and password to any function that could check the existence of the folder. Anyone have any advice?</description><pubDate>Thu, 08 May 2008 09:46:54 GMT</pubDate><dc:creator>omatsei</dc:creator></item></channel></rss>