On Wed, Mar 26, 2014 at 08:31:47AM +1100, Craig Small wrote:
> On Tue, Mar 25, 2014 at 08:44:18AM -0700, nairb rotsak wrote:
> >    Sorry.. I don't see the attachment??
> Attaching it might help huh.
OK, sourceforge strips them.

diff --git a/engine/pollers/snmp_counter.php b/engine/pollers/snmp_counter.php
index 447ee47..76dfa2a 100644
--- a/engine/pollers/snmp_counter.php
+++ b/engine/pollers/snmp_counter.php
@@ -16,8 +16,11 @@ function poller_snmp_counter ($options)
     if ($value === FALSE or $value == '')
         return $value;
 
-    if ( ($pos = strpos($value,' ')) !==FALSE)
-        $value = substr($value,0,$pos);
-    return (str_replace(array('(',')'),'',$value));
+    $value = intval(str_replace(array('(',')'),'',$value));
+    # Work around for when the counter32 is over 2^31
+    # e.g. for storage blocks
+    if ($value < 0)
+        $value += 4294967296;
+    return $value;
 }
 ?>
> 
>  - Craig
> -- 
> Craig Small (@smallsees)   http://enc.com.au/       csmall at : enc.com.au
> Debian GNU/Linux           http://www.debian.org/   csmall at : debian.org
> GPG fingerprint:        5D2F B320 B825 D939 04D2  0519 3938 F96B DF50 FEA5

> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech

> _______________________________________________
> jffnms-users mailing list
> jffnms-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jffnms-users


-- 
Craig Small (@smallsees)   http://enc.com.au/       csmall at : enc.com.au
Debian GNU/Linux           http://www.debian.org/   csmall at : debian.org
GPG fingerprint:        5D2F B320 B825 D939 04D2  0519 3938 F96B DF50 FEA5

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
jffnms-users mailing list
jffnms-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jffnms-users

Reply via email to