VMmanager 6: Administrator guide

Zabbix

ISPSystem

Zabbix is an open source monitoring system. With Zabbix you can configure monitoring of virtual machines (VM) and other platform entities.

Main components of Zabbix:

  • server — the component for managing network services, storing monitoring data, alerting the administrator about problems with equipment. You can use your own Zabbix server or create a VM to perform these functions;
  • proxy — the intermediate service that collects data from VMs and sends it to the server. This component is optional. Proxy should be used to reduce the load on the server or if VMs do not have direct access to the server. You can create one or more VMs to act as proxy;
  • agent — the software installed on the VM or cluster node. The agent collects monitoring data and transmits it to the server or proxy.

Read more about Zabbix in the official documentation.

Installing Zabbix components


Zabbix is installed on a VM using scripts from the ISPsystem repository. The scripts can be run both when the VM is being created and after it has been created. Read more in Running scripts on the VM.

To install Zabbix on the cluster node, you will need to create an Ansible installation script. Read more in Creating a script for the node.

Server

The system requirements for the Zabbix server depend on the number of devices to be monitored. Read more about system requirements in the official Zabbix documentation.

To install a Zabbix server on a VM:

  1. Create a VM with CentOS 8, Ubuntu 20.04 or Debian 10.
  2. Run the Zabbix server script on the VM.

The web interface of the server will be available at the URL http://<IP of the created VM>. For example, http://192.168.100.100. To log in, use:

  • username — Admin;
  • password — zabbix.

Proxy

To install a Zabbix proxy on a VM:

  1. Create a VM with CentOS 8, Ubuntu 20.04 or Debian 10.
  2. Run the Zabbix proxy script on the VM. Specify the IP address of the Zabbix server when requesting the parameter.

Agent

To install a Zabbix agents on a VM:

  1. Run the following on the VM:
    • with Linux family OS — Zabbix agent linux script;
    • with Windows OS — Zabbix agent windows script.
  2. Specify the following when sending query for the ZABBIX_SERVER parameter:
    • if you are using a proxy — the IP address of the Zabbix proxy;
    • if you are not using a proxy — the IP address of the Zabbix server.

To install a Zabbix agents on cluster nodes:

  1. Enter Scripts → For nodes → Create script.
  2. Create an Ansible script:

    ---
    - name: Install zabbix-agent playbook
      hosts: all
      debugger: on_failed
      tasks:
        - name: Install zabbix-release CentOS 8
          yum:
            name: https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
            state: present
          when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "8"
    
        - name: Install zabbix-release CentOS 7
          yum:
            name: https://repo.zabbix.com/zabbix/5.4/rhel/7/x86_64/zabbix-release-5.4-1.el7.noarch.rpm
            state: present
          when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "7"
    
        - name: Install zabbix release package
          apt:
            deb: https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb
          when: ansible_distribution == 'Ubuntu'
    
        - name: Install zabbix-agent2 package
          package:
            name: zabbix-agent2
            state: present
    
        - name: Change Server IP
          lineinfile:
            path: /etc/zabbix/zabbix_agent2.conf
            regexp: 'Server=127.0.0.1'
            line: "Server=127.0.0.1,<Zabbix server IP address>"
    
        - name: Change Active Server IP
          lineinfile:
            path: /etc/zabbix/zabbix_agent2.conf
            regexp: 'ServerActive=127.0.0.1'
            line: "ServerActive=127.0.0.1,<Zabbix server IP address>"
    
        - name: Stop zabbix-agent
          service:
            name: zabbix-agent
            state: stopped
            enabled: no
          ignore_errors: yes
    
    
        - name: Start zabbix-agent2
          service:
            name: zabbix-agent2
            state: started
            enabled: yes
    
        - name: Create a new sudoers file
          file:
            path: /etc/sudoers.d/zabbix
            state: touch
            mode: 0400
            owner: root
    
        - name: Add sudoers
          copy:
            dest: /etc/sudoers.d/zabbix
            content: |
              Defaults:zabbix !requiretty
              Cmnd_Alias ZABBIX_CMD = /usr/bin/virsh -q list, /usr/bin/virsh -q list --all
              zabbix ALL = (root) NOPASSWD: ZABBIX_CMD
    
        - name: Add vmmanager config to zabbix
          file:
            path: /etc/zabbix/zabbix_agent2.d/vmmanager.conf
            state: touch
            mode: 0644
            owner: root
    
        - name: Configure zabbix for VMmanager
          copy:
            dest: /etc/zabbix/zabbix_agent2.d/vmmanager.conf
            content: |
              UserParameter=vm.all,sudo virsh -q list --all | wc -l
              UserParameter=vm.running,sudo virsh -q list | wc -l
    
    
  3. Run the script on cluster nodes.

Zabbix server configuration


To configure the Zabbix server, specify proxy configurations and add a VM for monitoring.

Adding proxy configuration

  1. Enter AdministrationProxiesCreate proxy.
  2. Specify proxy settings:
    1. Proxy name — discretionary proxy name.
    2. Proxy mode — proxy’s operating mode. Select Passive.
    3. IP address — proxy's IP address.
    4. DNS name — DNS server name. Leave the default value — localhost.
    5. Connect to — connection type. Select IP.
    6. Port — connection port. Leave the default value — 10051.
    7. Description — discretionary proxy description.
  3. Press Add.

Adding platform monitoring

  1. Create a token for authorization in the platform:

    curl -s -X POST -H  "accept: application/json" -H  "Content-Type: application/json" -d '{"email": "admin@example.com", "password": "admin_pass"}' "https://vm6.example.com/auth/v4/public/token"

    admin@example.com — name of VMmanager user with administrator permissions

    admin_pass — user password

    vm6.example.com — domain name or IP address of the server with platform

    Save the token value from the reply:

    Example of reply
    {"id":"69","token":"69-a56c5bd9-ba6b-489e-a670-c452cbdd3b70"}
  2. Download templates from the Zabbix repository:
    1. template_vmmanager_6_master.yaml — for platform monitoring.
    2. template_vmmanager_6_kvm_hypervisor.yaml — for cluster nodes monitoring.
  3. Import the downloaded templates into Zabbix: ConfigurationTemplates Import → select the template file → ImportImport.
  4. Enable server monitoring with VMmanager in Zabbix:
    1. Enter Configuration Hosts Create host.
    2. Specify the server parameters:
      1. Host namediscretionary name for designation of the server in the Zabbix database.
      2. Visible namediscretionary name for display of the server in the Zabbix database.
      3. Groupsgroup of objects. Select VMmanager 6.
      4. Interfacesnetwork interfaces. Press AddAgent.
      5. IP address IP address of the server with the platform.
      6. DNS nameDNS server name. Leave the default value empty.
      7. Connect toconnection type. Select IP.
      8. Portconnection port. Leave the default value — 10050.
      9. Descriptiondiscretionary VM description.
      10. Monitored by proxyproxy used. Select the name of the proxy, if you are using one.
      11. Enabledenable this option to activate the monitoring of this VM.
    3. Go to the Templates tab and enter the following in the Link new templates field: Template VMmanager 6 Master.
    4. Go to the Macros tab and add macros:
      1. {$VM6_TOKEN} token for authorization in the platform.
      2. {$VM6_URL} URL of the server with the platform in the format https://vm6.example.com/vm/v3, where vm6.example.com is the domain name or the IP address of the server with the platform.
    5. Press Add.
  5. Enable cluster node monitoring in Zabbix:
    1. Enter ConfigurationHosts → select the server with the platform → Discovery.
    2. Under Discovery Rules in the Template VMmanager 6 Master: Host discovery line, press Host prototypes.

    3. In the Host Prototypes section, enable the Create enabled and Discover options for the server.
    4. Enter Monitoring → Hosts → select the server with the platform → Inventory.

    5. In the Host Inventory section, press Discovery.

    6. Select the line VMmanager 6 Master: Host discoveryExecute now.

Zabbix will automatically connect to VMmanager and get a list of cluster nodes to monitor. To have new cluster nodes automatically added to the Zabbix settings, install the Zabbix agent on the nodes.

Adding a certain VM for monitoring

  1. Enter ConfigurationHostsCreate host.
  2. Add the VM settings:
    1. Host name — discretionary name for designation of the VM in the Zabbix database.
    2. Visible name — discretionary name for display of the VM in the Zabbix database.
    3. Groups — group of objects. Select Virtual machines.
    4. Interfacesnetwork interfaces. Press AddAgent.
    5. IP address — VM's IP address.
    6. DNS name — DNS server name. Leave the default value empty.
    7. Connect to — connection type. Select IP.
    8. Port — connection port. Leave the default value — 10050.
    9. Description — discretionary VM description.
    10. Monitored by proxy — proxy used. Select the name of the proxy, if you are using one.
    11. Enabled — enable this option to activate the monitoring of this VM.
  3. Go to the Templates tab and select the template for VM monitoring in the Link new templates field:
    • with Linux family OS - Template OS Linux by Zabbix agent;
    • with Windows OS - Template OS Windows by Zabbix agent.
  4. Press Add.
Thank you for your feedback!
Was the article useful?
Tell us why not:

it does not match the title

it was hard to understand

I didn't find the answer

recommendations from the article did not help

other

Tell us what you didn't like in the article: