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?!?
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
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.
do you have a template for this that you can share?
i don't
but i can try to build one and do a proof-of-concept for you
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.