Cluster der kan alt/Overvågning med MRTG

From Teknologisk videncenter
< Cluster der kan alt
Revision as of 08:46, 20 April 2012 by Nfoged (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Opsætning af MRTG

  1. Intaller MRGT & SNMP
$ sudo apt-get install mrtg snmpd

Konfigure SNMP

  1. Backup configuration file:
$ sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak
  1. Lav ny konfig fil
$ sudo nano /etc/snmp/snmpd.conf
  1. Erstat nuværende indhold med:
1: rocommunity  public
2: syslocation  "ColekColek"
3: syscontact  xxxxxx@yahoo.com
4: com2sec public localhost public
5: group public v1 public
6: group public v2c public
7: group public usm public
8: view all included .1
9: access public "" any noauth exact all none none
  1. Rediger: /etc/default/snmpd
$ sudo nano /etc/default/snmpd
  1. Vær sikker på filen indeholder disse linjer
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'
TRAPDRUN=yes
SNMPDCOMPAT=yes
  1. Genstart SNMPD
$ sudo /etc/init.d/snmpd restart

Konfigure MRTG

  1. Lav konfig fil
$ sudo cfgmaker --global 'WorkDir:/var/www/mrtg' --ifref=name --ifdesc=eth --global 'Options[_]: bits' --output /etc/mrtg.cfg   public@localhost

Lav scheduled job

$ sudo crontab -e
  1. Tilføj
*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg.cfg


DONE
  1. You can check MRTG graph on http://localhost/mrtg/ or http://your_ip/mrtg/