opserver / Opserver

Stack Exchange's Monitoring System
https://opserver.github.io/Opserver/
MIT License
4.51k stars 827 forks source link

CPU graph not showing for some servers #264

Closed HBollah closed 6 years ago

HBollah commented 7 years ago

Now that I have Opserver up and running and have a few servers being monitored on the SQL side, of the 30 odd servers that I'm monitoring about 5 of these are displaying the CPU usage for the past hour, but the rest isn't showing anything.

Is there something that needs to be enabled on these servers?

Thanks.

NickCraver commented 6 years ago

@HBollah is this still occurring in latest?

SQLSourcerer commented 6 years ago

@HBollah is it possible that some of your servers are set to GMT, while others are on local time? The ring buffer it polls from has 256 data points, one per minute. So if you're on local time, but within 256 minutes of GMT, you might see at least some sparkline. It would be the wrong hour, but that's not so obvious from the frontend. But if there's no overlap between the server's time and the last hour of GMT, you'll get nothing.

If you look at the source code in GraphController.Spark.cs, the function SQLCPUSpark, it's filtering the ResourceHistory data by EventTime. It looks for events in the last hour based on UTC time. If you're too far off from UTC and your server is in local time, no events will make it through the where function. Also, the SparkSVG function in the same file bases its nowEpoch on UtcNow. If the "now" time were taken to be the time of the last event in the ring buffer, it would not be sensitive to the server's time zone.

NickCraver commented 6 years ago

No info to go on here - happy to answers questions but cleaning up issues with no info to go on or updates.