Skip to content

opennode-salt-formulas/zabbix-formula

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zabbix-formula

A saltstack formula to manage Zabbix.

This formula has been developed distributing id and state declarations in different files to make it usable in most situations. It should be useful from scenarios with a simple install of the package (without any special configuration) to a more complex set-up with different nodes for agent, server, database and frontend.

Any special needs could be addressed forking the formula repo, even in-place at the server acting as master. I'm trying to keep this as general as possible and further general improvements would be added.

The files directory is structured using a default root and optional <minion-id> directories:

files
  |-- default
  |        |-- etc
  |        |    |-- foo.conf
  |        |    `-- bar.conf
  |        `-- usr/share/thingy/*
  `-- <minion-id>
          |-- etc
          |    |-- foo.conf
          |    `-- bar.conf
          `-- usr/share/thingy/*

This way we have certain flexibility to use different files for different minions. It's not designed to substitute pillar data. Remember that pillar has to be used for info that it's essential to be only known for a certain set of minions (i.e. passwords, private keys and such).

Just as an example, this is a top.sls file to install a complete modular self- contained Zabbix system:

base:
  'minion':
    - zabbix.users
    - zabbix.agent.repo
    - zabbix.agent.conf
    - zabbix.mysql.conf
    - zabbix.mysql.schema
    - zabbix.server.repo
    - zabbix.server.conf
    - apache.repo
    - apache.conf
    - apache.users
    - apache.mod_proxy_fcgi
    - apache.mod_actions
    - php5.fpm.repo
    - php5.fpm.conf
    - php5.mysql
    - zabbix.frontend.repo
    - zabbix.frontend.conf

You need the appropriate apache and php5 formulas to complete the frontend installation.

Note

See the full Salt Formulas doc.

Available states

Configures official Zabbix repo.

Declares users and groups that could be needed even in other formulas (e.g. in the users formula to make an user pertain to the service group).

Installs the zabbix-agent package and starts the associated zabbix- agent service.

Configures the zabbix-agent package.

Configures official Zabbix repo specifically for the agent. Actually just include zabbix.repo and adds arequisite for the pkg state declaration

Installs the zabbix-server package and starts the associated zabbix- server service.

Configures the zabbix-server package.

Configures official Zabbix repo specifically for the server. Actually just include zabbix.repo and adds arequisite for the pkg state declaration

Installs mysql-server (via include of mysql.server) and creates database and user for Zabbix.

Creates mysql schema for Zabbix.

Installs Zabbix frontend.

Configures official Zabbix repo specifically for the frontend. Actually just include zabbix.repo and adds arequisite for the pkg state declaration.

Configures the zabbix-frontend package. Actually you need to use other formulas for apache/nginx and php5-fpm to complete a working setup.