15 Replies Latest reply: Jun 17, 2010 4:40 AM by DThorne RSS

Check if a fileshare exists



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?!?

  • Re: Check if a fileshare exists

    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.

    • Re: Check if a fileshare exists

      do you have a template for this that you can share? :)

      • Re: Check if a fileshare exists

        i don't

        but i can try to build one and do a proof-of-concept for you

        • Re: Check if a fileshare exists

          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.