Monday, October 31, 2011

Client side solution for Oracle/Windows service/resource checking

Most of the client side OS is Windows-this is a fact. In classic client-server environments (and those who are strictly not), 99% of the problems lay on the client side. So detecting those problems as quick as possible is always a big challenge to any IT structure and necessary foundation for any help desk structure.

Based on such a premises, recently I got a task to design a client side tool for that will check several services/resources, which would narrow detection of potential errors on client side. You know when user says "Database is down!" or "I cannot logon to database" that real problem is probably far from mentioned, and that mentioned is only the consequence of the core problem. Such a tool should obey several conditions at the very begging:
  1. Windows compatible for XP, Vista, Windows 7 on x86/x64 platforms
  2. Should have nice and clear GUI for average user
  3. There should be no installation
  4. Ordinary Windows user (not Administrator) should be able to run such a tool
  5. Regional settings independent
  6. Should fulfill all required checking
In the first moment I thought to start to develop Delphi application, where I have a lot of experience and looked to me correct solution according mentioned conditions. And just before I started, my chief come to me with idea to make something "WEB based"...

Regardless that this idea was ridiculous in first moment, his insistence on this kind of solution, put me in totally different direction which I didn't like in first moment only because of lack of experience. However, very soon (as many times before, after reading some materials on google), idea to develop Microsoft HTML Application seems very original and handy for this purpose.
HTA is special kind of WEB browser based application that runs only in MS Internet Explorer browsers, without any additional IIS or any other WEB server beside. It's embedded ActiveX support, perfectly fit any need for doing any deeper operation, far beyond any WEB based application.

One file support

Because HTA tool approach perfectly fit our need, firstly I placed pictures in three additional files (picture presentations for "?", "OK", "Bad" result) and connect them as link in HTA application. But this has to be put in single HTA file-without any external files. When I was stuck, I got amazing support from our programmers gurus, Tomislav Bacinger and Joso Mrša. They have encoded (Mime Base64 type) picture files in three separate variables, all put as declarations in HTA file. Then in the run time, these values were decoded and shown as real pictures. Very fast, very original and very flexible!! Bravo!

Unfortunately, chief, encouraged with our cool and fast progress, gave us another condition-HTA tool must be compatible with IE6-IE9 browsers. And IE6/IE7 was unable to decode such a values without external decoders. Because external decoder was not acceptable I was stuck again.

Then, again, comes to play our gurus and define pictures as pure div styles-solution which may be nothing for them but was Universe for me! And this was OK even for IE6/IE7 browsers. Perfect, now I was able to finish mine task to the end and concentrate on pure VBscript codding.

What can this tool do?

Regardless this is called "client side tool", this tool can be run on any kind of Windows machine. This tool can:
  1. Check presence and connectivity through PC network card
  2. Check connectivity to www.google.com
  3. Check pure ping one file server (in mine case server where some forms were placed as ordinary windows share)
  4. Check is file share is available (on mentioned file server)
  5. tnsping/tnsping80 availability (some of clients were using Forms 6 with tnsping80 and some of them were having tnsping utility)
  6. Check is application server available and running (on load balance path, and on single two nodes separately)
  7. Database availability.
    • For that I have created one oracle user TEB_TEST in all three database.
    • The whole statement for that was:
      grant create session to teb_test identified by teb_test;
    • Main part is to perform select 'OK' from dual; on all datbases-HDB, HLDB and TRX.
  8. Keep in mind that I have show both ways how to test availability (OraOLEDB as well as Microsoft ODBC for Oracle), but if you have just one type of connection i.e. Forms 6, which use TNS names entries, then you should not use other then "Microsoft ODBC for Oracle" connection. However look in source to see differences and reduce to your need
  9. Check is primary or backup route used. This was really important because when something on client side is slow. Usually the cause was use of backup connection, which is not so fast as primary network. So this tool can prove this question as well
As you see almost any part of checking is covered and the whole source code is in front of you, available to be customized to your needs. So when you start tool, you should look something like:
When user run "Start All test" button, all tests are run one by another. Untested question mark picture (initial value) is replaced with green check (for passed test) or red X (for error). When tests are run, you'll get a result like:
On this picture file share is not available, so user can easy say what is the problem and technical help may be very quick and accurate.

Warning

If you run a tool over the network you'll probably hit a warning like this:
then you are faced with security warning for 'Access data sources across domains'. This may be solved to set on client side this registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1 

Create/Change DWORD key 1406 with value "0"

The code

Source code of this client side tool is here with instruction to rename file from ".htax" to HTA because of many security reason that might be a problem in downloading this file with original extension. After that rename/replace your values and add/remove checking that you need. And this is all!

The End

regardless I'm not a fun of MS only based solutions, the easiness of development, maintenance and implementation is really something that in this case beat all other solutions.

For end, this is totally free tool until application title is not changed. Think this is not too much.
:-)

If you find this tool useful or find some bugs or improvements, please let me know-I'd rather see that.

Until then cheers!

No comments :

Post a Comment

Zagreb u srcu!

Copyright © 2009-2014 Damir Vadas

All rights reserved.


Sign by Danasoft - Get Your Sign