Friday, February 21, 2020

How can I setup a SNMP server on Ubuntu Server 18.04

在這篇短文中,紀錄一下如何在Ubuntu Server 18.04配置一台SNMP server同時支援snmpv2與v3,之後若有機會在補齊如何收遠端機器所發出來的snmp trap event。

Step1. 安裝:
$ sudo apt update
$ sudo apt install snmp snmpd snmp-mibs-downloader

Step2. 配置snmpd.conf:
$ sudo vi /etc/snmp/snmpd.conf
# 允許all net來連線 (IPv4+IPv6)
agentAddress udp:161,udp6:[::1]:161
# SNMP v2:
rocommunity public  default    -V systemonly
# SNMP v3:
createUser ubuntu MD5 1234567890
rouser ubuntu

Step3. 重啟snmpd 
$ sudo systemctl restart snmpd

Step4. 測試 SNMP v2與v3 lookup:
# SNMP v2
 $ snmpwalk -v 2c -c public 127.0.0.1
# SNMP v3:
$ snmpwalk -v 3 -a MD5 -A 1234567890 -u ubuntu -l auth 127.0.0.1

Note: 以上由於我都是在本機測試,所以IP為127.0.0.1

1 comment:

Unknown said...

According to Stanford Medical, It is in fact the one and ONLY reason women in this country get to live 10 years more and weigh 42 pounds less than we do.

(And by the way, it is not related to genetics or some secret exercise and really, EVERYTHING about "how" they are eating.)

P.S, What I said is "HOW", and not "what"...

Click on this link to discover if this easy questionnaire can help you discover your real weight loss possibilities