Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, January 14, 2019 1:48 PM
Dear
Does anyone know if it is possible to reset these windows UP Time counters without having to restart the servers.
All replies (19)
Monday, January 14, 2019 3:01 PM
I doubt that it is possible, but which "these windows UP Time counters" are you referring to? What is the real problem that you are trying to solve?
Monday, January 14, 2019 3:04 PM
Hi Alex.
Are you talking about Windows Performance Counters or the uptime value reported by Windows Task Manager? In this case, the discrepancy is due to the Fast Startup mode, which is enabled by default in Windows 10: read here to know more about that.
Bye.
Luigi Bruno
MCP, MOS, MTA, MCTS, MCSA, MCSE
Monday, January 14, 2019 4:02 PM
moto
The real problem I'm having.
I have an application that collects UP Time data from the machine but this data corrupts after a power failure and when the machine is reconnected, that data is no longer collected.
So my question is if I can accomplish this reset
So when I reboot the UP Time machine, it returns to normalized.
Monday, January 14, 2019 4:19 PM
Luigi
It would be in the Task Manager because I have an application that collects CPU data but after a power outage and it goes back on I can no longer collect this data from system up time as if the data was corrupted and when I restart it machine that data returns to its normalized
Monday, January 14, 2019 4:25 PM
I don't know of any way to do that. The link that Luigi provided appears to be your best bet.
From what I see, the real problem is that your servers are crashing due to a power failure. Correct uptime should be the least of your worries. Corrupted databases/files and hardware failures as a result of an uncontrolled shutdown might be much bigger problems.
I would recommend that you purchase a UPS system that shuts down your servers when you lose power.
Monday, January 14, 2019 5:14 PM
moto
Actually I work with monitoring and this behavior is on a client.
The client is using the System Center to manage their servers and together they have installed the Windows Firewall Configuratios provider on the servers and this application (Windows Firewall Configuratios provider) to be uninstalled this problem with UP Time does not happen.
Monday, January 14, 2019 6:02 PM
Sorry, I have no experience with that software or how it determines system uptime.
I suggest that you ask how uptime is calculated in a System Center forum.
One alternative is to use WMI and Powershell to check uptime.
$names =@('my-pc','localhost') # or use get-content to read the names from a file
$names | foreach {
$os = Get-WmiObject Win32_OperatingSystem -ComputerName $_
"$_ $($os.LastBootUpTime)"
}
.
Monday, January 14, 2019 6:07 PM
I have an application that collects CPU data but after a power outage and it goes back on I can no longer collect this data from system up time
It might help if you shared the WMI query that you are making, the error you are getting, and the data returned on the call.
Monday, January 14, 2019 8:11 PM
Unfortunately we don't have access to the code. As this is a third-party program, the error message probably won't be of any help.
About Luigi's answer, would be really helpful if you could explain a bit more detailed about how a power off changes the Windows startup behavior - resulting in the UP Time getting corrupted.
Thanks in advance.
Monday, January 14, 2019 9:48 PM
Its not corrupted, it's not calculated correctly. Here is the first paragraph.
Task Manager’s Performance tab (CPU section) shows the Up time information of the system, but you may be wondering why your boot up time doesn’t match the Up time data reported.
This is because Task Manager or WMI wouldn’t deduct the sleep/hibernation time when calculating up time, and with Fast Startup introduced and enabled by default in Windows 8 (and higher), the Up time reported may not match with your actual last boot up time.
Fast startup is a hybrid of cold startup + hibernate; when you shutdown the computer with fast startup enabled, the user accounts are logged off completely. Then the system goes to hibernate mode (instead of traditional cold shutdown), so that the next boot up till the logon screen will be quicker (30-70 % faster). If you have old hardware you may not see much difference in startup times.
Monday, January 14, 2019 9:56 PM
Unfortunately we don't have access to the code.
Does the documentation explain how it is calculating uptime? Or what performance counter/WMI call it is using? Have you contacted the software vendor's support?
resulting in the UP Time getting corrupted.
What exactly do you mean by "getting corrupted"? Perhaps if you share a screen snapshot like this we could see the corruption.
Tuesday, January 15, 2019 3:34 PM
they have installed the Windows Firewall Configuratios provider on the servers and this application (Windows Firewall Configuratios provider) to be uninstalled this problem with UP Time does not happen.
Turn on firewall logging and see if a bad configuration is being applied and blocking traffic from your monitoring server. http://techibee.com/windows-2008/enable-windows-firewall-logging-in-windows-7-and-windows-2008-r2/606
Log dropped packets and make sure that you enable it for domain/private/public.
Tuesday, January 15, 2019 6:17 PM
Moto
Sorry the delay was at a meeting this morning.
When you say active the Firewall log would be on my monitoring server right?
This Windows Firewall Configuratios provider is managed by a third party will I have the lock log on my monitoring server?
Tuesday, January 15, 2019 6:26 PM
No, it would be on the machine that has the "corrupted uptime".
That is based on my interpretation of your comment to mean that: we have a machine that is reporting corrupted uptime, and to fix it we have to reboot, but if we uninstall the Windows firewall configuration provider from that machine it starts reporting correct uptime andwe do not have to reboot.
Did I read that correctly?
Tuesday, January 15, 2019 6:35 PM
One alternative is to use WMI and Powershell to check uptime.
$names =@('my-pc','localhost') # or use get-content to read the names from a file $names | foreach { $os = Get-WmiObject Win32_OperatingSystem -ComputerName $_ "$_ $($os.LastBootUpTime)" }
.
Have run this against a machine that is reporting "corrupt uptime"?
Tuesday, January 15, 2019 6:39 PM
Moto
This is a log that I have in the tool that shows where I can not collect the data.
Jan 15 16:27:09:182 [2456] cdm: ntgetuptime: Unable to get the 'System Up Time' counter of the 'System' performance object
Jan 15 16:27:09:447 [2456] cdm: perfTakeSample (remember=0)
Jan 15 16:27:09:447 [2456] cdm: perfTakeSample (object=Global)
Jan 15 16:27:09:463 [2456] cdm: perfGetValue (object=System, counter=System Up Time, instance=)
I do not think it's blocking Firewall because restarting the server the problem happens.
Tuesday, January 15, 2019 6:44 PM
Moto
Sorry
Its interpretation was correct because yesterday we did more tests and this situation was ruled out.
We uninstalled the Windows firewall configuration provider and when running power off on the machine the problem still happened.
Tuesday, January 15, 2019 7:31 PM
Run this from an admin command prompt.
wmic path Win32_PerfRawData_PerfOS_System get * /format:list
That should match perfmon.
Or just look at a few counters.
C:\wmic path Win32_PerfRawData_PerfOS_System get processes,systemuptime /format:list
Processes=239
SystemUpTime=131919453602179700
Then use the /node switch to point it a machine that is reporting correctly, and one that has a "corrupted uptime". wmic /node:localhost path Win32_PerfRawData_PerfOS_System get processes,systemuptime /format:list
https://docs.microsoft.com/en-us/previous-versions/aa394272(v%3dvs.85)
SystemUpTime
Data type: uint64
Access type: Read-only
Qualifiers: CookingType ("PERF_ELAPSED_TIME") , Counter ("SystemUpTime") , PerfTimeStamp ("Timestamp_Object") , PerfTimeFreq ("Frequency_Object")
Elapsed time, in seconds, that the computer has been running after it was last started. This property displays the difference between the start time and the current time.
I have noticed that the systemuptime value returned from WMIC does not change. It must be used with the current system time to calculate the number of seconds, but I do not know what format the data is in.
In any event, it is a read only value, so there's not a lot we can do about it if the value is wrong. It will be interesting to see what's in there on a "corrupted machine".
Tuesday, January 15, 2019 8:22 PM
moto
Thank you this information was very helpful
I threading the command on both machines and both have values in SystemUpTime. I am sending this evidence to the Developer tracking tool for them to analyze the reason for the behavior.