Ad Widget

Collapse

Monitoring with NET-SNMP

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Monitoring with NET-SNMP

    (for all platforms, Linux, Solaris, Aix, HP-UX)

    You can monitor traffic with these OIDs with Zabbix :

    IP-MIB::ipAdEntIfIndex.[Addr IP] -> Addr IP is the host IP, for example IP-MIB::ipAdEntIfIndex.10.189.52.123 : returns the number of the interface used below (N° int).

    IF-MIB::ifDescr.[N° int] -> Name of the interface
    IF-MIB::ifInDiscards.[N° int] -> Number of discards packets in
    IF-MIB::ifOutDiscards.[N° int] -> Number of discards packets out
    IF-MIB::ifInErrors.[N° int] -> Number of errors packets in
    IF-MIB::ifOutErrors.[N° int] -> Number of errors packets out
    IF-MIB::ifInOctets.[N° int] -> Number of octets in
    IF-MIB::ifOutOctets.[N° int] -> Number of octets out
    IF-MIB::ifInNUcastPkts.[N° int] -> Number of non-unicast packets in (except Linux)
    IF-MIB::ifOutNUcastPkts.[N° int] -> Number of non-unicast packets out (except Linux)
    IF-MIB::ifInUcastPkts.[N° int] -> Number of unicast packets in
    IF-MIB::ifOutUcastPkts.[N° int] -> Number of unicast packets out
    for example IF-MIB::ifInOctets.2


    You can monitor Memory and Swap with these OID, using a custom multiplier of 1024 (size in Kbytes) :

    UCD-SNMP-MIB::memAvailReal.0 -> Memory available
    UCD-SNMP-MIB::memTotalReal.0 -> Total memory
    UCD-SNMP-MIB::memAvailSwap.0 -> Swap available
    UCD-SNMP-MIB::memTotalSwap.0 -> Total swap


    You can monitor Load Average with these OID :

    UCD-SNMP-MIB::laLoadInt.1 -> Load average / 1 min
    UCD-SNMP-MIB::laLoadInt.2 -> Load average / 5 min
    UCD-SNMP-MIB::laLoadInt.3 -> Load average / 15 min

    Use a custom multiplier of 0.01 for these values.


    You can monitor CPU utilisation (%) with these OID :

    Instant monitor, not an average :

    UCD-SNMP-MIB::ssCpuRawUser.0 -> Number of timeticks used by users's process (AIX, Solaris, Linux, HP-UX)
    UCD-SNMP-MIB::ssCpuRawSystem.0 -> Number of timeticks used by system's process (AIX, Solaris, Linux, HP-UX)
    UCD-SNMP-MIB::ssCpuRawIdle.0 -> Number of timeticks unused (AIX, Solaris, Linux, HP-UX)
    UCD-SNMP-MIB::ssCpuRawWait.0-> Number of timeticks used by process waiting (AIX, Solaris, HP-UX)
    UCD-SNMP-MIB::ssCpuRawNice.0-> Number of timeticks used by nice process (Linux, HP-UX)
    UCD-SNMP-MIB::ssCpuRawKernel.0 -> Number of timeticks used by kernel process (AIX, Solaris, Linux, HP-UX)

    Configure the item with an OID, chose a custom multiplier of :
    - 1 * 100 / (delay between checks * number of timeticks per second * number of CPU) for Linux
    - 1 * 100 * number of CPU / (delay between checks * number of timeticks per second) for HP-UX
    - 1 * 100 / (delay between checks * number of timeticks per second) for AIX and Solaris
    store 'Delta Simple Change'.
    To get the number of timeticks per second, use 'getconf CLK_TCK'. It's always 100 on hosts I've tested.
    For example, with CLK_TCK=100 (Linux i386), check every 10 seconds, 2 CPU, the custom multiplier is 0.05.
    For Linux, it's the logical number of CPU displayed by command 'top', not the physical number.


    You can monitor number of processes and users with these OID :

    HOST-RESOURCES-MIB::hrSystemNumUsers.0
    HOST-RESOURCES-MIB::hrSystemProcesses.0


    For UCD-SNMP-MIB, net-snmp must be compiled with option '--with-mib-modules=’ucd-snmp/diskio'
    For HOST-RESOURCES-MIB, net-snmp must be compiled with option '--with-mib-modules=’host'
    Last edited by chocho63; 28-10-2005, 09:17. Reason: Correct Load Average

    #2
    Greetings,

    Excellent info Chocho. Very helpful.
    Unofficial Zabbix Developer

    Comment


      #3
      UCD-SNMP-MIB::ssCpuRawIdle.0 -> Number of timeticks unused (AIX, Solaris, Linux, HP-UX)
      1 * 100 / (delay between checks * number of timeticks per second * number of CPU) for Linux
      It's hard to get a good reading for "ssCpuRawIdle" since a busy Zabbix server may not take a reading exactly at, for example, every 10 seconds. The % could go way out of whack, like to 300%.

      I had to write a small command line script and place it in the snmpd.conf to get the CPU %.

      Comment


        #4
        May i know how to get "delay between checks"?
        if anyone knows pls reply ..
        i really nid to get this thing works.

        Comment


          #5
          Originally posted by diopter
          May i know how to get "delay between checks"?
          if anyone knows pls reply ..
          i really nid to get this thing works.

          is that not set by you ion the Item configuration?

          Comment


            #6
            Originally posted by grabber
            is that not set by you ion the Item configuration?
            Below is how i configure to monitor cpu utilization (%) . But i failed to get the correct value, so please correct me if u see any mistake.
            thx alot!

            To monitor cpu idle
            Snmp OID: .1.3.6.1.4.1.2021.11.53.0
            Type: Float
            Units: <none>
            Multiplier: 0.025 [1 * 100 / (10 * 100 * 4) = 0.025]
            Store Value: Delta Simple Change

            The value i get = 173.97

            my server have 4 processors and the actually idle value by tat time should be 98% idle.

            i wonder which part i did wrong..
            how do i make it to collect the same value as it shown in TOP
            HELP?
            Last edited by diopter; 03-07-2006, 15:21.

            Comment


              #7
              which OS are you using?
              and can you give me an example of the data you have recieved, so we can try to work this out?

              My Zabbix server is getting rebuilt but as it is 5500 miles away I have to wait on the locals to get to it...

              Thanks

              Comment


                #8
                Originally posted by grabber
                which OS are you using?
                and can you give me an example of the data you have recieved, so we can try to work this out?

                My Zabbix server is getting rebuilt but as it is 5500 miles away I have to wait on the locals to get to it...

                Thanks
                im using Advance Server 4 U3 and the date i received is 173.97..

                and the counter value i received

                snmpwalk -c mycommunity -v 2c x.x.x.x .1.3.6.1.4.1.2021.11.ssCpuRawIdle.0 -On

                .1.3.6.1.4.1.2021.11.53.0 = Counter32: 1781085473

                thx for fast reply

                Comment


                  #9
                  "Update interval (in sec)" is configured as part of the Item...what have you got for that? I think that is what you use in the multiplier.

                  Ian

                  Comment


                    #10
                    Originally posted by grabber
                    "Update interval (in sec)" is configured as part of the Item...what have you got for that? I think that is what you use in the multiplier.

                    Ian
                    Update Interval i set it to 10 second ..

                    and the data i get sometimes is 126.45, 98 , 86 ..
                    i dun get it y the data exceed 100, suppose it should be counted as percentage.

                    really nid help here..

                    grabber, alexi or anyone.
                    pls help !

                    Comment


                      #11
                      remember what you are checking loks to be "Store Value: Delta Simple Change" is this really what you want to check?

                      you caxn pm me and I will give you my msn

                      ian

                      also: are you sure you are getting the correct value out?
                      Last edited by grabber; 04-07-2006, 20:33.

                      Comment


                        #12
                        Originally posted by grabber
                        remember what you are checking loks to be "Store Value: Delta Simple Change" is this really what you want to check?

                        you caxn pm me and I will give you my msn

                        ian

                        also: are you sure you are getting the correct value out?
                        actually delta simple change is wat? i have no ideal..
                        but if i pust:
                        "Store Value: As is"
                        it will show the counter value.

                        so i think Store Value should be "delta simple change"

                        wat i wan is to monitor cpu utilisation (in percentage) for:
                        ssCpuRawIdle, ssCpuRawUser and ssCpuRawSytem

                        Comment


                          #13
                          OK I think I got my head around it and I apologise and am embarrassed at being so dumb but it has been a long week!!!

                          1. UCD-SNMP-MIB::ssCpuRawIdle.0 -> Number of timeticks unused is a running total! this is important
                          2. - 1 * 100 / (delay between checks * number of timeticks per second * number of CPU) for Linux is calculated on the difference between data collection intervals. The Delta can never be more than for example (10 * 100 * 4)
                          3. you can therefore NOT calculate this on 1 single piece of data you need at least 2 and calculate it on the change.....

                          first collection value (A)= 1781085473
                          second collection value (B)= 1781088473
                          Delta (D)= 3000

                          (3000)*(1*100/(10*100*4)) = 75%

                          I think!!

                          Comment


                            #14
                            Originally posted by Godzilla
                            It's hard to get a good reading for "ssCpuRawIdle" since a busy Zabbix server may not take a reading exactly at, for example, every 10 seconds. The % could go way out of whack, like to 300%.

                            I had to write a small command line script and place it in the snmpd.conf to get the CPU %.

                            can we get a copy of that script buddy?

                            Comment


                              #15
                              I used mpstat to get the cpu %

                              also I added this to snmpd.conf:

                              exec cpuavg /bin/bash /etc/snmp/cpupct all
                              #exec cpu0 /bin/bash /etc/snmp/cpupct 0
                              #exec cpu1 /bin/bash /etc/snmp/cpupct 1
                              #exec cpu2 /bin/bash /etc/snmp/cpupct 2
                              #exec cpu3 /bin/bash /etc/snmp/cpupct 3



                              #!/bin/bash
                              #
                              # cpupct
                              #
                              # This returns the percent of CPU busy by subtracting 100 from % idle
                              #
                              # only accepts below
                              # all = avg of all CPU
                              #(for 2xCPU HyperThread)
                              # 0 = CPU 1a
                              # 1 = CPU 1b
                              # 2 = CPU 2a
                              # 3 = CPU 2b

                              if [ "$1" == all ] || [ "$1" == 0 ] || [ "$1" == 1 ] || [ "$1" == 2 ] || [ "$1" == 3 ]
                              then
                              passvar=$1
                              CPUidle=( `/usr/bin/mpstat -P ALL 1 1|/bin/grep Average|/bin/gawk "/$passvar /"'{print $9}'|/bin/sed 's/\.[0-9][0-9]*//'` )
                              CPUpct=`expr 100 - $CPUidle`
                              echo $CPUpct
                              exit 0
                              else
                              exit 1
                              fi
                              exit $?

                              Comment

                              Announcement

                              Collapse
                              No announcement yet.
                              Working...
                              X