KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

environment variable mishandled

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
terje



Joined: 25 Jul 2005
Posts: 88
Location: Sydney

PostPosted: Thu Mar 13, 2008 7:03 pm    Post subject: environment variable mishandled Reply with quote

I think that hostmonitor is using a windows environment variable that I have specified incorrectly.

We use private logs extensively for groups of tests. We have lots of these private log files in a specific directory and many of them are very large. The directory that they are kept in is along the following lines:-

C:/Inetput/hostmonitor.ourdomain.com/logs

For storage reasons we have decided to bite the bullet and relocate all these tests to the following new location:-

D:/Inetput/hostmonitor.ourdomain.com/logs

This will require a lot of manual updating of tests to specify the new location and we would like to avoid this headache if we ever have to move things again. So we created a Windows environment variable as follows:-

%hostmonpath% = D:/Inetput/hostmonitor.ourdomain.com

Then for a given test I attempt to change the location of the private log to:-

%hostmonpath%/logs

This would seem to satisfy the requirements we have to avoid this headache in future. However when we save the test with the above private log path specified, then hostmonitor for some reason mangles it and replaces it with:-

C:\WINDOWS\system32\%hostmonitorpath%\logs\privatelog1.htm

In essence it prepends the "C:\WINDOWS\system32" to the path we have tried to specify.

Is this something that can be fixed?
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12792
Location: USA

PostPosted: Fri Mar 14, 2008 10:53 am    Post subject: Reply with quote

Windows environment variables? You cannot use such variables as parameters of the tests. When you specify path to the log you may use some date macro variables.

Quote:
This will require a lot of manual updating of tests to specify the new location and we would like to avoid this headache if we ever have to move things again.

I think you may use export/import options and any text editor to perform "find&replace" operation.

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
terje



Joined: 25 Jul 2005
Posts: 88
Location: Sydney

PostPosted: Tue Mar 25, 2008 6:44 pm    Post subject: Reply with quote

Given the suggestion that Hostmonitor won't utilise windows enviroment variables I instead created a Hostmonitor Global Macro Variable with the required name. However hostmonitor also seemed to mangle this. It mangles as follows:-

%udv_hostmonpath%/logs/private1.htm

becomes

C:/HOSTMONITOR/%udv_hostmonpath%/logs/private1.htm

So it seems that hostmonitor global variables can't be used either?

I also tried using a mapped drive with the idea that I can just remap the drive to a new location when required:-

R:\logs\private1.htm

However under Windows-2003 an application running as a service can not access mapped drives so hostmonitor can't use it.

~~~~~~

The Export/Import option looks promising. If I export and then modify the text file and then re-import is it going to update my tests or will it simply duplicate them with the duplicates having the new settings?
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12792
Location: USA

PostPosted: Wed Mar 26, 2008 12:13 am    Post subject: Reply with quote

Quote:
So it seems that hostmonitor global variables can't be used either?

I think our manual is pretty clear
http://www.ks-soft.net/hostmon.eng/mframe.htm#logs.htm#macros

Quote:
However under Windows-2003 an application running as a service can not access mapped drives so hostmonitor can't use it.

Sure. Service does not "know" anything about "user" mapped drives. Its a true for any Windows (NT, 2000, XP, 2003...)

Quote:
The Export/Import option looks promising. If I export and then modify the text file and then re-import is it going to update my tests or will it simply duplicate them with the duplicates having the new settings?

There is ImportMode command can be specified in import file
Quote from the manual
ImportMode = Add
; this parameter may be set to one of the following values:
; - ImportMode = Add - in this mode HostMonitor adds new tests to the
; list; prompts for confirmation when the test with specified name already
; exists within the list (in any folder). This mode is used by default as it
; conforms with the behavior of previous versions of HostMonitor (version
; 4.30 or earlier);
ImportMode = Modify
; - in this mode application adds new test if
; the test with specified name doesn't exist in the folder. Otherwise,
; HostMonitor replaces the test settings by those provided in the imported
; file. Statistical information (dead ratio, alive ratio, etc) is kept intact;
ImportMode = Replace
; - adds new test if the test with provided name
; doesn't exist in the specified folder. Otherwise, HostMonitor replaces
; the test settings with the settings that are specified in the imported
; file and resets all statistical information (similar to the effect of
; complete removing of an old test and then creating the new one instead.

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
terje



Joined: 25 Jul 2005
Posts: 88
Location: Sydney

PostPosted: Wed Mar 26, 2008 12:50 am    Post subject: Reply with quote

Thanks.

I got the import function working. There was a bug but I have reported it separately:-

http://www.ks-soft.net/cgi-bin/phpBB/viewtopic.php?t=4592

The date based macros for logging does not help me because I want to be able to move the logs to an alternate drive as and when space management requires. Uncompressed our logs are now use over 11 Gbytes of space and we want to keep this history beause it offers some good baselines for lots of things. If Global Macro Variables worked in the path names for private logs then the drive name and root directory could be altered in one single place as and when required. Call it a wish.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index