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 (Russian)
  3. Помогите разобраться с Log Monitoring

Помогите разобраться с Log Monitoring

Scheduled Pinned Locked Moved Support (Russian)
3 Posts 2 Posters 10.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.
  • A
    A
    aachern
    wrote on last edited by
    #1

    Допустим надо мониторить лог: C:\NetXMS_agent\demo.log и если в логе встречается 'error', то выполнять какое то действие, к примеру, alert на почту.

    Я посмотрел инструкцию https://www.netxms.org/documentation/adminguide/log-monitoring.html, но из нее мало что понятно, нормальных примеров не нашел.

    Давайте прямо по инструкции пойдем, с раздела Log Monitoring:

    1. Agent Configuration for Log Monitoring

    Это этот файл? C:\NetXMS_agent\etc\nxagentd.conf:

    #
    #
    # NetXMS agent configuration file
    # Created by agent installer at Wed Mar 21 11:45:04 2018
    #

    MasterServers = 127.0.0.1
    ConfigIncludeDir = C:\NetXMS_agent\etc\nxagentd.conf.d
    LogFile = {syslog}
    FileStore = C:\NetXMS_agent\var
    RequireAuthentication = yes
    SharedSecret = 123qweR
    SubAgent = filemgr.nsm
    SubAgent = ping.nsm
    SubAgent = logwatch.nsm

    # Below is log parsers definitions

    *LOGWATCH
    Parser = C:\NetXMS_agent\parser1.xml

    SubAgent = portcheck.nsm
    SubAgent = winperf.nsm

    Parser1.xml, как и в примере:

    <parser>
        <file>C:\NetXMS_agent\demo.log</file>
        <rules>
            <rule>
                <match>process startup failed</match>
                <context action="set" reset="auto">STARTUP_FAILED</context>
            </rule>
            <rule context="STARTUP_FAILED">
                <match>process:(.*)</match>
                <event params="1">200000</event>
            </rule>
        </rules>
    </parser>

    demo.log:

    process:  5 6 54 4412345
    process:  5 6 54 4412345
    process:  5 6 54 4412345
    process startup failed sdfsdf
    process startup failed
    process startup failed
    process startup failed process:  5 6 54 4412345
    process:  5 6 54 4412345
    process:  5 6 54 4412345

    А дальше что?

    Есть хоть один рабочий пример, как следить за логами, или NetXMS под это не заточен, а заточен только под анализ системных логов, которые сам собирает?

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

      На всякий случай - у вас субагенты не в той секции прописаны (хотя вроде как дублируются в правильной секции тоже).

      Парсер выглядит правильным, должен был послать событие с кодом 200000 (кстати можно использовать имена событий вместо кодов). А событие было послано? Если нет, надо смотреть лог агента - можно в тэг парсер добавить опцию trace="9" и запустить агент с высоким дебагом - будет подробный лог парсера.

      1 Reply Last reply
      0
      • A
        A
        aachern
        wrote on last edited by
        #3

        После переустановки заработало

        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