SUN Solaris10 installation and configuration NET-SNMP——Method 1 (system default snmp)

1. Version Notes

Platform: x86
Operating system: Solaris 5.10
snmp: The system is installed by default, but the version is not queried

1.1 Installation and configuration method

1) The solaris system comes with snmp;
2) net-snmp pkg software package;
3) net-snmp compiled package;

This article only applies to the installation configuration of method 1;

2. Confirm whether the system snmp service is running:

After the Solaris10 system is newly installed, the snmp service comes with it by default, and the snmp service will automatically start when the system is turned on.
By default, the community name in the configuration file is "public". If you need to modify the community name and restart the service, you can refer to this article.

# ps -ef | grep snmp
    root  /usr/sfw/sbin/snmpd
    root  /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf
    root  grep snmp

2. If you can see snmp running, execute the following command to stop the service:

# svcadm disable sma
# svcadm disable seaport
# svcadm disable snmpdx
# ps -ef | grep snmp

3. Edit configuration file

# vi /etc/sma/snmp/snmpd.conf
rocommunity public		#默认
改为:
rocommunity cmsnmp

4. Start the service

# svcadm enable sma
# svcadm enable seaport
# svcadm enable snmpdx
# ps -ef | grep snmp

5. Local testing

snmpget -v 1 -c cmsnmp localhost sysUpTime.0
snmpwalk -v 1 -c cmsnmp -m ALL localhost .1.3 | more

If the configuration is successful, there will be relevant output information after executing the above command.

6. snmp server side test

# cmsnmp为共同体名称
# 10.168.1.129为client端IP地址
snmpwalk -v 1 -c cmsnmp 10.168.1.129 .1.3.6.1.2.1.25.2.2  			#取得系统总内存
snmpwalk -v 1 -c cmsnmp 10.168.1.129 hrSystemNumUsers  				#取得系统用户数
snmpwalk -v 1 -c cmsnmp 10.168.1.129 .1.3.6.1.2.1.4.20    			#取得IP信息
snmpwalk -v 1 -c cmsnmp 10.168.1.129 system   						#查看系统信息
snmpwalk -v 1 -c cmsnmp 10.168.1.129 ifDescr 						#获取网卡信息

Note: The system's default snmp encountered some bugs during our actual testing, mainly because the information obtained was incomplete or incorrect. Therefore, we considered installing net-snmp to replace the system's default snmp. Regarding the installation method of net-snmp, you can refer to my other blog posts.

Guess you like

Origin blog.csdn.net/m0_37862262/article/details/107065057