OBDC logging in multiple specific table
OBDC logging in multiple specific table
HI,
I try to log test result on a SQL Server in different table with detail depending on the test. I have found how to switch in different table with %FolderComment% but I want to log different column for different test
I try the following INSERT but it's not working ..
INSERT INTO hostmonitor.dbo.%FCommentLine01% (%FCommentLine02%) VALUES (%FCommentLine03%)
Any idea ?
Thanks
I try to log test result on a SQL Server in different table with detail depending on the test. I have found how to switch in different table with %FolderComment% but I want to log different column for different test
I try the following INSERT but it's not working ..
INSERT INTO hostmonitor.dbo.%FCommentLine01% (%FCommentLine02%) VALUES (%FCommentLine03%)
Any idea ?
Thanks
Thanks, I have just find that too
Now, the only part not working is replacing the expression after the VALUES with my %FCommentLine3% ....
The cmment line 3 is :
('%TestName%','%Agent%','%TestMethod%','%Interval%','%ScheduleName%','%AlertProfile%','%AlertThreshold%','%MasterTest%','%TaskComment%','%Folder%','%ModifiedTime%','%DateTime%','%LastTestTime%','%Reply%','%Status%','%AcknowledgedAt%','%AcknowledgedBy%','%AckComment%','%LastStatus%','%LastReply%','%PreviousStatus%','%Recurrences%','%StatusChangedTime%','%StatusChangesCnt%','%TotalTests%','%TotalTime%','%FailedCnt%','%PassedCnt%','%UnknownCnt%','%AliveTime%','%DeadTime%','%UnknownTime%','%AliveRatio%','%DeadRatio%','%UnknownRatio%','%AverageReply%','%MinReply%','%MaxReply%','%HostAddr%','%ServiceComp%','%ServiceName%','%httppage%','%NTEventSource%','%NTEventComp%','%NTEventTime%','%NTEventType%','%NTEventID%','%NTEventText%','%NTEventUser%','%TrapHost%','%TrapType%','%Enterprise%','%EnterpriseName%','%MibOid%','%MibName%','%MibType%','%MibValue%')
ML

Now, the only part not working is replacing the expression after the VALUES with my %FCommentLine3% ....
The cmment line 3 is :
('%TestName%','%Agent%','%TestMethod%','%Interval%','%ScheduleName%','%AlertProfile%','%AlertThreshold%','%MasterTest%','%TaskComment%','%Folder%','%ModifiedTime%','%DateTime%','%LastTestTime%','%Reply%','%Status%','%AcknowledgedAt%','%AcknowledgedBy%','%AckComment%','%LastStatus%','%LastReply%','%PreviousStatus%','%Recurrences%','%StatusChangedTime%','%StatusChangesCnt%','%TotalTests%','%TotalTime%','%FailedCnt%','%PassedCnt%','%UnknownCnt%','%AliveTime%','%DeadTime%','%UnknownTime%','%AliveRatio%','%DeadRatio%','%UnknownRatio%','%AverageReply%','%MinReply%','%MaxReply%','%HostAddr%','%ServiceComp%','%ServiceName%','%httppage%','%NTEventSource%','%NTEventComp%','%NTEventTime%','%NTEventType%','%NTEventID%','%NTEventText%','%NTEventUser%','%TrapHost%','%TrapType%','%Enterprise%','%EnterpriseName%','%MibOid%','%MibName%','%MibType%','%MibValue%')
ML
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
Hm. Quite long sentence. Please, note: Maximum length of the query: 4096 symbols. http://www.ks-soft.net/hostmon.eng/mfra ... dvancedLog
Could you specifythe full query into SQL Query field (Options > Advanced Logs tab) and press Test button. What exact error do you retrieve?
Regards,
Max
Could you specifythe full query into SQL Query field (Options > Advanced Logs tab) and press Test button. What exact error do you retrieve?
Regards,
Max
Ok, I have simplified my setup a little bit
I have a new DB and only one folder and one test ...
If I test :
Insert into %FCommentLine1% %FCommentLine2% VALUES %FCommentLine3%
I get the message : Return code: 4294967295
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'OK'
FCommentLine1 : hostmonitor.dbo.hmlog2
FCommentLine2 : ( Status, Reply, Intervale, ScheduleName)
FCommentLine3 : ( '%Status%', '%Reply%', '%Interval%', '%ScheduleName%')
ML

If I test :
Insert into %FCommentLine1% %FCommentLine2% VALUES %FCommentLine3%
I get the message : Return code: 4294967295
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'OK'
FCommentLine1 : hostmonitor.dbo.hmlog2
FCommentLine2 : ( Status, Reply, Intervale, ScheduleName)
FCommentLine3 : ( '%Status%', '%Reply%', '%Interval%', '%ScheduleName%')
ML
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
I think, for investigation purposes, you should specify full query, like:
When you figure the problem out, you may specify variables, like:
Please, be aware: each folder must have FCommentLine1,FCommentLine2,FCommentLine3 values specified.
Regards,
Max
Code: Select all
Insert into hostmonitor.dbo.hmlog2 ( Status, Reply, Intervale, ScheduleName) Values ( '%Status%', '%Reply%', '%Interval%', '%ScheduleName%')
When you figure the problem out, you may specify variables, like:
Code: Select all
Insert into %FCommentLine1% %FCommentLine2% VALUES %FCommentLine3%
Regards,
Max
It's work fine without the %FCommentLineNN%, work also when I replace the DB with %FcommentLine1%, work also when I replace the column with %FcommentLine2% but stop when I replace the values with %FcommentLine3% l ...
Insert into %FCommentLine1% %FCommentLine2% VALUES %FCommentLine3%
I get the message : Return code: 4294967295
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'OK'
FCommentLine1 : hostmonitor.dbo.hmlog2
FCommentLine2 : ( Status, Reply, Intervale, ScheduleName)
FCommentLine3 : ( '%Status%', '%Reply%', '%Interval%', '%ScheduleName%')
Insert into %FCommentLine1% %FCommentLine2% VALUES %FCommentLine3%
I get the message : Return code: 4294967295
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'OK'
FCommentLine1 : hostmonitor.dbo.hmlog2
FCommentLine2 : ( Status, Reply, Intervale, ScheduleName)
FCommentLine3 : ( '%Status%', '%Reply%', '%Interval%', '%ScheduleName%')
Ok, Can't be simplified more 
Insert into %FCommentLine1% %FCommentLine2% VALUES %FCommentLine3%
FCommentLine1 : hostmonitor.dbo.hmlog2
FCommentLine2 : ( Status)
FCommentLine3 : ( '%Status%')
The DB have oly one column, Status which is a varchar 50
I still get the message : Return code: 4294967295
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'OK'

Insert into %FCommentLine1% %FCommentLine2% VALUES %FCommentLine3%
FCommentLine1 : hostmonitor.dbo.hmlog2
FCommentLine2 : ( Status)
FCommentLine3 : ( '%Status%')
The DB have oly one column, Status which is a varchar 50
I still get the message : Return code: 4294967295
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'OK'
yes , the real Status is OK and it's change to Bad if I revert the test and refresh it ...
It's reallyr look like we can use a variable in sql for the values ... I even try to include the Key work Values in the comment and it's still the same error ...
When I try only %FolderComment% as SQL Query and put Insert into hostmonitor.dbo.hmlog2 (Status) Values ('Status') In the folder comment, I get the error Incorrect syntax near 'Status'
It's reallyr look like we can use a variable in sql for the values ... I even try to include the Key work Values in the comment and it's still the same error ...
When I try only %FolderComment% as SQL Query and put Insert into hostmonitor.dbo.hmlog2 (Status) Values ('Status') In the folder comment, I get the error Incorrect syntax near 'Status'
I see what's wrong. Some folder/test specific variables (e.g. Reply value) may contain ' (quotation mark), so HostMonitor must replace ' with ''. This option really useful for most of the customers. Unfortunately its not useful for you.
Solution? H'm..
may be you should use single query for common logging. If you need additional information for some tests, you may use "SQL Query" action.
Regards
Alex
Solution? H'm..

Regards
Alex