LoginSignup
2
0

More than 1 year has passed since last update.

zabbix-agent.conf での個人的勘所

Posted at

serverバージョンは4系、AmazonLinux2環境

ubuntu環境に入れた時はこの記事をまんま進めてた(大感謝)。
ubuntuにagentを入れた時はインスコ完了時点でstartしている。

zabbix-agent.confでよく弄る箇所

### Option: LogFile
#   Log file name for LogType ‘file’ parameter.
#
# Mandatory: yes, if LogType is set to file, otherwise no
# Default:
# LogFile=

LogFile=/var/log/zabbix/zabbix_agentd.log

agentのLogを吐き出す場所の指定。
各agentのログを一箇所にまとめたい時等に割と弄る


### Option: EnableRemoteCommands
#   Whether remote commands from Zabbix server are allowed.
#   0 - not allowed
#   1 - allowed
#
# Mandatory: no
# Default:
# EnableRemoteCommands=0

リモートコマンドを許可するかどうかの設定。
コンテナのdownを検知してActionから $docker restart〜 等々、アラートに応じて自動でコマンドを流したい時に弄る。

# EnableRemoteCommands=0
EnableRemoteCommands=1

こんな感じに書いておけばconf.orgとdiff撮った時に見やすい、個人的に。


### Option: LogRemoteCommands
#   Enable logging of executed shell commands as warnings.
#   0 - disabled
#   1 - enabled
#
# Mandatory: no
# Default:
# LogRemoteCommands=0

説明の通り。ログは大事、マジで。


##### Passive checks related

### Option: Server
#   List of comma delimited IP addresses, optionally in CIDR notation, or DNS names of Zabbix servers and Zabbix proxies.
#   Incoming connections will be accepted only from the hosts listed here.
#   If IPv6 support is enabled then ‘127.0.0.1’, ‘::127.0.0.1’, ‘::ffff:127.0.0.1’ are treated equally
#   and ‘::/0’ will allow any IPv4 or IPv6 address.
#   ‘0.0.0.0/0’ can be used to allow any IPv4 address.
#   Example: Server=127.0.0.1,192.168.1.0/24,::1,2001:db8::/32,zabbix.example.com
#
# Mandatory: yes, if StartAgents is not explicitly set to 0
# Default:
# Server=

Server=127.0.0.1

zabbix-serverのIP入力欄。
proxyを噛ませている場合はproxyのIP。そらそうでしょって感じだが意外と忘れてる事がある。


##### Active checks related

### Option: ServerActive
#   List of comma delimited IP:port (or DNS name:port) pairs of Zabbix servers and Zabbix proxies 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=127.0.0.1:20051,zabbix.domain,[::1]:30051,::1,[12fc::1]
#
# Mandatory: no
# Default:
# ServerActive=

ServerActive=127.0.0.1

アクティブチェックの設定。
基本的には Serverの設定と一緒。
serverやらproxyがコンテナで稼働している時はコンテナが使っているportを要確認。


### 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=Zabbix server

Hostnameの設定。
Autoregistの設定をしている時はココで設定した値がHostnameになる(そのまんま)


### Option: HostMetadata
#   Optional parameter that defines host metadata.
#   Host metadata is used at host auto-registration process.
#   An agent will issue an error and not start if the value is over limit of 255 characters.
#   If not defined, value will be acquired from HostMetadataItem.
#
# Mandatory: no
# Range: 0-255 characters
# Default:
# HostMetadata=

web側のauto registration設定で拾うHostMetaDataの設定。
ココ次第でHostGroupsの振り分けとかもできる。


### Option: RefreshActiveChecks
#   How often list of active checks is refreshed, in seconds.
#
# Mandatory: no
# Range: 60-3600
# Default:
# RefreshActiveChecks=120

ActiveCheckの更新間隔。
デフォの120secは少々長い印象。自分用に構築するときは大体60sec


### Option: Timeout
#   Spend no more than Timeout seconds on processing
#
# Mandatory: no
# Range: 1-30
# Default:
# Timeout=3

timeoutの長さ。
デフォの3secは短い印象。30sec位でええでしょ程度に。


雑多なメモ

・Elasticache memcacheの監視反映は思ったより時間がかかる。
・発報テスト時はseverityに注意しましょう(slack転送設定をした後とか稼働中のサービスがあったりすると。。。)
・Templateのimport時、Discovery配下設定はimportされない
※一例
All Template -> 対象Template -> Discover rules -> filesysteのtrigger prototypes

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0