ZCP_day_1_slides_Part4.pdf
Document Details
Uploaded by SpellboundTropicalIsland
2023
Tags
Full Transcript
PASSIVE PROXY Zabbix server connects to a passive proxy: Y P Proxy poller process is used for communication Up to 2 proxy pollers per proxy may be utilized simultaneously One proxy poller for data download One proxy poller for configuration upload E D U T Zabbix proxy passive S Data collector...
PASSIVE PROXY Zabbix server connects to a passive proxy: Y P Proxy poller process is used for communication Up to 2 proxy pollers per proxy may be utilized simultaneously One proxy poller for data download One proxy poller for configuration upload E D U T Zabbix proxy passive S Data collectors 6.0 Certified Professional ● Day 1 T N Trapper © 2023 by Zabbix. All rights reserved O C Zabbix server Proxy Poller Theory 61 PASSIVE PROXY CONFIGURATION For passive proxies both Zabbix server and proxy configuration files are used: Zabbix proxy configuration file: /etc/zabbix/zabbix_proxy.conf O C ProxyMode 1 (passive) Server IP address or DNS name of Zabbix server T N Y P ProxyOfflineBuffer Controls for how long data is kept locally if not synced with the server ProxyLocalBuffer How long to preserve data in proxy database after it is sent E D U T Zabbix server configuration file: /etc/zabbix/zabbix_server.conf StartProxyPollers Controls how many pollers contact proxies ProxyConfigFrequency How often Zabbix server sends configuration changes to passive proxies ProxyDataFrequency How often data is requested from passive proxies S 6.0 Certified Professional ● Day 1 © 2023 by Zabbix. All rights reserved Theory 62 ZABBIX PROXY COMMUNICATION Zabbix proxy can only work in active or passive mode: Y P In active mode Zabbix proxy is controlling all the update intervals In passive mode Zabbix server is controlling all the update intervals O C Proxy connects every ConfigFrequency seconds and retrieves configuration (1 hour by default) T N Proxy connects every DataSenderFrequency seconds and sends data, if any (1 second by default) U T E D S 6.0 Certified Professional ● Day 1 Active proxy Server connects every ProxyConfigFrequency seconds and sends configuration (1 hour by default) Server connects every ProxyDataFrequency seconds and retrieves data (1 second by default) © 2023 by Zabbix. All rights reserved Passive proxy Theory 63 PROXY RUN-TIME COMMANDS The configuration cache of an active proxy can be updated on request: Y P # zabbix_proxy --runtime-control config_cache_reload Active proxy: O C Requests the latest configuration from Zabbix server database Reloads configuration cache on the proxy T N Runtime control command was forwarded successfully Passive proxy: The command is ignored E D Cannot perform configuration cache reloading on passive proxy U T Other runtime commands supported by proxies: # # # # # S zabbix_proxy zabbix_proxy zabbix_proxy zabbix_proxy zabbix_proxy --runtime-control --runtime-control --runtime-control --runtime-control --runtime-control 6.0 Certified Professional ● Day 1 housekeeper_execute log_level_increase log_level_decrease snmp_cache_reload diaginfo=section © 2023 by Zabbix. All rights reserved Theory 64 PROXY CONFIGURATION Creating or configuring proxy: Y P Enter Proxy name Select active or passive Proxy mode Enter Proxy address Specify encryption parameters T N Encryption is optional E D U T S 6.0 Certified Professional ● Day 1 O C © 2023 by Zabbix. All rights reserved Theory 65 PROXY LIST Proxy list in the frontend displays: Y P Proxy mode Encryption Compression Last seen T N Host, item count Required performance O C E D Proxy view in Zabbix queue shows Zabbix server and per-proxy performance: U T S 6.0 Certified Professional ● Day 1 © 2023 by Zabbix. All rights reserved Theory 66 PROXY COMPRESSION All the data sent by a proxy is compressed: Y P Improved data transfer speed (5x-10x less network bandwidth) No impact on CPU and memory O C Compression is enabled by default and cannot be turned off sending sending sending sending sending configuration configuration configuration configuration configuration to to to to to T N "New York proxy", datalen 2757379, bytes 243985 with compression ratio 11.3 "London proxy", datalen 1355924, bytes 117055 with compression ratio 11.6 "Tokyo proxy", datalen 161761, bytes 16140 with compression ratio 10.0 "Paris proxy", datalen 7249340, bytes 597097 with compression ratio 12.1 "Dallas proxy", datalen 2648013, bytes 232968 with compression ratio 11.4 U T E D S 6.0 Certified Professional ● Day 1 © 2023 by Zabbix. All rights reserved Theory 67 MONITORING PROXIES Health of all the Zabbix proxies must be monitored: Y P The same internal items are used as for Zabbix server If some of the processes/ caches are overloaded, adjust the configuration accordingly E D U T S 6.0 Certified Professional ● Day 1 T N O C © 2023 by Zabbix. All rights reserved Theory 68 MONITORING PROXIES Use built-in "Zabbix proxy health" template: Y P Monitors proxy internal metrics The host with this template assigned needs to be monitored by the same proxy O C Otherwise, it will report metrics to Zabbix server(because of internal item types) T N HeartbeatFrequency: Ensures the server will notice active proxy missing E D Heartbeat is sent every minute by default Internal item: zabbix[proxy,"Proxy name",lastaccess] U T S A trigger based on the function fuzzytime: fuzzytime(/Zabbix server/zabbix[proxy,"Proxy name",lastaccess],3m)=0 6.0 Certified Professional ● Day 1 © 2023 by Zabbix. All rights reserved Theory 69 MONITORING PROXIES Add a regular host to monitor proxy: Name: Y P Enter any name Groups: Choose any group Interface is not required T N Link to "Zabbix proxy health" template O C E D Set that proxy is monitored by itself! Check the latest data, graphs and screens U T S 6.0 Certified Professional ● Day 1 © 2023 by Zabbix. All rights reserved Theory 70 PROXY FUNCTIONALITY Zabbix proxy is a data collector, it does not: Y P Calculate triggers Process and correlate events Process and send alerts T N All the other functionality is fully supported: Proxy can collect any type of metrics O C E D A proxy can collect LLD data and send to server Proxies preprocess data U T Items can be tested using proxies Remote commands can be executed on proxies S Auto-creation of a database is for SQLite only For other DB types database must be created manually 6.0 Certified Professional ● Day 1 © 2023 by Zabbix. All rights reserved Theory 71 BENEFITS OF PROXIES All the data on Zabbix server is collected only using trappers or proxy pollers: Y P Zabbix server data collectors are not used O C The load can be distributed by adding more proxies: Preprocessing is done by proxies T N Data collectors are utilized on proxies Discard unchanged with heartbeat reduces network traffic Easy to maintain: U T E D Only needs to install proxy, monitoring configuration is downloaded automatically S Only single communication port is needed between Zabbix server and proxy Zabbix proxy caches data, if Zabbix server is unreachable 6.0 Certified Professional ● Day 1 © 2023 by Zabbix. All rights reserved Theory 72 PERFORMANCE CONSIDERATIONS Zabbix server requirements: Y P Fast CPU Fast storage for processing of historical information O C Number of trappers should be higher than number of Active Proxies Must be able to handle higher than normal NVPS after proxy downtime T N Proxy hardware requirements depend on: E D Number of NVPS (new values per second) collected by the proxy Complexity of preprocessing steps processed by the proxy U T Embedded hardware can be used for small proxy instances S Using multiple proxies helps to offload Zabbix server: Can be used to scale Zabbix setup horizontally 6.0 Certified Professional ● Day 1 © 2023 by Zabbix. All rights reserved Theory 73 PROXY COMMUNICATION ISSUES In case of communication error with Zabbix server proxy stores all the data locally: Y P The data is sent as soon as possible when Zabbix server is online again O C This can cause problems if multiple proxies will send huge amount of data simultaneously T N Zabbix has built-in protection against overloading with data: If history cache is > 80% full, Zabbix will stop accepting new data from some proxies E D A FIFO priority list is used to prioritize both active and passive proxies Round Robin principle is used to cycle proxies. No preferences are used to sort this list U T S 6.0 Certified Professional ● Day 1 Sorry, my cache is already full © 2023 by Zabbix. All rights reserved Theory 74 THROTTLING ON PROXIES Using throttling on proxies can greatly reduce network traffic: Y P Proxy sends all the collected data to Zabbix server 10000 NVPS O C 10000 NVPS T N E D It is possible to discard duplicated values on proxy and not to send them to Zabbix server U T S 6.0 Certified Professional ● Day 1 10000 NVPS © 2023 by Zabbix. All rights reserved 1000 NVPS Theory 75 DO NOT KEEP HISTORY Proxy will not send data from a master item to the server if history is not kept: Y P This affects textual data only If the master item data type is numerical, it still will be sent for trend calculations O C Unneeded data will be discarded on proxy and not sent or stored in a local database Data is still sent if they are used in Inventory No history for master item E D U T S 6.0 Certified Professional ● Day 1 T N Open_tables = 10 Threads_cached = 3 Threads_created = 152 Threads_running = 25 Bytes_received = 932076 Bytes_sent = 62974983 Bytes_total = 79835355 ..... ..... Uptime = 24561 © 2023 by Zabbix. All rights reserved Open tables = 10 Threads running = 25 Uptime = 24561 Theory 76 PRACTICAL SETUP Y P 1) Set up an active proxy with SQLite by using Podman: Name: Config update frequency: Add the proxy in the Frontend Zabbix Active proxy 5 minutes O C 2) Create a new host to monitor Training resources host using Zabbix active proxy Name: Address: T N Training resources DNS training.lan E D 3) Set up passive proxy with SQLite by using Podman: Name: Add the proxy in the Frontend U T Zabbix Passive proxy 4) Create two hosts to monitor internal metrics of your proxies: Link "Zabbix proxy health" template to the hosts Make sure that the proxies are monitoring themselves S 6.0 Certified Professional ● Day 1 © 2023 by Zabbix. All rights reserved 30 minutes Practical task No: 4 77 Y P E DZabbix Agent 2 U T S 6.0 Certified Professional ● Day 1 T N O C © 2023 by Zabbix. All rights reserved 30 minutes 78 ZABBIX AGENT 2 AGENT 2 PLUGIN NETWORK CPU E D U T PLUGIN LOG scheduled/flexible intervals S older configuration file support SCHEDULER T N PLUGIN Y P BUILT-IN O C written in Go PLUGIN DATABASE less TCP connections out-of-the-box systemd monitoring easily extendable 6.0 Certified Professional ● Day 1 © 2023 by Zabbix. All rights reserved Theory 79 AGENT 2 DESCRIPTION Zabbix agent 2 is written in Go (GoLang): Y P A drop-in replacement for Zabbix agent: Supports all the previous functionality (the same item keys) Supports old configuration file format Has been developed to: Reduce the number of TCP connections Be easily extendible with plugins T N Improved active checks: O C E D Active checks support scheduled/flexible intervals Parallel execution of multiple active checks for each ServerActive U T Agent 2 currently has limited systemd support Can be installed as a Windows service S SQLite can be used to buffer data i https://www.zabbix.com/documentation/6.0/manual/concepts/agent2 6.0 Certified Professional ● Day 1 © 2023 by Zabbix. All rights reserved Theory 80