On Wed, 2005-11-09 at 10:56 +0200, Asim Zaka wrote:
> What data type should I use in MIB definition and in the var_ function if I
> want
> to return negative decimal values like -1.2?
There is no standard support for non-integer numeric values in SNMP.
You have three basic choices:
- for fixed-point values, use an integer value with an implicit
decimal point. For example, TimeTicks would represent 1.2s
using the value 120.
- the Net-SNMP suite supports the type NET-SNMP-TC::Float (and
Double), as used in UCD-SNMP-MIB::laLoadFloat.
But this will typically only work with Net-SNMP agent and tools.
Very few other SNMP toolkits understand this type.
- use a printable string - e.g. "-1.2" and parse this at the
receiving end.
Dave
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders