--- tags: PMC-100 --- # SNMP ### installation process ``` 1. apt-get install snmp 2. apt install snmp-mibs-downloader 3. apt install snmpd libsnmp-dev ``` ### Basic configuration ``` # Enable sub-agent by default master agentx # If you use agentX to add a custom mib library, you can configure sub-agent as needed agentxSocket tcp:localhost:705 agentxTimeout 5000 agentxRetries 0 # Listen for connections from the local system only #agentAddress udp:127.0.0.1:161 # Listen for connections on all interfaces (both IPv4 *and* IPv6) agentAddress udp:161,udp6:[::1]:161 # Comment out the next two lines view systemonly included .1.3.6.1.2.1.1 #view systemonly included .1.3.6.1.2.1.25.1 # new addition #view system only included .1.3.6.1 # disk checks # solve : dskUsed = No Such Instance currently exists at this OID disk / 10000 load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0]load 12 14 14 # Create v3 user username:bigdata, password:11111111 createUser bigdata MD5 11111111 DES rwuser bigdata priv # If you use dynamic loading to add a custom mib library, you can use the following statement to achieve #dlmod cluster_env /home/snmplib/libclusterenv.so ``` ### verify snmo MD5 certificate ``` snmpget -u bigdata -l authPriv -a MD5 -x DES -A 11111111 -X 11111111 localhost 1.3.6.1.2.1.1.1.0 ``` ### verify V3 ``` snmpwalk -v 3 -a MD5 -A 1234567890 -u ubuntu -l auth 127.0.0.1 ``` ## install reference ### [Both Server and Client Config](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-an-snmp-daemon-and-client-on-ubuntu-18-04) ### [LINUX: How do I enable SNMP on Ubuntu](https://martinsblog.dk/linux-how-do-i-enable-snmp-on-ubuntu/) ### [ubuntu 20.04 snmp安裝配置 一、SNMP MANAGER 安裝 二、SNMP AGENT 安裝 三、修改 SNMP AGENT 用戶和用戶組 (非必須!)](https://www.twblogs.net/a/5f7a097c44112d8d9c8bdda6) ### [完整範例 在ubuntu測試: Ubuntu Linux 以 SNMP 監控伺服器狀態教學與範例](https://officeguide.cc/ubuntu-linux-install-configure-snmp-tutorial-examples/) ### [arm net-snmp source](https://sourceforge.net/projects/net-snmp/) ### [snmptrapd 配置 SNMP 連線的加密](https://support.kaspersky.com/KWTS/6.1/zh-HantTW/184759.htm) ### [[ NetSNMP ] snmptrapd.conf 設定](https://blog.xuite.net/aflyfish/blog/86126735-%5B+NetSNMP+%5D+snmptrapd.conf+%E8%A8%AD%E5%AE%9A) ### [How can I setup a snmptrap receiver server on Ubuntu Server 18.04?](https://go-linux.blogspot.com/2020/03/how-can-i-setup-snmptrap-receiver.html) ### [How can I setup a SNMP server on Ubuntu Server 18.04](https://go-linux.blogspot.com/2020/02/how-can-i-setup-snmp-server-on-ubuntu.html) ### [用 Cacti 來監控你的系統 – SNMP Client 設定 Round2](https://shazi.info/%E7%94%A8-cacti-%E4%BE%86%E7%9B%A3%E6%8E%A7%E4%BD%A0%E7%9A%84%E7%B3%BB%E7%B5%B1-snmp-client-%E8%A8%AD%E5%AE%9A-round2/) ## test use : [完整範例 在ubuntu測試: Ubuntu Linux 以 SNMP 監控伺服器狀態教學與範例](https://officeguide.cc/ubuntu-linux-install-configure-snmp-tutorial-examples/)