Using Hostmon 8.06 I am trying to compare the line count of a SQL table on two different servers alerting me if they aren’t the same. When the tests are run the results show the numbers in the reply field match but the test still shows bad
Here are the two tests I’m using
; ------- Test #01 -------
Method = ODBC
;--- Common properties ---
;DestFolder = Root\DP1\Active\
Title = DP1 - Test: ODBC: Etracs-HM
Comment = select count(*) from weeklytimecardhours
NamePattern = DP1 - Test: ODBC: %object%
CmntPattern = %path%
ScheduleMode= Regular
Schedule = 7 X 24 Except BU
Interval = 3600
Alerts = Email Admin
ReverseAlert= No
UnknownIsBad= No
WarningIsBad= Yes
UseCommonLog= Yes
PrivLogMode = Default
CommLogMode = Default
;--- Test specific properties ---
Datasource = Etracs-HM
Timeout = 10
SQLQuery = select count(*) from weeklytimecardhours
CheckField = LessThan
FieldRow = 1
FieldCol = 1
Value = 0
EmptyStatus = 0
; ------- Test #02 -------
Method = ODBC
;--- Common properties ---
;DestFolder = Root\DP1\Active\
Title = DP1 - Test: ODBC: Etracs-WP2
Comment = select count(*) from weeklytimecardhours
NamePattern = DP1 - Test: ODBC: %object%
CmntPattern = %path%
ScheduleMode= Regular
Schedule = 7 X 24 Except BU
Interval = 3600
Alerts = Email Admin
ReverseAlert= No
UnknownIsBad= No
WarningIsBad= No
UseNormal = No
UseCommonLog= Yes
PrivLogMode = Full
CommLogMode = Default
SyncCounters= Yes
SyncAlerts = No
DependsOn = list
MasterTest-Alive = DP1 - Test: ODBC: Etracs-HM
;--- Test specific properties ---
Datasource = Etracs-WP2
Timeout = 10
SQLQuery = select count(*) from weeklytimecardhours
CheckField = DifferentFrom
FieldRow = 1
FieldCol = 1
Value = %::DP1 - Test: ODBC: Etracs-HM::Reply_Number%
EmptyStatus = 0
Comparing results from SQL Queries
Are you trying to use variable (that refers to another test item) as parameter of the test?? This will not work.
I would sugest to create stored procedure and compare values there then just return result to HostMonitor.
Another posible solution: use "Optional status processing" options
http://www.ks-soft.net/hostmon.eng/mfra ... processing
E.g. you may set Use Warning status if '%::DP1 - Test: ODBC: Etracs-HM::Reply%' <> '%SuggestedReply%' option
Regards
Alex
I would sugest to create stored procedure and compare values there then just return result to HostMonitor.
Another posible solution: use "Optional status processing" options
http://www.ks-soft.net/hostmon.eng/mfra ... processing
E.g. you may set Use Warning status if '%::DP1 - Test: ODBC: Etracs-HM::Reply%' <> '%SuggestedReply%' option
Regards
Alex