Este es el codigo que tiene el monitor:

import pyodbc

Agent = 'DBA'
SourceName = VSMMonitorName
Category = 'Data Adapter'
EventLogType = 'ThinkServer'
EventCategory = 2
User = user
ComputerName = server
Domain = 'NODOMAIN'
System = 'NOHOST'


try:
  connection = pyodbc.connect(driver= driver, server= server, database= database, uid= user, pwd= password)
  cursor = connection.cursor()

  SQL = """declare @prueba int
        set @prueba = 10304
        select top 10 * from t4eventlog where eventid = @prueba"""

#  SendMessageToConfigurator(REPORT, SQL)
  cursor.execute(SQL)

  for row in cursor:
    CompleteMsg = "System: " + str(row[1]) + "Computername: " + str(row[8]) + "Sourcename: " + str(row[2]) + "Category: " + str(row[11])
    MessageText = "System: " + str(row[1]) + "Computername: " + str(row[8]) + "Sourcename: " + str(row[2]) + "Category: " + str(row[11])
    Variables = [str(row[1]),str(row[2]),str(row[3]),str(row[4]),str(row[5]),str(row[6]),str(row[7]),str(row[8]),str(row[9]),str(row[10])]
    EventID = 10304
    EventType = 4
    SendMessageToConfigurator(SUCCESS,MessageText)
    SendMessageToSmartConsole(SUCCESS, MessageText, Variables, EventID, ComputerName, Agent, System, SourceName, CompleteMsg, EventLogType, EventType, EventCategory, Category, User, Domain)

except:
  SendMessageToConfigurator(ERROR, "Error executing the monitor, please contact professional services")
  MonitorStop(VSMMonitorName)


Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: October 24, 2018