snmp+mrtg - cpu graph?

Sekcia: Konfigurácia 05.07.2010 | 04:29
Avatar linuxacik Debian  Používateľ
dobry..

rozhodol som sa ze si zacnem grafovat cpu vyuzitie a tak, ale mam problem.

z tohoto webu ( http://www.enterastream.com/whitepapers/mrtg/mrtg-manual-cap9.html ) som si dal konfiguraciu

Target[10.0.0.254-cpu]:.1.3.6.1.4.1.311.1.1.3.1.1.33.9.0&.1.3.6.1.4.1.311.1.1.3.1.1.33.9.0:public@10.0.0.254
AbsMax[10.0.0.254-cpu]: 100
MaxBytes[10.0.0.254-cpu]: 100
Title[10.0.0.254-cpu]: CPU Utilization (average)
PageTop[10.0.0.254-cpu]: CPU Utilization
Options[10.0.0.254-cpu]: gauge,growright,nopercent, noo
YLegend[10.0.0.254-cpu]: CPU Utilization
ShortLegend[10.0.0.254-cpu]: %
LegendI[10.0.0.254-cpu]: CPU Utilization (percentage)

vsetko by islo len ked idem spustit MRTG tak vyhodi toto:

root@buri-laptop:/net# env LANG=C /usr/bin/mrtg /home/buri/mrtg.conf
SNMP Error:
Received SNMP response with error code
error status: noSuchName
index 2 (OID: 1.3.6.1.4.1.2021.13.16.3.1.3.1)
SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)
community: "public"
request ID: 1166482177
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/share/perl5/SNMP_util.pm line 492
SNMPGET Problem for .1.3.6.1.4.1.2021.13.16.3.1.3.1 .1.3.6.1.4.1.2021.13.16.3.1.3.1 sysUptime sysName on public@localhost::::::v4only
at /usr/bin/mrtg line 2207
2010-07-05 02:11:20: ERROR: Target[localhost.fan][_IN_] ' $target->[3]{$mode} ' did not eval into defined data
2010-07-05 02:11:20: ERROR: Target[localhost.fan][_OUT_] ' $target->[3]{$mode} ' did not eval into defined data


-
dalej ako som skusal, tak hociaky snmpwalk prikaz ak zadam, hned mi vrati toto:

root@buri-laptop:/etc/snmp# snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.9
End of MIB

viete niekto poradit?
Dal som si debian, a druhy HDD s naj vecami sa mi zmazal xD
    • Re: snmp+mrtg - cpu graph? 05.07.2010 | 14:35
      peter   Návštevník
      ahoj,

      preco to robis cez snmp? ak tie data ziskavas len z localhost-u tak je zbytocne. mrtg dokaze spustit hocijaky skript co si napises a jeho vystup pouzije ako data pre graf.

      napr.:
      # more /etc/mrtg/cpu.conf
      Target[cpu_percent]: ` sar -P ALL 1 1|grep Average|grep all|awk {'print $3'}'`
      ....
      • Re: snmp+mrtg - cpu graph? 05.07.2010 | 14:54
        Avatar linuxacik Debian  Používateľ
        Cawko. DIK ale robi my to chyby.. trosku som si upravil tvoj prikaz ale to je jedno. Mam to takto:

        Target[cpu0.0]: `sar -P 0 1 1|grep Average|awk {'print $3'}`
        AbsMax[cpu0.0]: 100
        MaxBytes[cpu0.0]: 100
        Title[cpu0.0]: CPU Utilization (average)
        PageTop[cpu0.0]: CPU Utilization
        Options[cpu0.0]: gauge,growright,nopercent, noo
        YLegend[cpu0.0]: CPU Utilization
        ShortLegend[cpu0.0]: %
        LegendI[cpu0.0]: CPU Utilization (percentage)


        a pise:

        root@buri-laptop:/home/buri# env LANG=C /usr/bin/mrtg /home/buri/mrtg.conf
        2010-07-05 12:46:18: WARNING: Problem with External get 'sar -P 0 1 1|grep Average|awk {'print $3'}':
        Expected a Number for 'out' but nothing'

        2010-07-05 12:46:22: ERROR: Target[cpu0.0][_OUT_] ' $target->[3]{$mode} ' did not eval into defined data
        root@buri-laptop:/home/buri#
        Dal som si debian, a druhy HDD s naj vecami sa mi zmazal xD
        • Re: snmp+mrtg - cpu graph? 09.07.2010 | 13:38
          peter   Návštevník
          Expected a Number for 'out' but nothing'
          daj si to do googla. Zatial narychlo skus: sar -P 0 1 1|grep Average|awk {'print $3'} && echo 0
    • Re: snmp+mrtg - cpu graph? 09.07.2010 | 13:54
      WlaSaTy   Návštevník
      Ahoj.
      Mne taketo nieco normalne funguje, ale musim mat nakonfigurovanu a beziacu sluzbu SNMP ktora nesmie mat blokovanu komunikaciu medzi strojom na ktorom bezi SNMP a kolektovaciou masinou (napriklad cez firewall).

      Pre MIBs som sa s tym moc nehral, jednoducho som vyuzil UCB definiciu a u mna to vyzera takto:
      #### CPUs
      LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
      Target[localhost.cpu]:ssCpuRawUser.0&ssCpuRawUser.0:public@127.0.0.1+ssCpuRawSystem.0&ssCpuRawSystem.0:public@127.0.0.1+ssCpuRawNice.0&ssCpuRawNice.0:public@127.0.0.1
      RouterUptime[localhost.cpu]: public@127.0.0.1
      MaxBytes[localhost.cpu]: 100
      Title[localhost.cpu]: CPU Load -- rybnik
      PageTop[localhost.cpu]: <h1>Active CPU Load % -- rybnik</h1>
      Unscaled[localhost.cpu]: ymwd ShortLegend[localhost.cpu]: % YLegend[localhost.cpu]: CPU Utilization LegendI[localhost.cpu]: Active CPU in % (Load) LegendO[localhost.cpu]: Options[localhost.cpu]: nopercent

      S preklepmi som sa nekaslal, je to lokalne na mojom desktope. A mam jednoprocesorovu masinu, preto max 100%.