Skip to content

Instantly share code, notes, and snippets.

Created August 10, 2017 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4d9c8493ad399b916a235f911c48681c to your computer and use it in GitHub Desktop.
Save anonymous/4d9c8493ad399b916a235f911c48681c to your computer and use it in GitHub Desktop.
Action in my sls file :
{% set hostname = grains['host'] %}
hostname_zabbix_agentd.conf:
file.replace:
- name: /etc/zabbix/zabbix_agentd.conf
- pattern: HOSTNAMEAGENT
- repl: hostname
- show_changes: True
- bufsize: file
My Zabix conf sample :
##### Active checks related
### Option: ServerActive
# List of comma delimited IP:port (or hostname:port) pairs of Zabbix servers for active checks.
# If port is not specified, default port is used.
# IPv6 addresses must be enclosed in square brackets if port for that host is specified.
# If port is not specified, square brackets for IPv6 addresses are optional.
# If this parameter is not specified, active checks are disabled.
# Example: ServerActive=192.168.196.61:20051,zabbix.domain,[::1]:30051,::1,[12fc::1]
#
# Mandatory: no
# Default:
# ServerActive=
ServerActive=IPSERVER
### Option: Hostname
# Unique, case sensitive hostname.
# Required for active checks and must match hostname as configured on the server.
# Value is acquired from HostnameItem if undefined.
#
# Mandatory: no
# Default:
# Hostname=
Hostname=HOSTNAMEAGENT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment