首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用snmp获取UCD-SNMP-MIB::dskTotalLow值

如何使用snmp获取UCD-SNMP-MIB::dskTotalLow值
EN

Stack Overflow用户
提问于 2014-01-23 14:50:05
回答 1查看 2.9K关注 0票数 0

我的snmp版本是5.7.2,在我将其安装到ubuntu上并尝试像这样获得磁盘空间后:

代码语言:javascript
复制
cloud@cloud:~/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时,得到正确的答案如下:

代码语言:javascript
复制
cloud@cloud:~/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的值,以解决大磁盘空间的错误值,非常感谢。

EN

回答 1

Stack Overflow用户

发布于 2014-01-24 18:38:01

检查有关磁盘使用情况监视的snmpd.conf设置。以下是"man snmpd.conf“的摘录。

代码语言:javascript
复制
  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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21301279

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档