配置mrtg遇到问题..哪位兄弟发个snmp.conf来看看!!!

由 hgkrt 在 02-20-2004 22:00 发表:

配置mrtg遇到问题..哪位兄弟发个snmp.conf来看看!!!

我感觉自己的snmp.conf配置的不太好!!

哪位配置好的给我看看...

我是RH8.0,net-snmp-5.0.1的好像...


欢迎访问我的个人主页!!!

主机:

http://hgkrt.minidns.net/

网上空间:

http://www.paw.hi-ho.ne.jp/hgkrt


由 hgkrt 在 02-20-2004 23:35 发表:

我的mrtg.cfg

这是我用cfgmaker得到的mrtg.cfg...

里面所有的东东都是#的...

[quoto]# Created by

./cfgmaker --global WorkDir:/web/www/html/mrtg --output /etc/mrtg/mrtg.cfg public@localhost

Global Config Options

for UNIX

WorkDir: /home/http/mrtg

or for NT

WorkDir: c:\mrtgdata

Global Defaults

to get bits instead of bytes and graphs growing to the right

Options[_]: growright, bits

EnableIPv6: no

WorkDir:/web/www/html/mrtg

######################################################################

System: linuxserver

Description: Linux linuxserver 2.4.18-14 #1 Wed Sep 4 12:13:11 EDT 2002 i686

Contact: Root

  1<root@localhost> (configure /etc/snmp/snmp.local.conf)   
  2  
  3# Location: Unknown (edit /etc/snmp/snmpd.conf)   
  4  
  5######################################################################   
  6  
  7  
  8  
  9  
 10  
 11### Interface 1 &gt;&gt; Descr: 'lo' | Name: '' | Ip: '' | Eth: '' ###   
 12  
 13### The following interface is commented out because:   
 14  
 15### * has a speed of which makes no sense   
 16  
 17### * got 'no response received   
 18  
 19### SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)   
 20  
 21### community: "public"   
 22  
 23### request ID: -113874710   
 24  
 25### PDU bufsize: 8000 bytes   
 26  
 27### timeout: 2s   
 28  
 29### retries: 5   
 30  
 31### backoff: 1)' from interface when trying to query   
 32  
 33#   
 34  
 35# Target[localhost_1]: 1 ![](http://linuxsir.zahui.net/html/11/http_3A/linuxsir.zahui.net/html/11/http_3A/linuxsir.zahui.net/html/11/http_3A/linuxsir.zahui.net/html/11/images/smilies/tongue.gif) ublic@localhost:   
 36  
 37# SetEnv[localhost_1]: MRTG_INT_IP="" MRTG_INT_DESCR="lo"   
 38  
 39# MaxBytes[localhost_1]: 0   
 40  
 41# Title[localhost_1]: Traffic Analysis for 1 -- linuxserver   
 42  
 43# PageTop[localhost_1]: <h1>Traffic Analysis for 1 -- linuxserver</h1>   
 44  
 45# <table>   
 46  
 47# <tr><td>System:</td> <td>linuxserver in Unknown (edit /etc/snmp/snmpd.conf)</td></tr>   
 48  
 49# <tr><td>Maintainer:</td> <td>Root &lt;root@localhost&gt; (configure /etc/snmp/snmp.local.conf)</td></tr>   
 50  
 51# <tr><td>Description:</td><td>lo </td></tr>   
 52  
 53# <tr><td>ifType:</td> <td> ()</td></tr>   
 54  
 55# <tr><td>ifName:</td> <td></td></tr>   
 56  
 57# <tr><td>Max Speed:</td> <td>0.0 Bytes/s</td></tr>   
 58  
 59# </table>   
 60  
 61  
 62  
 63  
 64  
 65### Interface 2 &gt;&gt; Descr: 'eth0' | Name: '' | Ip: '' | Eth: '' ###   
 66  
 67### The following interface is commented out because:   
 68  
 69### * has a speed of which makes no sense   
 70  
 71### * got 'no response received   
 72  
 73### SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)   
 74  
 75### community: "public"   
 76  
 77### request ID: -113874709   
 78  
 79### PDU bufsize: 8000 bytes   
 80  
 81### timeout: 2s   
 82  
 83### retries: 5   
 84  
 85### backoff: 1)' from interface when trying to query   
 86  
 87#   
 88  
 89# Target[localhost_2]: 2 ![](http://linuxsir.zahui.net/html/11/http_3A/linuxsir.zahui.net/html/11/http_3A/linuxsir.zahui.net/html/11/http_3A/linuxsir.zahui.net/html/11/images/smilies/tongue.gif) ublic@localhost:   
 90  
 91# SetEnv[localhost_2]: MRTG_INT_IP="" MRTG_INT_DESCR="eth0"   
 92  
 93# MaxBytes[localhost_2]: 0   
 94  
 95# Title[localhost_2]: Traffic Analysis for 2 -- linuxserver   
 96  
 97# PageTop[localhost_2]: <h1>Traffic Analysis for 2 -- linuxserver</h1>   
 98  
 99# <table>   
100  
101# <tr><td>System:</td> <td>linuxserver in Unknown (edit /etc/snmp/snmpd.conf)</td></tr>   
102  
103# <tr><td>Maintainer:</td> <td>Root &lt;root@localhost&gt; (configure /etc/snmp/snmp.local.conf)</td></tr>   
104  
105# <tr><td>Description:</td><td>eth0 </td></tr>   
106  
107# <tr><td>ifType:</td> <td> ()</td></tr>   
108  
109# <tr><td>ifName:</td> <td></td></tr>   
110  
111# <tr><td>Max Speed:</td> <td>0.0 Bytes/s</td></tr>   
112  
113# </table>   
114  
115  
116  
117  
118  
119### Interface 3 &gt;&gt; Descr: 'eth1' | Name: '' | Ip: '' | Eth: '' ###   
120  
121### The following interface is commented out because:   
122  
123### * has a speed of which makes no sense   
124  
125### * got 'no response received   
126  
127### SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)   
128  
129### community: "public"   
130  
131### request ID: -113874708   
132  
133### PDU bufsize: 8000 bytes   
134  
135### timeout: 2s   
136  
137### retries: 5   
138  
139### backoff: 1)' from interface when trying to query   
140  
141#   
142  
143# Target[localhost_3]: 3 ![](http://linuxsir.zahui.net/html/11/http_3A/linuxsir.zahui.net/html/11/http_3A/linuxsir.zahui.net/html/11/http_3A/linuxsir.zahui.net/html/11/images/smilies/tongue.gif) ublic@localhost:   
144  
145# SetEnv[localhost_3]: MRTG_INT_IP="" MRTG_INT_DESCR="eth1"   
146  
147# MaxBytes[localhost_3]: 0   
148  
149# Title[localhost_3]: Traffic Analysis for 3 -- linuxserver   
150  
151# PageTop[localhost_3]: <h1>Traffic Analysis for 3 -- linuxserver</h1>   
152  
153# <table>   
154  
155# <tr><td>System:</td> <td>linuxserver in Unknown (edit /etc/snmp/snmpd.conf)</td></tr>   
156  
157# <tr><td>Maintainer:</td> <td>Root &lt;root@localhost&gt; (configure /etc/snmp/snmp.local.conf)</td></tr>   
158  
159# <tr><td>Description:</td><td>eth1 </td></tr>   
160  
161# <tr><td>ifType:</td> <td> ()</td></tr>   
162  
163# <tr><td>ifName:</td> <td></td></tr>   
164  
165# <tr><td>Max Speed:</td> <td>0.0 Bytes/s</td></tr>   
166  
167# </table>   
168  
169  
170  
171  
172  
173### Interface 4 &gt;&gt; Descr: 'ppp0' | Name: '' | Ip: '' | Eth: '' ###   
174  
175### The following interface is commented out because:   
176  
177### * has a speed of which makes no sense   
178  
179### * got 'Received SNMP response with error code   
180  
181### error status: noSuchName   
182  
183### index 1 (OID: 1.3.6.1.2.1.2.2.1.10.4)   
184  
185### SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)   
186  
187### community: "public"   
188  
189### request ID: -113874707   
190  
191### PDU bufsize: 8000 bytes   
192  
193### timeout: 2s   
194  
195### retries: 5   
196  
197### backoff: 1)' from interface when trying to query   
198  
199#   
200  
201# Target[localhost_4]: 4 ![](http://linuxsir.zahui.net/html/11/http_3A/linuxsir.zahui.net/html/11/http_3A/linuxsir.zahui.net/html/11/http_3A/linuxsir.zahui.net/html/11/images/smilies/tongue.gif) ublic@localhost:   
202  
203# SetEnv[localhost_4]: MRTG_INT_IP="" MRTG_INT_DESCR="ppp0"   
204  
205# MaxBytes[localhost_4]: 0   
206  
207# Title[localhost_4]: Traffic Analysis for 4 -- linuxserver   
208  
209# PageTop[localhost_4]: <h1>Traffic Analysis for 4 -- linuxserver</h1>   
210  
211# <table>   
212  
213# <tr><td>System:</td> <td>linuxserver in Unknown (edit /etc/snmp/snmpd.conf)</td></tr>   
214  
215# <tr><td>Maintainer:</td> <td>Root &lt;root@localhost&gt; (configure /etc/snmp/snmp.local.conf)</td></tr>   
216  
217# <tr><td>Description:</td><td>ppp0 </td></tr>   
218  
219# <tr><td>ifType:</td> <td> ()</td></tr>   
220  
221# <tr><td>ifName:</td> <td></td></tr>   
222  
223# <tr><td>Max Speed:</td> <td>0.0 Bytes/s</td></tr>   
224  
225# </table>   
226  
227  
228  
229  
230  
231[/quoto] 
232
233__________________   
234  
235  
236  
237欢迎访问我的个人主页!!!   
238  
239  
240  
241主机:   
242  
243http://hgkrt.minidns.net/   
244  
245  
246  
247网上空间:   
248  
249http://www.paw.hi-ho.ne.jp/hgkrt 
250
251  
252
253
254* * *
255
256  
257_由 victoryan 在 02-23-2004 10:43 发表:_   
258  
259
260
261****
262
263  
264  
265
266
267使用指令,检查是否有结果   
268  
269# snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.2.2.1.10   
270  
271IF-MIB::ifInOctets.1 = Counter32: 729209   
272  
273IF-MIB::ifInOctets.2 = Counter32: 3535618   
274  
275如果有类似的显示,则snmpd运行基本正常,   
276  
277修改mrtg.cfg即可 
278
279  
280
281
282* * *
283
284  
285_由 hgkrt 在 02-23-2004 12:54 发表:_   
286  
287
288
289****
290
291  
292  
293
294
295执行上述命令,返回Timeout:No Response... 
296
297__________________   
298  
299  
300  
301欢迎访问我的个人主页!!!   
302  
303  
304  
305主机:   
306  
307http://hgkrt.minidns.net/   
308  
309  
310  
311网上空间:   
312  
313http://www.paw.hi-ho.ne.jp/hgkrt 
314
315  
316
317
318* * *
319
320  
321_由 victoryan 在 02-23-2004 13:20 发表:_   
322  
323
324
325****
326
327  
328  
329
330
331参考   
332  
333http://www.linuxsir.org/bbs/showthr...;threadid=87742   
334  
335  
336  
337//修改配置文件/etc/snmp/snmpd.conf,允许mrtg读取网络接口的流量数据。   
338  
339340  
341view systemview included .1.3.6.1.2.1.1   
342  
343view systemview included .1.3.6.1.2.1.25.1.1   
344  
345修改为:   
346  
347view systemview included .1.3.6.1.2.1.1   
348  
349view systemview included .1.3.6.1.2.1.2   
350  
351view systemview included .1.3.6.1.2.1.25.1.1   
352  
353//打开SNMPD服务   
354  
355# chkconfig snmpd on   
356  
357# service snmpd start   
358  
359  
360  
361再重新测试#snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.2.2.1.10 
362
363  
364
365
366* * *
367
368  
369_由 hgkrt 在 02-23-2004 14:35 发表:_   
370  
371
372
373****
374
375  
376  
377
378
379我就是参考他做的..所以才奇怪为啥不行...   
380  
381  
382  
383才要个snmp.conf来看看... 
384
385__________________   
386  
387  
388  
389欢迎访问我的个人主页!!!   
390  
391  
392  
393主机:   
394  
395http://hgkrt.minidns.net/   
396  
397  
398  
399网上空间:   
400  
401http://www.paw.hi-ho.ne.jp/hgkrt 
402
403  
404
405
406* * *
407
408  
409_由 victoryan 在 02-23-2004 14:50 发表:_   
410  
411
412
413****
414
415  
416  
417
418
419使用指令,检查是否有结果   
420  
421#snmpwalk -v 1 -c public localhost uptime   
422  
423system.sysUpTime.0 = Timeticks: (33930645) 3 days, 22:15:06.45 
424
425  
426
427
428* * *
429
430  
431_由 hgkrt 在 02-23-2004 15:34 发表:_   
432  
433
434
435****
436
437  
438  
439
440
441不管执行什么...都是一个结果::   
442  
443  
444  
445Timeout: No Response from localhost   
446  
447  
448  
449所以,还是赶快把snmp.conf给我看看得了... 
450
451__________________   
452  
453  
454  
455欢迎访问我的个人主页!!!   
456  
457  
458  
459主机:   
460  
461http://hgkrt.minidns.net/   
462  
463  
464  
465网上空间:   
466  
467http://www.paw.hi-ho.ne.jp/hgkrt 
468
469  
470
471
472* * *
473
474  
475_由 victoryan 在 02-23-2004 15:51 发表:_   
476  
477
478
479****
480
481  
482  
483
484
485兄弟,这么着急,我的snmpd.conf如下   
486  
487  
488  
489com2sec notConfigUser default public   
490  
491  
492  
493group notConfigGroup v1 notConfigUser   
494  
495group notConfigGroup v2c notConfigUser   
496  
497  
498  
499view systemview included .1.3.6.1.2.1.1   
500  
501view systemview included .1.3.6.1.2.1.2   
502  
503view systemview included .1.3.6.1.2.1.25.1.1   
504  
505  
506  
507  
508  
509access notConfigGroup "" any noauth exact systemview none none   
510  
511  
512  
513syslocation Unknown (edit /etc/snmp/snmpd.conf)   
514  
515syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)   
516  
517  
518  
519pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat 
520
521  
522
523
524* * *
525
526  
527_由 passerchia 在 03-01-2004 18:09 发表:_   
528  
529
530
531****
532
533  
534  
535
536
537按照楼上的snmpd.conf和之前mrtg.cfg运行mrtg时得到以下错误信息:   
538  
539SNMP Error:   
540  
541Received SNMP response with error code   
542  
543error status: noSuchName   
544  
545index 2 (OID: 1.3.6.1.2.1.25.1.6.0)   
546  
547SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)   
548  
549community: "public"   
550  
551request ID: 442115856   
552  
553PDU bufsize: 8000 bytes   
554  
555timeout: 2s   
556  
557retries: 5   
558  
559backoff: 1)   
560  
561at /usr/local/mrtg/bin/../lib/mrtg2/SNMP_util.pm line 487   
562  
563SNMPGET Problem for hrSystemProcesses.0 hrSystemProcesses.0 sysUptime sysName on public@localhost::::::v4only   
564  
565at /usr/local/mrtg/bin/mrtg line 1835   
566  
567ERROR: Target[mem][_IN_] ' $target-&gt;[2]{$mode} ' did not eval into defined data   
568  
569ERROR: Target[mem][_OUT_] ' $target-&gt;[2]{$mode} ' did not eval into defined data   
570  
571ERROR: Target[disk][_IN_] ' $target-&gt;[4]{$mode} ' did not eval into defined data   
572  
573ERROR: Target[disk][_OUT_] ' $target-&gt;[4]{$mode} ' did not eval into defined data   
574  
575ERROR: Target[process][_IN_] ' $target-&gt;[5]{$mode} ' did not eval into defined data   
576  
577ERROR: Target[process][_OUT_] ' $target-&gt;[5]{$mode} ' did not eval into defined data 
578
579  
580
581
582* * *
583
584  
585_由 victoryan 在 03-02-2004 09:05 发表:_   
586  
587
588
589****
590
591  
592  
593
594
595有可能还是snmpd.conf的配置问题,或者没有启动snmpd服务.   
596  
597启动snmpd服务, #service snmpd restart   
598  
599重试一次.   
600  
601  
602  
603如果还有问题,   
604  
605把你的/etc/snmpd.conf 和/etc/mrtg/mrtg.cfg贴出来看看 
606
607  
608
609
610* * *
611
612  
613_由 passerchia 在 03-02-2004 12:21 发表:_   
614  
615
616
617****
618
619  
620  
621
622
6231\. 我的snmp是手工安装的, 选用snmp v2, 启动命令是;   
624  
625/usr/local/snmp/sbin/snmpd -c /usr/local/snmp/snmpd.conf   
626  
627  
628  
629snmp服务是确认已</root@localhost></root@localhost>
Published At
Categories with 服务器类
comments powered by Disqus