vpeopleonatank / installing-zabbix-with-ansible

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change host file

ansible-playbook -i hosts ../bastion.yml --ask-become-pass

Install zabbix server

ansible-playbook -i hosts zabbix-server.yml

Post-installation when move zabbix to another machine (new ip addresses)

  • Remove old ip in /etc/hosts manually (ssh to machine) and use ansible to update hosts file
ansible-playbook -i ansible/hosts update_hosts_file.yml
  • Use virt-manager through ssh to manage virtual machines remotely
virt-manager -c 'qemu+ssh://monitor@<host_vm_ip_address>/system?keyfile=/home/vpoat/.ssh/id_monitor'
  • Add macvtap network interface for virtual machines, and update netplan config (in /etc/netplan/) as below:
network:
  ethernets:
    ens3:
      addresses:
      - 192.168.122.11/24
      dhcp4: false
      gateway4: 192.168.122.1
      match:
        name: ens3
      set-name: ens3
    ens9:
      addresses:
      - 192.168.12.248/24
      dhcp4: false
      gateway4: 192.168.12.1
      match:
        name: ens9
      nameservers:
        addresses:
        - 192.168.12.11
        - 192.168.12.12
      set-name: ens9

then run sudo netplan apply to apply change

  • Change ip host granted for mysql account (zabbix-server):
    • ssh to zabbix-database vm
    • login mysql with root user:
    mysql -uroot -proot
    select * from information_schema.user_privileges; # show granted host ip for users
    • change ip granted for user zabbix-server, 192.168.122.11 is old granted ip and 192.168.12.248 is new ip of zabbix-server
    rename user `zabbix-server@192.168.122.11` to `zabbix-server@192.168.12.248`;

About


Languages

Language:Jinja 100.0%