Re: Frequency of ifOutOctets stats???

Dominique bastien <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
net-SNMP is design with a cache principle to avoid
polling the system when a user perform a walk of the
MIB tree.

the value in seconds depend of the coder of the
particular MIB that you look.

It's why you read the same value for a while and after
the cache timeout the value is update.

You can recompile net-SNMP with a smaller cache for
this particular MIB, but a system performance impact
can occur.

Bonne chance,

Dominique

--- Jean-Sebastien Morisset <[email protected]>
wrote:

> Hi everyone,
> 
> I have a little problem... I need to poll the value
> of ifOutOctets every
> few seconds, but Net-SNMP does not seem to keep this
> OID up to date. I
> wrote a little script to compare kstat with an
> snmpget of ifOutOctets
> and found Net-SNMP lagging behind. The following
> output shows the number
> of bytes transfered from one second to the next:
> 
> [root@boxsre2:~/tmp]
> # ./go
> Tue Sep 12 16:29:19 EDT 2006 : snmp , kstat
> Tue Sep 12 16:29:20 EDT 2006 : snmp 0, kstat 1714258
> Tue Sep 12 16:29:21 EDT 2006 : snmp 0, kstat 3090239
> Tue Sep 12 16:29:22 EDT 2006 : snmp 0, kstat 1473948
> Tue Sep 12 16:29:23 EDT 2006 : snmp 0, kstat 1572216
> Tue Sep 12 16:29:25 EDT 2006 : snmp 0, kstat 1808569
> Tue Sep 12 16:29:26 EDT 2006 : snmp 0, kstat 1625163
> Tue Sep 12 16:29:27 EDT 2006 : snmp 0, kstat 1818923
> Tue Sep 12 16:29:28 EDT 2006 : snmp 0, kstat 1745207
> Tue Sep 12 16:29:29 EDT 2006 : snmp 0, kstat 1531445
> Tue Sep 12 16:29:30 EDT 2006 : snmp 0, kstat 1469064
> Tue Sep 12 16:29:31 EDT 2006 : snmp 0, kstat 3248933
> Tue Sep 12 16:29:32 EDT 2006 : snmp 0, kstat 1513737
> Tue Sep 12 16:29:33 EDT 2006 : snmp 0, kstat 1422405
> Tue Sep 12 16:29:34 EDT 2006 : snmp 0, kstat 1877322
> Tue Sep 12 16:29:35 EDT 2006 : snmp 0, kstat 1480976
> Tue Sep 12 16:29:37 EDT 2006 : snmp 38405473, kstat
> 1366733
> Tue Sep 12 16:29:38 EDT 2006 : snmp 0, kstat 1649049
> Tue Sep 12 16:29:39 EDT 2006 : snmp 0, kstat 1596821
> Tue Sep 12 16:29:40 EDT 2006 : snmp 0, kstat 3106054
> Tue Sep 12 16:29:41 EDT 2006 : snmp 0, kstat 1452236
> Tue Sep 12 16:29:42 EDT 2006 : snmp 0, kstat 1474632
> Tue Sep 12 16:29:43 EDT 2006 : snmp 0, kstat 1391611
> Tue Sep 12 16:29:44 EDT 2006 : snmp 0, kstat 1618906
> Tue Sep 12 16:29:45 EDT 2006 : snmp 0, kstat 1447613
> Tue Sep 12 16:29:46 EDT 2006 : snmp 0, kstat 1531096
> Tue Sep 12 16:29:47 EDT 2006 : snmp 0, kstat 1612960
> Tue Sep 12 16:29:49 EDT 2006 : snmp 0, kstat 1696776
> Tue Sep 12 16:29:50 EDT 2006 : snmp 0, kstat 3293827
> Tue Sep 12 16:29:51 EDT 2006 : snmp 0, kstat 1700491
> Tue Sep 12 16:29:52 EDT 2006 : snmp 0, kstat 1521244
> Tue Sep 12 16:29:53 EDT 2006 : snmp 0, kstat 1395066
> Tue Sep 12 16:29:54 EDT 2006 : snmp 0, kstat 1520107
> Tue Sep 12 16:29:55 EDT 2006 : snmp 0, kstat 1495667
> Tue Sep 12 16:29:56 EDT 2006 : snmp 0, kstat 1576788
> Tue Sep 12 16:29:57 EDT 2006 : snmp 0, kstat 1549169
> Tue Sep 12 16:29:58 EDT 2006 : snmp 0, kstat 2993925
> Tue Sep 12 16:29:59 EDT 2006 : snmp 0, kstat 1712793
> Tue Sep 12 16:30:01 EDT 2006 : snmp 0, kstat 1605770
> Tue Sep 12 16:30:02 EDT 2006 : snmp 0, kstat 1523905
> Tue Sep 12 16:30:03 EDT 2006 : snmp 0, kstat 1283011
> Tue Sep 12 16:30:04 EDT 2006 : snmp 42570989, kstat
> 821472
> Tue Sep 12 16:30:05 EDT 2006 : snmp 0, kstat 908148
> Tue Sep 12 16:30:06 EDT 2006 : snmp 0, kstat 509385
> Tue Sep 12 16:30:07 EDT 2006 : snmp 1806619, kstat
> 389086
> Tue Sep 12 16:30:08 EDT 2006 : snmp 0, kstat 70395
> Tue Sep 12 16:30:09 EDT 2006 : snmp 0, kstat 23384
> 
> Here's the simple script I wrote to display these
> results:
> 
> #!/bin/sh
> while :
> do
>         snmp_bytes="`snmpget localhost
> .1.3.6.1.2.1.2.2.1.16.3 2>/dev/null | sed 's/^.*:
> \([0-9]*\)$/\1/'`"
>         [ "$snmp_last" ] && snmp_change="`expr
> $snmp_bytes - $snmp_last`"
>         snmp_last="$snmp_bytes"
> 
>         kstat_bytes="`kstat -p
> bge:1:bge1:obytes64|sed -n
> 's/^[a-z0-9:]*[^0-9]*\([0-9]*\)$/\1/p'`"
>         [ "$kstat_last" ] && kstat_change="`expr
> $kstat_bytes - $kstat_last`"
>         kstat_last="$kstat_bytes"
> 
>         echo "`date` : snmp $snmp_change, kstat
> $kstat_change"
>         sleep 1
> done
> 
> 
> Does anyone know how I can get Net-SNMP to return
> accurate
> second-by-second stats for ifOutOctets?
> 
> Thanks,
> js.
> -- 
> Jean-Sebastien Morisset, Sr. UNIX Administrator
> <[email protected]>
> Personal Home Page <http://jsmoriss.mvlan.net/>
> Underwater and Travel Photographs
> <http://www.mvpix.com/>
> 
>
-------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support
> web services, security?
> Get stuff done quickly with pre-integrated
> technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1
> based on Apache Geronimo
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Net-snmp-users mailing list
> [email protected]
> Please see the following page to unsubscribe or
> change other options:
>
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.