Navigation:  Remote Monitoring and Management > Proactive Monitoring > Windows Server and Workstation Monitoring > 24x7 Checks > Script Check > Default Script Checks > Virtualisation >

VMware ESXi Virtual Machine Power State

Previous pageReturn to chapter overviewNext page

 

Script Type: PowerShell

 

This script queries the ESXi server, returning various health indicators from the selected Virtual Machine.

 

When configuring the Check, in addition to the Host, Username, Password and Script timeout, the guest's Virtual Machine Name must also be entered. This field is not case sensitive and the * wildcard can be entered when specifying the machine name.

 

The script will only fail when the Virtual Machine is unreachable or the guest Operating System powered down, there is no threshold configuration.

 

Virtual Machine

RAM Usage

Network Usage

Network Usage

Disk Space Usage

 

This is then displayed in the More Information... section of the Script Check:

 

 

clip0826clip0823

 

 

Notes

Only one virtual machine may be selected per-check.

 

As the Check performs an intensive scan of the selected Virtual Machine this may impact upon the performance of the device running the scan. As such where a number of Virtual Machines are to be queried, we would suggest spreading the load by running Checks from multiple Agents, not just one.

 

Requirements

Our VMware ESXi scripts are supported on ESXi 6.5 or earlier.

 

The script uses the VMware CIM / SMASH API including the WSMAN library which is not supported on XP, 2003 or earlier Operating systems.

 

In addition to this, Microsoft .Net 3.5 (or higher), PowerCLI and PowerShell 2.0 (or later) must be installed on the device the scripts will be executed from.

 

Additionally for PowerShell scripts Microsoft .Net 3.5 (or higher), PowerCLI and PowerShell 2.0 (or later) must be installed on the device the scripts will be executed from.

Please note: PowerCLI is supported up to version 6.0. Later versions of PowerCLI (from 6.3) are currently unsupported and may results in unexpected results when running Checks.

 

We suggest running this script from machines running Agent 8.16.1RC or later.

 

PowerShell: the use of $ and other special characters in the password

Consideration must be given when passing passwords that contain special characters through PowerShell to ensure they are handled as literal strings.

 

For example if the password contains a dollar sign ($) it must either be preceded by a grave accent ` (also known as a backtick: ASCII code 96 - Alt+96) or the password encapsulated in single ' ' to pass the password to PowerShell exactly as entered.

 

Password Example

String

Result

pas$word

pas

pas`word

pas$word

'pas$word'

pas$word

 

Where the password contains a special character (in this example dollar sign) but no preceding grave accent, or is not encapsulated in single quotes, the message Failed to connect – Credentials invalid is returned.

 

Note: some PowerShell special characters are themselves constructed using a grave accent so should be encapsulated in single quotes when passed via the Script and these are covered in the Microsoft Technet article: about_Special_Characters

 

Further information on Escape_Characters and Quoting_Rules is available from Microsoft's Technet

 

Please be aware that we are not responsible for the content of external sites.