Home Directory Plugins Operating Systems Windows check_laptop_battery.vbs

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com


Remember Me


0 votes
check_laptop_battery.vbsCheck laptop battery charge remotely using NSClient++ and NRPE

Help Support Ethan Galstad's New Project:

Help Support Ethan

A Message From The Founder...

As the founder of Nagios, I'm asking for your help in a cause that's dear to my heart.

I'm launching a new project to help better the world by providing the information, ideas, and inspiration that I believe can improve the lives of people everywhere.

I know you're busy managing networks, but I would appreciate it if you would consider liking my Facebook page and showing your support for the content and messages I produce by sharing them with your friends and family.

You can learn more about my project by visiting ethangalstad.me/nagios. Thank you for your time. I wish you all the best in your endeavors, whatever they may be.

- Ethan

Check the charge in a laptop battery
Visual Basic script for checking the charge remaining in a laptop battery. Uses WMI.

Written for a Dell laptop, but should work for any Windows-based laptop that returns
a value for the "Win32_Battery -> EstimatedChargeRemaining" WMI object query.

Install as NSClient++ script (excerpt from NSC.ini below):

[External Scripts]
check_battery=cscript.exe //T:30 //NoLogo scriptscheck_laptop_battery.vbs

I call it using NRPE syntax; YMMV:

Command Name: check_nrpe_laptop_battery_status
Command Line: $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_battery

Hard-coded to go to warning at 99% charge remaining, critical at 80%