Using test results in outher tests or scripts

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
jhuppertz
Posts: 19
Joined: Fri Feb 10, 2006 5:32 am
Location: Netherlands
Contact:

Using test results in outher tests or scripts

Post by jhuppertz »

Hi,

I am trying to build a test that will give the the total number of active terminal server or citrix connections in a server farm.

Citrix and Microsoft are nog able to do this on their own. I can read the number of active connections through WMI on a per server basis. These tests work flawless. Now I would like to add the test results per server and test this in a single test so that we can see how many users are overall working in the farm.

I have allready tried the following:

1) Add a private log entry in each test to an external DBF file table
2) This gives me a growing DB table with the correct information
3) Add an ODBC source and test the entries in the table

The query returns the correct number but I cannot delete any entries form the table since the ODBC query test only supports 1 line of ODBC code.

I failed in getting ODBC queries working in a VBScript due to lack of experince.

Does anyone have any bright ideas?

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

Re: Using test results in outher tests or scripts

Post by KS-Soft Europe »

jhuppertz wrote:Citrix and Microsoft are nog able to do this on their own. I can read the number of active connections through WMI on a per server basis. These tests work flawless. Now I would like to add the test results per server and test this in a single test so that we can see how many users are overall working in the farm.
I would suggest you the following solution.
1. To the each test, you should assign an action profile with "SQL Query" action. This action should perform the query like the following: IF EXISTS (select ... from ... WHERE ServerName = 'SomeServerName') UPDATE ... WHERE ServerName = 'SomeServerName' ELSE INSERT .... into .....
It helps you to get rid of duplicated records. In case you utilize MySQL, you may use "ON DUPLICATE KEY UPDATE" syntax.
http://www.ks-soft.net/hostmon.eng/mfra ... htm#actSQL
2. You should create "ODBC Query" to perform single query, like the following: select sum(CountSessions) from SomeTable
where "SomeTable" is a table, you filled up in step 1.
jhuppertz wrote: The query returns the correct number but I cannot delete any entries form the table since the ODBC query test only supports 1 line of ODBC code.
In fact, ODBC query test supports several lines, separated by semicolon ; Also it may execute stored procedures as well.

Regards,
Max
jhuppertz
Posts: 19
Joined: Fri Feb 10, 2006 5:32 am
Location: Netherlands
Contact:

Post by jhuppertz »

Hello Max,

Thanks for your reply.

On the second reply:
In fact, ODBC query test supports several lines, separated by semicolon ; Also it may execute stored procedures as well.
I cannot get the the semicolon to work. If I use it this will genetatie an ODBC error "charaters found at end of SQL statement".

Any ideas?

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

Post by KS-Soft Europe »

jhuppertz wrote:I cannot get the the semicolon to work. If I use it this will genetatie an ODBC error "charaters found at end of SQL statement".
Probably, ODBC driver you use does not support multicolumns statements. In this case you may create simple stored procedure.

Actually, I think my suggestion regarding "IF EXISTS (...) UPDATE ... ELSE ... INSERT..." should work fine with any ODBC driver.
Beside that you may use single alert profile with "SQL query" action for all your WMI terminal server tests. Pretty convenient IMHO.

Regards,
Max
Post Reply