Difference between revisions of "Cluster der kan alt/Overvågning med MRTG"
From Teknologisk videncenter
(Created page with "=Opsætning af MRTG= # Intaller MRGT & SNMP <source lang=cli> $ sudo apt-get install mrtg snmpd </source> ==Konfigure SNMP== # Backup configuration file: <source lang=cli> $ su...") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 17: | Line 17: | ||
$ sudo nano /etc/snmp/snmpd.conf | $ sudo nano /etc/snmp/snmpd.conf | ||
</source> | </source> | ||
+ | |||
+ | # Erstat nuværende indhold med: | ||
+ | |||
+ | <source lang=cli> | ||
+ | |||
+ | |||
+ | 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> | ||
+ | |||
+ | # Genstart SNMPD | ||
+ | |||
+ | <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==== | ||
+ | |||
+ | <source lang=cli> | ||
+ | $ sudo crontab -e | ||
+ | </source> | ||
+ | |||
+ | # 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/ | ||
+ | |||
{{Source cli}} | {{Source cli}} | ||
[[Category:cluster]][[Category:Ubuntu]] | [[Category:cluster]][[Category:Ubuntu]] |
Latest revision as of 08:46, 20 April 2012
Contents
Opsætning af MRTG
- Intaller MRGT & SNMP
$ sudo apt-get install mrtg snmpd
Konfigure SNMP
- Backup configuration file:
$ sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak
- Lav ny konfig fil
$ sudo nano /etc/snmp/snmpd.conf
- 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
- Rediger: /etc/default/snmpd
$ sudo nano /etc/default/snmpd
- 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
- Genstart SNMPD
$ sudo /etc/init.d/snmpd restart
Konfigure MRTG
- 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
- Tilføj
*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg.cfg
DONE
- You can check MRTG graph on http://localhost/mrtg/ or http://your_ip/mrtg/