System.Uptime Calculation

Started by maxknight, January 30, 2008, 06:28:22 PM

Previous topic - Next topic

maxknight

Hi,

Based on the value returned by the System.Uptime parameter, I'm trying to work out a "multiplier" to show data in my custom report. The custom report page basically reads data from the SQL DB of NetXMS after calculating the current date and fetching data from the 1st of each month.

What I'm doing is dividing the value using the following formula:

(value on uptime in DB / 60 sec / 60 min / 24 hrs) * 100

Is there a better way to do this calculation so that I can also have the downtime along with uptime for each month? How do we tackle server reboots?

maxknight

Any one who can throw some light on this?

Victor Kirhenshtein

Hello!

If I understand your correctly, you need to calculate percentage of server's uptime (or normal operation) for a month. You can use two approaches:
1) scan collected data of System.Uptime parameter - while it's growing, it means that system is up. Gap in values means that system was down - so you need to calculate the amount of time passed between high and low value. For example, if System.Uptime history looks like this:

...
11:00:00 10000
11:01:00 10060
11:04:00 7
11:05:00 67
...

it means that server was down for about 3 minutes. So you sum all gap intervals, and then calculate uptime percentage using formula gap_interval_sum / total_seconds_in_month * 100 if you measure gap intervals in seconds.

2) Second approach is similar, but you scan event log for SYS_NODE_DOWN and SYS_NODE_UP events, and sum intervals between them. This method is less reliable then first one, because SYS_NODE_DOWN may be generated if, for example, NetXMS server loses connectivity with the server, while server still up and running. It's up to you to decide what should be considered uptime and what - downtime.

Best regards,
Victor

maxknight

Thanks Victor...the first choice worked. I did have to modify the query to read the data for the current month and then apply the formula. It also now gives me the number of reboots done in a month.