Welcome, Guest. Please login or register.

Author Topic: interfaces table: counter  (Read 2831 times)

dobst

  • Full Member
  • ***
  • Posts: 144
    • View Profile
interfaces table: counter
« on: July 19, 2013, 02:10:16 PM »
Hello folks,

I try to figure out what what these counters (in the interface table) describe. Is the follwoing description correct?

Traffic
inoct = absolute counter of incomming bytes since start of device
outoct = absolute counter of outgoing bytes since start of device
inbrc = absolute counter of incomming broadcasts (bytes) since start of device
dinoct = difference of incomming bytes since last messurement (relative)
doutoct = difference of outgoing bytes since last messurement (relative)
dinbrc = difference of incomming discards since last messurement (relative)

Errors
inerr = absolute counter of incomming errors
outerr = absolute counter of outgoing errors
dinerr = difference of incomming errors since last messurement (relative)
douterr = difference of outgiong errors since last messurement (relative)

Discards
indis = absolute counter of incomming discards
outdis = absolute counter of outgoing discards
dindis = difference of incomming discards since last messurement (relative)
doutdis = difference of outgoing discards since last messurement (relative)

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2532
    • View Profile
    • NeDi
Re: interfaces table: counter
« Reply #1 on: July 19, 2013, 05:42:58 PM »
That is correct (I used the d as in delta). And in case you're wondering, why there's not outbroadcasts. I don't really care what devices send out as it's only a combination of all incoming broadcasts . It's much more interesting where do those broadcasts enter the network...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

dobst

  • Full Member
  • ***
  • Posts: 144
    • View Profile
Re: interfaces table: counter
« Reply #2 on: July 22, 2013, 10:41:44 AM »
Ok, thx. I want to calculate rates from the delatas (kbit/s in, kbit/s out, etc.) with mysql. How can I get/calculate the time between two runs (according to rrdstep in nedi.conf)?

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2532
    • View Profile
    • NeDi
Re: interfaces table: counter
« Reply #3 on: July 22, 2013, 08:17:25 PM »
The time difference should be rrdstep, actually. So you simply divide doctet by rrdstep and multiply by 8...

mysql> select dinoct,dinoct/300*8 as "kibt/s" from interfaces where comment regexp "atlas";
+--------+------------+
| dinoct | kibt/s     |
+--------+------------+
| 418631 | 11163.4933 |
+--------+------------+
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

dobst

  • Full Member
  • ***
  • Posts: 144
    • View Profile
Re: interfaces table: counter
« Reply #4 on: July 24, 2013, 11:11:44 PM »
The time difference should be rrdstep, actually. So you simply divide doctet by rrdstep and multiply by 8...

mysql> select dinoct,dinoct/300*8 as "kibt/s" from interfaces where comment regexp "atlas";


Well, I know where to find these 300 seconds but I want to calculate it somehow from the database with sql instead of hardcoding (flexible for scripting).

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2532
    • View Profile
    • NeDi
Re: interfaces table: counter
« Reply #5 on: July 25, 2013, 07:10:49 PM »
I was wondering, if I missunderstood. It's not stored in the DB, but you could leverage Readconf in either perl or php to get $rrdstep...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

dobst

  • Full Member
  • ***
  • Posts: 144
    • View Profile
Re: interfaces table: counter
« Reply #6 on: July 26, 2013, 09:48:15 AM »
No, you got it right. I'll be afraid that reading the nedi.conf would be the only solution. I thought I could calculate the rrdstep exclusevley with sql by a difference of to date stamps. :-P

Conclusion: To calculate data rates just with sql is not possible.