Go to All Forums

SQL Script

Has  anyone create a VB script plugin with a SQL (MSSQL) script?

We currently use OpMan but am in the process of moving everything into Site24x7. I'd like to collect some SQL metrics specific to our system. Example is replication transactions...

Here is what OpMan runs:

TAB = chr(9)
Const adOpenStatic = 3
Const adUseClient = 3
Set objConn = WScript.CreateObject("ADODB.Connection")
Set objRS = WScript.CreateObject("ADODB.Recordset")
objConn.CommandTimeout =300
strConn = "Data Source=A_NAME;Initial Catalog=Distribution;User Id=ASQLUSER;Password=ASQLPASSWORD"
objConn.Open strConn
objRS.CursorLocation = adUseClient
objRS.ActiveConnection = objConn
objRS.CursorType = adOpenStatic

query = "distribution.dbo.sp_replmonitorsubscriptionpendingcmds @publisher ='ASERVERNAME', @publisher_db = 'DBNAME', @publication ='Publication_NAME', @subscriber ='SUBSCRIBER', @subscriber_db ='DBNAME', @subscription_type ='0'"
objRS.Source = query
if objRS.RecordCount>0 then
For iRow = objRS.AbsolutePosition to objRS.RecordCount
wscript.echo "Message:This message will be used as alarm message."
wscript.echo "Data:"
wscript.echo "Instance1"& TAB & objRS.Fields(0).value
end if


Any help would be much appreciated! :)


Attached is the graph above creates...





Size: 22.85 KB
Like (2) Reply
Replies (1)

Re: SQL Script


Please try Site24x7 SQL Monitoring for in-depth monitoring of your SQL servers. Further, we are working on adding new metrics and deeper insight for your SQL servers. Will post an update once that is ready. Do let us know for specific requirements, if any, from your side.



Like (0) Reply

Was this post helpful?