#21992 [Com]: snmpget returns wrong value on negative integer
| From: | spoon at nexdot dot net | Date: | Tue, 04 Feb 2003 21:18:47 +0000 |
| Subject: | #21992 [Com]: snmpget returns wrong value on negative integer | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-32114@lists.php.net to get a copy of this message | ||
ID: 21992
Comment by: spoon@nexdot.net
Reported By: spoon@nexdot.net
Status: Open
Bug Type: SNMP related
Operating System: Windows XP Pro SP1
PHP Version: 4CVS-2003-01-31 (stable)
New Comment:
Any update on this? If it needs more information/some way of
confirmation, i would be happy to aid.
Previous Comments:
------------------------------------------------------------------------
[2003-01-31 21:31:25] spoon@nexdot.net
I believe i read somewhere that PHP's integer max was 2147483647?
If using snmp to pull bandwidth information from a device (such as
ifInOctets and ifOutOctets), the number DOES constandly rise. If using
a device with snmpv1 (32bit) the counter will only reach a certain
number before it rolls over the the opposite and negative number and
counts toward the maximum again.
The Max (and prolly min?) is the same as PHP's.
"INTEGER(-2147483648..2147483647) -- corresponds to a signed 32-bit
int"
Well, once the counter turns over to the negative, php only returns
"2147483647" for every negative value it reads.
Such as, my ifInOctets for my cisco router is now reading
'-1980181848', and php's snmpget on that oid returns '2147483647', but
when the counter is positive, it returns the correct value.
(this is probably a problem on 64bit snmpv2 since i believe its maximum
is much higher, but thats probably not fix-able)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21992&edit=1