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. Update DCI from syslog message

Update DCI from syslog message

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 55.1k 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.
  • Y
    Y
    yordi
    wrote on last edited by
    #1

    Hello fellow admin,

    I want to monitor very simple wifi enabled battery powered clocks.
    those clock only send syslog message when executing NTP sync. (see image)
    and only connect to wifi when syncing to save battery power. (5 times a day)

    Ho to monitor up status ? like if there is more then 8:30hours past no syslog message received mark as offline status

    Second create a DCI for the Synchronised and Battery TAG in syslog.

    So i can create action rules if the Battery TAG of a clock is not  "Battery OK" or the Synchronised TAG is not "Synchronised".

    Try to create a syslog parser could not get it to work.

    At the moment the node only has the default DCI, i know how to create DCI templates but not ho to us a syslog status to update de DCI of a host.

    Thanks.


    clock-syslog.png

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      In syslog parser we can configure event generation. You can create some event template for this and uncheck "write to log" as we use that event just to pass information.

      Next step is to have EPP rule. In this rule we can specify container with the clocks, so that rule reacts only to messages from them. Here we need some scripting, e.g.:

      $node.setCustomAttribute("lastSyslogMessageTimestamp", GetCurrentTime());
      return true; // To process actions in the rule if we need them
      

      This will store timestamp into custom attribute on the node. We can access parameters of the event, e.g. $event.getParameter("message") will be the message, so you can filter by that in the script if needed.

      Now on the node we can create a script DCI or Internal DCI with Dummy metric and to things in it's transformation script:

      return GetCurrentTime() - $node.setCustomAttribute("lastSyslogMessageTimestamp");
      

      So our DCI keeps number of seconds since last syslog message. You can set units to Uptime to display the value in human-readable form. Threshold would compare with the number of seconds that you need.

      P.S. We also can push value to a push DCI from EPP rule's script:

      dciId = FindDCIByName($node, "lastMessageTimestamp");
      if (dciId != null) {
        PushDCIData($node, dciId, GetCurrentTime());
      }
      

      but the problem is that threshold on a DCI is processed only when new value is coming, so for that we need some DCI that is regularly collected.

      1 Reply Last reply
      0
      • Y
        Y
        yordi
        wrote on last edited by
        #3

        thank you for you help.

        For the 1ste step, the syslog parser, what are the condition to use ?
        and do I need to select an event in this syslog parser ?

        pleas see image in first message.

        thanks verry much.

        1 Reply Last reply
        0
        • F
          F
          Filipp Sudanov
          wrote on last edited by
          #4

          Simple syslog parser rule with Matching regular expression .*  and specifying the event will work. They you can add Facility and Severity filters if needed.

          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