VMware Cloud Community
Aenema_hyperic
Contributor
Contributor

[SIGAR] getRxBytes & getTxBytes

i'm writing a program to control the network traffic of a node.
it looks like these function gives always the same value.
and they do not control all the traffic of the node.
i'm working on winxp.

can you give me some explenation?

THANKS
Reply
0 Kudos
3 Replies
dougm_hyperic
VMware Employee
VMware Employee

You need to call Sigar.getNetInterfaceStat() to update the metrics
for each interface, sounds like you might only be calling it once?
For an example, have a look at bindings/java/src/org/hyperic/sigar/
cmd/Ifconfig.java

On Feb 23, 2007, at 7:33 AM, Aenema wrote:

> i'm writing a program to control the network traffic of a node.
> it looks like these function gives always the same value.
> and they do not control all the traffic of the node.
> i'm working on winxp.
>
> can you give me some explenation?
>
> THANKS
>



Reply
0 Kudos
Aenema_hyperic
Contributor
Contributor

Thanks for the answer!

if i run from the prompt of windowsXP:
java -jar sigar.jar ifconfig

i got the normal response:
MS TCP loopback interface
l0: Link encap:local loopback
....
RX packets: 11251 ...
TX packets: 11251 ...
collisions -1
RX bytes 3919679 (3.7M) TX bytes 3919679 (3.7M)

I got the numbers running the program one time, but i always get similar results: with the same RX and TX packets, and the same RX and TX Bytes!
Reply
0 Kudos
dougm_hyperic
VMware Employee
VMware Employee


Sorry I missed this one.. are you still seeing no changes?   There would need to be traffic going over the loopback interface of course.  For example, http://localhost/ if you have a web server running.

On Feb 25, 2007, at 4:53 AM, Aenema wrote:

Thanks for the answer!

if i run from the prompt of windowsXP:
java -jar sigar.jar ifconfig

i got the normal response:
MS TCP loopback interface
l0: Link encap:local loopback
....
RX packets: 11251 ...
TX packets: 11251 ...
collisions -1
RX bytes 3919679 (3.7M) TX bytes 3919679 (3.7M)

I got the numbers running the program one time, but i always get similar results: with the same RX and TX packets, and the same RX and TX Bytes!



Reply
0 Kudos