netsnmp 安裝與配置 (zt)
net-snmp installation and configuration
Recently I spent much time to learn SNMP to try to setup a snmp server for the developers. The following is the steps of installation and configuration of net-snmp, a popular and open source snmp server and agent .
DOWNLOAD AND INSTALL
1.download the source.
or the official web:
2.Extract the packet.
tar -zxvf net-snmp-5.4.tar.gz
3.Compile the packet.
cd net-snmp-5.4
./configure (for example ./configure --with-mib-modules="agentx")
make
make test
make install
4.Copy the example configure file
cp EXAMPLE.conf /usr/local/share/snmp/snmpd.conf
5.Modify the configure file as following
Change the COMMUNITY to democommunity which is a community string
6.check the process of snmpd and kill it and then run it
ps -A | grep snmp kill xxxx snmpd -d -L
7.have a try.
snmpget -v 1 -c democommunity localhost system.sysUpTime.0
INSTALL A MIB
1. A mibs file like JM-TEST-1-MIB.txt. the following is the content.
JM-TEST-1-MIB DEFINITIONS ::= BEGINIMPORTS MODULE-IDENTITY, OBJECT-TYPE, INTEGER FROM SNMPv2-SMI;jmtest MODULE-IDENTITY LAST-UPDATED "200203210000Z" ORGANIZATION "Temple U" CONTACT-INFO "None yet." DESCRIPTION "AgentX testing MIB" REVISION "200203210000Z" DESCRIPTION "None yet." ::= { experimental 72}firstKey OBJECT-TYPE SYNTAX INTEGER (0..100) MAX-ACCESS read-write STATUS current DESCRIPTION "Value initialized to 0 and on each access: - Return current val. - increment" ::= { jmtest 1 }END
2.Copy the mib file to the correct locations
cp JM-TEST-1-MIB.txt /usr/local/share/snmp/mibs
3.Let the snmp tools to recognize the mibs
echo "mibs +JM-TEST-1-MIB" >> /usr/local/share/snmp/snmp.conf
4.Use the snmptranslate to verify if the mib is loaded.
snmptranslate -IR -Tp experimental
and should get the following show:
Unlinked OID in JM-TEST-1-MIB: jmtest ::= { experimental 72 }
+--experimental(3)
|
+--jmtest(72)
+-- -RW- INTEGER firstKey(1)
Range: 0..100
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/312079/viewspace-245715/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Samba 安裝與配置 (zt from paipai-oss)SambaAI
- 本地windows搭建spark環境,安裝與詳細配置(jdk安裝與配置,scala安裝與配置,hadoop安裝與配置,spark安裝與配置)WindowsSparkJDKHadoop
- centos7 (阿里雲、linux) 單機spark的安裝與配置詳解(jdk安裝與配置,scala安裝與配置,hadoop安裝與配置,spark安裝與配置)CentOS阿里LinuxSparkJDKHadoop
- XAMPP安裝(zt)
- MacVim安裝與配置Mac
- [Redis] 安裝與配置Redis
- 【MongoDB】安裝與配置MongoDB
- 【Redis】安裝與配置Redis
- 【MySQL】安裝與配置MySql
- vim安裝與配置
- jdk安裝與配置JDK
- Rabbitmq安裝與配置MQ
- MySQL安裝與配置MySql
- Nginx安裝與配置Nginx
- Grafana 安裝與配置Grafana
- Redis安裝與配置Redis
- Mahout安裝與配置
- Spark安裝與配置Spark
- Nginx 安裝與配置Nginx
- Kafka SSL安裝與配置Kafka
- Supervisor安裝與配置
- Mac Flutter安裝與配置MacFlutter
- macOS Java安裝與配置MacJava
- Centos安裝與配置RedisCentOSRedis
- Telnet安裝與配置
- Mac 安裝與配置mongodbMacMongoDB
- JAVA—JDK安裝與配置JavaJDK
- Tomcat安裝與配置Tomcat
- 【Jenskins】安裝與配置
- Hive的安裝與配置Hive
- PG的安裝與配置
- yum的安裝與配置
- NetBackup安裝與配置
- TortoiseGit安裝與配置(轉)Git
- Redis的安裝與配置Redis
- Vue的安裝與配置Vue
- WAS與IHS整合的安裝與配置
- Linux下oracle10g安裝配置說明(ZT)LinuxOracle