Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. System.Uptime Calculation

System.Uptime Calculation

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 19.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    M
    maxknight
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • M
      M
      maxknight
      wrote on last edited by
      #2

      Any one who can throw some light on this?

      1 Reply Last reply
      0
      • V
        V
        Victor Kirhenshtein
        wrote on last edited by
        #3

        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.

        1. 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

        1 Reply Last reply
        0
        • M
          M
          maxknight
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          Powered by NodeBB Contributors
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups