OK.
I've resloved it.
This is my snmpd.conf
Old:
Code: Select all
# snmpd.conf:
com2sec notConfigUser default public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
[b][i]view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1[/i][/b]
access notConfigGroup "" any noauth exact systemview none none
com2sec mynetwork 0.0.0.0/0 public
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
mibDirs +/usr/local/lib/snmp/mibs/
mibs ALL
showMibErros yes
[i][b]extend .1.3.6.1.4.1.18689.0.1 dnscache-stats /data/logdns/runstats.sh[/b][/i]
#
i've added a line
view systemview included .1.3.6.1.4.1
same sub head of my command: extend
.1.3.6.1.4.1.18689.0.1 dnscache-stats /data/logdns/runstats.sh
==> DONE.
But have another error
# /usr/bin/snmpget -v 2c -Ovq -c public localhost .1.3.6.1.4.1.18689.0.1.4.1.2.14.100.110.115.99.97.99.104.101.45.115.116.97.116.115.1
"/data/logdns/runstats.sh: Permission denied"
# chmod 755 runstats.sh
# /usr/bin/snmpget -v 2c -Ovq -c public localhost .1.3.6.1.4.1.18689.0.1.4.1.2.14.100.110.115.99.97.99.104.101.45.115.116.97.116.115.1
"/data/logdns/runstats.sh: Permission denied"
have 2 way to reslove.
1. Allow runstats.sh can run by user who run snmp.
2. Don't run snmp by acc default: service snmpd start.
run by acc root:
#snmpd -c /etc/snmp/snmpd.conf
then.
# /usr/bin/snmpget -v 2c -Ovq -c public localhost .1.3.6.1.4.1.18689.0.1.4.1.2.14.100.110.115.99.97.99.104.101.45.115.116.97.116.115.1
"a:57 a6:0 aaaa:214 any:0 cname:0 mx:46 naptr:0 ns:2 ptr:24 soa:0 spf:0 srv:0 txt:0 rsnx:16 rsfail: rserr: rsipv4qs:58 rsipv4rr:58 rsmismatch: rsqr:11 rsqt: rsrtt10:13 rsrtt100500:7 rsrtt10100:38 rsrtt1600: rsrtt500800: rsrtt8001600: sockopen:60 sockclosed:58 sockbf: consest:58 recverr:"
And from my Cacti Server
#/var/www/html/cacti/scripts//bind-stats.sh 192.168.1.5
a:57 a6:0 aaaa:347 any:222 cname:0 mx:184 naptr:0 ns:2 ptr:24 soa:0 spf:0 srv:0 txt:0 rsnx:18 rsfail: rserr: rsipv4qs:60 rsipv4rr:60 rsmismatch: rsqr:13 rsqt: rsrtt10:14 rsrtt100500:7 rsrtt10100:39 rsrtt1600: rsrtt500800: rsrtt8001600: sockopen:62 sockclosed:60 sockbf: consest:60 recverr:
[root@localhost scripts]#
and show rrd file
[root@localhost rra]# ls -l | more
total 3789576
-rw-r--r--. 1 cacti cacti 85834424 Apr 11 04:56 dns_lab_rsrtt500800_684.rrd
-rw-r--r--. 1 cacti cacti 85834424 Apr 11 04:56 dns_lab_rsrtt500800_685.rrd
-rw-r--r--. 1 cacti cacti 85834424 Apr 11 04:56 dns_lab_rsrtt500800_686.rrd
-rw-r--r--. 1 cacti cacti 85834424 Apr 11 04:56 dns_lab_rsrtt500800_687.rrd
--More--