Can anyone help me in this? I am trying to monitor the humidity for my network device and I did the snmpwalk which is:
snmpget -v2c -cpublic -mALL 172.x.x.x .1.3.6.1.4.1.13742.4.2.x.x.x.x
and it stated:
SNMPv2-SMI::enterprises.13742.4.2.4.1.x.x = Gauge32: 2147483647
So what does the gauge32 means? And is there any way I can convert it to integer?
The MIB object that you are trying to poll is defined in PDU-MIB from raritan [1]
RelativeHumidity ::= TEXTUAL-CONVENTION
DISPLAY-HINT "d"
STATUS current
DESCRIPTION
"Data type for reporting sensor readings and thresholds
associated with humidity sensors. Relative humidity is
expressed as percentage and is defined as the ratio of the
partial pressure of water vapor in a gaseous mixture of
air and water vapor to the saturated vapor pressure of water
at a given temperature."
SYNTAX Unsigned32 (0..100)
humidity OBJECT-TYPE
SYNTAX RelativeHumidity
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The value of the external humidity sensor reported
as relative humidity (a percentage)."
::= { humiditySensorEntry 3 }
So your relative humidity should be in range [0..100]. There could be two problems:
The NET-SNMP fails to display the value properly for some reason
The SNMP Agent does not implement this object or humidity sensor is not installed or disabled on device
Related
i have to try get a class-map bit rate traffic from router cisco ios xe
i get a oid from cisco
https://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/119031-technote-router-00.html
the OID of postbitrate is give me only Gauge32
+-- -R-- Gauge cbQosCMPostPolicyBitRate(11)
so when my police traffic is under number : 4,294,967,295 , i get i correct value
but when the traffic go up of 4,294,967,295 bit
of example my real policy-traffic bps is :4,665,204,000
and when i try to get in by snmp i get value 376,176,704 (9 dig only)
snmpwalk -v2c -c ABCDED X.X.X.X iso.3.6.1.4.1.9.9.166.1.15.1.1.11
iso.3.6.1.4.1.9.9.166.1.15.1.1.11.1298180580.131072 = Gauge32: 376176704
so how to convert a Gauge32 correct value when my traffic is go up of 4,294,967,295 bps
i know is 32-bit only can Handle maximum 4,294,967,295
but in cisco mib . and for policy-map postbitrate , is only return Gauge32 ...
This is called the "SNMP counter wrap" condition (you can google it).
This is detailed in this Cisco page
https://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/26007-faq-snmpcounter.html
The only way for a management app to detect it is if the counter is smaller
than previously retrieved, at least one counter wrap occurred and you add 2^32-1 to
the latest value.
The alternative is to find the 64-bit counter, usually defined in a newer MIB.
I am trying to configure SNMP on Ubuntu 14.04. There is a step where I have to edit the community string along with sysLocation and sysContact but I am not sure what goes there. What are the sysLocation and sysContact objects in the snmpd.conf file and how I can get those values for my machine?
All SNMP devices share the following common configurable parameters:
sysLocation
sysContact
sysName
Read-write and read-only access
community strings (and frequently, a trap community string)
Trap destination
sysLocation is the physical location for the device being monitored. Its definition in RFC 1213 is:
sysLocation OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255))
ACCESS read-write
STATUS mandatory
DESCRIPTION
"The physical location of this node (e.g., 'telephone closet,
3rd floor')."
::= { system 6 }
RFC 1213's definition of sysContact is similar to that of sysLocation:
sysContact OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255))
ACCESS read-write
STATUS mandatory
DESCRIPTION
"The textual identification of the contact person for this managed
node, together with information on how to contact this person."
::= { system 4 }
sysContact is a DisplayString. It's fairly obvious what it's used for: it identifies the primary contact for the device in question. It is important to set this object with an appropriate value, as it can help your operations staff determine who needs to be contacted in the event of some catastrophic failure. You can also use it to make sure you're notified, if you're responsible for a given device, when someone needs to take your device down for maintenance or repairs. As with sysLocation, make sure to keep this information up to date as your staff changes. It's not uncommon to find devices for which the sysContact is someone who left the company several years ago.
source: http://docstore.mik.ua/orelly/networking_2ndEd/snmp/ch07_01.htm
SysLocation and SysContact are simply arbitrary SNMP string variables that are part of SNMPV2-MIB and can be fetched with SNMP get.
OID 1.3.6.1.2.1.1.4 == SysContact
OID 1.3.6.1.2.1.1.6 == SysLocation
Most sites I have been involved with use SysLocation as a decription of the location of the SNMP managed network device, and SysContact as the contact details of somebody who is in some way responsible for the device.
Warning: SysContact also has a habit of becoming out of date without being modified when staff changes.
To get sysContact using snmpget command line:
snmpget -v1 -c public localhost system.sysContact.0
where "public" is your community string, and "localhost" is the ip address of the machine you want to send the SNMP query to.
These values are defined by the administrator. Common formats include:
syslocation Rack, Room, Building, City, Country [GPSX,Y]
syscontact Your Name <your#email.address>
If all the equipment you monitor is in the same country you can use the format google maps uses: "street, city, state zip". For example searching google maps for the white house returns:
1600 Pennsylvania Ave NW, Washington, DC 20500
syslocation is often used my monitoring applications to generate visual maps.
When I do an snmpwalk for oid 1.3.6.1.2.1.2.2.1.10.1 I get a Counter32 integer value as the result. [1] states that 1.3.6.1.2.1.2.2.1.10 gives total number of octets received on the interface, including framing characters.
Does anybody knows for which time frame snmp gives this integer value because what I get is a pretty large value.
[1] http://www.oid-info.com/get/1.3.6.1.2.1.2.2.1.10
Thank you.
In RFC 202 you can find the mapping of MIB objects to their corresponding item in IEEE 802.12,
https://www.rfc-editor.org/rfc/rfc2020#page-12
That means, SNMP only exposes those values directly from the network adapters, without any processing at SNMP layer. Thus, when you see a value for ifInOctets, it is very likely to be an accumulated value since the last reset of this adapter (may or may not be related to device reset).
I'm unable to get the manufacturer serial number when I do an SNMP get on an OID .2.47.1.1.1.1.11.1.0. If I do an snmpget with the below command on the OID with the command:
snmpget -v1 -c public 192.168.4.99 .2.47.1.1.1.1.11.1.0
I get the message:
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: joint-iso-ccitt.47.1.1.1.1.11.1.0
I did search on google for the possible cause of error by going to this SO thread as it is caused by missing the instance subidentifier.
I performed an SNMPtranslate for the OID and I got the below string joint-iso-ccitt.47.1.1.1.1.11.1.0.
And when I performed an snmpwalk on the OID by the below command i get the message as END OF MIB.
snmpwalk -v1 -c public 192.168.4.1 .2.47.1.1.1.1.11.1.0
Please let me know where I'm going wrong and let me know the exact generic OID to get the manufacturers serial number.
Who tells you the OID is .2.47.1.1.1.1.11.1.0?
Seriously speaking, a normal OID starts with .1, except .0.0 which is very special.
If you start with walking the top of the MIB tree, you'll soon find out which variables your equipment supports:
snmpwalk -v1 -c public -Ont 192.168.4.1 .1
Remove the "-Ont" to get translated names, where possible, instead of the fully numeric OIDs.
If you're looking for vendor-independent data, you could look into a MIB that most equipment supports, SNMPV2-MIB:
http://www.ietf.org/rfc/rfc3418.txt
However, you'll find it does not contain any serial number variable. Most vendors provide a vendor-specific (or product-specific) MIB which will define, among other things, serial number. However, like most things in SNMP, it's entirely up to each vendor which MIBs they choose to implement.
I am writing a MIB and a SNMP agent. I seem to be confused by an apparent conflict between DISPLAY-HINT and UNITS. Is it better for a NMS to have a DISPLAY-HINT, or knowledge of the UNITS?
The background for this question is as follows: One object in the MIB is mPowerVoltage:
FixedDiv10 ::= TEXTUAL-CONVENTION
DISPLAY-HINT "d-1"
STATUS current
DESCRIPTION "Fixed point, one decimal"
SYNTAX Integer32
mPowerVoltage OBJECT-TYPE
SYNTAX FixedDiv10
UNITS "V/10"
MAX-ACCESS read-only
STATUS current
DESCRIPTION "Power Voltage in desiVolts"
::= { mPowerEntry 2 } -- an entry in a table with integer index
Actual transfer "on the wire" of the value I understand, for instance 10.8 V is transferred as 108 in an Integer32. And this is my motivation to set UNITS as "V/10" and describe the object as Power Voltage in desiVolts. However, when I use snmpget I get:
snmpget -c public -v 1 -m -MY-MIB 192.168.1.3 mPowerVoltage.1
MY-MIB::mPowerVoltage.1 = INTEGER: 10.8 V/10
which is indeed what I specified, but is clearly wrong.
But I can hardly change the UNITS to "V"? Hence the question, should I remove the DISPLAY-HINT, or should I remove the UNITS?
Baard
As I understand it, they're two diferent things, so neither takes precidence.
DISPLAY-HINT tells the caller how to place the decimal point - so in your example it prints out an "on-the-wire" value of 108 as 10.8.
UNITS is just a bit of text that gets appended after the number, exactly as you typed it. In this case you should definitely change the units to "V" because you've told the caller to display the number in V by dividing it by 10.
It does seem a bit inconsistent that one is part of the textual convention, while the other is part of the object definition, however.