cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 10

Issue With Windows Script Monitor

Jump to solution

Hello, I have an issue that i can't figure out. I keep randomly receiving the following errors:

"Script does not contain the expected parameters or is improperly formatted. 'Statistic' missing."

"is showing One or more errors occurred."

The script works majority of the time, but randomly fails with a message like i have posted above.

Any help would be appreciated.

dim sql1, IssueCount

  Set oConn1 = WScript.CreateObject("ADODB.Connection")

  Set oRS1 = WScript.CreateObject("ADODB.Recordset")

    oConn1.ConnectionString = "ConnectionString"

   oConn1.Open

   sql1 = "QUERY"

  

   oRS1.open sql1, oConn1,3 ,3

if not oRs1.eof then

    issueCount= oRs1("IssueCount")

        

   

    if(cdbl(issueCount)<=10) then

         Wscript.Echo "Message: " & issueCount & " Current Issues"

         WScript.Echo "Statistic: "& issueCount

         Wscript.quit(0)

    else

         Wscript.Echo "Message: " & issueCount & " Current Issues"

         WScript.Echo "Statistic: "& issueCount

         Wscript.quit(3)

    end if

else

  Wscript.Echo "Message: Failed to run query."

  WScript.Echo "Statistic: 0"

  Wscript.quit(1)

end if

set oRS1 = nothing

set oConn1 = nothing

0 Kudos
1 Solution
Level 10

Turned out to be a bug with the version of SAM we were on. We upgraded and it fixed the issue.

View solution in original post

0 Kudos
1 Reply
Level 10

Turned out to be a bug with the version of SAM we were on. We upgraded and it fixed the issue.

View solution in original post

0 Kudos