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:
1) 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):
2) add libnsm_logscan.so/logscan.nsm to you nxagentd.conf (SubAgent parameter)
3) 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.
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:
1) 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):
Code Select
$ cd netxms-VERSION
$ ./configure ...
$ cd src/agent/subagents/logscan
$ make install
2) add libnsm_logscan.so/logscan.nsm to you nxagentd.conf (SubAgent parameter)
3) 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.