Keeping data for dynamic queue

I have a mikrotik router and all is well with me but have a burning problem. I loose traffic data for dynamic queue (it restarts counter every morning). I can view data for static queue but not dynamic. pliz check out this link of all interfaces and help me. http://gw.hotgossip.co.ke:8181/graphs . I appreciate any help. Am using winbox for most of my operations, bandwith alocation and so on but only have this problem.

The dynamic queues will not save because they are just that.. “dynamic”

If you had a permanent user you wanted to monitor, you could just create a queue for their specific IP address, otherwise you could generate a queue for each IP address in your range (if that is feasible for your setup)

What if the clients who are connected to my servers get ips dynamically through DHCP, could i use there mac addresses so that i can keep the data? Thank you for your help.

This is a bit of a half-assed way of doing it but you could do the following:

Create a simple queue for each IP address you wish to monitor, then assign static dhcp leases to those clients you’re trying to keep track of.

Or

If the client’s you want to monitor change often, then just set the DHCP lease to remain for 7days or 14days (this depends again thou on how many people you have using the hotspot) as this will lock the user to a single IP unless they don’t use for more than 1 week or 2 weeks.

Your advice has greatly helped me. Most of my client (devices) router and access points have ips in 172.16.2.x range so all i have to do is create a queue for this ips so that i can be able to get their graphs. Whatever they do after isnt my concern (they get dhcp’s from devices) which am happy about :slight_smile:. Since i already created the queue for each device (in 172.x.x.x), Why do i still loose the data? What solution would you advice me to follow? am using mikrotik router and cacti for this very purpose. Thank you so much for your time.

Hi, have a script i found out and would like to have your coments on it to keep data for my dynamic queues. Also check out http://human.network.web.id/2008/02/16/a-working-dynamic-bandwidth-script/

code (can make any corrections).

![/queue simple get $i disabled]) && (![/queue simple get $i dynamic]) && ([:find [/queue simple get $i name] $KeyString] = 0) ) do={ #if it is a queue with traffic info (points) :if ([:find [/queue simple get $i name] $TrafficKeyString] >= 0) do={ #read trafficinfo from Queuename in KB :set OldPoints ([:pick [/queue simple get $i name] ([:find [/queue simple get $i name] $TrafficKeyString] + 2) [:len [/queue simple get $i name]]]); #read new traffic from :set Traffic ([/queue simple get $i total-bytes] / 1024) #reset traffic /queue simple reset-counters [/queue simple get $i name] :set NewPoints ($OldPoints-$DecreasePerStep+$Traffic); :if ($NewPoints < 0) do={:set NewPoints 0;} :set NewSpeedDown $MaxSpeedDown; :set NewSpeedUp $MaxSpeedUp; #if to much traffic then decrease speed :if ($NewPoints > $TrafficBurst * 1024) do={ :if ($SlowDownVolume < 1) do={:set SlowDownVolume 1;} #little bit math, linear slowdown if traffic over traffic burst :set SpeedMultiplier (10000 - ((($NewPoints - ($TrafficBurst * 1024

:smiley: Thanks alot omega-00. I have been able to graph my clients by doing exactly wat u asked me (create static dhcp leases). I can now keep there traffic and all thanks to you.

I was wondering if it would be possible to graph routers that dont support snmp in anyway? I have a client for example who has a router and distributes links to his clients but would like to get total traffic from router. Is it possible?

Thanks again