carya.liu
carya.liu

Reputation: 51

how to use snmp to get UCD-SNMP-MIB::dskTotalLow value

my snmp version is 5.7.2, after i install it on ubuntu and try to get disk space like this:

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

when i changed the mib, then get the right answer as follows:

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

now, please give me some advice to get the dskTotalLow value, to solve the wrong value for large disk space, thanks so much.

Upvotes: 0

Views: 3869

Answers (1)

k1eran
k1eran

Reputation: 4970

Check your snmpd.conf settings regarding regarding Disk Usage Monitoring. Here is an extract from "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).

Upvotes: 0

Related Questions