Logging / Calling SQL

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
HogHunter
Posts: 3
Joined: Fri Aug 13, 2010 3:20 pm

Logging / Calling SQL

Post by HogHunter »

I was hoping to be able to have a test call a Stored Proc every time it runs. The idea is to log the results so I can establish metrics.

I looked at the alerts and figured I could set an alert to fire for both bad and good conditions. Then I set the alert to fire on the schedule. The only problem is the alert isn't actually going to SQL.

I ran a trace and the user never even tries to login.

Here is what I put in the alert:

Action: SQL Query
ODBC source: LSOPSDB
Login : HostMon
SQL query : exec usp_AddCondition(1, %Reply%)
Timeout : 10 sec

The same thing is in the good and bad conditions.

What am I missing?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

So you want to execute action after each test probe regardless of test status?
Then you should use "Repeat until status changes" option for "bad" and "good" actions assigned to the test.
Do you use this option?
Then I set the alert to fire on the schedule
On the schedule? This option should be used for actions that are not assigned to the tests but used by built-in Scheduler.
If you assign action to the test, use "standard" or "advanced" mode.

Regards
Alex
HogHunter
Posts: 3
Joined: Fri Aug 13, 2010 3:20 pm

Post by HogHunter »

Alex,

Thanks for the input. I will see if I can change the way the test is setup. In the meantime, I will answer your questions below as best I can with the current setup.
KS-Soft wrote:So you want to execute action after each test probe regardless of test status?
Then you should use "Repeat until status changes" option for "bad" and "good" actions assigned to the test.
Do you use this option?
No I am not using that option. I was just counting on the scheduler. I see the test being run because the count of tests increases
KS-Soft wrote:
Then I set the alert to fire on the schedule
On the schedule? This option should be used for actions that are not assigned to the tests but used by built-in Scheduler.
If you assign action to the test, use "standard" or "advanced" mode.
I am not real clear on what you are saying, The action was assigned under the Profiles menu using the Action profiles. In there I can choose what to do when a test executes. There is a "Bad" status action and a "Good" status action. I set them both to call SQL and execute the Stored Proc. However, the proc is not being called.
HogHunter
Posts: 3
Joined: Fri Aug 13, 2010 3:20 pm

Post by HogHunter »

Ok I had a duh moment. The issue was a syntax error in my SQL statement. I decided to try an ODBC test to see how HostMon connects to SQL. That is when I saw the error.

So now I am passing the %Reply% value into the stored proc and it works perfectly!
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

On the schedule? This option should be used for actions that are not assigned to the tests but used by built-in Scheduler.
If you assign action to the test, use "standard" or "advanced" mode.
...
I am not real clear on what you are saying
There are 3 kinds of actions
- condition to start action: standard
- condition to start action: advanced
- condition to start action: on the schedule
You said "Then I set the alert to fire on the schedule". Such action cannot be triggered by any test.
Please check the following section for details:
http://www.ks-soft.net/hostmon.eng/mfra ... properties

Regards
Alex
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Ok I had a duh moment. The issue was a syntax error in my SQL statement. I decided to try an ODBC test to see how HostMon connects to SQL. That is when I saw the error.
So action was executed? Then you may use system log or quick log to check for action status and error description. If action failed for some reason, HostMonitor should record error description into the log.
http://www.ks-soft.net/hostmon.eng/mfra ... ickLogPane
So now I am passing the %Reply% value into the stored proc and it works perfectly!
Great :)

Regards
Alex
Post Reply