how to dump file logs into the ODBC database?

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).
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

how to dump file logs into the ODBC database?

Post by Robert_in_MTL »

Hi,
sorry to bug you, but we just realised that HM was not dumping logs into the ODBC Database for a few months since someone deleted the ODBC Datasource on the server. :x

Is there a way to import all log files into the database or do I have to live with 2 log sources now? :(

Thank you for your time.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

What format of your log files? I think its pretty easy to import data from text or DBF files. If you are asking about HTML logs, that's more complicated...

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

Hi,
great if they are easy to put back in the database!

The logs files are of this format:

Code: Select all

[2010-03-23 00:00:01]	   	msrvaq02: Disk Space: D	Ok	6114 Mb	check UNC (3072 Mb)	1002
It is the "backup log" setting set to "file" in d:\Host Monitor\HostMonitor Logs\%yyyy%_%mm%_%dd%-log.txt as text files

I have 179 text files like this and they are around 2 to 4 Mb each.

My primary log SQL Query setting is this:

Code: Select all

Insert into ACTIVE_MONITOR(hostname,TestName,TestID,eventtime,status,reply,Reply_Number,StatusID,SimpleStatus, Agent,TestMethod,MethodID,AlertThreshold,TestInterval,ScheduleName,AlertProfile,FullPath, CurrentStatusDuration_sec, CurrentStatusIteration, PreviousStatus, PreviousStatusDuration_Sec, HostURL,HttpCode,RelatedURL,ServiceName, TotalTests,TotalTime,AverageReply,FailedCnt,PassedCnt,AliveRatio,DeadRatio,AliveTime,DeadTime)  VALUES ('%Folder%','%TestName%','%TestID%','%DateTime%','%Status%','%Reply%','%Reply_Number%','%StatusID%','%SimpleStatus%', '%Agent%','%TestMethod%','%MethodID%','%AlertThreshold%','%Interval%','%ScheduleName%','%AlertProfile%','%FullPath%', '%CurrentStatusDuration_sec%','%CurrentStatusIteration%','%PreviousStatus%','%PreviousStatusDuration_Sec%', '%HostURL%','%HttpCode%','%RelatedURL%','%ServiceName%', '%TotalTests%','%TotalTime%','%AverageReply%','%FailedCnt%','%PassedCnt%','%AliveRatio%','%DeadRatio%','%AliveTime%','%DeadTime%')
By the way, when correcting the ODBC problem, I did not receive the alert even if the option "Execute alert profile when log comes to life" is checked (this alert profile is working ok in other tests in case you ask.)

If you have an easy solution to import files it would be great, for the alert, it is far less important, but still I would like it to work eventually.

Thank you very much for your time Alex.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

By the way, when correcting the ODBC problem, I did not receive the alert even if the option "Execute alert profile when log comes to life" is checked (this alert profile is working ok in other tests in case you ask.)
Well, the same actions cannot work for tests and log-related alerts. Tests trigger "standard" or "advanced" actions. While built-in scheduler, reports and various user alerts require "on the schedule" actions.

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

Post by KS-Soft »

Insert into ACTIVE_MONITOR(hostname,TestName,TestID,eventtime,status,reply,Reply_Number,StatusID,SimpleStatus, Agent,TestMethod,MethodID,AlertThreshold,TestInterval,ScheduleName,AlertProfile,FullPath, CurrentStatusDuration_sec, CurrentStatusIteration, PreviousStatus, PreviousStatusDuration_Sec, HostURL,HttpCode,RelatedURL,ServiceName, TotalTests,TotalTime,AverageReply,FailedCnt,PassedCnt,AliveRatio,DeadRatio,AliveTime,DeadTime)
H'm, you are using much more fields then text log can provide. This means there is no easy way to get such iformation and import into database. Should be pretty complicated code that needs to analyze all previous records from database, calculate varuous statistics then check text logs, get additional information from HML file for each text record, continue calculating statistic and so on... Sorry :roll:

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

Well,
I guess there is no easy solution for the logs...

For the alert:
The action I use for the ODBC connection is simply an action used in other tests which is «send email after 2 bad» and «send e-mail after 1 good» which I assumed would work no?

In the help I see that you just say to use an alert profile:
Alerts
--------------------------------------------------------------------------------
Execute alert profile when log inaccessible
If you mark this option and choose alert profile, HostMonitor will execute specified actions when it’s impossible to record data into the log (e.g. disk is full or SQL server does not respond).

Execute alert profile when log comes to life
This option tells HostMonitor to execute specified actions when log becomes acessible (e.g. link to SQL server has been restored).
What is the action I should use if this one is not good?

Thank you!
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

The same actions cannot work for tests and log-related alerts. Tests trigger "standard" or "advanced" actions. While built-in scheduler, reports and various user alerts require "on the schedule" actions.

"on the schedule" action means "condition to start action" should be set to "on the schedule"

Actually HostMonitor warns you when you try to select alert profile without any "sheduled" actions for logging alerts.

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

Sorry, but where does it say that I should use «on the schedule» actions for alerts on the Primary log option page?
I don't see that.
Why are you talking about «on the schedule» and standard or advanced? I don't understand???

Help doesn't work from RCC (I get Navigation to the web page was cancelled) So I use help from your site and it does not talk abour schedule whatsoever for this option:
Alerts
--------------------------------------------------------------------------------
Execute alert profile when log inaccessible
If you mark this option and choose alert profile, HostMonitor will execute specified actions when it’s impossible to record data into the log (e.g. disk is full or SQL server does not respond).

Execute alert profile when log comes to life
This option tells HostMonitor to execute specified actions when log becomes acessible (e.g. link to SQL server has been restored).
It only say to use an alert profile...

Anyway, I tried like you said:
I tried creating a profile with «on the schedule», it worked for the «bad» status action (send e-mail) but for the «good» status action, I get a message «Cannot focus a disabled or invisible window», when I click [OK] I get another popup saying «List index out of bounds (-1)»

Can you tell me clearly what I should for action profile in these:

options/Primary logs/[] execute profile when log inaccessible
and
options/Primary logs/[] execute profile when log comes to life

Thank you.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Sorry, but where does it say that I should use «on the schedule» actions for alerts on the Primary log option page?
I don't see that.
You don't trust me? :)
It works in the same way like any other non-test related actions: actions assigned to the scheduler, actions that starts after reports generation, actions that can be used prior to "reset statistics" and so on.
H'm, looks like we missed such note for log-related actions in the manual. Will be corrected. Sorry :oops:
Why are you talking about «on the schedule» and standard or advanced? I don't understand???
Then please read "action properties" section of the manual. Page #211-215 (if you are using Advanced Host Monitor version 8.54)
Help doesn't work from RCC (I get Navigation to the web page was cancelled)
If there is no hostmon.chm file on system where RCC is located, RCC should get help from our web site.
May be you have installed some antivirus/fireall that does not allow such connection? Then you may copy hostmon.chm file from HostMonitor folder to remote system where RCC is used.
I tried creating a profile with «on the schedule», it worked for the «bad» status action (send e-mail) but for the «good» status action, I get a message «Cannot focus a disabled or invisible window», when I click [OK] I get another popup saying «List index out of bounds (-1)»
We cannot reproduce the problem. What version of software (RCC) do you use?
Can you tell me clearly what I should for action profile in these:
options/Primary logs/[] execute profile when log inaccessible
and
options/Primary logs/[] execute profile when log comes to life
Sorry, I do not understand this question.

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

You don't trust me?
Lol! You know I always trust you Alex! You always find a way to let me know you were right in the first place! :wink:
May be you have installed some antivirus/fireall that does not allow such connection?
Don't worry, I am Domain Admin with no restrictions :wink:
We cannot reproduce the problem. What version of software (RCC) do you use?
HM 8.54 and RCC 3.54
Sorry, I do not understand this question.
What I mean is can you provide an example on what action profile I should use for these 2 options to work:

options/Primary logs/[] execute profile when log inaccessible
and
options/Primary logs/[] execute profile when log comes to life

Herre are pictures of the errors:
Image

AND:

Image

Thank you!
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

H'm.. we just tested RCC "help" function on several systems, works fine.
What Windows do you use? Service Pack?

Also we cannot reproduce these "list index" errors :(
Could you send actions.lst file to support@ks-soft.net?

Regarding profile with "scheduled" actions: when you setup "standard" actions you use "bad" or "good" action lists to tell HostMonitor which actions should be started when test has "bad" or "good" status.
When you setup "schedules" actions, you use "bad" and "good" lists just for your convenience (so you know this is some "good" action and that one is not so good). While HostMonitor starts all "scheduled" actions listed within profile. This means if you assign 1 "bad" and 1 "good" scheduled actions into some profile, both actions will be executed when such profile is triggered.
So, in case of action profiles for "log inacessible" and "log comes to life" alerts foresaids means you need to create 2 profiles (if you need 2 different alerts). Both alert profiles should have 1 actions with "condition to start == on the schedule", it does not mater how you name it "bad" or "good".
Sure its more clear when you put action into "bad" list for 1st action profile (log failed) and put action into "good" list for 2nd aaction profile (log recovered). However its not necessary, you can use any list in case of "scheduled" actions

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

Ok, I get it for the actions, thank you!

I sent you the actions.lst you asked for.

Thank you very much for the help!
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Thank you.
Error appears because you marked "Action depends on bad one" option but have not selected any "bad" action from the list. Then you changed type of the action from "standard" to "on the schedule" so HostMonitor disables this GUI element. Then you save action and HostMonitor tries to warn you about incomplete settings and put focus on disabled element. Here error comes...
In other words - actions work fine but GUI tries to warn you about invalid settings and fails.
We will fix this minor issue in next version.

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

Ok! I understand.
Thank you, it was very helpful!
Last edited by Robert_in_MTL on Wed May 05, 2010 11:18 am, edited 1 time in total.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I just though I did not provide clear workaound - you may change action type back to "standard", unmark "Action depends on bad one" option and change action type to "on the schedule" again.

Regards
Alex
Post Reply