FullPath var

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).
Hanno
Posts: 2
Joined: Wed Dec 24, 2003 7:26 am

FullPath var

Post by Hanno »

When I use the fullpath var in a mySQL query (ODBS) is doesn't work.

All other variables work fine. Is this a known bug?

Regards,

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

Post by KS-Soft »

Where do you use this SQL query? ODBC logging? "SQL Query" action? "ODBC Query" test?
Version of HostMonitor?

Regards
Alex
Hanno
Posts: 2
Joined: Wed Dec 24, 2003 7:26 am

Post by Hanno »

I figured it out. It is a mySQL "problem". Using MS SQL it works fine.

FYI:
I used the FullPath var in a ODBC connection to the mySQL database in advanced logging with the latest version of the Host Monitor.

Insert into hmlog (eventdatetime, testname, status, AlertThreshold, klant, method, reply) VALUES ('%DateTime%', '%TestName% ', '%SimpleStatus%', '%AlertThresHold%', '%FullPath%', '%TestMethod%', '%Reply%')

Test given an error and after that the logging doesn't work (obviously).

Thanks,

Hanno
Culprit
Posts: 15
Joined: Fri Apr 28, 2006 8:35 am

Post by Culprit »

Hanno wrote:I figured it out. It is a mySQL "problem". Using MS SQL it works fine.

FYI:
I used the FullPath var in a ODBC connection to the mySQL database in advanced logging with the latest version of the Host Monitor.

Insert into hmlog (eventdatetime, testname, status, AlertThreshold, klant, method, reply) VALUES ('%DateTime%', '%TestName% ', '%SimpleStatus%', '%AlertThresHold%', '%FullPath%', '%TestMethod%', '%Reply%')

Test given an error and after that the logging doesn't work (obviously).

Thanks,

Hanno
It could be problem with backslash on end of string of FullPath.

But I got another problem with FullPath
HostMonitor 5.92
ODBC MySQL ODBC 3.51 or Mysql Connector/ODBC v5
MySQL Server 5.0.20a

When I try to log into DB I become FullPath without \ (backslashes).
What I need to do to save it correctly?

Thanks for Answer.
Culprit
Posts: 15
Joined: Fri Apr 28, 2006 8:35 am

Post by Culprit »

Sometimes save with \
some\Z .. saves with backslash
some\0 .. saves with backslash
some\O .. no backslash
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

MySQL interprets \0 as NULL character. For MySQL we can replace \ with \\ but I am not sure this will work fine with every SQL server.
We need to investigate this matter...

Regards
Alex
Culprit
Posts: 15
Joined: Fri Apr 28, 2006 8:35 am

Post by Culprit »

Thanks for answer.
I need to find some solution that will be working everywhere.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I am afraid \\ will not work for MS SQL, so there is no universal solution.
We have to implement some options (switches) for different servers...

Regards
Alex
Culprit
Posts: 15
Joined: Fri Apr 28, 2006 8:35 am

Post by Culprit »

KS-Soft wrote:I am afraid \\ will not work for MS SQL, so there is no universal solution.
We have to implement some options (switches) for different servers...

Regards
Alex
OK,
Could you post me what exaclty you send in variable %FullPath%?
When I create function for escaping chars from \<char> to \\<char>
I didn't become correct result. It escape every char.
thx
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Variable shows path to the test, e.g. Root\USA\Main Office\

Regards
Alex
Culprit
Posts: 15
Joined: Fri Apr 28, 2006 8:35 am

Post by Culprit »

When you implement feature with \\?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

May be in next version
I need to find some solution that will be working everywhere
I do not see such solution. Different SQL servers have different encoding rules.

Regards
Alex
Culprit
Posts: 15
Joined: Fri Apr 28, 2006 8:35 am

Post by Culprit »

KS-Soft wrote:May be in next version
Should be
Will be in next version
8)
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Done. Version 6.00 available at http://www.ks-soft.net/hostmon.eng/downpage.htm

Use ODBC_UseDoubleSlash option
http://www.ks-soft.net/hostmon.eng/news.htm

Regards
Alex
Culprit
Posts: 15
Joined: Fri Apr 28, 2006 8:35 am

Post by Culprit »

Great.
I have downloaded and tested.

Problem
"Undocumented" ODBC_UseDoubleSlash option directs HostMonitor to replace \ (back slash) with \\ in every variable used in SQL query. This may be necessary for some SQL servers, e.g. MySQL 5.0.
"Undocumented" means that the option is not accessible thru GUI and you should add "ODBC_UseDoubleSlash=1" line into [Misc] section of hostmon.ini file.
It replace in variable %FullPath% correctly, it's GREAT.
But if you have example testname "CPU \\server 1", will be logged only "CPU \server 1". That could be not a bug but feature (clothesed bug).
I hope, if you have in variable allready 2 \ behind you dont replace this, you replace only single \.
Post Reply