FreeBSD SNMP 設定檔

之前都是用

{% codeblock %}rocommunity mrtg```

來設定,不過後來因為需要由另外機器來抓資料,上面的設定只允許 localhost

仔細去看 sample ,調整設定檔的內容

{% codeblock %} #先 map community name 與 security name

sec.name source community

com2sec local localhost yourname com2sec mynetwork yourip/netmask yourname #再來將 security name 組成 group

sec.model sec.name

group MyRWGroup v1 local group MyRWGroup v2c local group MyRWGroup usm local group MyROGroup v1 mynetwork group MyROGroup v2c mynetwork group MyROGroup usm mynetwork #這步看不懂,留著就對了

Third, create a view for us to let the groups have rights to:

incl/excl subtree mask

view all included .1 80 #存取權限設定,讓 local 可讀可寫,讓 mynetwork 只能讀

context sec.model sec.level match read write notif

access MyROGroup "" any noauth exact all none none access MyRWGroup "" any noauth exact all all none #設定 E-mail 設不設都可以 syscontact admin@host


之後用 mrtg 來抓就下

{% codeblock %}cfgmaker yourname@ip > mrtg.cfg```
Follow 院長與芊比媽 on Google News