VMware Cloud Community
jmedd
Enthusiast
Enthusiast

Update Hardware Status to Clear Battery Charge Warning

After rebooting a host we regularly get a warning that the status of the battery is charging. Annoyingly this also seems to appear at random intervals without a reboot and consequently too many hosts appear with a warning status when all that is wrong with them is that the battery is charging. This does not clear until you navigate onto the Hardware Status tab and run an Update.

I was hoping that it might be possible to do this from PowerCLI so that these warnings can be mass cleared. Any ideas?

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
Tags (2)
0 Kudos
22 Replies
Varunsh
Enthusiast
Enthusiast

It requires your attention, I am sure it exactly refering to array controller battery, If you see such warning that means you need to replace the battery. It will take 72 hours to get fully charged.If it continues to show as failed, you need to replace array controller....before that I would recommend to upgrade your monitring tools management agents as it is appearing for all of your host.

if you are using HP SIM upgrade the PSP to the latest.

0 Kudos
jmedd
Enthusiast
Enthusiast

All Dell 2950s under a year old, don't believe they all need the battery replacing. Latest Dell Management agent for ESXi installed, no errors in logs for battery. The warning for re-charging battery clears as soon as a manual update of Hardware Status is initiated.

I guess there could be underlying hardware issues, but I'm looking for an easy way to clear all these warnings in the meantime.

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
0 Kudos
Varunsh
Enthusiast
Enthusiast

stop the SNMP service it will stop monitoring of server and its hardware or disable Dell management agents on the server...I dont think there is any option with Rcli to stop specific hardware alert.

But dont forget to resolve underlying hardware issue because your server is in pain Smiley Happy

0 Kudos
halr9000
Commander
Commander

Jonathan, when you say "Update", what do you mean? I'm looking at an ESXi box via VIC and I see on Configuration / Health Status two buttons: Reset Sensors, and Refresh.

Reset Sensors corresponds to the API method ResetSystemHealthInfo. Refresh corresponds to RefreshHealthStatusSystem. Which of these "fixes" your problem?



[vExpert|http://www.vmware.com/communities/vexpert/] 2009-2010, PowerShell MVP, PowerCLI forum moderator

Author of the book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

Follow me on Twitter: @halr9000

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
halr9000
Commander
Commander

Code to invoke them both:

$esx = get-vmhost MyHost
$hv = get-view -VIObject $esx
$hss = get-view $hv.ConfigManager.HealthStatusSystem
$hss.ResetSystemHealthInfo()
$hss.RefreshHealthStatusSystem()






[vExpert|http://www.vmware.com/communities/vexpert/] 2009-2010, PowerShell MVP, PowerCLI forum moderator

Author of the book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

Follow me on Twitter: @halr9000

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
jmedd
Enthusiast
Enthusiast

See attached screenshot which shows the Update I mean. Is there a method for 'Update'?

Thanks

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
0 Kudos
halr9000
Commander
Commander

That seems to correspond to the Refresh option if I had to make an educated guess. Just try the code I gave, and run the 2nd to last and last lines at the console and see which one does it for you.
[vExpert|http://www.vmware.com/communities/vexpert/] 2009-2010, PowerShell MVP, PowerCLI forum moderator

Author of the book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

Follow me on Twitter: @halr9000

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
jmedd
Enthusiast
Enthusiast

Thanks for the replies, unfortunately neither of those worked. See attached screenshots which show the tasks they generate:

Reset System Health Sensors

Refresh Hardware Information

The second screenshot shows what you get on the screen when hitting the Update option. I guess its just a question of finding whether that is available from the API?

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
0 Kudos
halr9000
Commander
Commander

Do you see anything in the task pane when you see "refresh hardware information" in the top pane?
[vExpert|http://www.vmware.com/communities/vexpert/] 2009-2010, PowerShell MVP, PowerCLI forum moderator

Author of the book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

Follow me on Twitter: @halr9000

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
jmedd
Enthusiast
Enthusiast

No nothing. You don't get anything in the task pane when using the GUI on the Hardware Status tab - only when using the code you supplied.

I tried using Onyx to record what I was doing, but it didn't capture anything.

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
0 Kudos
halr9000
Commander
Commander

Does anyone else have this Update button? I don't have an ESX box handy, just 'i', so I don't know if that's the difference. But regardless, I don't see anything jumping out to me in the API after having done a little bit of research. I seriously wonder if this isn't some Dell VI plugin or something like that.

[vExpert|http://www.vmware.com/communities/vexpert/] 2009-2010, PowerShell MVP, PowerCLI forum moderator

Author of the book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

Follow me on Twitter: @halr9000

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
LucD
Leadership
Leadership

Yes, there is an Update button in the HW Status tab.

The APIs behind the HW Status tab are not public. And in fact they even use a different port (that's probably why you don't see anything in Onyx).

You can inquire the HW Status via CIM calls with the Get-WSManInstance cmdlet.

See the Monitoring ESX hardware with PowerShell post. But unfortunately this doesn't work anymore since PS v2 CTP3. See What's Up Duck.

A possible solution/bypass is documented in PowerShell, WinRM, and open-WSMan.

For this question it could probably be sufficient to query the CIM_Battery class.

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

jmedd
Enthusiast
Enthusiast

OK, thanks for the replies. I'll see if I can get anywhere with it.

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
0 Kudos
halr9000
Commander
Commander

Thanks for all of that detail Luc, I had not heard that this was broken. I will see if I can't raise some visibility of the slash-prepending as a powershell bug and get it resolved.




[vExpert|http://www.vmware.com/communities/vexpert/] 2009-2010, PowerShell MVP, PowerCLI forum moderator

Author of the book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

Follow me on Twitter: @halr9000

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
halr9000
Commander
Commander

Please vote for this bug: https://connect.microsoft.com/PowerShell/feedback/details/568849/get-wsmaninstance-prepends-username...



[vExpert|http://www.vmware.com/communities/vexpert/] 2009-2010, PowerShell MVP, PowerCLI forum moderator

Author of the book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

Follow me on Twitter: @halr9000

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
LucD
Leadership
Leadership

Done.

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
RvdNieuwendijk
Leadership
Leadership

Done also.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
halr9000
Commander
Commander

Microsoft has admitted to me privately that this is a known bug. I'm trying to get more details.

[vExpert|http://www.vmware.com/communities/vexpert/] 2009-2010, PowerShell MVP, PowerCLI forum moderator

Author of the book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

Follow me on Twitter: @halr9000

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
jmedd
Enthusiast
Enthusiast

Done also.

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
0 Kudos