Hi,
I want to create a fileshare monitor...
For now I have used a file existance monitor for "\\${IP}\User$\*" but this fails if there is no file in that share (only folders).
What would be the best way to just check if the fileshare is alive?!?
Hi,
I want to create a fileshare monitor...
For now I have used a file existance monitor for "\\${IP}\User$\*" but this fails if there is no file in that share (only folders).
What would be the best way to just check if the fileshare is alive?!?
i am not sure this is exactly what you are looking for but it seems you could use APM's WMI to monitor this:
select * from Win32_Share
and then there are Instance Properties where one is called "STATUS" - all of mine show "OK"
but perhaps you could use this to build your logic where Status<>OK
...good luck.
here are the steps to making this.
i created a share named SW$ on a server.
i used Create New Template on APM and selected to use WMI MONITOR.
in the field for WQL QUERY i used Select STATUS From Win32_Share WHERE Name = 'SW$'
i assigned this to that server. it went GREEN in APM and all is well.
i created an alert to monitor the Component Name i used for this: TEST - WMI Monitor SHARE named SW$
the alert condition was for the Component Status and the alert action was an email.
i went to the server and removed the share name and later got the email alert. it was alerted as being 'unknown' status but this would be same as fileshare failure.
i hope this helps...good luck.
no, if the share does not exist, the wmi query will actually not return any results so i will have to leave out the where/filter part and then maybe make a loop to check all elements for "SW$" and return 0 or 1 if found/not found... just dont know how the syntax will look like for that...
Then you would have to use script for that. Unfortunately WQL language doesn't support such things as looping.
hrmpf :-\
why cant there just be a directory existence monitor? :P
i couldnt find anything like that shared already in thwack either :(
is there something similar i can use as a base where only minor adjustments need to be made? :P
You can still use VB script for this. It can be a short one, something like:
strFolder = "\\computer\share"
set objFSO = createobject("Scripting.FileSystemObject")
if objFSO.FolderExists(strFolder) then
wscript.echo "Message: The folder exists"
wscript.echo "Statistic: 1"
else
wscript.echo "Message: The folder does not exists"
wscript.echo "Statistic: 0"
end if
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.