Announcement

Collapse
No announcement yet.

Monitoring Map Network Drive

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Monitoring Map Network Drive

    HI,

    I want to monitor mapped network Drives on one of my servers;

    I am managing the server usign TS; windows 2003 server

    I have 3 mapped network drives from windows machies
    and 1 Mapped netwrok drive from Linux machines (Samba)

    Problem:

    in my computer (detailed view) it shows disconnected and my applicaitons stops working;
    when i double click on the drive it becomes available again and application starts working again;

    some times on Linux Mapped drive it prompts for user name and password;

    I want to get any alert / email when any of this happen by running a script after every 10 mints on the server; how do i do that??

    Waiting for +ve feedback

  • #2
    Re: Monitoring Map Network Drive

    Do you have a monitoring system in place? Nagios, hobbit etc.

    Comment


    • #3
      Re: Monitoring Map Network Drive

      Here is a simple vbs script that will do what you want.

      Code:
      dim filesys
      dim netdrive(3)
      dim emailmsg
      dim sleepmins
      '------------  Modify this block --------------
      sleepmins   = 10
      netdrive(0) = "r:\NUL"
      netdrive(1) = "s:\NUL"
      netdrive(2) = "t:\NUL"
      netdrive(3) = "t:\NUL"
      EmailFrom   = "[email protected]"
      EmailTo     = "[email protected]"
      EmailServer = "10.10.10.10"   ' IP of your email server
      '----------------------------------------------
      Sub Sendemail(msgbody)
        Set objEmail = CreateObject("CDO.Message")
        objEmail.FROM = EmailFrom
        objEmail.To = EmailTo
        objEmail.Subject = "Detected Network Drive Issue"
        objEmail.HTMLBody = msgbody 
        objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...tion/sendusing") = 2
        objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = EmailServer
        objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...smtpserverport") = 25
        objEmail.Configuration.Fields.Update
        objEmail.Send
        Set objEmail = Nothing
      End Sub
       
      Set filesys = CreateObject("Scripting.FileSystemObject") 
       
      While 1<>2
        emailmsg    = ""
        for f = 0 to 3
          If NOT filesys.FileExists(netdrive(f)) Then
            emailmsg = emailmsg & "Could not Find Network Drive [" & left(netdrive(f),2) & "]<br>"
          End If
        Next
        If emailmsg <> "" then
          sendemail(emailmsg)
        End If
        wscript.sleep(sleepmins*1000*60)
      Wend
      Keep in mind this script will continue to run until you turn it off manually via Task Manager, End Task on wscript.

      Let me know if this works for you or if you run into any issues.

      Hobie

      Comment

      Working...
      X