在snmpd.conf中采用load关键字来监控系统负载,格式如下:# load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0]## 1MAX: If the 1 minute load average is above this limit at query# time, the errorFlag will be set.# 5MAX: Similar, but for 5 min average.# 15MAX: Similar, but for 15 min average.load关键字跟随1 min max load 以及5 min max load ,15 min max load,如果系统负载超过了这三个的某一个值,loadaveErrorFlag就被设为1,如果没有参数,默认使用1分钟最大负载。具体的OID为:root(.)->iso(1)->org(3)->dod(6)->internet(1)->private(4)->enterprises(1)->ucdavis(2021)->10->1也就是:.1.3.6.1.4.1.2021.10在配置文件中添加:load 0.01 10 0.01 #此配置仅用于测试# snmpwalk -v2c -cpublic 192.168.1.21 1.3.6.1.4.1.2021.10UCD-SNMP-MIB::laIndex.1 = INTEGER: 1 //1分钟、5分钟、15分钟的负载索引编号UCD-SNMP-MIB::laIndex.2 = INTEGER: 2UCD-SNMP-MIB::laIndex.3 = INTEGER: 3UCD-SNMP-MIB::laNames.1 = STRING: Load-1 //1分钟、5分钟、15分钟的负载标识名UCD-SNMP-MIB::laNames.2 = STRING: Load-5UCD-SNMP-MIB::laNames.3 = STRING: Load-15UCD-SNMP-MIB::laLoad.1 = STRING: 0.24 //获得的当前负载值UCD-SNMP-MIB::laLoad.2 = STRING: 0.05UCD-SNMP-MIB::laLoad.3 = STRING: 0.02UCD-SNMP-MIB::laConfig.1 = STRING: 0.01 //系统负载的预设值UCD-SNMP-MIB::laConfig.2 = STRING: 10.00UCD-SNMP-MIB::laConfig.3 = STRING: 0.01UCD-SNMP-MIB::laLoadInt.1 = INTEGER: 23 //int类型值UCD-SNMP-MIB::laLoadInt.2 = INTEGER: 5UCD-SNMP-MIB::laLoadInt.3 = INTEGER: 2UCD-SNMP-MIB::laLoadFloat.1 = Opaque: Float: 0.240000 //float类型值UCD-SNMP-MIB::laLoadFloat.2 = Opaque: Float: 0.050000UCD-SNMP-MIB::laLoadFloat.3 = Opaque: Float: 0.020000UCD-SNMP-MIB::laErrorFlag.1 = INTEGER: error(1) //是否超出预设值UCD-SNMP-MIB::laErrorFlag.2 = INTEGER: noError(0)UCD-SNMP-MIB::laErrorFlag.3 = INTEGER: error(1)UCD-SNMP-MIB::laErrMessage.1 = STRING: 1 min Load Average too high (= 0.24) //出错信息提示UCD-SNMP-MIB::laErrMessage.2 = STRING:UCD-SNMP-MIB::laErrMessage.3 = STRING: 15 min Load Average too high (= 0.02)
(以上内容不代表本站观点。) --------------------------------- |