Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate interval between items in list box?

Hi, guys!

I have such case: There are some routers which can be in different statuses: "Up", "Down", and random status which can describe the current state of a router. When router changes its status, the status record creates in the table. It containes timestamp and status message. I need to culculate the total time when router was offline during the reporting period. That means that I need to miss all status messages between "Up" and "Down" from the table and calculate the interval of time between each pair of Up and Down status messages then get the sum of it.

I need some help, I'm fighting with it all this day, but worthless.

Thanks in advance!

2 Replies
Not applicable
Author

look at this example:

- load only up or down states

+ make a loop each router

and of course sort by time (i hope the states goes up dopw up down.... each router? (after deleting random))

function previous() could be helpfull for you (becouse i recomend calculating time inside the loading script)

Not applicable
Author

That works correctly but I need to calculate the offline time for several routers. What should I do then? As I see it, I need to create the loop for each router. Am I right?