Blaster2k Skrevet 7. desember 2009 Del Skrevet 7. desember 2009 Så jeg har installert MRGT og SNMPD for å vise trafikk på nettverkskortene og å vise CPU-bruk. Men den vil ikke vise CPU-loaden. Slik ser det ut: Jeg har gjort følgende flatbox ~ # aptitude install mrtg snmpd Svarte ja til "Make /etc/mrtg.cfg owned by and readable only by the MRTG user?" flatbox ~ # mkdir /var/www/mrtg flatbox ~ # nano /etc/mrtg.cfg i mrtg.cfg gjorde jeg følgende: # Global configuration RunAsDaemon: yes EnableIPv6: no WorkDir: /var/www/mrtg Options[_]: bits,growright WriteExpires: Yes Title[^]: Traffic Analysis for I /etc/cron.d/mrtg har følgende jobb dukket opp. Noen mener at det er her problemet er: */5 * * * * root if [ ! -d /var/lock/mrtg ]; then mkdir /var/lock/mrtg; fi; if [ -x /usr/bin/mrtg ] && [ -r /etc/mrtg.cfg ]; then env LANG=C /usr/bin/mrtg /etc/mrtg.cfg 2>&1 | tee -a /var/log/mrtg/mrtg.log; fi flatbox ~ # nano /etc/snmp/snmpd.conf i snmpd.conf gjorde jeg følgende: # sec.name source community #com2sec paranoid default public com2sec readonly default public #com2sec readwrite default private flatbox ~ # /etc/init.d/snmpd restart cfgmaker public@localhost > /etc/mrtg.cfg indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html Hittil funker det som det skal. (Har jo ikke lagt inn CPU-grafen enda. [cond]flatbox ~ # nano /etc/mrtg/cpu.cfg[/code] Her legger jeg inn dette jeg hentet fra http://www.debianhelp.co.uk/mrtg.htm WorkDir: /var/www/mrtg LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt Target[localhost.cpu]:ssCpuRawUser.0&ssCpuRawUser.0:[email protected]+ ssCpuRawSystem.0&ssCpuRawSystem.0:[email protected]+ ssCpuRawNice.0&ssCpuRawNice.0:[email protected] RouterUptime[localhost.cpu]: [email protected] MaxBytes[localhost.cpu]: 100 Title[localhost.cpu]: CPU Load PageTop[localhost.cpu]: <H1>Active CPU Load %</H1> Unscaled[localhost.cpu]: ymwd ShortLegend[localhost.cpu]: % YLegend[localhost.cpu]: CPU Utilization Legend1[localhost.cpu]: Active CPU in % (Load) Legend2[localhost.cpu]: Legend3[localhost.cpu]: Legend4[localhost.cpu]: LegendI[localhost.cpu]: Active LegendO[localhost.cpu]: Options[localhost.cpu]: growright,nopercent flatbox ~ # nano /etc/cron.mrtg/cpu Her legger jeg til: #!/bin/sh /usr/bin/mrtg /etc/mrtg/cpu.cfg Lager en ny index-side som i tillegg til nettverkskort viser cpu: flatbox ~ # /usr/bin/indexmaker --output=/var/www/mrtg/index.html \ > --title="System info: " \ > --sort=name \ > --enumerate \ > /etc/mrtg/cpu.cfg \ > /etc/mrtg.cfg Legger til en cronjob ca slik det sto på debianhelp.co.uk echo "*/5 * * * * /bin/run-parts /etc/cron.mrtg 1> /dev/null" >> /var/spool/cron/crontabs/root Men det funker altså ikke. CPU-grafen dukker ikke opp. MRTG-loggen sier følgende: ERROR: CFG Error in "workdir", line 8: Working directory /var/www/mrtg does not exist ERROR: CFG Error in "workdir", line 11: Working directory /var/www/mrtg does not exist ERROR: CFG Error in "workdir", line 21: Working directory /var/www/mrtg does not exist 2009-12-07 17:35:02, Rateup WARNING: /usr/bin/rateup could not read the primary log file for localhost_eth0 2009-12-07 17:35:02, Rateup WARNING: /usr/bin/rateup The backup log file for localhost_eth0 was invalid as well 2009-12-07 17:35:02, Rateup WARNING: /usr/bin/rateup Can't remove localhost_eth0.old updating log file 2009-12-07 17:35:02, Rateup WARNING: /usr/bin/rateup Can't rename localhost_eth0.log to localhost_eth0.old updating log file 2009-12-07 17:35:02, Rateup WARNING: /usr/bin/rateup could not read the primary log file for localhost_pan0 2009-12-07 17:35:02, Rateup WARNING: /usr/bin/rateup The backup log file for localhost_pan0 was invalid as well 2009-12-07 17:35:02, Rateup WARNING: /usr/bin/rateup Can't remove localhost_pan0.old updating log file 2009-12-07 17:35:02, Rateup WARNING: /usr/bin/rateup Can't rename localhost_pan0.log to localhost_pan0.old updating log file 2009-12-07 17:40:02, Rateup WARNING: /usr/bin/rateup Can't remove localhost_eth0.old updating log file 2009-12-07 17:40:02, Rateup WARNING: /usr/bin/rateup Can't remove localhost_pan0.old updating log file Konfigurasjonsfiler: /etc/mrtg.cfg - http://pastie.org/732415 /etc/mrtg/cpu.cfg - http://pastie.org/732416 /etc/snmp/snmpd.conf - http://pastie.org/732418 Håper noen kan hjelpe meg til å få cpu-grafen til å fungere. Lenke til kommentar
kpolberg Skrevet 7. desember 2009 Del Skrevet 7. desember 2009 Ikke for å spore helt av, men cacti er mitt i blinken for deg :)http://www.cacti.net/ Lenke til kommentar
Anbefalte innlegg
Opprett en konto eller logg inn for å kommentere
Du må være et medlem for å kunne skrive en kommentar
Opprett konto
Det er enkelt å melde seg inn for å starte en ny konto!
Start en kontoLogg inn
Har du allerede en konto? Logg inn her.
Logg inn nå