Skip to content

Latest commit

 

History

History
87 lines (74 loc) · 11.1 KB

README.md

File metadata and controls

87 lines (74 loc) · 11.1 KB

Ansible Role: trippsc2.zabbix.host

Version: 1.1.8

This role configures a host within Zabbix Server.

Requirements

Dependencies

Collection
ansible.utils
community.general
community.vmware
community.zabbix

Role Arguments

Option Description Type Required Choices Default
vmware_hostname

The hostname or IP address of the vCenter server or standalone ESXi host.

If zbxhost_vmware_uuid is not defined and zbxhost_configure_vmware_monitoring is true, this is required.

str no
vmware_username

The username to use for connecting to the vCenter server or standalone ESXi host.

If zbxhost_vmware_uuid is not defined and zbxhost_configure_vmware_monitoring is true, this is required.

str no
vmware_password

The password to use for connecting to the vCenter server or standalone ESXi host.

If zbxhost_vmware_uuid is not defined and zbxhost_configure_vmware_monitoring is true, this is required.

str no
vmware_datacenter

The name of the datacenter in which the VM is located.

If using a standalone ESXi host, this should be set to ha-datacenter.

If zbxhost_vmware_uuid is not defined and zbxhost_configure_vmware_monitoring is true, this is required.

str no
vmware_vm_folder

The folder in which the VM is located.

If zbxhost_vmware_uuid is not defined and zbxhost_configure_vmware_monitoring is true, this is required.

For formatting, see https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_info_module.html#parameter-folder.

str no
vmware_vm_name

The name of the VM to monitor.

If zbxhost_vmware_uuid is not defined and zbxhost_configure_vmware_monitoring is true, this is required.

str no
zabbix_host

The hostname or IP address of the Zabbix server for API requests.

str yes
zabbix_port

The port on which to connect to Zabbix server for API requests.

int yes
zabbix_url_path

The URL path for the Zabbix API.

If using Apache for web frontend, this should be set to zabbix unless configured otherwise.

If using NGINX for web frontend, this should be set to an empty string unless configured otherwise.

str no
zabbix_ssl

Whether to use SSL for API requests.

bool no False
zabbix_validate_certs

Whether to validate SSL certificates for API requests.

If not specified, the default behavior is to validate certificates.

bool no
zabbix_username

The username to use for API requests.

str yes
zabbix_password

The password to use for API requests.

str yes
zbxhost_configure_vmware_monitoring

Whether to configure VMware monitoring for the host.

bool no False
zbxagent_tls_connect

The type of connection to use for connections to the Zabbix server for active checks.

This should not be supplied when not using a Zabbix agent interface.

Linux reference: https://www.zabbix.com/documentation/current/en/manual/appendix/config/zabbix_agent2#tlsconnect

Windows reference: https://www.zabbix.com/documentation/current/en/manual/appendix/config/zabbix_agent2_win#tlsconnect

str no
  • unencrypted
  • psk
  • cert
unencrypted
zbxagent_tls_accept

The type of connection to accept for connections from the Zabbix server.

This should not be supplied when not using a Zabbix agent interface.

Linux reference: https://www.zabbix.com/documentation/current/en/manual/appendix/config/zabbix_agent2#tlsaccept

Windows reference: https://www.zabbix.com/documentation/current/en/manual/appendix/config/zabbix_agent2_win#tlsaccept

str no
  • unencrypted
  • psk
  • cert
unencrypted
zbxhost_name

The name of the host on the Zabbix Server.

str yes
zbxhost_visible_name

The visible name of the host on the Zabbix Server.

If not specified, the visible name will not be set on the host.

str no
zbxhost_groups

A list of host groups to which the host on the Zabbix Server belongs.

list of 'str' yes
zbxhost_interfaces

A list of interfaces for the host on the Zabbix Server.

list of dicts of 'zbxhost_interfaces' options yes
zbxhost_templates

A list of templates to link to the host on the Zabbix Server.

list of 'str' yes
zbxhost_proxy

The name of the Zabbix proxy to use for the host.

This is mutually exclusive with zbxhost_proxy_group.

If not specified, the host will not use a proxy.

str no
zbxhost_proxy_group

The name of the Zabbix proxy group to use for the host.

This is mutually exclusive with zbxhost_proxy.

If not specified, the host will not use a proxy group.

str no
zbxhost_macros

A dictionary of macros to set for the host on the Zabbix Server.

list of dicts of 'zbxhost_macros' options no []
zbxhost_vmware_uuid

The UUID of the VM to monitor.

If zbxhost_configure_vmware_monitoring is false, this is ignored.

Otherwise, this value will be used to set the VM UUID host macro, instead of querying the vCenter server or standalone ESXi host.

str no

Options for zbxhost_interfaces

Option Description Type Required Choices Default
type

Interface type to add.

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/type

str no
  • agent
  • snmp
  • ipmi
  • jmx
agent
main

Whether the interface is used as default.

If multiple interfaces with the same type are provided, only one can be default.

0 (not default), 1 (default)

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/main

int yes
  • 0
  • 1
useip

Connect to host interface with IP address instead of DNS name.

0 (don’t use ip), 1 (use ip)

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/useip

int yes
  • 0
  • 1
ip

IP address used by host interface.

Required if useip=1.

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/ip

str no
dns

DNS name of the host interface.

Required if useip=0.

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/dns

str no
port

Port used by host interface.

If not specified, default port for each type of interface is used

10050 if type=”agent”

161 if type=”snmp”

623 if type=”ipmi”

12345 if type=”jmx”

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/port

int no
details

Additional details for SNMP host interfaces.

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/details

dict of 'details' options no

Options for zbxhost_interfaces > details

Option Description Type Required Choices Default
authpassphrase

SNMPv3 authentication passphrase.

Used when securitylevel=1(authNoPriv) or securitylevel=2(AuthPriv).

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/details/authpassphrase

str no
authprotocol

SNMPv3 authentication protocol.

Used when securitylevel=1(authNoPriv) or securitylevel=2(AuthPriv).

0 (MD5), 1 (SHA1), 2 (SHA224), 3 (SHA256), 4 (SHA384), 5 (SHA512)

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/details/authprotocol

int no
  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
0
bulk

Whether to use bulk SNMP requests.

0 (don’t use bulk requests), 1 (use bulk requests)

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/details/bulk

int no
  • 0
  • 1
1
community

SNMPv1 and SNMPv2 community string.

Required when version=1 or version=2.

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/details/community

str no
contextname

SNMPv3 context name.

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/details/contextname

str no
privpassphrase

SNMPv3 privacy passphrase.

Used when securitylevel=2(AuthPriv).

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/details/privpassphrase

str no
privprotocol

SNMPv3 privacy protocol.

Used when securitylevel=2(AuthPriv).

0 (DES), 1 (AES128), 2 (AES192), 3 (AES256), 4 (AES192C), 5 (AES256C)

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/details/privprotocol

int no
  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
0
securitylevel

SNMPv3 security level.

0 (noAuthNoPriv), 1 (authNoPriv), 2 (AuthPriv)

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/details/securitylevel

int no
  • 0
  • 1
  • 2
0
securityname

SNMPv3 security name.

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/details/securityname

str no
version

SNMP version.

1 (SNMPv1), 2 (SNMPv2c), 3 (SNMPv3)

Reference: https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html#parameter-interfaces/details/version

int no
  • 1
  • 2
  • 3
2

Options for zbxhost_macros

Option Description Type Required Choices Default
name

The macro name.

str yes
type

The macro type.

str no
  • text
  • secret
  • vault
text
value

The macro value.

str yes

License

MIT

Author and Project Information

Jim Tarpley