Powerdns con supporto mysql e mrtg

Configurare il powerdns :

Scaricare Powerdns a seconda dell’architettura del server dal sito http://www.powerdns.com/
installarlo

# Autogenerated configuration file template
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
allow-axfr-ips=0.0.0.0/0

#################################
# allow-recursion List of subnets that are allowed to recurse
#
allow-recursion=0.0.0.0/0

#################################
# allow-recursion-override Set this so that local data fully overrides the recursor
#
allow-recursion-override=no

#################################
# cache-ttl Seconds to store packets in the PacketCache
#
cache-ttl=20

#################################
# chroot If set, chroot to this directory for more security
#
# chroot=

#################################
# config-dir Location of configuration directory (pdns.conf)
#
# config-dir=/usr/local/etc

#################################
# config-name Name of this virtual configuration – will rename the binary image
#
# config-name=

#################################
# control-console Debugging switch – don’t use
#
# control-console=no

#################################
# daemon Operate as a daemon
#
# daemon=no

#################################
# default-soa-name name to insert in the SOA record if none set in the backend
#
default-soa-name=test.com

#################################
# default-ttl Seconds a result is valid if not set otherwise
#
default-ttl=3600

#################################
# disable-axfr Disable zonetransfers but do allow TCP queries
#
# disable-axfr=no

#################################
# disable-tcp Do not listen to TCP queries
#
# disable-tcp=no

#################################
# distributor-threads Default number of Distributor (backend) threads to start
#
# distributor-threads=3

#################################
# do-ipv6-additional-processing Do AAAA additional processing
#
# do-ipv6-additional-processing=no

#################################
# fancy-records Process URL and MBOXFW records
#
# fancy-records=no

#################################
# guardian Run within a guardian process
#
# guardian=no

#################################
# launch Which backends to launch and order to query them in
#
# launch=

#################################
# lazy-recursion Only recurse if question cannot be answered locally
#
# lazy-recursion=yes

#################################
# load-modules Load this module – supply absolute or relative path
#
# load-modules=

#################################
# local-address Local IP addresses to which we bind
#
local-address=0.0.0.0

#################################
# local-ipv6 Local IP address to which we bind
#
# local-ipv6=

#################################
# local-port The port on which we listen
#
local-port=53

Configurazione MRTG

vi /etc/mrtg/mrtg.conf

Interval: 5
WorkDir: /var/www/html/mrtg
WriteExpires: yes
Options[_]: growright,nopercent
XSize[_]: 600

Target[udp-queries]: `/etc/init.d/pdns mrtg udp-queries udp-answers`
Options[udp-queries]: growright,nopercent,perminute
MaxBytes[udp-queries]: 600000
AbsMax[udp-queries]: 600000
Title[udp-queries]: Queries per minute
PageTop[udp-queries]:

Queries per minute

WithPeak[udp-queries]: ymwd
YLegend[udp-queries]: queries/minute
ShortLegend[udp-queries]: q/m
LegendI[udp-queries]: udp-questions
LegendO[udp-queries]: udp-answers

Target[perc-failed]: `/etc/init.d/pdns mrtg udp-queries udp-answers`
Options[perc-failed]: growright,dorelpercent,perminute
MaxBytes[perc-failed]: 600000
AbsMax[perc-failed]: 600000
Title[perc-failed]: Queries per minute, with percentage success
PageTop[perc-failed]:

Queries per minute, with percentage success

WithPeak[perc-failed]: ymwd
YLegend[perc-failed]: queries/minute
ShortLegend[perc-failed]: q/m
LegendI[perc-failed]: udp-questions
LegendO[perc-failed]: udp-answers

Target[packetcache-rate]: `/etc/init.d/pdns mrtg packetcache-hit udp-queries`
Options[packetcache-rate]: growright,dorelpercent,perminute
Title[packetcache-rate]: packetcache hitrate
MaxBytes[packetcache-rate]: 600000
AbsMax[packetcache-rate]: 600000
PageTop[packetcache-rate]:

packetcache hitrate

WithPeak[packetcache-rate]: ymwd
YLegend[packetcache-rate]: queries/minute
ShortLegend[packetcache-rate]: q/m
LegendO[packetcache-rate]: total
LegendI[packetcache-rate]: hit

Target[packetcache-missrate]: `/etc/init.d/pdns mrtg packetcache-miss udp-queries`
Options[packetcache-missrate]: growright,dorelpercent,perminute
Title[packetcache-missrate]: packetcache MISSrate
MaxBytes[packetcache-missrate]: 600000
AbsMax[packetcache-missrate]: 600000
PageTop[packetcache-missrate]:

packetcache MISSrate

WithPeak[packetcache-missrate]: ymwd
YLegend[packetcache-missrate]: queries/minute
ShortLegend[packetcache-missrate]: q/m
LegendO[packetcache-missrate]: total
LegendI[packetcache-missrate]: MISS

Target[latency]: `/etc/init.d/pdns mrtg latency`
Options[latency]: growright,nopercent,gauge
MaxBytes[latency]: 600000
AbsMax[latency]: 600000
Title[latency]: Query/answer latency
PageTop[latency]:

Query/answer latency

WithPeak[latency]: ymwd
YLegend[latency]: usec
ShortLegend[latency]: usec
LegendO[latency]: latency
LegendI[latency]: latency

Target[recursing]: `/etc/init.d/pdns mrtg recursing-questions recursing-answers`
Options[recursing]: growright,nopercent,gauge
MaxBytes[recursing]: 600000
AbsMax[recursing]: 600000
Title[recursing]: Recursive questions/answers
PageTop[recursing]:

Recursing questions/answers

WithPeak[recursing]: ymwd
YLegend[recursing]: queries/minute
ShortLegend[recursing]: q/m
LegendO[recursing]: recursing-questions
LegendI[recursing]: recursing-answers

poi crontab -e ed insrire questa riga :

0,5,10,15,20,25,30,35,40,45,50,55 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg.cfg

creare i file index per mrtg

indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html