우선 몇몇 패키지의 설치가 필요 하다
#sudo apt-get install snmp-mibs-downloader snmp snmpd
설치 완료 후
/etc/snmp
폴더 안에
snmp.conf 파일 을 수정 한다 .
# As the snmp packages come without MIB files due to license reasons, loading
# of MIBs is disabled by default. If you added the MIBs you can reenable
# loading them by commenting out the following line.
#mibs : --> 이부분 주석 처리
그 후 snmpd.conf 파일 수정
-----------------------------------------------------------------------------------------------
# Listen for connections from the local system only
#agentAddress udp:161,udp6:[::1]:161
# Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentAddress udp:161,udp6:[::1]:161 --> 이 부분 주석 해제
###############################################################################
#
# SNMPv3 AUTHENTICATION
#
# Note that these particular settings don't actually belong here.
# They should be copied to the file /var/lib/snmp/snmpd.conf
# and the passwords changed, before being uncommented in that file *only*.
# Then restart the agent
# createUser authOnlyUser MD5 "remember to change this password"
# createUser authPrivUser SHA "remember to change this one too" DES
# createUser internalUser MD5 "this is only ever used internally, but still change the password"
# If you also change the usernames (which might be sensible),
# then remember to update the other occurances in this example config file to match.
###############################################################################
#
# ACCESS CONTROL
#
# system + hrSystem groups only
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
# Full access from the local host
rocommunity public localhost
# Default access to basic system info
#rocommunity public default -V systemonly
rocommunity public [허용할 IP ]
여기서 public 는 아이디 역할을 한다.
그 후
허용 할 IP 에 적어준 서버에 들어가서 확인 해보면
#snmpwalk -v1 -c public [snmp 설정한 서버 IP] ifEntry
여기서 public 는 snmp 설정 한 서버의 snmpd.conf 파일에서 ID 라고 말한 그것을 적어 주면 된다.
'리눅스' 카테고리의 다른 글
postfix SPF check 하기 (0) | 2018.11.13 |
---|---|
bash 특정 파일 전부 바꾸기 (0) | 2018.10.25 |
centos mrtg 설치 (0) | 2018.10.08 |
expect 날짜 넣기 (0) | 2018.10.04 |
grep 명령어 (0) | 2018.10.02 |