We are currently in the process of migrating our Server monitoring from HP SiteScope to Solarwinds and I'm stuck on a monitor I can't figure out how to convert, so I'm looking for some guidance or help with a template/script. We have an application that will create a new folder everyday and throughout the day it will drop files in the folder if there is an error encountered. We monitor this folder for incoming files so we can alert when there is an issue that needs to be investigated. In SiteScope you can utilize RegEX and path variables to accomplish the task pretty easily but I'm struggling to figure out how to do this in Solarwinds.
HP SiteScope parameters:
Server: (hostname)
Directory Path: s/d:\(folder)\(sub-folder)\(sub-folder)\(sub-folder)\$year$$0month$$0day$/
No subdirectories: (box checked)
File name match: /_0000.ini|..bat|..exe/c
Right now we are attempting (and failing) to use VBScript through a Solarwinds SAM template. I can get the rotating folder monitored but I can't figure out how to scan for files in that folder:
Variables passed:
${IP} "\d$\(folder)\(sub-folder)\(sub-folder)\(sub-folder)\"
====================
Set args = WScript.Arguments
Function timeStamp()
Dim t
t = Now
timeStamp = Year(t) & Right("0" & Month(t),2) & Right("0" & Day(t),2)
End Function
ServerShare = "\\" & args.Item(0) & args.Item(1) & "\" & timeStamp
Set FSO = CreateObject("Scripting.FileSystemObject")
If Not FSO.FolderExists(ServerShare) Then
WScript.Echo "Message.Folder: " & ServerShare & " does not exist"
WScript.Echo "Statistic.Folder: 0"
Wscript.quit(0)
Else
WScript.Echo "Message.Folder: " & ServerShare & " does exist"
WScript.Echo "Statistic.Folder: " & "1"
Wscript.quit(0)
End If