0 Replies Latest reply on May 29, 2017 5:40 AM by scott.l

    SNMP Trap & VB Script


      I'm wondering if someone could tell me if I have something wrong with my script or if I have missed something in my process.


      I have external devices behind a firewall that cannot be reached; however, the firewall forwards SNMP traffic from these devices into SolarWinds. What I've set up is an SNMP Trap to log when a device reports in. I use regex to find when these devices report in and this is working great. Where I have the issue is when I execute a VB script through the alert actions. If a device reports in periodically there is no issue, it's when the same device or several report in more than once or simultaneously in the same second. What I am noting is the wscript.exe process appears to remain in the task manager, but it writes the entry. So after 1 day, there might be over 100 wscript.exe process running/hung and I have to kill it using taskkill. This is a concern because of resources being consumed over time. Below is my script and screen shots of whats happening, thoughts on how I can improve or correct this would be appreciated.


      This issue also occurs if I trigger an SQL database INSERT or UPDATE statement, instead of writing to a text file.


      The alert action is set up as follows:


      ${vbData8} is the node name of the device passed through the SNMP trap and is stored in TrapVarbinds


      The script which is called is:


      Dim oArg, strNode, fso, oFile

      Set oArg = WScript.Arguments

      strNode = oArg(0)

      set fso = CreateObject("Scripting.FileSystemObject")

      set oFile = fso.OpenTextFile("c:\Scripts\DeviceLog.txt",8,true)

      oFile.WriteLine Now() & " - " & strNode


      set oFile = Nothing

      set fso = Nothing



      Here is the result after a multiple/simultaneous hits:


      To kill it, I issue the following: