2014-01-23 261 views
0

我的SNMP版本是5.7.2,當我在Ubuntu上安裝它,並試圖讓這樣的磁盤空間:如何利用SNMP獲得UCD-SNMP-MIB :: dskTotalLow值

[email protected]:~/snmp/net-snmp-5.7.2$ snmpwalk -v 2c -c public 10.0.0.125 .1.3.6.1.4.1.2021.9.1.11 
UCD-SNMP-MIB::dskTotalLow = No Such Object available on this agent at this OID 

當我改變了MIB,然後找到正確答案如下:

[email protected]:~/snmp/net-snmp-5.7.2$ snmpwalk -v 2c -c public 10.0.0.125 .1.3.6.1.4.1.2021.9.1.6 
UCD-SNMP-MIB::dskTotal.1 = INTEGER: 14332332 
UCD-SNMP-MIB::dskTotal.2 = INTEGER: 0 
UCD-SNMP-MIB::dskTotal.3 = INTEGER: 0 
UCD-SNMP-MIB::dskTotal.4 = INTEGER: 0 
UCD-SNMP-MIB::dskTotal.5 = INTEGER: 0 
UCD-SNMP-MIB::dskTotal.6 = INTEGER: 0 
UCD-SNMP-MIB::dskTotal.7 = INTEGER: 500708 
UCD-SNMP-MIB::dskTotal.8 = INTEGER: 0 
UCD-SNMP-MIB::dskTotal.9 = INTEGER: 203908 
UCD-SNMP-MIB::dskTotal.10 = INTEGER: 5120 
UCD-SNMP-MIB::dskTotal.11 = INTEGER: 509768 
UCD-SNMP-MIB::dskTotal.12 = INTEGER: 233191 

現在,請給我一些建議,以獲得dskTotalLow值,解決了大的磁盤空間的錯誤值,非常感謝。

回答

0

檢查有關磁盤使用情況監控的snmpd.conf設置。這裏是一個來自「man snmpd.conf」的摘錄。

Disk Usage Monitoring 
    This requires that the agent was built with support for the ucd-snmp/disk module (which is included as part of the default build con- 
    figuration). 

    disk PATH [ MINSPACE | MINPERCENT% ] 
      monitors the disk mounted at PATH for available disk space. 

      The minimum threshold can either be specified in kB (MINSPACE) or as a percentage of the total disk (MINPERCENT% with a ’%’ 
      character), defaulting to 100kB if neither are specified. If the free disk space falls below this threshold, then the corre- 
      sponding dskErrorFlag instance will be set to 1, and a suitable description message reported via the dskErrorMsg instance. 

      Note: This situation will not automatically trigger a trap to report the problem - see the DisMan Event MIB section later. 

    includeAllDisks MINPERCENT% 
      configures monitoring of all disks found on the system, using the specified (percentage) threshold. The threshold for indi- 
      vidual disks can be adjusted using suitable disk directives (which can come either before or after the includeAllDisks direc- 
      tive). 

      Note: Whether disk directives appears before or after includeAllDisks may affect the indexing of the dskTable. 

      Only one includeAllDisks directive should be specified - any subsequent copies will be ignored. 

      The list of mounted disks will be determined when the agent starts using the setmntent(3) and getmntent(3), or fopen(3) and 
      getmntent(3), or setfsent(3) and getfsent(3) system calls. If none of the above system calls are available then the root 
      partition "/" (which is assumed to exist on any UNIX based system) will be monitored. Disks mounted after the agent has 
      started will not be monitored. 

    If neither any disk directives or includeAllDisks are defined, then walking the dskTable will fail (noSuchObject). 
+0

我對磁盤的snmpd.conf如下: –

+0

'# #磁盤監控 # #10MBs根磁盤,5%免費的/ var,所需10%免費的所有其他磁盤 盤/ 10000 disk/var 5% includeAllDisks 10%'如上所述,我認爲已啓用獲取磁盤信息,但無法獲取UCD-SNMP-MIB :: dskTotalLow的值 –