Ad Widget

Collapse

Dynamic index help, does it add multiple identical values together?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maplesyrupghost
    Member
    • Jul 2012
    • 37

    #1

    Dynamic index help, does it add multiple identical values together?

    Sooo.. I'm learning how this dynamic index works now, and it's absolutely fantastic. I just added individual process graphing for my machine.

    I noticed, though, that there are multiple values returned by my snmpwalk and I'm not sure if I am graphing it properly, looks like it's grabbing the first value and not looking any further.

    So I want to monitor many things, Apache2 is an example:

    So I see these processes running:

    Code:
    .1.3.6.1.2.1.25.4.2.1.4.1 = STRING: "init"
    .1.3.6.1.2.1.25.4.2.1.4.2 = STRING: "kthreadd/136"
    .1.3.6.1.2.1.25.4.2.1.4.3 = STRING: "khelper/136"
    .1.3.6.1.2.1.25.4.2.1.4.40 = STRING: "init-logger"
    .1.3.6.1.2.1.25.4.2.1.4.180 = STRING: "upstart-socket-bridge"
    .1.3.6.1.2.1.25.4.2.1.4.233 = STRING: "/usr/sbin/sshd"
    .1.3.6.1.2.1.25.4.2.1.4.320 = STRING: "/sbin/syslogd"
    .1.3.6.1.2.1.25.4.2.1.4.354 = STRING: "/usr/sbin/saslauthd"
    .1.3.6.1.2.1.25.4.2.1.4.355 = STRING: "/usr/sbin/saslauthd"
    .1.3.6.1.2.1.25.4.2.1.4.402 = STRING: "sendmail: MTA: accepting connections"
    .1.3.6.1.2.1.25.4.2.1.4.4187 = STRING: "cron"
    .1.3.6.1.2.1.25.4.2.1.4.4420 = STRING: "/usr/sbin/xinetd"
    .1.3.6.1.2.1.25.4.2.1.4.4602 = STRING: "upstart-udev-bridge"
    .1.3.6.1.2.1.25.4.2.1.4.4604 = STRING: "/sbin/udevd"
    .1.3.6.1.2.1.25.4.2.1.4.4699 = STRING: "/usr/sbin/named"
    .1.3.6.1.2.1.25.4.2.1.4.7058 = STRING: "/usr/bin/memcached"
    .1.3.6.1.2.1.25.4.2.1.4.7487 = STRING: "/usr/sbin/apache2"
    .1.3.6.1.2.1.25.4.2.1.4.10382 = STRING: "/usr/sbin/apache2"
    .1.3.6.1.2.1.25.4.2.1.4.10397 = STRING: "/usr/sbin/apache2"
    .1.3.6.1.2.1.25.4.2.1.4.12840 = STRING: "/usr/sbin/mysqld"
    .1.3.6.1.2.1.25.4.2.1.4.21398 = STRING: "sshd: root@pts/0"
    .1.3.6.1.2.1.25.4.2.1.4.21411 = STRING: "-bash"
    .1.3.6.1.2.1.25.4.2.1.4.21813 = STRING: "/usr/sbin/apache2"
    .1.3.6.1.2.1.25.4.2.1.4.21814 = STRING: "/usr/sbin/apache2"
    .1.3.6.1.2.1.25.4.2.1.4.27021 = STRING: "/usr/sbin/snmpd"
    .1.3.6.1.2.1.25.4.2.1.4.27927 = STRING: "sshd: root@pts/2"
    .1.3.6.1.2.1.25.4.2.1.4.27940 = STRING: "-bash"
    .1.3.6.1.2.1.25.4.2.1.4.28029 = STRING: "/usr/sbin/apache2"
    and here is the memory usage:

    Code:
    .1.3.6.1.2.1.25.5.1.1.2.1 = INTEGER: 728 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.2 = INTEGER: 0 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.3 = INTEGER: 0 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.40 = INTEGER: 12 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.180 = INTEGER: 8 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.233 = INTEGER: 356 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.320 = INTEGER: 524 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.354 = INTEGER: 4 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.355 = INTEGER: 16 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.402 = INTEGER: 864 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.4187 = INTEGER: 492 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.4420 = INTEGER: 200 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.4602 = INTEGER: 180 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.4604 = INTEGER: 144 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.4699 = INTEGER: 3400 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.7058 = INTEGER: 10788 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.7487 = INTEGER: 20468 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.10382 = INTEGER: 16872 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.10397 = INTEGER: 19452 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.12840 = INTEGER: 62356 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.21398 = INTEGER: 3624 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.21411 = INTEGER: 2096 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.21813 = INTEGER: 12540 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.21814 = INTEGER: 12528 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.27021 = INTEGER: 3700 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.27927 = INTEGER: 3672 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.27940 = INTEGER: 2076 KBytes
    .1.3.6.1.2.1.25.5.1.1.2.28029 = INTEGER: 10096 KBytes
    I start graphing this OID:

    Code:
    HOST-RESOURCES-MIB::hrSWRunPerfMem[index,HOST-RESOURCES-MIB::hrSWRunPath,/usr/sbin/apache2]
    and it is consistently recording "20.96 Mbytes"

    so..

    is my apache really only taking 20.96 MB? That does sound realistic, but I want your opinion on the matter, because there are multiple "apache2" OID's in the hrSWRunPath OID. This machine is running, but there is extremely little webtraffic on it at all. Adding up all the OIDs gives me 91.9 MB just adding them up with a calculator. Enlighten? Thanks in advance!
  • maplesyrupghost
    Member
    • Jul 2012
    • 37

    #2
    side question

    a side question about dynamic index, what if I wanted to monitor all the OIDs that match that string?

    like, on an ESXi box, every time I fire up a VM I see a new OID:

    Code:
    .iso.org.dod.internet.mgmt.mib-2.host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunPath.3772561 = STRING: "/bin/vmx"
    .iso.org.dod.internet.mgmt.mib-2.host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunPath.4814243 = STRING: "/bin/vmx"
    .iso.org.dod.internet.mgmt.mib-2.host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunPath.5332507 = STRING: "/bin/vmx"
    what if I wanted to monitor these individually?

    thanks!

    Comment

    • mbsit
      Senior Member
      • Sep 2012
      • 130

      #3
      There is no possible to get more than one value from SNMP dynamic index.
      Use calculated items to sum (avg, multiply etc.) to do that.

      Dynamic SNMP Items always return ONLY first value it found.

      Use external bash script to get multiple value and do the math inside them.

      Best
      Grzegorz
      Pozdrawiam
      Grzegorz Grabowski
      ____
      WdroĊĵenia, szkolenia, umowy serwisowe
      Warszawa - Polska

      Comment

      • kevind
        Member
        • Sep 2011
        • 40

        #4
        I believe dynamic indexing just finds the first occurrence and uses that as the index. If there are multiple occurrences, I don't think you can index the others using Zabbix, you'd need to write some kind of external script to deal with it.

        Comment

        Working...