polygun2000
Joined: 30 Jul 2008 Posts: 1
|
Posted: Wed Jul 30, 2008 2:47 am Post subject: tinydns stats template [ use tinystats ,not djbdns-stats] |
|
|
1.Download tinystats
wget http://morettoni.net/bsd/tinystats-1.1.tar.gz
tar -xfz tinystats-1.1.tar.gz
cd tinystats
2.Fix Makefile
find:
.ifdef WITH_IPV6
IPV6=-DWITH_IPV6
.endif
modified:
ifdef WITH_IPV6
IPV6=-DWITH_IPV6
endif
3.Edit tinystats.c
delete :
fprintf (o, "%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu:%lu\n",
a, ns, cname, soa, ptr, hinfo, mx, txt, rp, sig, key, aaaa, axfr, any,
total, other, na, ni, bc, nq);
fprintf (o, "a:ns:cname:soa:ptr:hinfo:mx:txt:rp:sig:key:aaaa:axfr:any:total:other:notauth:notimpl:badclass:noquery\n");
add:
fprintf (o, "A:%lu NS:%lu CNAME:%lu SOA:%lu PTR:%lu HINFO:%lu MX:%lu TXT:%lu RP:%lu SIG:%lu KEY:%lu AAAA:%lu AXFR:%lu ANY:%lu TOTAL:%lu OTHER:%lu NA:%lu NI:%lu BC:%lu NQ:%lu\n", a, ns, cname, soa, ptr, hinfo, mx, txt, rp, sig, key, aaaa, axfr, any,total, other, na, ni, bc, nq);
4.Compile tinystats
make install strip
5.Edit tinydns log run script (/etc/tinydns/log/run)
#!/bin/sh
exec /usr/local/bin/setuidgid dnslog \
/usr/local/bin/tinystats -h /etc/tinydns/log/main/ /usr/local/bin/multilog s1048576 n2 /etc/tinydns/log/main/
restart log supervise:
svc -t /etc/tinydns/log
6.Edit the snmpd.conf of the tinydns server
add the below line:
exec .1.3.6.1.4.1.2021.13.107 tinydns-stats /bin/cat /etc/tinydns/log/main/tinystats.out
then restart you snmpd daemon:
/etc/init.d/snmpd restart
You can use the snmpget to test:
snmpget -v 2c -Oaqv -c public localhost .1.3.6.1.4.1.2021.13.107.101.1
7.Put tinystats.sh into cacti_install_directory/scripts
#!/bin/bash
/usr/bin/snmpget -v 2c -Oaqv -c public $1 .1.3.6.1.4.1.2021.13.107.101.1|sed 's/"//;s/"$//'
8.Import cacti_data_template_tinydns_stats_data_template.xml and cacti_graph_template_tinydns_statistic_graph_template.xml from cacti web gui.
9.Add your graph.
tinystats offical website: http://morettoni.net/tinystats.en.html
| Description: |
|
| Filesize: |
38.54 KB |
| Viewed: |
814 Time(s) |

|
| Description: |
|
 Download |
| Filename: |
cacti_graph_template_tinydns_statistic_graph_template.xml |
| Filesize: |
50.98 KB |
| Downloaded: |
25 Time(s) |
| Description: |
|
 Download |
| Filename: |
cacti_data_template_tinydns_stats_data_template.xml |
| Filesize: |
21.76 KB |
| Downloaded: |
18 Time(s) |
|
|