Internal Monitoring Agent
The agent is installed in a VM instance and regularly pushes the VM monitoring data to
the specified host through the internal network.
Note:

- Before you can view the monitoring data of a VM instance, install an agent first.
- Internal monitoring relies on the DHCP and User Data services of the l3 network. To install and use the agent successfully, enable the DHCP and User Data services of the VM instance first.
Installation Method
The agent is included in the performance optimization tool (GuestTools). The
installation method varies according to the operating systems installed by the VM
instance.
-
Linux VM instances
UI-based installation- Install the GuestTools on the details page of the VM instance.
- Launch the VM console and run the following command:
/bin/bash -c "$(curl -s -S http://169.254.169.254/vm-tools.sh)"
Figure 1. Install Agent
Note:
- In the command above, 169.254.169.254 is the IP address of the User Data server.
- Before you install or upgrade an agent, make sure that you installed the corresponding Linux command tools, such as tar, wget, and curl.
- The agent can be upgraded automatically,
User Data-based installation- Perform System Configurations when you create a VM instance.
- In the User Data input box, enter the
following
information:
#cloud-config runcmd: - /bin/bash -c "$(curl -s http://169.254.169.254/cloud-tools.sh)"
Note: Before you inject User Data into Linux-based VM instances, install cloud-init on the VM image first.
-
Windows/Windows VirtIO-bassed VM instances
- Install the GuestTools on the details page of the VM instance.
- Launch the VM console and install GuestTools as prompted.
Installation Requirements
Supported Operating System | Supported Version |
---|---|
CentOS |
|
RHEL |
|
Fedora |
|
Debian |
|
Ubuntu |
|
Kylin |
|
openSUSE |
|
SLES |
|
Windows |
|
Entry | Requirements |
---|---|
Environmental dependence |
|
Ports |
|

- The agent must be installed by the root account of the VM operating system.
- If the default port is occupied, the agent might fail to be started after installation. In this case, you can go the installation directory, find the conf.yaml file, and manually change the port.
- The agent pushes VM monitoring data to the host through the internal network at an interval of 10 seconds. Note that the data is not uploaded to the external network.
Manage the Agent
You can manage the agent by using the following commands:
- Stop the agent service:
service zwatch-vm-agent stop
. - Start the agent service:
service zwatch-vm-agent start
. - Restart the agent service:
service zwatch-vm-agent restart
. - Query the agent service:
service zwatch-vm-agent status
.
Uninstallation Method
The uninstallation method varies according to the operating system of the VM
instance.
- Linux-based VM instances
- Stop the agent by running the service zwatch-vm-agent stop command.
- Delete the service configuration file by running the rm -f /etc/systemd/system/zwatch-vm-agent.service command.
- Delete the agent installation directory by running the rm -rf /usr/local/zstack/zwatch-vm-agent command.
- Windows-based VM instances
- Delete registry related entries.Run the Windows command prompt as an administrator and run the following command to delete the relevant keys in the system:
reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSDTC /f reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC /f reg delete HKEY_CLASSES_ROOT\CID /f
- Stop and reinstall msdtc service.Run the Windows command prompt as an administrator and run the following commands to stop and reinstall the msdtc service:
net stop msdtc msdtc -uninstall msdtc -install
- Reboot the VM instance.
- Uninstall the agent.Run the Windows command prompt as an administrator and run the following command to delete the agent:
msiexec /a "c:\Program Files\GuestTools\qemu-ga.msi" targetdir="c:\Program Files" "c:\Program Files\QEMU Guest Agent\Qemu-ga\qemu-ga.exe" -s vss-uninstall
- Delete registry related entries.