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. Count SNMP walk results

Count SNMP walk results

Scheduled Pinned Locked Moved Support
3 Posts 2 Posters 14.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.
  • S
    S
    squeezypiano
    wrote on last edited by
    #1

    Hi,

    As a new user to NetXMS I still cannot believe just how easy it is to use.  I have been looking for a replacement to the old RRD based systems for a while and this is blowing everything else away.  I just have a couple of things I am struggling to get worked out (custom scripting seems the way to go with these) that I would like to iron out before I add it to my production.  I have split them in to two posts to keep it simpler.

    This topic is an SNMP Walk query.  I am trying to work out how I can count the lines in a SNMP Walk.  For example, I might want to count the number of Arp entries where no SNMP OID exists.  I would like to be able to get just a count as an integer from walking 1.3.6.1.2.1.4.22.1.2.  Is this possible?

    Many thanks.

    1 Reply Last reply
    0
    • T
      T
      tomaskir
      wrote on last edited by
      #2

      Very easy with a "Script" type DCI.

      Just create a script named "count_ARP_entries" in the script library, and used that for the DCI parameter.
      (DCI origin will of course be "Script")

      For the script, you can do this:

      walk_oid = "1.3.6.1.2.1.4.22.1.2";
      
      tube = CreateSNMPTransport($node);
      if (tube == null)
        return null;
      
      varbinds = SNMPWalk(tube, walk_oid);
      if (varbinds == null)
        return null;
      
      return varbinds->size;
      

      Refferences:
      https://wiki.netxms.org/wiki/NXSL_Function_Reference
      https://wiki.netxms.org/wiki/SG:Script_Examples

      1 Reply Last reply
      0
      • S
        S
        squeezypiano
        wrote on last edited by
        #3

        Thanks, Tomas.  Works perfectly  🙂

        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