Ad Widget

Collapse

Monitoring CPU, Memory and Load

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chocho63
    Member
    • Jun 2005
    • 53

    #1

    Monitoring CPU, Memory and Load

    I'm testing Zabbix and Cacti to see if it could help us to monitor various servers (AIX, HP-UX, Linux, Solaris, Windows).
    Zabbix can monitor CPU, Memory, Processor Load and Traffic with Zabbix Agent and SNMP, but only for Linux and Windows. CPU is not monitored for HP-UX, AIX and Solaris, and Processor Load for AIX. The functions for other OS aren't still developped. Will they be planed to be add to Zabbix Agent ?
    Cacti can monitor these functions with SNMP (with a thing called ucd/net) for all OS. Is it possible to add this possibility to Zabbix ?
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #2
    Greetings,

    Cacti is simply a PHP frontend for the RRDtool. Zabbix is capable of monitoring pretty much anything that RRDtool can monitor, however, you have to use SNMP to do most of it. Please note that Cacti adds no capabilities for monitoring, only for displaying the monitored information. Additionally, the ucd/net thing you are talking about is actually an SNMP variant.
    Unofficial Zabbix Developer

    Comment

    • tvman
      Junior Member
      • Sep 2005
      • 21

      #3
      CPU monitoring

      For my Linux servers I use little script for cpu monitoring which allow to see load in percents. Be a little bit more creative in using such a powerful tool.

      Comment

      • chocho63
        Member
        • Jun 2005
        • 53

        #4
        Monitoring CPU, Memory

        I agree that Zabbix is more flexible than Cacti, and I think there's more possibilities for monitoring.

        I'm using SNMP for monitoring network traffic, but I couldn't find how to monitor CPU or Memory with SNMP. (try ucd/net in Google, and you'll find ... nothing).

        I finally see the OID in Cacti that enables to do that, but by default, snmpwalk don't show it :

        /usr/local/bin/snmpwalk -c public -v 1 localhost .1.3.6.1.4.1.2021
        UCD-SNMP-MIB::memIndex.0 = INTEGER: 0
        UCD-SNMP-MIB::memErrorName.0 = STRING: swap
        UCD-SNMP-MIB::memTotalSwap.0 = INTEGER: 25165824
        UCD-SNMP-MIB::memAvailSwap.0 = INTEGER: 19122820
        UCD-SNMP-MIB::memTotalReal.0 = INTEGER: 25165824
        UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 268728
        UCD-SNMP-MIB::memTotalFree.0 = INTEGER: 19393848
        UCD-SNMP-MIB::memMinimumSwap.0 = INTEGER: 16000
        UCD-SNMP-MIB::memSwapError.0 = INTEGER: 0
        UCD-SNMP-MIB::memSwapErrorMsg.0 = STRING:
        UCD-SNMP-MIB::laIndex.1 = INTEGER: 1
        UCD-SNMP-MIB::laIndex.2 = INTEGER: 2
        UCD-SNMP-MIB::laIndex.3 = INTEGER: 3
        UCD-SNMP-MIB::laNames.1 = STRING: Load-1
        UCD-SNMP-MIB::laNames.2 = STRING: Load-5
        UCD-SNMP-MIB::laNames.3 = STRING: Load-15
        UCD-SNMP-MIB::laLoad.1 = STRING: 5.52
        UCD-SNMP-MIB::laLoad.2 = STRING: 3.79
        UCD-SNMP-MIB::laLoad.3 = STRING: 3.54
        UCD-SNMP-MIB::laConfig.1 = STRING: 12.00
        UCD-SNMP-MIB::laConfig.2 = STRING: 12.00
        UCD-SNMP-MIB::laConfig.3 = STRING: 12.00
        UCD-SNMP-MIB::laLoadInt.1 = INTEGER: 552
        UCD-SNMP-MIB::laLoadInt.2 = INTEGER: 379
        UCD-SNMP-MIB::laLoadInt.3 = INTEGER: 354
        UCD-SNMP-MIB::laLoadFloat.1 = Opaque: Float: 5.522781
        UCD-SNMP-MIB::laLoadFloat.2 = Opaque: Float: 3.791458
        UCD-SNMP-MIB::laLoadFloat.3 = Opaque: Float: 3.544296
        UCD-SNMP-MIB::laErrorFlag.1 = INTEGER: 0
        UCD-SNMP-MIB::laErrorFlag.2 = INTEGER: 0
        UCD-SNMP-MIB::laErrorFlag.3 = INTEGER: 0
        UCD-SNMP-MIB::laErrMessage.1 = STRING:
        UCD-SNMP-MIB::laErrMessage.2 = STRING:
        UCD-SNMP-MIB::laErrMessage.3 = STRING:
        UCD-SNMP-MIB::ssIndex.0 = INTEGER: 1
        UCD-SNMP-MIB::ssErrorName.0 = STRING: systemStats
        UCD-SNMP-MIB::ssSwapIn.0 = INTEGER: 0
        UCD-SNMP-MIB::ssSwapOut.0 = INTEGER: 0
        UCD-SNMP-MIB::ssIOSent.0 = INTEGER: 17
        UCD-SNMP-MIB::ssIOReceive.0 = INTEGER: 17
        UCD-SNMP-MIB::ssSysInterrupts.0 = INTEGER: 3
        UCD-SNMP-MIB::ssSysContext.0 = INTEGER: 23
        UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 72
        UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 25
        UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 4
        UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 105054204
        UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 105084815
        UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 732748344
        UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 25116856
        UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 79967959
        UCD-SNMP-MIB::ssIORawSent.0 = Counter32: 511255298
        UCD-SNMP-MIB::ssIORawReceived.0 = Counter32: 1011706304
        UCD-SNMP-MIB::ssRawInterrupts.0 = Counter32: 3460633287
        UCD-SNMP-MIB::ssRawContexts.0 = Counter32: 1037967192
        UCD-DLMOD-MIB::dlmodNextIndex.0 = INTEGER: 1
        UCD-DISKIO-MIB::diskIOIndex.1 = INTEGER: 0
        UCD-DISKIO-MIB::diskIOIndex.2 = INTEGER: 1
        UCD-DISKIO-MIB::diskIOIndex.3 = INTEGER: 2
        UCD-DISKIO-MIB::diskIOIndex.4 = INTEGER: 3
        UCD-DISKIO-MIB::diskIOIndex.5 = INTEGER: 4
        UCD-DISKIO-MIB::diskIOIndex.6 = INTEGER: 5
        UCD-DISKIO-MIB::diskIOIndex.7 = INTEGER: 6
        ....

        I'll work on it !

        Comment

        • tvman
          Junior Member
          • Sep 2005
          • 21

          #5
          What about this?

          In zabbix_agentd.conf

          UserParameter=cpu[load],cpu_load.sh

          In cpu_load.sh

          #!/bin/sh
          LAST=""
          STAT=`cat /proc/stat | grep cpu0 `
          if [ -f /tmp/cpu_last ]; then
          LAST=`cat /tmp/cpu_last `

          fi
          awk -v b="$LAST" -v a="$STAT" '
          BEGIN {
          if ( b == "" ) {
          print "0";
          print a > "/tmp/cpu_last";
          exit;
          }
          split(a,data_a," ");
          split(b,data_b," ");
          d_u = data_a[2] - data_b[2];
          d_n = data_a[3] - data_b[3];
          d_s = data_a[4] - data_b[4];
          d_i = data_a[5] - data_b[5];
          load = 100 - (d_i/(d_u + d_s + d_n + d_i)*100);
          print load;
          print a > "/tmp/cpu_last";
          exit;}'

          Comment

          • chocho63
            Member
            • Jun 2005
            • 53

            #6
            SNMP monitoring

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

            You can monitor traffic, CPU, Memory, Load Average with Zabbix :

            Last edited by chocho63; 12-10-2005, 14:25.

            Comment

            Working...