Problem : MRTG Graph in DirectAdmin cp + CentOS
Solutions:

yum -y install gd gd-devel libpng libpng-devel zlib zlib-devel net-snmp net-snmp-utils mrtg
chkconfig snmpd on
cd /etc/snmp/
mv snmpd.conf snmpd.conf.bak
vim snmpd.conf
############
syslocation  Thailand
syscontact  admin
sysservices 79
rocommunity  public localhost
agentaddress localhost
############

/etc/init.d/snmpd restart
snmpwalk -v1 -cpublic localhost
wget -O /var/www/mrtg/php.load.php www.icez.net/files/php.load.txt
chmod a+x /var/www/mrtg/php.load.php
vim /var/www/mrtg/php.load.php
#find "/usr/bin/php"  replace to /usr/local/bin/php
cd /etc/mrtg
mv mrtg.cfg mrtg.cfg.bak
vim mrtg.cfg
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt,/usr/share/snmp/mibs/TCP-MIB.txt,/usr/share/snmp/mibs/UDP-MIB.txt

WorkDir: /var/www/html/mrtg

Options[_]: growright

EnableIPv6: no

Target[server.traffic]: 2:[email protected]:
SetEnv[server.traffic]: MRTG_INT_IP="12.34.56.78" MRTG_INT_DESCR="eth0"
MaxBytes[server.traffic]: 125000000
Title[server.traffic]: Traffic Load
PageTop[server.traffic]: <h1>Traffic Load</h1>
Options[server.traffic]: growright, bits

### Cpu Load ###
Target[cpu]: .1.3.6.1.4.1.2021.10.1.5.1&.1.3.6.1.4.1.2021.10.1.5.2:[email protected]
MaxBytes[cpu]: 100
Unscaled[cpu]: dwmy
Options[cpu]: gauge, absolute, growright, noinfo, nopercent
YLegend[cpu]: CPU Load(%)
ShortLegend[cpu]: (%)
LegendI[cpu]: &nbsp; CPU System
LegendO[cpu]: &nbsp; CPU User
Title[cpu]: CPU Analysis
PageTop[cpu]: <H1>CPU Analysis</H1>

### Memory Free ###
Target[mem]: .1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.4.0:[email protected]
MaxBytes1[mem]: 2230288
MaxBytes2[mem]: 2252216
Unscaled[mem]: dwmy
Options[mem]: gauge, absolute, growright, noinfo
YLegend[mem]: Memory Free
ShortLegend[mem]: Bytes
kilo[mem]: 1024
kMG[mem]: k,M
LegendI[mem]: Real
LegendO[mem]: Swap
Legend1[mem]: (MBytes)
Legend2[mem]: (MBytes)
Title[mem]: Memory Analysis
PageTop[mem]: <H1>Memory Analysis</H1>

### CPU Load Average ###
Target[public.load]: `/var/www/mrtg/php.load.php`
Title[public.load]: Server load average
PageTop[public.load]: <H1>Server load average</H1>
MaxBytes[public.load]: 10000
ShortLegend[public.load]:
YLegend[public.load]:
LegendI[public.load]: cnt
LegendO[public.load]: cnt
Legend1[public.load]: Count
Legend2[public.load]: Count
Options[public.load]: gauge,growright,nopercent

### New TCP Connection Monitoring (per minute) ###
Target[server.newconns]: tcpPassiveOpens.0&tcpActiveOpens.0:[email protected]
Title[server.newconns]: Newly Created TCP Connections
PageTop[server.newconns]: <H1>New TCP Connections</H1>
MaxBytes[server.newconns]: 10000000000
ShortLegend[server.newconns]: c/s
YLegend[server.newconns]: Conns / Min
LegendI[server.newconns]: In
LegendO[server.newconns]: Out
Legend1[server.newconns]: New inbound connections
Legend2[server.newconns]: New outbound connections
Options[server.newconns]: growright,nopercent,perminute

### Established TCP Connections ###
Target[server.estabcons]: tcpCurrEstab.0&tcpCurrEstab.0:[email protected]
Title[server.estabcons]: Currently Established TCP Connections
PageTop[server.estabcons]: <H1>Established TCP Connections</H1>
MaxBytes[server.estabcons]: 10000000000
ShortLegend[server.estabcons]:
YLegend[server.estabcons]: Connections
LegendI[server.estabcons]: In
LegendO[server.estabcons]:
Legend1[server.estabcons]: Established connections
Legend2[server.estabcons]:
Options[server.estabcons]: growright,nopercent,gauge
mkdir /var/www/html/mrtg
indexmaker --columns=2 --output=/var/www/html/mrtg/index.html /etc/mrtg/mrtg.cfg

recheck “http://ip/mrtg” wait 5-10 m.

share: Install MRTG Directadmin CentOS 5 32/64bit