Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
vamsibn Frequent Contributor.
Frequent Contributor.
676 views

Windows dynamic log file moniotr

Hi Experts,

Can you help me how to configure a monitor for dynamic log file monitor, when i am trying to create it is throwing error like unable to read log file. i am trying by giving the format as below mentioned.

Path: \\windows hostname\E$\xxx\xxxx\xxxx\xxx\Log_$day$_$0month$_$year$.log/

 

Can you please help me how to sort the issue and waiting for the response.

 

0 Likes
5 Replies
Micro Focus Expert
Micro Focus Expert

Re: Windows dynamic log file moniotr

Hi vamsibn,

it would be helpful if you tell us
- what SiteScope version you are using
- on what OS
- a example how the logfile name looks like in reality, so that it's possible to verify the regular expression

Check the log and provide the full error message, it may show what file the monitor tries to open
On the SiteScope box check if you can access the file
\\<host>\E$\<whatever>\Log_<whatever>.log
Make sure the user SiteScope runs the service under can access the file as well.

Greetings
Siggi

Customer Support
Micro Focus

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
0 Likes
vamsibn Frequent Contributor.
Frequent Contributor.

Re: Windows dynamic log file moniotr

Hi siggi,

Currently we are using 11.32 sitescope version on widows 2012 server.

In real time log file looks like E:\xxxx\utilities\MigrationUtility\Log_NewgenCallUtility\Log_02_02_2017.log/.

and i tried the regular expression as \\sbbcmspapp1\E$\xxxx\utilities\MigrationUtility\Log_NewgenCallUtility\Log_$0day$_$0month$_$year$.log/ and unable to read the file.

I have checked from windows support team and all permissions are there for the above mentioned log.

 

Waiting for your quick response.

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Windows dynamic log file moniotr

Hi vamsibn,

thanks for providing the details.

I tested this on my box (easy first, then getting advanced):
I created the file C:\utilities\MigrationUtility\Log_NewgenCallUtility\Log_03_02_2017.log

This pattern
 s/C:\utilities\MigrationUtility\Log_NewgenCallUtility\Log_$0day$_$0month$_$year$.log/
works fine and maps to (as today it's 03_02_2017 !)
 C:\utilities\MigrationUtility\Log_NewgenCallUtility\Log_03_02_2017.log

I then copied the whole folder to a mapped drive Z: (which is \\sov02bac16\software_and_scripts)

Neither

s/Z:\utilities\MigrationUtility\Log_NewgenCallUtility\Log_0$day$_$0month$_$year$.log/

nor

s/\\sov02bac16\software_and_scripts\utilities\MigrationUtility\Log_NewgenCallUtility\Log_0$day$_$0month$_$year$.log/

work, although fromout a DOS prompt all is fine:

dir z:\utilities\MigrationUtility\Log_NewgenCallUtility\Log_03_02_2017.log
02/03/2017  02:03 PM                18 Log_03_02_2017.log

dir \\sov02bac16\software_and_scripts\utilities\MigrationUtility\Log_NewgenCallUtility\Log_03_02_2017.log
02/03/2017  02:03 PM                18 Log_03_02_2017.log

In my case the issue is that SiteScope runs under the Local System Account, and there the drive is NOT mapped.

Logged in as Administrator, I mapped the drive manually

C:\>net use z: \\sov02bac16\software_and_scripts /persistent:yes
C:\>net use

Status       Local     Remote                    Network
-------------------------------------------------------------------------------
OK           Z:        \\sov02bac16\software_and_scripts
                                                Microsoft Windows Network
stopped the HP SiteScope service, changed the Log On Account to Administrator,
and now it works with:

s/\\sov02bac16\software_and_scripts\utilities\MigrationUtility\Log_NewgenCallUtility\Log_0$day$_$0month$_$year$.log/

Check out
 http://stackoverflow.com/questions/182750/map-a-network-drive-to-be-used-by-a-service
for some magic hints on mapping files or drives globally and for services.

BTW, if you need to find out whether or not the substitution works,
enable per process debug logging
(Monitor -> Properties -> Logging Settings
 check "Enable separate log for this monitor"
 and set Log level : DEBUG

After changing anything, you can click on Verify & Save.
If it works, fine, if not, simply go down to
Monitor -> Properties -> Logging Settings and click on View Log,
then you'll see what's going on.

What I found is that it displays the substituion as long as something goes wrong, for example
[Logile bac19 Z:(200981347/31) ] (AtomicMonitor.java:2191) INFO  - Running the monitor Logile bac19 Z:
[Logile bac19 Z:(200981347/31) ] (LogMonitorBase.java:1253) DEBUG - Log name [s/Z:\\utilities\\MigrationUtility\\Log_NewgenCallUtility\\Log_$day$_02_2017\.log/] was substituted with: Z:\\utilities\\MigrationUtility\\Log_NewgenCallUtility\\Log_3_02_2017\.log
[Logile bac19 Z:(200981347/31) ] (LogMonitorBase.java:458) DEBUG - unable to read log file

so here I could see that I need to use "$0day$" instead of "$day$

if you only see these entries
[Logile bac19 Z:(200981347/31) ] (AtomicMonitor.java:2191) INFO  - Running the monitor Logile bac19 Z:
[Logile bac19 Z:(200981347/31) ] (LogMonitorBase.java:458) DEBUG - unable to read log file
then it usually means that the file doesn't exist or unable to be read.

Greetings
Siggi

Customer Support
Micro Focus

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
vamsibn Frequent Contributor.
Frequent Contributor.

Re: Windows dynamic log file moniotr

Dear Siggi san,

Thanks for sharing the valuable information.

But here the log file Log_02_02_2017.log is not updating in daily basis. If any scheduled or migration utilities activities are there then only the log will update and in this case i am unable to pick the data for the same.

Please find the attached log for the reference.

If i am changing the log format as Log_03_02_2017.log and giving any dummy matter then it is picking the log data.

Can you please help me how to sort the same.

Regards,

Vamsi Krishna Bollineni.

+91-7760526394

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Windows dynamic log file moniotr

Hi Vamsi,

thanks for your update.

If I understand correctly, then the issue is that when SiteScope checks "now" (02/07/2017) there mighr me no logfile Log_07_02_2017,
but for example Log_06_02_2017.log only.

In that case the file monitor is unable to deal with this setup. It simply doesn't know that today no new logfile is present, and thus will return an error.
You can
- setup the thresholds in a creative way so that the "logfile doesn't exist" error doesn't cause a warning or error for the
  SiteScope monitor

or
- create a directory monitor looking for today's file and make it a dependency of the log file monitor,
   so that it runs only if the file exists
or
- (may or may not be useful) setup a scheduled .bat file which simply copies and empty file with the correct
   date into the folder. The monitor will still tell you that there is nothing to read, but it will not return an error

If I miss something or I don't quite understand, you might post some sample data.
You mentioned that you attached the logfile, but I cannot find it ...

Greetings
Siggi

Customer Support
Micro Focus

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.