installl mrtg on centos

1. install snmp

yum install net-snmp-utils net-snmp

-config snmp

# service snmpd start
# chkconfig –add snmpd
# chkconfig snmpd on

vi /etc/snmp/snmpd.conf

#pertama :

cari baris :

com2sec notConfigUser default public

ganti dengan (make sure you replace with your network/subnet) baris di bawah ini:

com2sec local localhost public
com2sec mynetwork public

#kedua /scroll ke bawah

cari baris:

group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser

ganti dengan :

group MyRWGroup v1 local
group MyRWGroup v2c local
group MyRWGroup usm local
group MyROGroup v1 mynetwork
group MyROGroup v2c mynetwork
group MyROGroup usm mynetwork

#ketiga / scroll

Find line:

view systemview included system

Replace with:

view all included .1 80

#keempat /scroll

Find line:

access notConfigGroup “” any noauth exact systemview none none

Replace with:

access MyROGroup “” any noauth exact all none none
access MyRWGroup “” any noauth exact all all none

#kelima /scroll

Find lines:

syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root (configure /etc/snmp/snmp.local.conf)

Replace with (make sure you supply appropriate values):

syslocation Linux (RH3_UP2), Home Linux Router.
syscontact YourNameHere

(a) Make sure when linux comes up snmpd always starts after the system reboot:

# chkconfig snmpd on

(b) Start the snmpd service:

# service snmpd start

(c) Finally, test your snmp server:

# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex

2. Install MRTG

yum install mrtg

#config mrtg

(a) Create a document root to store mrtg graphs/html pages for Apache web-server, enter:

# mkdir -p /var/www/html/mymrtg/

(b) Run any one of the following cfgmaker command to create mrtg configuration file:

# cfgmaker –global ‘WorkDir: /var/www/html/mymrtg’ –output /etc/mrtg/mymrtg.cfg public@localhost

OR (make sure FQDN resolves. In the following example I’m using i.e. my router’s FQDN address)

# cfgmaker –global ‘WorkDir: /var/www/html/mymrtg’ –output /etc/mrtg/mymrtg1.cfg

(c) Create a default index page for your MRTG configuration, run:

# indexmaker –output=/var/www/html/mymrtg/index.html /etc/mrtg/mymrtg.cfg

(d) Copy all tiny png files to your mrtg path, run:

# cp -av /var/www/html/mrtg/*.png /var/www/html/mymrtg/

3. test mrtg di browser

(a) Run mrtg command from command line with your configuration file, enter:

# mrtg /etc/mrtg/mymrtg.cfg

Note: You may get few warning message for the first time; please ignore them.

(b) Fire your favorite web browser (like FireFox ) and type the url or http://your-ip-here/mymrtg/

sumber :

About the Author

Leave a Reply