Difference between revisions of "Cluster der kan alt/Overvågning med MRTG"

From Teknologisk videncenter
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 23: Line 23:
  
  
rocommunity  public
+
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
 +
</source>
  
 +
# Rediger: /etc/default/snmpd
  
 +
<source lang=cli>
 +
$ sudo nano /etc/default/snmpd
 +
</source>
  
 +
# Vær sikker på filen indeholder disse linjer
  
 +
<source lang=cli>
 +
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
 +
</source>
  
2
+
# Genstart SNMPD
  
syslocation  "ColekColek"
+
<source lang=cli>
 +
$ sudo /etc/init.d/snmpd restart
 +
</source>
  
 +
===Konfigure MRTG===
  
 +
# Lav konfig fil
  
 +
<source lang=cli>
 +
$ sudo cfgmaker --global 'WorkDir:/var/www/mrtg' --ifref=name --ifdesc=eth --global 'Options[_]: bits' --output /etc/mrtg.cfg  public@localhost
 +
</source>
  
 +
====Lav scheduled job====
  
3
+
<source lang=cli>
 +
$ sudo crontab -e
 +
</source>
  
syscontact  xxxxxx@yahoo.com
+
# Tilføj
  
 +
<source lang=cli>
 +
*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg.cfg
 +
</source>
  
  
 +
=====DONE=====
  
 
+
# You can check MRTG graph on http://localhost/mrtg/ or http://your_ip/mrtg/
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
 
</source>
 
 
 
  
  

Latest revision as of 08:46, 20 April 2012

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/