Skip to content

Zabbix Server and Agent with Nginx/Apache, PostgreSQL and TimescaleDB

Notifications You must be signed in to change notification settings

isaqueprofeta/zabbix-vagrant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant Zabbix

What is Vagrant?

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.

What is this project?

This is the Vagrant configuration used in my boxes for Zabbix at VagrantCloud. They start out with:

Zabbix Server 6.0, Nginx and PostgreSQL 15 with TimescaleDB on:

  • Alma 8
  • Rocky 8
  • Debian 11
  • Ubuntu 22.04

How do I install Vagrant?

The VirtualBox version used is 6.1 and Vagrant version is v2.2.14.

How do I run?

Two options:

  1. Using the VagrantCloud box: From an empty directory, Create a Vagrantfile and put in it the contents:

config.vm.box could be "isaqueprofeta/zabbix-debian11":

Vagrant.configure("2") do |config|
  config.vm.box = "isaqueprofeta/zabbix-debian11"
  config.vm.box_version = "6.0"
  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"
end

or "isaqueprofeta/zabbix-rocky8":

Vagrant.configure("2") do |config|
  config.vm.box = "isaqueprofeta/zabbix-rocky8"
  config.vm.box_version = "6.0"
  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"
end

or "isaqueprofeta/zabbix-alma8":

Vagrant.configure("2") do |config|
  config.vm.box = "isaqueprofeta/zabbix-alma8"
  config.vm.box_version = "6.0"
  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"
end

or "isaqueprofeta/zabbix-ubuntu2204":

Vagrant.configure("2") do |config|
  config.vm.box = "isaqueprofeta/zabbix-ubuntu2204"
  config.vm.box_version = "6.0"
  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"
end

Save, exit, and then type:

vagrant init isaqueprofeta/zabbix-debian11 # or centos8, or alma8, or ubuntu2204
vagrant up
  1. Build ground up from Centos8/Debian10: Clone this repo and inside the wanted OS folder, run vagrant up.

  2. Download the gist scripts and use on your own VM/Server:

How do I work?

  1. 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

  2. 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.

  3. Default Zabbix Database Password: Z4bb1xD4t4b4s3

Quick reference:

  1. How to stop/turn off:
vagrant halt
  1. How to clean/delete all data:
vagrant destroy
vagrant box prune isaqueprofeta/zabbix-debian11 # or centos8, or alma8
  1. Create a snapshot for tests:
vagrant snapshot create MySnapshot
  1. Recover the snapshot:
vagrant snapshot restore MySnapshot

About

Zabbix Server and Agent with Nginx/Apache, PostgreSQL and TimescaleDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published