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
Using test results in outher tests or scripts
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
Re: Using test results in outher tests or scripts
I would suggest you the following solution.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.
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.
In fact, ODBC query test supports several lines, separated by semicolon ; Also it may execute stored procedures as well.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.
Regards,
Max
Hello Max,
Thanks for your reply.
On the second reply:
Any ideas?
Regards,
John
Thanks for your reply.
On the second reply:
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".In fact, ODBC query test supports several lines, separated by semicolon ; Also it may execute stored procedures as well.
Any ideas?
Regards,
John
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
Probably, ODBC driver you use does not support multicolumns statements. In this case you may create simple stored procedure.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".
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