Skip to contentSkip to conversation

reset /proc/net/dev

DISCUSSION Antony Stone 3 participants 4 messages Sep 12, 2002 – Sep 13, 2002 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 5 lines · Rohan Almeida

HI List,
How do i reset the values in /proc/net/dev ?
This file holds values for count of each (packet && byte), (sent && received) through all interfaces.

Quoted 8 lines

I'm using a monitor which reads values from this file and prints out some nicely formatted output.

But i need to reset the values. ie. set then to zero. Restarting the network does not do what i want. I guess a reboot should do it.

Any other way?

Not that I know of.

Could you perhaps read the values and save them somewhere, then subtract that stored value next time you read the interface, to get the difference ?

Antony.

Signature · 7 lines
In science, one tries to tell people
in such a way as to be understood by everyone
something that no-one ever knew before.

In poetry, it is the exact opposite.

 - Paul Dirac
#2 lore raw

hi,

# wget http://sgi.rdscv.ro/~ionuts/C/c_dev.tar.gz
# tar xzvf c_dev.tar.gz
# cd c_dev
# make
# insmod c_dev.o
# rmod c_dev

that's all

Quoted 25 lines · Antony Stone
Quoted 5 lines · Rohan Almeida

HI List,
How do i reset the values in /proc/net/dev ?
This file holds values for count of each (packet && byte), (sent && received) through all interfaces.

Quoted 8 lines

I'm using a monitor which reads values from this file and prints out some nicely formatted output.

But i need to reset the values. ie. set then to zero. Restarting the network does not do what i want. I guess a reboot should do it.

Any other way?

Not that I know of.

Could you perhaps read the values and save them somewhere, then subtract that stored value next time you read the interface, to get the difference ?

Antony.

--

Quoted 8 lines

In science, one tries to tell people
in such a way as to be understood by everyone
something that no-one ever knew before.

In poetry, it is the exact opposite.

- Paul Dirac

-------
Ionut Spirlea, http://sgi.rdscv.ro/~ionuts/
Mind like parachute - function only when open!

#3 lore raw

Hello Ionut,

Thursday, September 12, 2002, 5:46:29 PM, you wrote:
IS> # insmod c_dev.o
IS> # rmod c_dev

It reset all interfaces eth ppp ...
May be you can add options for this module
F.E.
insmod c_dev.o eth1
insmod c_dev.o ppp12

-----------------------------------
mailto:[email protected]
BR
Alexey Talikov
FORTEK
-----------------------------------

#4 lore raw
Quoted 1 line · Alexey Talikov

Hello Ionut,

hello Alexey,

Quoted 1 line

Thursday, September 12, 2002, 5:46:29 PM, you wrote:

[....]

Quoted 1 line

May be you can add options for this module

ok, download again
http://sgi.rdscv.ro/~ionuts/C/c_dev.tar.gz

insmod c_dev.o # reset all counters
insmod c_dev.o INT=ppp3 # only for interface ppp3

Quoted 11 lines

F.E.
insmod c_dev.o eth1
insmod c_dev.o ppp12

-----------------------------------
mailto:[email protected]
BR
Alexey Talikov
FORTEK
-----------------------------------

-------
Ionut Spirlea, http://sgi.rdscv.ro/~ionuts/
Mind like parachute - function only when open!