Octets to kbps?

My LCD Smartie Plugins
Post Reply
sandoval
New User
Posts: 6
Joined: Sat Nov 11, 2006 5:21 pm

Octets to kbps?

Post by sandoval » Sat Nov 11, 2006 5:24 pm

Hi,

Your plugin works great! Nice job well done!

I have a wrt54g, 1.3.6.1.2.1.2.2.1.10.8 gets me the number of octets on Wan side. How can I convert this to kbps??

User avatar
phil
Site Admin
Posts: 5197
Joined: Sun Apr 06, 2003 11:12 pm

Post by phil » Sun Nov 12, 2006 7:19 pm

As far as I am aware (and as Google has helped me find out), an Octet is a byte.

\"Octets are units of 8 bits (also know as bytes).\"

So 1 octet = 1 byte, therefore the conversion is pretty straight forward :)
Octets = Bytes, therefore multiply by 8 to get bits. Then divide by 1000 (Kbit or 1024 KiB. I think normally we use 1024 for data coms?)

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

sandoval
New User
Posts: 6
Joined: Sat Nov 11, 2006 5:21 pm

Post by sandoval » Sun Nov 12, 2006 7:24 pm

Hello Phil,

How it should be:

1e in 4114816394 | out 1416674403
2e in 4120532506 | out 1419886543

Math calculation:

4120532506 - 4114816394 = 5716112
5716112 * 8 = 45728896
45728896 / 1000 = 45728
45728 / 60 = 762kbps

But the problem is that using the DLL in Smartie is that you can't get 2 readings, so you can't do the math!

User avatar
phil
Site Admin
Posts: 5197
Joined: Sun Apr 06, 2003 11:12 pm

Post by phil » Sun Nov 12, 2006 7:38 pm

You should be able to get two readings in one query....
and you should be able to do the maths - let me try and describe it...

Bear with me because its been a while since I actually did this :)

a) Use function 10 to multiply the result of a) by 0.000133333 (which is 8/1000/60)

b) Use function 9 to subtract two values...
Value 1 = Use funciton 1 with OID of 1e
Value 2 = Use function 1 with OID of 2e

Giving something like:
$dll(NetStuffPlugin.dll,10,$dll(NetStuffPlugin.dll,9,$dll(NetStuffPlugin.dll,1,ipaddress:public,oid-1e),$dll(NetStuffPlugin.dll,1,ipaddress:public,oid-2e)),0.000133333)

I think thats right...
Let me know how you get on :)

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

sandoval
New User
Posts: 6
Joined: Sat Nov 11, 2006 5:21 pm

Post by sandoval » Sun Nov 12, 2006 7:50 pm

Hi,

Yes, that would be a solution if the points would be 1 second appart.

But that is the problem, the time var is not correct:

$dll(NetStuffPlugin.dll,10,$dll(NetStuffPlugin.dll,9,$dll(NetStuffPlugin.dll,1,192.168.200.1:public,1.3.6.1.2.1.2.2.1.10.8),$dll(NetStuffPlugin.dll,1,192.168.200.1:public,1.3.6.1.2.1.2.2.1.10.8)),0.000133333)
=
-26666600

User avatar
phil
Site Admin
Posts: 5197
Joined: Sun Apr 06, 2003 11:12 pm

Post by phil » Sun Nov 12, 2006 7:53 pm

Ah I see your problem...
Not sure how to handle this one... Either it will be a change to the plugin to remember the last value... or some other method will be required...

I'll have a think and get back to you.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

sandoval
New User
Posts: 6
Joined: Sat Nov 11, 2006 5:21 pm

Post by sandoval » Sun Nov 12, 2006 7:58 pm

Thank you for your input so far!

I really really love this plugin, really nice job! I'm still having lots of fun with it, great way of monitoring your network if you can see router stats on your mediacenter LCD!

User avatar
phil
Site Admin
Posts: 5197
Joined: Sun Apr 06, 2003 11:12 pm

Post by phil » Sun Nov 12, 2006 9:22 pm

Ive just made a new version for you to try.

It has 2 new funcitions, the important one, is funciton 12.
It takes the same parameters as function 1 but it basically gets the difference between the current value, and the value last time the funciton was called.

And returns the result extrapolated over 1 second.

So it should, if my theory works, return bytes per second for the SNMP OID counter.

Does that make sence?
Download the new NetStuffPlugin.rar from my website (same name but it should have todays date on the files)

Let me know if it works.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

sandoval
New User
Posts: 6
Joined: Sat Nov 11, 2006 5:21 pm

Post by sandoval » Sun Nov 12, 2006 9:50 pm

It works like a charm!

$dll(NetStuffPlugin.dll,11,$dll(NetStuffPlugin.dll,12,192.168.200.1:public,1.3.6.1.2.1.2.2.1.10.8),1000)

Result is 876,4823 that is close to my maximum download speed, so it should be right I think.

If you need a tester, please mail me. I'm willing to help..

Keep up the good work.
Last edited by sandoval on Sun Nov 26, 2006 2:29 pm, edited 1 time in total.

User avatar
phil
Site Admin
Posts: 5197
Joined: Sun Apr 06, 2003 11:12 pm

Post by phil » Sun Nov 12, 2006 9:54 pm

Great :)
Let me know if there is anything else I can add.

I'll try and remember to let you know if I make any changed, but generally the plugin is fairly stable (I hope) - this is the first change I have made to it .

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-6600k, Asus 170-A, 16GB DDR4,
nVidia GeForce GTX 970, 2xEvo 850 (RAID 0), 2x2TB WD Black (RAID1)

sandoval
New User
Posts: 6
Joined: Sat Nov 11, 2006 5:21 pm

Post by sandoval » Sun Nov 26, 2006 2:25 pm

Hi me again,

You might want to update your download page, it still links to your old download file!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest