KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Using test results in outher tests or scripts

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
jhuppertz



Joined: 10 Feb 2006
Posts: 19
Location: Netherlands

PostPosted: Thu Jan 24, 2008 1:57 am    Post subject: Using test results in outher tests or scripts Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Thu Jan 24, 2008 2:52 am    Post subject: Re: Using test results in outher tests or scripts Reply with quote

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/mframe.htm#actions.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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jhuppertz



Joined: 10 Feb 2006
Posts: 19
Location: Netherlands

PostPosted: Fri Jan 25, 2008 2:10 am    Post subject: Reply with quote

Hello Max,

Thanks for your reply.

On the second reply:
Quote:
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
Back to top
View user's profile Send private message Visit poster's website
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Fri Jan 25, 2008 3:50 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index