Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Log.Scan()?

Log.Scan()?

Scheduled Pinned Locked Moved Support
5 Posts 4 Posters 16.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P
    P
    prutser
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • A
      A
      Alex Kirhenshtein
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • P
        P
        prutser
        wrote on last edited by
        #3

        Ok, thank you very much for your help. After adding the Logscan.nsm to the client config file and restarting the client and core, I can indeed search a textfile... Very nice!

        1 Reply Last reply
        0
        • A
          A
          Anth0ny
          wrote on last edited by
          #4

          is it support a Windows Event Logs?
          😃

          or this @ plan only...?

          1 Reply Last reply
          0
          • V
            V
            Victor Kirhenshtein
            wrote on last edited by
            #5

            Still only a plans unfortunately....

            1 Reply Last reply
            0

            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
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            Powered by NodeBB Contributors
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups