when off peak starts after midnight, wrong buckets

Utility to monitor network throughput on devices supporting SNMP such as the Vigor 2600, Billion 7402 & Cisco 2600.
govogy
New User
Posts: 9
Joined: Wed Jul 02, 2008 8:09 am

when off peak starts after midnight, wrong buckets

Post by govogy »

Hi again,

My off-peak hours are 1am - 7am, and when I use the settings below, usage at 8pm ends up in the off-peak bucket. I guess I could use peak start = 1 and offpeak start = 7 and mentally switcheroo... That will get confusing after not too long though :lol:

<entry name=\"Peak Start Hour\">7</entry> <!--Hour when your ISP's peak time kicks in. -1 to disable peak time support-->
<entry name=\"Offpeak Start Hour\">1</entry> <!--Hour when your ISP's offpeak time kicks in. (0 = 24 = midnight)-->


Have a good one
User avatar
phil
Site Admin
Posts: 7611
Joined: Sun Apr 06, 2003 11:12 pm

Post by phil »

Hi, I will take a look at this too... I suspect that because up till now the offpeak start has always been after (later) than the onpeak start there os probably something in the code that does not like it the other way round.

I will have a look when I get back... maybe sometime this weekend but I cant promise anything immediatly because I have got some other things happening this weekend.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
govogy
New User
Posts: 9
Joined: Wed Jul 02, 2008 8:09 am

Post by govogy »

Thanks for that; my ISP is a bit mean to start offpeak so late.

Have a good weekend!
User avatar
phil
Site Admin
Posts: 7611
Joined: Sun Apr 06, 2003 11:12 pm

Post by phil »

Hi Govogy,

I've got a new version for you to try - it should work with your off peak hours (I hope). If you don't mind, I'd like you to check before I release it properly just in case I've missed something.

I've attached it to this post. Just extract over the top of your current version (it will replaces 2 files).

Sorry its taken so long, let me know how you get on.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
govogy
New User
Posts: 9
Joined: Wed Jul 02, 2008 8:09 am

Post by govogy »

Hi Phil, many thanks for that. It doesn't seem to have quite done the trick though. I will upload today's report.

The peak hours i've selected are 7am to 1am. The hourly report shows the peak colour scheme on hours 1 through 7 inclusive, and the rest as off-peak. The second issue is that the hourly totals don't seem to be categorized into buckets the for the daily totals, they all end up in offpeak.


I think something like the following would do the trick to work out if a particular hour is peak. That VB is derived from the attached spreadsheet. I think you are C#(?) so I'm sure you'll be able to tell what is going on.

Code: Select all

function isPeak (t as Date, peakStart as Integer, offPeakStart as Integer) as boolean
   dim adjustedStartHour as Integer = peakStart - t.hour
   dim adjustedOtherStartHour as Integer = offPeakStart - t.hour
   if adjustedStartHour <= 0 then adjustedStartHour += 24
   if adjustedOtherStartHour <= 0 then adjustedOtherStartHour += 24
   return adjustedStartHour > adjustedOtherStartHour 
end function
I cleared out my Device1.xml. Is there anything else I should be doing if I make config changes?

Thanks for getting back to me. I think your program will be useful for others on the same ISP as me who often complain about quota issues.

Ah the weekend again :D
You do not have the required permissions to view the files attached to this post.
govogy
New User
Posts: 9
Joined: Wed Jul 02, 2008 8:09 am

Post by govogy »

Brilliant, thanks for 2.6 Beta 2

Sorry for the previous post. I took so long over it, that I missed the updated file. Haha

The daily total now looks good, as well as the raw data in Device_1.xml. I will clear everything and run for a day or 2 to make sure.

The only thing that's not quite right is the way the shading is applied to to each hour on the daily report. hours 1-7 are shaded peak colours (yellow) when it should be 1-6 in off-peak colours.

Just in time for my quota rollover, thank you!
User avatar
phil
Site Admin
Posts: 7611
Joined: Sun Apr 06, 2003 11:12 pm

Post by phil »

OK, I'll take a look at the colours tomorrow or Sunday.
I am running an off-line test on my router with peak set to 8am till 1am so I should be able to figure out any more problems.

OK, I just took another look and it seems that my test is also wrong (with the off-peak coloured as peak and visa-versa)...
Now the question is, are the raw stats good and is it just a html generation problem.. :)

I will look into it.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
User avatar
phil
Site Admin
Posts: 7611
Joined: Sun Apr 06, 2003 11:12 pm

Post by phil »

Ooops :oops:

I think I found the problem. Its not in the raw stats, and its fine on all graphs except the hourly one :)

Try 2.6.3 (attached) and let me know :?:

Thanks,
Phil


EDIT: thanks for the VB example - yes SNMPTP is C# but its always good to see another perspective. That's not at all like how I've done it (but probably makes it a lot easier) lol...
Anyway, let me know how you get on with B3 - if that doesn't work maybe I'll borrow your example :)
Last edited by phil on Sat Aug 02, 2008 4:13 pm, edited 1 time in total.
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
User avatar
phil
Site Admin
Posts: 7611
Joined: Sun Apr 06, 2003 11:12 pm

Post by phil »

Scrap that.

There is something wrong, looking at my test system right now (1:55am) its registering as peak still.

This will take a little more investigation so I can't do it right now (a little too much alkywhole in my system).

I'll post again when I think Ive fixed it properly - and this time I might test it a little more :)

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
User avatar
phil
Site Admin
Posts: 7611
Joined: Sun Apr 06, 2003 11:12 pm

Post by phil »

OK, Here is v2.6.5 beta

It not only supports your off-peak times properly (and I've tested it for a while this time) but it has some nice new features.

You can now tell SNMPTP your usage allowance (cap) for peak / off-peak (or a combined value) and it will display remaining usage in the summary page and percent of allowance used in the billing page.

You can also set SNMPTP to send email notifications and warnings when certain configurable limits are reached (e.g.. percentage of remaining allowance falls below a specified value (or values)).

I've included all the files in the archive so be careful not to overwrite your exiting configuration XML file.

If you want to use the new features, you can find the XML configuration items in the example configuration XML.

Please let me know how you get on with this one :)

Thanks,
Phil
You do not have the required permissions to view the files attached to this post.
Last edited by phil on Tue Aug 05, 2008 3:33 am, edited 1 time in total.
Reason: Updated attachement to 2.6.6b
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
govogy
New User
Posts: 9
Joined: Wed Jul 02, 2008 8:09 am

Re: when off peak starts after midnight, wrong buckets

Post by govogy »

This is excellent, thanks Phil!

All looks perfect. :cheers:

I haven't tried the emailing support. Does it take the port number in the SMTP Mail Server entry? eg.

<entry name="SMTP Mail Server">smtp.googlemail.com:587</entry> <!-- The SMTP Email server address -->

Being able to specify that the quota only applies to inward traffic is great.

I got SNMPThroughput service-ified in a few easy steps. Using instsvc and srvany from an ancient windows resource kit (not sure if it will work on Vista). http://www.tacktech.com/display.cfm?ttid=197 had the clearest explanation I found with the required tools for download.

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

Re: when off peak starts after midnight, wrong buckets

Post by phil »

I haven't added the option to include the mail server port yet - typically I didn't think it would be that important lol. It also doesn't support SMTP authentication yet.
I will do so in the next beta, or at least before I release 2.7 final.

At least now it seems to be working.
As for service-ified, yes, I use Fire daemon but to be quite honest that is not working very well.. SvrAny is MS's rather reg edit dependant version is it not?

The advantage of FireDaemon (I'm not sure about svrany) is that it will restart the app if for any reason it stops running. I also have my own very basic version of this sort of app which will run the app as a service, monitor it and restart it if needed but its very basic (although I did get it working with Vista is some cases lol)

Out of interest, what ISP are you with that has off-peak as 1am-7am? I've just noticed that my ISP is operating similar off-peak times on their new ADSL2 service and I'm not looking forward to that lol.


Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
User avatar
phil
Site Admin
Posts: 7611
Joined: Sun Apr 06, 2003 11:12 pm

Re: when off peak starts after midnight, wrong buckets

Post by phil »

OK, as promised, this one supports setting the SMTP port and authentication.
I hope this is the last version before I release 2.7 :)

Thanks,
Phil
You do not have the required permissions to view the files attached to this post.
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
govogy
New User
Posts: 9
Joined: Wed Jul 02, 2008 8:09 am

Re: when off peak starts after midnight, wrong buckets

Post by govogy »

My ISP is TPG in Australia. Popular because of cheap plans. One or two annoyances , but overall they've been pretty good for me. A perennial complaint people have is with the usage accounting; the rude shock of getting shaped unexpectedly.

Yes, srvany involves a bit of regedit. All pretty straightforward though (... oops, oh dear, there goes HKEY_LOCAL_MACHINE, will that be a problem?) :lol:
User avatar
phil
Site Admin
Posts: 7611
Joined: Sun Apr 06, 2003 11:12 pm

Re: when off peak starts after midnight, wrong buckets

Post by phil »

Yes I know what you mean. Caps and shapping seem to be pretty hated here too. My current ISP isnt too bad but Im on an office package which makes it a bit expensive but I get 8am-8pm peak time and offpeak all weekends! But their new ADSL2 plans (I'm still ADSL1 as is most of the UK) are going 1am-7am off peak (inc. weekends).

I'm now looking to switch to a new ADSL2+ ISP for unlimited/unshapped usage - and it actually costs less ?!!! There must be a catch - but they have a good rep for a high quality network too :o
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
Post Reply