I am New to SNMP and trying to create a .MIB file for my SNMP manager.
I use “iReasoning” on my PC as SNMP Manager.
I can get and observe all the integer values correctly, but I can’t display the float numbers!
After searching, I found out that the agent can only send integer values and it should be specified on the Manager’s side that the results should be displayed with the number of decimals. So I came up with this code for the .MIB file:
myMIB DEFINITIONS ::= BEGIN
IMPORTS
internet FROM RFC1155-SMI
OBJECT-TYPE FROM SNMPv2-SMI
TEXTUAL-CONVENTION FROM SNMPv2-TC;
-- ---------------------------------------------------------- --
-- Textual Conventions
-- ---------------------------------------------------------- --
Thousandths ::= TEXTUAL-CONVENTION
DISPLAY-HINT "d-3"
STATUS current
DESCRIPTION "An integer to be displayed with 3 decimal places;
i.e. 12345 displayed as 12.345"
SYNTAX INTEGER (-10000..10000)
baseDir OBJECT IDENTIFIER ::= { internet 3}
myOID OBJECT IDENTIFIER ::= { baseDir 1 }
myDeviceVoltage OBJECT-TYPE
SYNTAX Thousandths (0..65535)
UNITS "V"
ACCESS read-only
STATUS current
DESCRIPTION
"Voltage of my Device"
::= { myOID Monitoring(1) 1 }
END
But still, the value of the number in “iReasoning” is displayed as an integer!
Any Solution?