ODBC field sizes

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
whitneje
Posts: 9
Joined: Wed Dec 27, 2006 1:36 pm

ODBC field sizes

Post by whitneje »

I am new to Host Monitor, and I have a question:

When I am setting up a table for an ODBC log. What size do I make the fields? I am doing columns like TestName, Status, Reply, TestMethod. Where can I find the max size of the associated macros?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

1) We don't know what size you should use for TestName field because you are the one who specifies name of the tests.
2) We don't know what size you should use for Reply field because we don't know what exactly test methods do you use. Most of tests return short values, like "200 ms", "1590 KB", "90 %". However NT Event Log, SNMP Get and SNMP Trap tests may return long text descriptions, depends on what exactly services and devices you are monitoring.
3) Value of TestMethod may depend on test parameters as well. Usually 40 chars is enough. If you are using Performance Counter test methods, reserve more space for the field: 80
4) HostMonitor uses the following statuses: 'Not tested', 'Host is alive', 'No answer', 'Unknown', 'Unknown host', 'Ok','Bad', 'Disabled', 'Bad contents', 'Wait for Master', 'Out of schedule', 'Paused', 'Warning', 'Normal'. So max size for Status field: 15 chars

Regards
Alex
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Trere are no common rules to create SQL table. You may create any table you want and use any query you want.
Here http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro
you could find all macro variables, that might be used in SQL Query. What data type should you use for appropriate variable? You should choose it depends on description. If variable always returns number, you may use int or bigint. Otherwise I recommend to use varchar or datetime type. Be carefull with datetime variables. Remember about "Use fixed date & time format" option (option located in Options > Miscellaneous tab).

We recommend to store at least the following fields/macros:
%DateTime%
%TestName%
%Status% or %StatusID%
%Reply%
%TestID%
%TestMethod%
And of course you may use other fields/variables based on your needs.

Regards,
Max
whitneje
Posts: 9
Joined: Wed Dec 27, 2006 1:36 pm

Post by whitneje »

Thanks, I was just curious if I could define a table with TestName varchar(50), and know that I wouldn't have to worry about an exception getting thrown because TestName couldn't be over 50. I guess I will do something like SUBSTRING('%TestName%', 1, 50) for inserts into the log in case anyone puts in a test where the name is too long. (and repeat this for every varchar macro I want to log.)
Post Reply