Vagrant is a tool that uses Oracle's VirtualBox to dynamically build configurable, lightweight, and portable virtual machines. Vagrant supports the use of either Puppet or Chef for managing the configuration. Much more information is available on the Vagrant web site.
This is the Vagrant configuration used in my boxes for Zabbix at VagrantCloud. They start out with:
- CentOS 8: Zabbix Server 5.4, Apache and PostgreSQL 12 with TimescaleDB.
- Debian 10: Zabbix Server 5.4, Nginx and PostgreSQL 13 with TimescaleDB.
- Rocky 8: Zabbix Server 5.4, Nginx and PostgreSQL 13 with TimescaleDB.
- Debian 11: Zabbix Server 5.4, Nginx and PostgreSQL 13 with TimescaleDB.
The VirtualBox version used is 6.1 and Vagrant version is v2.2.14.
- Download VirtualBox 6.1: https://www.virtualbox.org/wiki/Downloads
- Download Vagrant 2.2.14: https://www.vagrantup.com/downloads
Two options:
- Using the VagrantCloud box: From an empty directory, Create a Vagrantfile and put in it the contents:
config.vm.box could be "isaqueprofeta/zabbix-debian10":
Vagrant.configure("2") do |config|
config.vm.box = "isaqueprofeta/zabbix-debian10"
config.vm.box_version = "5.4"
config.vm.network "forwarded_port", guest: 80 , host: 8080, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 5432 , host: 5432, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 10050 , host: 10050, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 10051 , host: 10051, host_ip: "127.0.0.1"
endor "isaqueprofeta/zabbix-centos8":
Vagrant.configure("2") do |config|
config.vm.box = "isaqueprofeta/zabbix-centos8"
config.vm.box_version = "5.2"
config.vm.network "forwarded_port", guest: 80 , host: 8080, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 5432 , host: 5432, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 10050 , host: 10050, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 10051 , host: 10051, host_ip: "127.0.0.1"
endSave, exit, and then type:
vagrant init isaqueprofeta/zabbix-debian10 # Or isaqueprofeta/zabbix-centos8
vagrant up- Build ground up from Centos8/Debian10: Clone this repo and inside the wanted OS folder, run vagrant up.
-
Zabbix Frontend is forwarded from TCP/80 of guest to TCP/8080 on the host, so just go for http://localhost:8080 (User: Admin, Pass:zabbix), and you should be fine
-
Ports 5432, 10050 and 10051 are directly mapped from the guest to the host to use it as appliance and make it easier to connect to the agents and to make queries using SQL.
-
Zabbix Database Password: Z4bb1xD4t4b4s3
- How to stop/turn off:
vagrant halt- How to clean/delete all data:
vagrant destroy
vagrant box prune isaqueprofeta/zabbix-debian10 # Or isaqueprofeta/zabbix-centos8- Create a snapshot for tests:
vagrant snapshot create MySnapshot- Recover the snapshot:
vagrant snapshot restore MySnapshot