Write to database using SQL query action

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
Grabarczyka
Posts: 8
Joined: Wed Aug 04, 2004 1:16 pm

Write to database using SQL query action

Post by Grabarczyka »

Hello
In our company, we joined AHM with additional web application. In AHM, in case of test changes status BAD-> OK or OK ->BAD, we use "SQL query" action, which writes a few parameters (Reply, current date and time, testname etc.) to Oracle database. Everything is working properly if oracle database resides on the same machine, where AHM is installed. Problem appeares in case database server is on the other machine or in remote site. In case of the link between locations (AHM and Oracle) fails, I don't know, if the information is loged to Oracle database or not. The question is: Are there in AHM any possibilities to retrive the status of "SQL Query" used in action profile and then in case of "SQL query" fails store data in eg text files? After connection is up, rewrite all information to databse? Currently we use 15 instances of AHM (we plan to have about 50) and this is realy important for use, to have such possibilities.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Are there in AHM any possibilities to retrive the status of "SQL Query" used in action profile and then in case of "SQL query" fails store data in eg text files? After connection is up, rewrite all information to databse?
Sorry, this is impossible.
However you may setup additional test to check ODBC link. Then you may setup 2 "advanced" actions (http://www.ks-soft.net/hostmon.eng/mfra ... ncedaction):
- 1st "SQL Query" action will record data into database when SQL Server is accessible. Use condition like ('%Status%'<>'%LastStatus%') and ('::ODBCTestName::%SimpleStatus%'=='UP')
- 2nd "Execute external program" or "SQL Query" action should record data into local log (text file or ODBC). Condition may look like ('%Status%'<>'%LastStatus%') and ('::ODBCTestName::%SimpleStatus%'=='DOWN')

This way all records will be stored. The only problem - import data from local logs into central database when link is up. You will need to create some script and setup HostMonitor to execute the script every time ODBC link is recovered.

Regards
Alex
Post Reply