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
    1. Install the GuestTools on the details page of the VM instance.
    2. 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
    1. Perform System Configurations when you create a VM instance.
    2. 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

    1. Install the GuestTools on the details page of the VM instance.
    2. Launch the VM console and install GuestTools as prompted.

Installation Requirements

Table 1. Version Requirements
Supported Operating System Supported Version
CentOS
  • CentOS 6.8 64 bit
  • CentOS 6.9 64 bit
  • CentOS 6.10 64 bit
  • CentOS 7.2 64 bit
  • CentOS 7.3 64 bit
  • CentOS 7.4 64 bit
  • CentOS 7.5 64 bit
  • CentOS 7.6 64 bit
  • CentOS 8.0 64 bit
RHEL
  • Red Hat Enterprise Linux Server 6.9 64 bit
  • Red Hat Enterprise Linux Server 7.4 64 bit
  • Red Hat Enterprise Linux Server 7.5 64 bit
  • Red Hat Enterprise Linux Server 7.6 64 bit
Fedora
  • Fedora 30 64 bit
    Note: This version does not support the service command, which results in an execution error in line 54 of systemctl start. You can successfully start the agent by changing the command to systemctl start.
  • Fedora 31 64 bit
Debian
  • Debian 9.9 64 bit
  • Debian 10.0 64 bit
Ubuntu
  • Ubuntu 14.04 64 bit
  • Ubuntu 16.04 64 bit
  • Ubuntu 16.10 64 bit
  • Ubuntu 18.04 64 bit
Kylin
  • Kylin 4.0.2 64 bit
openSUSE
  • openSUSE 15.0 64 bit
SLES
  • SUSE Linux Enterprise Server 15 64 bit
  • SUSE Linux Enterprise Server 12 64 bit
Windows
  • Windows Server 2003 R2 64 bit
  • Windows Server 2008 R2 64 bit
  • Windows Server 2012 64 bit
  • Windows Server 2016 64 bit
Table 2. Other Requirements
Entry Requirements
Environmental dependence
  • rpm
  • systemd
Ports
  • 9103
  • 9100
  • 25826
Note:
  • 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
    1. Stop the agent by running the service zwatch-vm-agent stop command.
    2. Delete the service configuration file by running the rm -f /etc/systemd/system/zwatch-vm-agent.service command.
    3. Delete the agent installation directory by running the rm -rf /usr/local/zstack/zwatch-vm-agent command.
  • Windows-based VM instances
    1. 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
    2. 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
    3. Reboot the VM instance.
    4. 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