Events not logged to MSSQL Database

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
Sanderrr
Posts: 3
Joined: Thu Dec 18, 2008 9:21 am

Events not logged to MSSQL Database

Post by Sanderrr »

Hello,

I have some troubles to log my events to an MSSQL (2000) database.
When checks changed to bad or good nothing wil written in the database.

My situation is as follow:

1 Databaseserver (W2k3 R2 and MSSQL 2000 std)
1 Hostmonitor machine (Windows XP Professional + Hostmonitor 5.34)
1 Client to test for monitoring (Windows 2003 SBS R2)

On the database server i created the following:

Code: Select all

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Graphic]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Graphic]
GO

CREATE TABLE [dbo].[Graphic] (
	[DT] [datetime] NULL ,
	[TestID] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Rpl] [numeric](18, 0) NULL ,
	[CommentLine1] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CommentLine2] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CommentLine3] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CommentLine4] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CommentLine5] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CommentLine6] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
GO
This wil create a Table "Graphic" and create also the collums for me.
After this i create an Stored Procedure with the following script:

Code: Select all

CREATE PROCEDURE sp_AddGraphic
   @DT datetime = NULL,
   @TstID nvarchar (10) = NULL ,
   @Rpl numeric(18, 0)  = NULL ,
   @CL1 nvarchar(5)= NULL ,
   @CL2 nvarchar(5) = NULL ,
   @CL3 nvarchar(5) = NULL ,
   @CL4 nvarchar(5) = NULL ,
   @CL5 nvarchar(5) = NULL ,
   @CL6 nvarchar(100) = NULL 
AS

INSERT INTO GRAPHIC
   (DT, TestID, Rpl, Commentline1, Commentline2, CommentLine3, Commentline4, Commentline5, Commentline6)
VALUES
   (@DT, @TstID, @Rpl, @CL1, @CL2, @CL3, @CL4, @CL5, @CL6)
GO
The database has an database user HmLog and is database owner.

On the client server i created the following:
ODBC connection to the database server via SYSTEM DSN. I selected the right database and give the HmLog SQL credentials. When testing the connection i says Succesfull.

On the hostmonitor machine i create the following test:
Internal Memory Check, When < then 100Mb status is Bad Else Good.
I create an action profile for it with an SQL Query what will do the following when Bad:

Action type: SQl Query
Action name: SQl Query
Execute by HostMonitor (Local Machine)
Condition to start action (Advanced) ('%SimpleStatus%'=='DOWN')
ODBC data Source HM_HBK(DatabaseName)
Login: HmLog
Password: Password
SQL Query: EXEC AddGraphic '%DateTime%', '%TestID%', '%Reply_Integer%', '%CommentLine1%', '%CommentLine2%', '%CommentLine3%', '%CommentLine4%', '%CommentLine5%', '%CommentLine6%'
Timeout: 10 sec

It is very strange when the test is bad nothing wil written to the database. Can someone advise me wat i'm doing wrong at the moment?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Do you see any error messages in System Log (file is specified in menu "Options" -> "System Log"). You may access the System Log using menu "View" - > "System Log".

What exact logging mode have you selected in "Options" -> "Primary log" tab?

Have you setup Primary or Backup log?

Regards,
Max
Sanderrr
Posts: 3
Joined: Thu Dec 18, 2008 9:21 am

Post by Sanderrr »

The System Log show only events as:

12/18/2008 12:08:41 Monitor started
12/18/2008 12:08:41 RCI enabled
12/18/2008 12:32:40 Monitor started
12/18/2008 12:32:40 RCI enabled
12/18/2008 13:04:17 Monitor started
12/18/2008 13:04:17 RCI enabled
12/18/2008 14:09:47 Monitor started
12/18/2008 14:09:47 RCI enabled

Further is Common Logging disabled
Advanced Logging shows me ODBC Log which is disabled
and System Log as displayed above. The Primary Logging Tab is not show here?

When i open an test the following is effective:

Alerts: Alert profile SQL Graphic
Log & Reports: none of them are selected

Ps, thanks for the quick support
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Hostmonitor machine (Windows XP Professional + Hostmonitor 5.34)
This is very old version, we do not support it anymore.
If you do not own "LifeTime updates" option, you may update software with 50% discount http://www.ks-soft.net/hostmon.eng/regmon.htm#upgrades

However I will try to help
Further is Common Logging disabled
Advanced Logging shows me ODBC Log which is disabled
Do you mean "Record log to ODBC data source" option is not marked? That's why HostMontor does not record anything.
If I misunderstood you, could you send hostmon.ini file to support@ks-soft.net?

Regards
Alex
Sanderrr
Posts: 3
Joined: Thu Dec 18, 2008 9:21 am

Post by Sanderrr »

Alright,

I marked the odbc selection en re-create the sql query and everthing works fine right now :)

Thanks for the support
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

no problem :)

Regards
Alex
Post Reply