Connecting to HM via ODBC

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
smt
Posts: 9
Joined: Tue Nov 22, 2005 5:28 pm

Connecting to HM via ODBC

Post by smt »

Hi,

Is this posible? Is there a DB as such?
Many thanks. :)
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

HostMontor stores statistics and tests related information in files with .hml extension and there are no interfaces to access that data except GUI or RCC.

Actually, could you explain, please, what goals do you want to achieve?

If you need some statistical information, you may use powerful reporting engine to generate various reports: http://www.ks-soft.net/hostmon.eng/mfra ... tm#Reports

"HMS Script" action allows you to perform different manipulation over tests data: http://www.ks-soft.net/hostmon.eng/mfra ... #actScript

Also you may use "Telnet Service" or "Web Service" to control HostMonitor remotely:
http://www.ks-soft.net/hostmon.eng/teln ... /index.htm
http://www.ks-soft.net/hostmon.eng/webservice/index.htm

Regards,
Max
smt
Posts: 9
Joined: Tue Nov 22, 2005 5:28 pm

Post by smt »

Hi, I want to display in a php / html page to number of test performed on a daily basis. Can this be done? Many thanks! :lol:
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

You need number of test probes? Then simply use menu View -> Estimated load to check average tests per second value and multiply this number by 86400. Then write this number anywhere you want: HTML, PHP, Text, etc

Regards
Alex
smt
Posts: 9
Joined: Tue Nov 22, 2005 5:28 pm

Post by smt »

Thanks, is there a way to script it from h/m? I need it to actively pull the data every 10 seconds for example, multiply it and display. I can do the multiply and display, but I need to extract the data actively from h/m. :) Thanks!
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I though you need that number on daily basis. Which basically is a constant.
So you need number of performed tests every 10 seconds? That's different task. :roll: If you are using ODBC data source for logging, you may enable Full logging and use some stored procedure instead of insert statement to calculate number of probes... or you may use external application started by "Execute external program" action, this action should be assigned to each alert profile. I should say I do not like any of this methods, these methods will lead to increased usage of system resources.
Are you sure this number is so important? I think nobody asked about such option ever :roll:

May be I misunderstand you? May be you need some usefull list of test items? Or just a single number?
Then why you have used "Connecting to HM via ODBC" as topic name? What "a number" has to do with ODBC?

Regards
Alex
smt
Posts: 9
Joined: Tue Nov 22, 2005 5:28 pm

Post by smt »

lol, getting confusing here...
I need a running count of test performed by h/m on a daily basis. You can't have a constant of tests because it may change if tests are disabled or added and they increase as the day goes on. I need to rest the result at 00:00am query h/m on it's current day test rate and display it. As the day moves on the number of tests increases, I said 10 seconds as it seem to be a sensible refresh time for the web page.
I was hoping if it had a odbc interface then I could connect to the database at 00:00 take the number of test performed, store it and the every 10 seconds ask for it again, decute the two and the result is the amount of tests performed on that day. If it doesn't have odbc this is fine, I just need a way if getting the current tests performed via php, which if I can export a report every 5 seconds from h/m in csv or a text file and then read it in via php or is this availibe via a web interface?. Cheers! :)
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

I think, I can suggest you a solution, but it will be a bit tricky.
At first, you should create "Custom HTML report", clear up data on all tabs in "HTML report template" window and put "%TotalTests%" variable into "Header" tab. %TotalTests% represents the number of tests in report and in this case it is equal to number of HostMonitor tests. Also you may place here %DisabledTests% variable to retrieve number of disabled tests. This report should generate a text file with two values, which you may easy read by your php pr oyher application. Please note: you may wrap these numbers into HTML and HostMonitor generate complete HTML page and place it anywhere you need. http://www.ks-soft.net/hostmon.eng/mfra ... CustomHTML

On the second step, you should create a new action profile with "Execute HMS Script action". Action should start script CreateReport command.
"CreateReport" command executes specified report profile and store result into certain file.
http://www.ks-soft.net/hostmon.eng/mfra ... #actScript

The third and the last step. You should setup buil-in "Scheduler" ("Options" -> "Scheduler") to start foregoing action on regular basis, e.g. every minute. http://www.ks-soft.net/hostmon.eng/mfra ... #SchedPage

Regards,
Max
smt
Posts: 9
Joined: Tue Nov 22, 2005 5:28 pm

Post by smt »

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

Post by KS-Soft »

%TotalTests%
This variable returns number of test ITEMS while "smt" needs number of test PROBES. Am I right?
I was hoping if it had a odbc interface then I could connect to the database at 00:00 take the number of test performed, store it and the every 10 seconds ask for it again
Of cource HostMonitor may work with ODBC. It may perform ODBC test, it may record logs using ODBC data source, it may execute SQL Query action.
If you are using ODBC logging and you need to calculate number of test probes using some external script, set logging to "Full" mode and use SQL Query in your application to calculate number of records. E.g. select count(*) from hmlog where eventtime > NOW() - INTERVAL 10 SECOND (this syntax valid for MySQL server)

Information about logging options: http://www.ks-soft.net/hostmon.eng/mframe.htm#logs.htm

Regards
Alex
smt
Posts: 9
Joined: Tue Nov 22, 2005 5:28 pm

Post by smt »

Hi, O.k. so i can use the %totaltests% varible, how do I get these from hm in html? :)
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

If I understand you correctly, you CANNOT use %totaltests%
Please read my previous post

Regards
Alex
Post Reply