MRTG and SNMP setup

refer here :

http://www.cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/mrtg/mrtg_references.php

mrtg.png

Basically , you need to properly setup the snmpd..
then test will snmp walk…

then only setup mrtg to parse the data and generate output
peridocally..

su -
yum install net-snmp-utils net-snmp -y

kill -9 21282
ps xa | grep rpm
rpm -aq | grep mrtg
cd /var/www/html/
ls
mkdir stats
cfgmaker --global 'WorkDir: /var/www/html/stats' --output /etc/mrtg/sa.cfg public@localhost
indexmaker --output=/var/www/html/stats/index.html /etc/mrtg/sa.cfg
which mrtg
ls
cd ..

cp -av /var/www/mrtg/*.png /var/www/html/stats/
ls

env LANG=C mrtg /etc/mrtg/sa.cfg
crontab -e

export SERVER="192.168.x.xxx"
iptables -A OUTPUT -p udp -s $SERVER --sport 1024:65535 -d 0/0 --dport 161:162 -m state --state NEW,ESTABLISHED -j ACCEPT

iptables -A INPUT -p udp -s 0/0 --sport 1024:65535 -d $SERVER --dport 161:162 -m state --state NEW,ESTABLISHED -j ACCEPT

iptables -A OUTPUT -p udp -s $SERVER --sport 161:162 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

iptables -A OUTPUT -p udp -s $SERVER --sport 1024:65535 -d 0/0 --dport 161:162 -m state --state NEW,ESTABLISHED -j ACCEPT

service iptables sa ve
cd html/
ls
cd stats/
ls
vi .htaccess

mkdir /var/members
htpasswd -c /var/members/.htpass wd mrtgadmin

ls
cd ..
ls
cd /etc/mrtg/
ls
vi sa.cfg

ps xa
ip addr

ls
pwd
indexmaker --output=/var/www/html/stats/index.html /etc/mrtg/sa.cfg

screenshot.png

Related Post

3 Responses

  1. HawkEYE says:

    I got better one after a few minute..
    by adding this two line before line 602 (/usr/share/system-config-network/netconfpkg/gui/maindialog.py)


    if (not isinstance (host.Hostname, str)):
    continue

    now it works like charms again.. hehe.. 😎

    Reply
  2. UncleOp says:

    This was helpful. Summary: if the /etc/hosts file is not well-formed, the python script doesn’t handle it well. In my case, somehow a long entry that was commented out got “line wrapped”, leaving some uncommented garbage on the next line. Fixing the hosts file or adding the above patch “worked”. It seems that some complaint to the user should be generated in such a case, though.

    Reply
    • HawkEYE says:

      @UncleOp , Glad it help.. thanks for dropping by..

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *