Get CMOS healthy/status as battery voltage @ x86-64 PC

Hi All

Is possible get CMOS status as battery voltage?
My case, utility power off due maintenance, but my server(x86-64 PC) won't auto-start after utility power on because BIOS configured "Restore AC Power Loss" was lost @ CMOS😅
I assume CMOS out of battery.
Therefore check it in system running is require.

Ubuntu get it possible

Thanks a lot.
 
Is [it] possible [to] get CMOS status as battery voltage?
And then? Do you actually have a (i. e. the appropriate) data sheet telling you “SuperDuperClock 3000™ does not work if voltage < 2.345 V”? – I don’t. Hence knowing the voltage is of limited use.​
I assume CMOS out of battery.
The MSB of the NVRAM’s status register D (RTCSD_PWR in /usr/src/sys/isa/rtc.h) is essentially a “battery condition” flag. Unset flag ⇒ battery dead.

If I’m interpreting /usr/src/sys/x86/isa/atrtc.c correctly, in case of a dead battery any atrtc(4) clock_gettime(2) should printf(9) “WARNING: Battery failure indication” and the machdep.atrtc_power_lost sysctl(8) becomes true (1).​
 
On servers with BMC the VBAT may be displayed in the web interface..

It may be possible with sysutils/ipmitool too.
 
And then? Do you actually have a (i. e. the appropriate) data sheet telling you “SuperDuperClock 3000™ does not work if voltage < 2.345 V”? – I don’t. Hence knowing the voltage is of limited use.
The MSB of the NVRAM’s status register D (RTCSD_PWR in /usr/src/sys/isa/rtc.h) is essentially a “battery condition” flag. Unset flag ⇒ battery dead.

If I’m interpreting /usr/src/sys/x86/isa/atrtc.c correctly, in case of a dead battery any atrtc(4) clock_gettime(2) should print(9) “WARNING: Battery failure indication” and the machdep.atrtc_power_lost sysctl(8) becomes true (1).​
Thanks you, I got.🤝
I hope to know any clues that battery is will empty.

I executed sysctl machdep.atrtc_power_lost and return 0.
And I read "RTC lost power on last power cycle (probably caused by an empty cmos battery)"
In fact, my family help me to power-on remote server manual and boot normally (was no mention of issue about CMOS like checksum error)
Based on both result, I cannot confirm if the battery is really empty.😅
 
Since I store most of my old, but working hardware - "you never know, if there come the day, you may have a use for it" - I made the experience of empty CMOS batteries a few times.

As long as your time and date are not set to weird values again everytime you repower your machine, the battery is OK.
If not it's just annoying, but it ain't no serious issue. Set time and date correctly everytime by hand when you repower your machine, until you replace the battery - if the machine really is continued to be actually used in that case.

It depends on a whole bunch of factors, but those batteries are meant for the computer's lifetime, and normally last at least app. ~fifteen to twenty years.
It's a rare situation the CMOS battery becomes depleted on a machine still in use. If so, just replace it, and you're good to go for another fifteen to twenty years.
The battery is either OK, or NOK. There is no need for the operating system to control its voltage.
IMO such things come from people I call "conky-watchers". You know, those who install conky to continously watch: "My disk is at 11.34% capacity. 14.7% RAM used, swap empty. All eight CPU cores at 2.400 MHz@43°C...🥸" - but missing: conky itself uses more CPU time than everything else together...😂

However:
There are two tests to figure out for sure, if the battery is depleted:
1. Take your multimeter and measure its voltage.
2. After you set the machine's time and date (BIOS setting was enough), power it off. Make it completely powerfree. Since power supply units still powering some parts of a main board while the machine is 'officially' switched off, you need to pull the power chord. (Then hit the power on button. On many boards are LED signalling several things; they all need to be dark.) Or even better (carefully!) pull the main boards power connector. Wait for a couple of minutes (some capacitors may have some charge left.)
Then power your machine on again.
If the time is still correct, the battery is OK.
If time and date are resetted to some weird, ancient date like 00:01am 1.1.1970, or such, the battery is dead.

There are two workarounds:
1. If the battery is not soldered to the board, simply replace it by a new one anyway, so, you don't need to care about it anymore.
Of course, you could also replace a soldered battery, but since I neither know your soldering skills, nor your equipment I will not recommend that. (Never ever get even near some electronics with a soldering gun or some plumber's soldering iron!)
Get the exact fitting battery cell (All you need to know is written on it. The internet helps you on finding a suitable replacement [size and nominal voltage must fit; rest doesn't matter.]) Cost 1..2 bucks.
2. Don't care about it at all.
If I read correctly, it's a server, right? So, it runs 24/7 anyway, right? The battery is only needed to keep CMOS settings (time, date, and other things) while the main board is powerless. As long as the machine is powered, time and date are kept. And I bet you're going to use ntpd to set system's time automatically via net, anyway, right?
So, why bother?
 
If I read correctly, it's a server, right? So, it runs 24/7 anyway, right? The battery is only needed to keep CMOS settings (time, date, and other things) while the main board is powerless. As long as the machine is powered, time and date are kept. And I bet you're going to use ntpd to set system's time automatically via net, anyway, right?
So, why bother?
I will replace CMOS battery🐱

Yes, my server runs 24/7 and use ntpd to set system's time automatically via net.
But need keep CMOS settings still because setting of "Restore AC Power Loss" = "OFF" default, server won't power-up automatically when the utility power is restored.😹

Thanks you a lot.
 
Back
Top