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. File keyword and process search

File keyword and process search

Scheduled Pinned Locked Moved Support
8 Posts 2 Posters 32.0k 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.
  • K
    K
    Kelvin Sin
    wrote on last edited by
    #1

    Hi.. everybody,

    There are some two requreiments for monitoring system

    1. Search specific keyword of file(c:\test.txt) in local drive of agent every 1 hour.

    2. Search existence running process for example notepad.exe in windows platform of agent every 1 hour

    May i know how to configure in NetXMS? Thank in advance.

    Kelvin Sin

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

      Hi!

      1. do you need to check for file existence or to search for some string inside the file? To check for file existence, you can use File.Count parameter - it returns number of files matching given name or pattern. To search for string inside file, you should setup logwatch subagent for that file.

      2. Parameter Process.Count(process_name) will return you number of running processes with given name. You can schedule DCI to be collected once per hour, and generate event if it is running (or not running).

      Best regards,
      Victor

      1 Reply Last reply
      0
      • K
        K
        Kelvin Sin
        wrote on last edited by
        #3

        Hi Victor,

        First of all, thank you for your help.

        Regardinging question 1, I want to search some OLD string inside file. this is static file instead of log file.
        I think i can't use logwatch subagent method to check it. It is because string can only be searched when NEW line is added. Am i misunderstanding usage of logwatch subagent.

        Regards,
        Kelvin Sin

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

          Yes, you are right - logwatch looks for new records in file. But why you need to look repeatedly for old records in a file?

          Best regards,
          Victor

          1 Reply Last reply
          0
          • K
            K
            Kelvin Sin
            wrote on last edited by
            #5

            My monitored application will generate new log file every hour.

            Latest log file is heavily accessed and written by application. On average, log file size is 1.5M every hour.  All contenet is in text format.

            I am afraid that it affects application performance. Therefore, I just monitor pervious version log file which is generated last hour.

            This is why I look repeatedly for old records in a file.

            Question 1: Is there any idea to monitor old records in a file?
            Question 2: Is there any performance issue about monitor heavy read+write operation log file by logwatch? Is there any limitation?

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

              Logwatch subagent can work with changing log file names. If agent detect file name change, it reads new log file from the beginning. Also, it detects file overwrite, so if file was overwritten, it also will be scanned from the beginning. How do you log files named?

              Regarding question 2 - it is application specific. I don't think there should be any performance impact. Also, there should be no problem on UNIX to read file being actively written, but it can cause application misbehavior on Windows. The only way to know it for sure is to test it.

              Best regards,
              Victor

              1 Reply Last reply
              0
              • K
                K
                Kelvin Sin
                wrote on last edited by
                #7

                Log file is named as below pattern
                AMS3AutoDealerLog00Thu06Jan2010.AMS3
                AMS3AutoDealerLog01Thu06Jan2010.AMS3
                ..
                ..
                ..
                ..
                AMS3AutoDealerLog23Thu06Jan2010.AMS3

                Pattern is
                AMSAutoDealerLog<00-23><MON-FRI)<DDMMMYYYY>.AMS

                log file will be generated every hour.

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

                  Is log file name represents current date and time? If yes, then for that pattern active log file can be identified as following:

                  <file>AMS3AutoDealerLog%H%a%d%b%Y.AMS3</file>

                  Logwatch will automatically switch to new file each hour.

                  But if log file name contains past hour, not current, then you will need to create external script which will provide logwatch with file name to parse. To use script for generating log file name, use following syntax:

                  <file>AMS3AutoDealerLog`my_script_name`.AMS3</file>

                  Best regards,
                  Victor

                  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