snmp 썼어요.
7531 단어 snmp
참고 자료
설치하다.
Ubuntu의 경우apt-get install -y snmpd
apt-get install -y snmp snmp-mibs-downloader
Hub OS의 경우sudo yum install net-snmp-utils
SNMP 값 가져오기
apt-get install -y snmpd
apt-get install -y snmp snmp-mibs-downloader
sudo yum install net-snmp-utils
- rocommunity public default -V systemonly
+ rocommunity public default
모든 SNMP 값 가져오기snmpwalk -v1 localhost -c public
결실iso.3.6.1.2.1.1.1.0 = STRING: "Linux debsrv1 4.2.3-2-pve #1 SMP Sun Nov 15 16:08:19 CET 2015 x86_64"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10
iso.3.6.1.2.1.1.3.0 = Timeticks: (48332) 0:08:03.32
iso.3.6.1.2.1.1.4.0 = STRING: "Me <[email protected]>"
iso.3.6.1.2.1.1.5.0 = STRING: "debsrv1"
iso.3.6.1.2.1.1.6.0 = STRING: "Sitting on the Dock of the Bay"
iso.3.6.1.2.1.1.7.0 = INTEGER: 72
iso.3.6.1.2.1.1.8.0 = Timeticks: (0) 0:00:00.00
...(略)
특정 MIB 값만 가져오기$ snmpwalk -v1 localhost -c public iso.3.6.1.2.1.25.1.1.0
iso.3.6.1.2.1.25.1.1.0 = Timeticks: (51977649) 6 days, 0:22:56.49
snmpstatus$ snmpstatus -v 1 -c public localhost
[UDP: [127.0.0.1]:161->[0.0.0.0]:40345]=>[Linux debsrv1 4.2.3-2-pve #1 SMP Sun Nov 15 16:08:19 CET 2015 x86_64] Up: 1:18:36.91
Interfaces: 3, Recv/Trans packets: 14747404/9752459 | IP: 8961633/9364840
1 interface is down!
다른 서버에서 가져오기 허용
/etc/snmp/snmpd.conf
- agentAddress udp:127.0.0.1:161
+ agentAddress udp:161
snmpwalk -v1 debsrv1 -c public UCD-SNMP-MIB::laTable
snmpwalk -v1 debsrv1 -c public UCD-SNMP-MIB::memory
snmpwalk -v1 debsrv1 -c public UCD-SNMP-MIB::dskTable
더하기
$ snmpwalk -v1 windesk1 -c public | wc -l
3320
$ snmpwalk -v1 windesk1 -c public .| wc -l
3673
창의 SNMP 값 가져오기
Ubuntu부터 구현snmpwalk -v1 192.168.0.64 -c public
결실iso.3.6.1.2.1.1.1.0 = STRING: "Hardware: x86 Family 15 Model 6 Stepping 1 AT/AT COMPATIBLE
- Software: Windows Version 6.1 (Build 7601 Multiprocessor Free)"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.311.1.1.3.1.1
iso.3.6.1.2.1.1.3.0 = Timeticks: (78696420) 9 days, 2:36:04.20
iso.3.6.1.2.1.1.4.0 = ""
iso.3.6.1.2.1.1.5.0 = STRING: "windesk1"
iso.3.6.1.2.1.1.6.0 = ""
iso.3.6.1.2.1.1.7.0 = INTEGER: 76
iso.3.6.1.2.1.2.1.0 = INTEGER: 21
...(略)
snmpwalk -v1 192.168.0.64 -c public
iso.3.6.1.2.1.1.1.0 = STRING: "Hardware: x86 Family 15 Model 6 Stepping 1 AT/AT COMPATIBLE
- Software: Windows Version 6.1 (Build 7601 Multiprocessor Free)"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.311.1.1.3.1.1
iso.3.6.1.2.1.1.3.0 = Timeticks: (78696420) 9 days, 2:36:04.20
iso.3.6.1.2.1.1.4.0 = ""
iso.3.6.1.2.1.1.5.0 = STRING: "windesk1"
iso.3.6.1.2.1.1.6.0 = ""
iso.3.6.1.2.1.1.7.0 = INTEGER: 76
iso.3.6.1.2.1.2.1.0 = INTEGER: 21
...(略)
야후 라우터 SNMP
snmp host 192.168.0.64 public
192.168.0.64부터 실시snmpwalk -v1 192.168.0.1 -c public
config 가져오기snmpwalk -v1 192.168.0.1 -c public \
iso.3.6.1.4.1.1182.2.2.10.1.2
IP 요약(OID를 통해)snmpwalk -On \
-v1 192.168.0.1 -c public \
.1.3.6.1.2.1.4.22.1.3.1
Mib browser
Mib
load average
1.3.6.1.4.1.2021.10.1.3
snmpwalk -v1 localhost -c public 1.3.6.1.4.1.2021.10.1.3
iso.3.6.1.4.1.2021.10.1.3.1 = STRING: "0.07" # 1分
iso.3.6.1.4.1.2021.10.1.3.2 = STRING: "0.21" # 5分
iso.3.6.1.4.1.2021.10.1.3.3 = STRING: "0.22" # 15分
프로세스 수
참조
.1.3.6.1.4.1.2021.2.1
.+ proc apache2
성공 사례$ snmpwalk -v1 -c public localhost .1.3.6.1.4.1.2021.2.1 | grep 4\
...
iso.3.6.1.4.1.2021.2.1.5.4 = INTEGER: 11
...
실패 예$ snmpwalk -v1 -c public localhost .1.3.6.1.4.1.2021.2.1 | grep 4\
...
iso.3.6.1.4.1.2021.2.1.101.4 = STRING: "No httpd process running"
...
Reference
이 문제에 관하여(snmp 썼어요.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/tukiyo3/items/7c53960b172d5a6cd31a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)