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 [email protected]
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

Get Free Email Updates!

Signup now and receive an email once I publish new content.

I will never give away, trade or sell your email address. You can unsubscribe at any time.

Like

Related Post

3 Responses

  1. Girish says:

    This is a great article. I was able to setup a monitoring service quickly. I have visited a lot of websites and none of them got me to a place where I could monitor my servers this quickly.

    Thanks
    Girish

    Reply
  2. namran says:

    to use snmp to monitor other thing..

    better to get the utils correct with this.

    yum install net-snmp-utils

    and then can test with ..

    snmpwalk -v 1 localhost -c public system

    Reply
  3. looker says:

    Looking forward start investing very soonBeautiful! Great site!

    Reply

Anything to add?

X