############ GENERAL PARAMETERS #################
### Option: PidFile
# Name of PID file.
#
# Mandatory: no
# Default:
#pidFile=PID路徑
#說明:指定程程式PIDFILE路徑,可修改到其它路徑,但SNC不建議修改
PidFile=/smp/sncmon/zabbix_agentd.pid
### Option: LogFile
# Name of log file.
# If not set, syslog is used.
# LogFile=
#LogFile=路徑
#說明:用戶端AGENT運作産生的日志檔案路徑,可修改到其它路徑,如/var/log/zabbix_agnetd.log,視具體情況修改,也可保持預設
LogFile=/smp/sncmon/zabbix_agentd.log
### Option: LogFileSize
# Maximum size of log file in MB.
# 0 - disable automatic log rotation.
# Range: 0-1024
#LogFileSize=數字
#說明:AGENT産生日志大小控制,預設1M,若為0,則表示不産生任何日志,數字範圍(1-1024M)不建議關閉日志功能,建議保持預設
LogFileSize=1
### Option: DebugLevel
# Specifies debug level
# 0 - no debug 無日志級别
# 1 - critical information 災難資訊級别
# 2 - error information 一般錯誤資訊級别
# 3 - warnings 警告級别
# 4 - for debugging (produces lots of information) 調試級别
#說明:0~4級别,日志産生量在相同機關時間,生成的日志量為遞增,即0級别日志量最少,4級别最多,預設3級别,建議視具體情況,自行把握
# Range: 0-4
DebugLevel=3
### Option: SourceIP
# Source IP address for outgoing connections.
#SourceIP=IP位址
#說明:當系統設定有多個IP時,需要指定一個IP與二級代理或服務端通信,若系統隻有一個IP,也建議指定一個IP
SourceIP=192.168.1.3
### Option: EnableRemoteCommands
# Whether remote commands from Zabbix server are allowed.
# 0 - not allowed 不允許
# 1 - allowed 允許
#EnableRemoteCommands=0或1
#說明:是否允許在本地執行遠端指令,建議設定為“允許”,因為SNC對指令下發功能進行了二次開發,功能強大,極大的友善日志運維工作
EnableRemoteCommands=1
### Option: LogRemoteCommands
# Enable logging of executed shell commands as warnings.
# 0 - disabled 不産生日志
# 1 - enabled 産生日志
#LogRemoteCommands=1或0
#說明:在參數EnableRemoteCommands=1的情況下,執行遠端指令是否儲存記錄檔,若已設定EnableRemoteCommands=1
#建議LogRemoteCommands=1,以便 日後查證。若EnableRemoteCommands=0,此參數不生效
LogRemoteCommands=1
##### Passive checks related
#與被動模式有關的參數設定
#什麼是被動模式?
#被動模式下,由二級代理或服務端主動請求AGENT,去擷取所采集到的監控資料
### Option: Server
# List of comma delimited IP addresses (or hostnames) of Zabbix servers.
# 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.
# Server=
#Server=IP位址或主機名,建議IP位址
#說明:在有二級代理情況下,此IP位址應該填寫二級代理伺服器的IP,反之,若無二級代理伺服器,則此IP應設定為服務端#IP
Server=192.168.1.14
### Option: ListenPort
# Agent will listen on this port for connections from the server.
# Range: 1024-32767 (監控端口範圍)
# ListenPort=數字
#說明:此AGENT端以本地服務的形式運作,需要監聽端口,強烈建議設定為10050,以便移動整個系統統一規劃管理,當然,特殊情況下可修改為1024-32767 未使用的端口
ListenPort=10050
### Option: ListenIP
# List of comma delimited IP addresses that the agent should listen on.
# First IP address is sent to Zabbix server if connecting to it to retrieve list of active checks.
## ListenIP=IP位址
#說明:對應的ListenPort監聽到哪個IP上面,建議指定IP時,不用0.0.0.0
# ListenIP=192.168.1.6
### Option: StartAgents
# Number of pre-forked instances of zabbix_agentd that process passive checks.
# If set to 0, disables passive checks and the agent will not listen on any TCP port.
# Range: 0-100 數字範圍(0-100)
#StartAgents=數字
#說明:在被動模式下,此參數用于設定控制監聽程序可啟用的子程序的數量,若監控項較多且采集很頻繁,建議加大此數值
;若此數值為0,則禁止使用被動模式。另外,一般情況,不建議修改此數值,當且僅當某些監控項無法采集到資料,或資料采集資料有延遲現象時,可調整。第四,啟用線程越多,則相對越耗系統資源
StartAgents=5
##### Active checks related
#主動模式相關參數設定
#什麼時主動模式?
#在主動模式下,AGENT端(即采集用戶端)将所采集的結果,主動送出給二級代理伺服器或伺服器,而此種情況下,二級代理伺服器或伺服器将被動接收采集資訊
### 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=127.0.0.1:20051,zabbix.domain,[::1]:30051,::1,[12fc::1]
# ServerActive=
#ServerActive=IP位址或IP位址:端口号
#說明:在主動模式下,ServerActive為二級代理伺服器或伺服器,預設端口為10051,若需更改端口,則為#ServerActive=IP:port,非特殊情況下,不建議修改。
ServerActive=192.168.1.14
### 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.
# Hostname=
# Hostname=主機名
#說明:手工自定義一個主機名,可以和系統的主機名一樣,也可以不一樣,此參數可根據實際情況啟用或關閉,建議關閉此參數,并啟用HostnameItem參數
#Hostname=Zabbix server
### Option: HostnameItem
# Item used for generating Hostname if it is undefined.
# Ignored if Hostname is defined.
#HostnameItem:自動擷取主機名
#說明:system.hostname是ZABBIX内置的一個自動擷取主機名的方法,為了友善配置,建議打開此參數而關閉Hostname參數#。注意:HostnameItem的優化級低于Hostname,當兩個參數都啟用且配置的情況下,ZABBIX擷取的主機名,将以Hostname為#準
HostnameItem=system.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.
# Range: 0-255 characters 0-255個字元
# HostMetadata=字元串
#說明:用于定義目前主機唯一辨別符,最大長度255個,僅适用于自動發現情況下,預設不定義,建議不定義
# HostMetadata=
### Option: HostMetadataItem
# Optional parameter that defines an item used for getting host metadata.
# During an auto-registration request an agent will log a warning message if
# the value returned by specified item is over limit of 255 characters.
# This option is only used when HostMetadata is not defined.
#說明;用于擷取主機的HostMetadata,建議保持預設
# HostMetadataItem=
### Option: RefreshActiveChecks
# How often list of active checks is refreshed, in seconds.
# Range: 60-3600
#RefreshActiveChecks=數字
#說明:被監控的主機多久(秒)重新請求二級代理或服務端重新整理一監控清單。範圍為60-3600秒。ZABBIX運作原理為:,zabbix用戶端啟動後,在等待RefreshActiveChecks秒後,開始從二級代理或服務端請求并下載下傳監控項資訊,儲存在本地專門的buffersend中,再過RefreshActiveChecks秒後,重新擷取監控項資訊。這就是為什麼當配置監控項,要過一會才能生效的原因。這個數值,就是等待時間。建議,不要将此數值設定過小,以免加大AGENT端和服務端及資料庫的壓力,建議為120秒。
RefreshActiveChecks=120
### Option: BufferSend
# Do not keep data longer than N seconds in buffer.
# Range: 1-3600
#BufferSend=數字
#說明:多少秒後,将BUFFER中的資料送出到二級代理或服務端。範圍(1-36600)此數值的大小決定了采集後,送出資料的及時性,數值越小,則送出得越頻繁,對伺服器壓力越大,同時對AGENT端系統資源消耗越大,則表現出來的現象是報警非常及時,建議根據實際情況自行考慮,也可保持預設,若發現ZABBIX消耗資源較多,建議加大此數值。
BufferSend=5
### Option: BufferSize
# Maximum number of values in a memory buffer. The agent will send
# all collected data to Zabbix Server or Proxy if the buffer is full.
# Range: 2-65535
#BufferSize=數值
#說明:此參數作用設定儲存采集資料在記憶體中的容量大小。若此agent端監控項較多,建議加大此數值。BufferSize與BufferSend之間有聯系的。當達到bUFFERSEND或Buffersize已滿時,都會觸發資料送出動作。
BufferSize=100
### Option: MaxLinesPerSecond
# Maximum number of new lines the agent will send per second to Zabbix Server
# or Proxy processing 'log' and 'logrt' active checks.
# The provided value will be overridden by the parameter 'maxlines',
# provided in 'log' or 'logrt' item keys.
# Range: 1-1000
#MaxLinesPerSecond=數值
#說明:定義了AGENT在1秒内發送的日志行數,用于避免網絡或cpu過載,建議保持預設
# MaxLinesPerSecond=100
############ ADVANCED PARAMETERS #################
#進階參數設定
### Option: Alias
# Sets an alias for parameter. It can be useful to substitute long and complex parameter name with a smaller and simpler one.
# Range:
#設定參數的别名。它可以替代長和複雜的一個小而簡單的一個有用的參數名稱
#alias_name=long_command
### Option: Timeout
# Spend no more than Timeout seconds on processing
# Range: 1-30
#Timeout=數值
#說明:當agent采集一個資料時,多長少算逾時。建議保持預設
Timeout=30
### Option: AllowRoot
# Allow the agent to run as 'root'. If disabled and the agent is started by 'root', the agent
# will try to switch to user 'zabbix' instead. Has no effect if started under a regular user.
# 0 - do not allow
# 1 - allow
#AllowRoot=0或1
#說明:是否允許ROOT帳号運作此用戶端。0:不允許,1:允許,當一個腳本執行需要以ROOT身份執行的,則此開關必須打開,建議根據實際情況開啟或關閉,
AllowRoot=0
### Option: Include
# You may include individual files or all files in a directory in the configuration file.
# Installing Zabbix will create include directory in /usr/local/etc, unless modified during the compile time.
# Include=
# Include=目錄路徑或擴充配置檔案路徑
#說明:從配置檔案可管理性或擴充性考慮,若需配置大量參數的且為了友善後續管理可以啟用此參數,建議根據實際情況考慮,不過,一般情況下無須啟用
# Include=/usr/local/etc/zabbix_agentd.userparams.conf
# Include=/usr/local/etc/zabbix_agentd.conf.d/
####### USER-DEFINED MONITORED PARAMETERS #######
#自定義監控腳本
### Option: UnsafeUserParameters
# Allow all characters to be passed in arguments to user-defined parameters.
# Range: 0-1
#UnsafeUserParameters=0或1
#說明:是否啟用使用者自定義監控腳本,1啟用,0不啟用。由于ZABBIX實作監控方法的多樣性,一般都采用腳本來實作監控資料的采集,是以,建議開啟,否則功能将受限。
UnsafeUserParameters=1
### Option: UserParameter
# User-defined parameter to monitor. There can be several user-defined parameters.
# Format: UserParameter=,
# See 'zabbix_agentd' directory for examples.
# UserParameter=
####### LOADABLE MODULES #######
### Option: LoadModulePath
# Full path to location of agent modules.
# Default depends on compilation options.
# LoadModulePath=${libdir}/modules
#說明:擴充子產品路徑,強烈建議不要改動,除非你具有AGENT 開發能力
### Option: LoadModule
# Module to load at agent startup. Modules are used to extend functionality of the agent.
# Format: LoadModule=.so>
# The modules must be located in directory specified by LoadModulePath.
# It is allowed to include multiple LoadModule parameters.
# LoadModule=
#UserParameter=
#說明:使用者自定義監控腳本,當且僅當UnsafeUserParameters=1時UserParameter生效。以下為SNC初始自定監控腳本,不建議修改,已有選項,但可自義添加。
#自定義監控項配置文法
#UserParameter=key,command
#如何使用:以擷取mysql監控為例
#步驟1,設定自定義腳本
#UserParameter=mysql.questions,mysqladmin -uroot --password='XXXXX' status|cut -f4 -d":"|cut -f1 -d"S"
#儲存退出,并重新開機AGENT
#步驟2,手工驗證
#在二級代理端或伺服器端用指令 zabbix_get -s IP -k mysql.questions 将傳回采集資訊
#步驟3,在管理頁面添加監控項
#注意:成功關鍵,腳本本身具有可執行權限,且腳本運作正常
本文轉自 曾哥最愛 51CTO部落格,原文連結:http://blog.51cto.com/zengestudy/1791596,如需轉載請自行聯系原作者