NetXMS Support Forum

English Support => General Support => Topic started by: yashii on April 23, 2018, 02:55:22 PM

Title: Logwatch file lock
Post by: yashii on April 23, 2018, 02:55:22 PM
On a Windows system, I'm executing an external script through the nxagent that writes to a .txt file.
This file is monitored for changes by the logwatch subagent.

When the external script tries to write to that .txt file, the script's own log shows that the file is locked by the nxagent.
Is there any way to keep the agent from permanently locking the file?
Title: Re: Logwatch file lock
Post by: Victor Kirhenshtein on May 02, 2018, 09:03:52 PM
Hi,

agent opens file being monitored with "shared for write" access. However, if application that writes to the file attempts to open it without specifying "shared for read" option it will get file open error. In upcoming 2.2.5 release we have added log parser option "keepOpen" that can be set to false to instruct parser to re-open file every time to get new records.

Best regards,
Victor
Title: Re: Logwatch file lock
Post by: Spheron on May 02, 2018, 09:11:30 PM
Hi Victor,

does this option also apply to access to the Windows event log?

Greets
Marco


Title: Re: Logwatch file lock
Post by: Victor Kirhenshtein on May 02, 2018, 09:14:18 PM
Hi,

no, it's irrelevant for Windows Event Log. Agent uses appropriate Windows API to access events in event log.

Best regards,
Victor
Title: Re: Logwatch file lock
Post by: Spheron on May 02, 2018, 10:16:21 PM

I asked because I still had the same problems with the agent update from V2.2.3 to V2.2.4 that I had described here

https://www.netxms.org/forum/installation/install-agent-2-2-1-fails/


Maybe i had same Problem at Agent Update as the user who has opened this Thread:

https://www.netxms.org/forum/installation/upgrading-agents/


Greets
Marco