Log.Scan()?
-
Hello everyone,
First a happy new year and best wishes for everyone.
I would like to know how the function Log.Scan is used. I can see it on one of the screenshots, but don't find any documentation on it.
I basically want to read a text file, and check for the content of the file...Thanxx in advance for the help...
Peter. -
Hello.
Actually, log scanner in it current state is a more a hack than a production grade code - it was made for a specific task.
However, you can try to use it:- while logscan subagent is already included in windows version (i believe so), you should compile it manually on unix (or add "--enable-unstable" parameter to configure, this will enable some additional features, including logscan subagent):
$ cd netxms-VERSION $ ./configure ... $ cd src/agent/subagents/logscan $ make install- add libnsm_logscan.so/logscan.nsm to you nxagentd.conf (SubAgent parameter)
- now you can call LogScan.FindString parameter with two arguments: filename and substring to search. If substring is found - whole string returned, empty string otherwise.
LogScan works on per-line basis; it stops search when substring is found, so if you have multiple lines matching - FindString will return them all. Position in file is persisted between requests; log rotation is detected only by file size (e.g. if last known file position is beyond the end of file)
wbr, alex.
-
-
-
Still only a plans unfortunately....
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login