### VMware Monitoring Setup Example Source: https://www.zabbix.com/documentation/current/en/manual/vm_monitoring/vmware_json Illustrates a practical setup example for VMware monitoring in Zabbix, likely involving configuration of hosts, items, and potentially low-level discovery rules. ```text 1. Configure Zabbix server to connect to vCenter. 2. Create a host in Zabbix representing the vCenter or individual ESXi hosts. 3. Add items using the VMware item keys to collect desired metrics. 4. For automatic discovery of VMs, configure Low-Level Discovery (LLD) rules using VMware-specific LLD macros and JSONPath. ``` -------------------------------- ### Start Zabbix Server (Package Install) Source: https://www.zabbix.com/documentation/current/en/manual/concepts/server Use this command to start the Zabbix server when installed as a package on most GNU/Linux systems. ```bash systemctl start zabbix-server ``` -------------------------------- ### Run Zabbix Proxy with Configuration File Source: https://www.zabbix.com/documentation/current/en/manual/concepts/proxy Example of starting Zabbix proxy with a specific configuration file path. ```bash zabbix_proxy -c /usr/local/etc/zabbix_proxy.conf ``` -------------------------------- ### Start Request Example Source: https://www.zabbix.com/documentation/current/en/manual/appendix/protocols/zabbix_agent2_plugin The agent sends this request to initiate the Start function of a plugin's Runner interface. It only contains common data parameters. ```json {"id":3,"type":4} ``` -------------------------------- ### Module Get Response Example Source: https://www.zabbix.com/documentation/current/en/manual/api/reference/module/get This is an example of the response structure when retrieving module data. It includes details like module ID, relative path, status, and configuration. ```json { "jsonrpc": "2.0", "result": [ { "moduleid": "1", "id": "actionlog", "relative_path": "widgets/actionlog", "status": "1", "config": [] }, { "moduleid": "2", "id": "clock", "relative_path": "widgets/clock", "status": "1", "config": [] }, { "moduleid": "25", "id": "example", "relative_path": "modules/example_module", "status": "1", "config": [] } ], "id": 1 } ``` -------------------------------- ### Run Zabbix Server with Parameters Source: https://www.zabbix.com/documentation/current/en/manual/concepts/server Examples demonstrating how to run the Zabbix server with specific command-line arguments. ```bash zabbix_server -c /usr/local/etc/zabbix_server.conf ``` ```bash zabbix_server --help ``` ```bash zabbix_server -V ``` -------------------------------- ### GET Request to Elasticsearch Source: https://www.zabbix.com/documentation/current/en/manual/config/items/itemtypes/http Example of creating a GET item to retrieve data from Elasticsearch. Includes the URL and a sample response. ```json { "name" : "YQ2VAY-", "cluster_name" : "elasticsearch", "cluster_uuid" : "kH4CYqh5QfqgeTsjh2F9zg", "version" : { "number" : "6.1.3", "build_hash" : "af51318", "build_date" : "2018-01-26T18:22:55.523Z", "build_snapshot" : false, "lucene_version" : "7.1.0", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" : "You know, for search" } ``` -------------------------------- ### SSH Subsystem Examples Source: https://www.zabbix.com/documentation/current/en/manual/config/items/itemtypes/ssh_checks Demonstrates how to use SSH subsystems like SFTP and NETCONF within the ssh.run item key. ```text ssh.run[SFTPBackup,192.0.2.18,,,,sftp] ``` ```text ssh.run[Cisco1234,192.0.2.18,,,,netconf] ``` -------------------------------- ### Start Zabbix Agent with Default Configuration Source: https://www.zabbix.com/documentation/current/en/manual/appendix/install/windows_agent Starts a single instance of the Zabbix agent service that was installed with the default configuration file. ```bash zabbix_agentd.exe --start ``` -------------------------------- ### Start Zabbix Server (Alternative Init Script) Source: https://www.zabbix.com/documentation/current/en/manual/concepts/server If 'systemctl' is not available, use this command to start the Zabbix server via its init script. ```bash /etc/init.d/zabbix-server start ``` -------------------------------- ### Run Zabbix Web Service Source: https://www.zabbix.com/documentation/current/en/manual/appendix/install/web_service Start the Zabbix web service process after installation. This command is run on the machine where the web service is installed. ```bash zabbix_web_service ``` -------------------------------- ### Force Active Checks on Start Example Source: https://www.zabbix.com/documentation/current/en/manual/extensions/plugins Example of setting a configuration parameter to force active checks immediately after agent restart for the Uptime plugin. ```configuration Plugins.Uptime.System.ForceActiveChecksOnStart=1 ``` -------------------------------- ### Example: Create Server/Proxy User Source: https://www.zabbix.com/documentation/current/en/manual/best_practices/security/access_control/postgresql Example of creating a user 'usr_srv' with a password and assigning the 'zbx_srv' role to it. ```sql CREATE USER usr_srv WITH ENCRYPTED password 'password'; GRANT zbx_srv TO usr_srv; ``` -------------------------------- ### Start Zabbix Agent using systemctl Source: https://www.zabbix.com/documentation/current/en/manual/concepts/agent Use this command to start the Zabbix agent service on most GNU/Linux systems. Ensure the agent is installed via packages. ```bash systemctl start zabbix-agent ``` -------------------------------- ### Display Help Source: https://www.zabbix.com/documentation/current/en/manpages/zabbix_get Show the help message for the zabbix_get utility, listing all available options and their descriptions. ```bash zabbix_get -h ``` -------------------------------- ### Example Input File Line Source: https://www.zabbix.com/documentation/current/en/manpages/zabbix_sender Demonstrates the format for a single line in an input file for zabbix_sender, specifying hostname, item key, and value. ```plaintext "Linux DB3" db.connections 43 ``` -------------------------------- ### SNMP Get OID Example Source: https://www.zabbix.com/documentation/current/en/manual/config/items/itemtypes/snmp Use 'get[OID]' to retrieve a single value asynchronously. This is recommended for better performance compared to synchronous OID retrieval. ```text get[1.3.6.1.2.1.31.1.1.1.6.3] ``` -------------------------------- ### Include configuration files Source: https://www.zabbix.com/documentation/current/en/manual/appendix/config/zabbix_agent2_win This snippet shows how to include additional configuration files or all files matching a pattern from a directory. Ensure included files have correct syntax to prevent agent startup failure. ```text Include=C:\ Program Files\Zabbix Agent2\zabbix_agent2.d\*.conf ``` -------------------------------- ### Token Get Response Example Source: https://www.zabbix.com/documentation/current/en/manual/api/reference/token/get This is an example response for the token.get method when retrieving a specific token. It includes details such as token ID, name, user ID, and expiration. ```json { "jsonrpc": "2.0", "result": [ { "tokenid": "1", "name": "The Token", "description": "", "userid": "1", "lastaccess": "0", "status": "0", "expires_at": "1609406220", "created_at": "1611239454", "creator_userid": "1" } ], "id": 1 } ``` -------------------------------- ### Start Zabbix Proxy (init.d) Source: https://www.zabbix.com/documentation/current/en/manual/concepts/proxy Use this command to start the Zabbix proxy service on systems using init.d scripts. ```bash /etc/init.d/zabbix-proxy start ``` -------------------------------- ### Correct Environment Variable Syntax Examples Source: https://www.zabbix.com/documentation/current/en/manual/appendix/config/environment_variables Demonstrates the correct syntax for environment variables in Zabbix configuration files. ```bash DebugLevel=${NEW_DEBUG_LEVEL} Hostname=${ZBX_HOSTNAME} LogFile=${LogFile_001} ``` -------------------------------- ### Response Example for Item Get Source: https://www.zabbix.com/documentation/current/en/manual/api/reference/item/get Example response structure when retrieving items using the item.get method. It includes details for CPU utilization and load average items. ```json { "jsonrpc": "2.0", "result": [ { "itemid": "42269", "type": "18", "snmp_oid": "", "hostid": "10084", "name": "CPU utilization", "key_": "system.cpu.util", "delay": "0", "history": "7d", "trends": "365d", "status": "0", "value_type": "0", "trapper_hosts": "", "units": "%", "logtimefmt": "", "templateid": "42267", "valuemapid": "0", "params": "", "ipmi_sensor": "", "authtype": "0", "username": "", "password": "", "publickey": "", "privatekey": "", "flags": "0", "interfaceid": "0", "description": "CPU utilization in %.", "inventory_link": "0", "evaltype": "0", "jmx_endpoint": "", "master_itemid": "42264", "timeout": "", "url": "", "query_fields": [], "posts": "", "status_codes": "200", "follow_redirects": "1", "post_type": "0", "http_proxy": "", "headers": [], "retrieve_mode": "0", "request_method": "0", "output_format": "0", "ssl_cert_file": "", "ssl_key_file": "", "ssl_key_password": "", "verify_peer": "0", "verify_host": "0", "allow_traps": "0", "uuid": "", "state": "0", "error": "", "parameters": [], "lastclock": "0", "lastns": "0", "lastvalue": "0", "prevvalue": "0", "name_resolved": "CPU utilization" }, { "itemid": "42259", "type": "0", "snmp_oid": "", "hostid": "10084", "name": "Load average (15m avg)", "key_": "system.cpu.load[all,avg15]", "delay": "1m", "history": "7d", "trends": "365d", "status": "0", "value_type": "0", "trapper_hosts": "", "units": "", "logtimefmt": "", "templateid": "42219", "valuemapid": "0", "params": "", "ipmi_sensor": "", "authtype": "0", "username": "", "password": "", "publickey": "", "privatekey": "", "flags": "0", "interfaceid": "1", "description": "", "inventory_link": "0", "evaltype": "0", "jmx_endpoint": "", "master_itemid": "0", "timeout": "", "url": "", "query_fields": [], "posts": "", "status_codes": "200", "follow_redirects": "1", "post_type": "0", "http_proxy": "", "headers": [], "retrieve_mode": "0", "request_method": "0", "output_format": "0", "ssl_cert_file": "", "ssl_key_file": "", "ssl_key_password": "", "verify_peer": "0", "verify_host": "0", "allow_traps": "0", "uuid": "", "state": "0", "error": "", "parameters": [], "lastclock": "0", "lastns": "0", "lastvalue": "0", "prevvalue": "0", "name_resolved": "Load average (15m avg)" }, { "itemid": "42249", "type": "0", "snmp_oid": "", "hostid": "10084", "name": "Load average (1m avg)", "key_": "system.cpu.load[all,avg1]", "delay": "1m", "history": "7d", "trends": "365d", "status": "0", "value_type": "0", "trapper_hosts": "", "units": "", "logtimefmt": "", "templateid": "42209", "valuemapid": "0", "params": "", "ipmi_sensor": "", "authtype": "0", "username": "", "password": "", "publickey": "", "privatekey": "", "flags": "0", "interfaceid": "1", "description": "", "inventory_link": "0", "evaltype": "0", "jmx_endpoint": "", "master_itemid": "0", "timeout": "", "url": "", "query_fields": [], "posts": "", "status_codes": "200", "follow_redirects": "1", "post_type": "0", "http_proxy": "", "headers": [], "retrieve_mode": "0", "request_method": "0", "output_format": "0", "ssl_cert_file": "", "ssl_key_file": "", "ssl_key_password": "", "verify_peer": "0", "verify_host": "0", "allow_traps": "0", "uuid": "", "state": "0", "error": "", "parameters": [], "lastclock": "0", "lastns": "0", "lastvalue": "0", "prevvalue": "0", "name_resolved": "Load average (1m avg)" } ] } ``` -------------------------------- ### Install Kerberos KDC and client utilities Source: https://www.zabbix.com/documentation/current/en/manual/appendix/items/kerberos Installs the necessary Kerberos packages on Debian/Ubuntu systems. Ensure you answer the prompts during setup to define your Kerberos realm and servers. ```bash sudo apt update sudo apt install krb5-kdc krb5-admin-server krb5-user ``` -------------------------------- ### Secured AllowKey and DenyKey Rules Source: https://www.zabbix.com/documentation/current/en/manual/config/items/restrict_checks This example shows how to secure the previous rules by explicitly defining allowed arguments for scripts and using more precise patterns for item keys. ```text AllowKey=system.run["C:\\Program^ Files\\Zabbix^ Agent^ 2\\scripts\\test.bat status"] AllowKey=system.run["C:\\Program^ Files\\Zabbix^ Agent^ 2\\scripts\\test.bat version"] DenyKey=vfs.file.*[*] DenyKey=system.cpu.load DenyKey=system.cpu.load[*] ``` -------------------------------- ### View Configure Help Source: https://www.zabbix.com/documentation/current/en/manual/installation/install Display all supported configuration options for Zabbix by running the configure script with the --help flag. ```bash ./configure --help ``` -------------------------------- ### Install Zabbix Agent with Custom Configuration and TLS Source: https://www.zabbix.com/documentation/current/en/manual/installation/install_from_packages/win_msi Installs Zabbix agent with a custom installation folder, hostname, and enables TLS support using pre-shared keys. This example also configures specific host permissions for agent commands. ```bash mkdir "C:\Program Files\Zabbix Agent" 2>nul msiexec.exe /l*v "C:\package.log" /i "C:\zabbix_agent-7.4.0-windows-amd64-openssl.msi" /qn+ \ SERVER=192.0.2.1\ INSTALLFOLDER="C:\Program Files\Zabbix Agent"\ HOSTNAME=LAPTOP-IKP7S51S\ TLSACCEPT=psk\ TLSCONNECT=psk\ TLSPSKIDENTITY="PSK 001"\ TLSPSKFILE="C:\Program Files\Zabbix Agent\psk.key"\ TLSPSKVALUE=1f87b595725ac58dd977beef14b97461a7c1045b9a1c963065002c5473194952\ ENABLEPATH=1\ ALLOWDENYKEY="AllowKey=system.run[type C:\Windows\System32\drivers\etc\hosts];DenyKey=system.run[*]" ``` -------------------------------- ### Start Zabbix Agent with Custom Configuration Source: https://www.zabbix.com/documentation/current/en/manual/appendix/install/windows_agent Starts a single instance of the Zabbix agent service that was installed with a specific configuration file. The path to the configuration file must be provided. ```bash zabbix_agentd.exe --config --start ``` -------------------------------- ### User Macro Examples with Context Source: https://www.zabbix.com/documentation/current/en/manual/config/macros/user_macros_context Illustrates different ways to define user macros with static and regular expression contexts, including examples for specific paths and patterns. ```text {$LOW_SPACE_LIMIT} ``` ```text {$LOW_SPACE_LIMIT:/tmp} ``` ```text {$LOW_SPACE_LIMIT:regex:"^/tmp$"} ``` ```text {$LOW_SPACE_LIMIT:regex:"^/var/log/.*$"} ``` -------------------------------- ### Map Get API Response Example Source: https://www.zabbix.com/documentation/current/en/manual/api/reference/map/get This is an example response from the map.get API call, showing the structure of map data including selements, links, users, userGroups, and shapes. ```json { "jsonrpc": "2.0", "result": [ { "selements": [ { "selementid": "10", "sysmapid": "3", "elementtype": "4", "evaltype": "0", "iconid_off": "1", "iconid_on": "0", "label": "Zabbix server", "label_location": "3", "x": "11", "y": "141", "iconid_disabled": "0", "iconid_maintenance": "0", "elementsubtype": "0", "areatype": "0", "width": "200", "height": "200", "viewtype": "0", "use_iconmap": "1", "show_label": "-1", "zindex":"0", "elements": [], "urls": [], "tags": [ { "tag": "service", "value": "mysqld", "operator": "0" } ] }, { "selementid": "11", "sysmapid": "3", "elementtype": "4", "evaltype": "0", "iconid_off": "1", "iconid_on": "0", "label": "Web server", "label_location": "3", "x": "211", "y": "191", "iconid_disabled": "0", "iconid_maintenance": "0", "elementsubtype": "0", "areatype": "0", "width": "200", "height": "200", "viewtype": "0", "use_iconmap": "1", "show_label": "0", "zindex":"0", "elements": [], "urls": [], "tags": [] }, { "selementid": "12", "sysmapid": "3", "elementtype": "0", "evaltype": "0", "iconid_off": "185", "iconid_on": "0", "label": "{HOST.NAME}\r\n{HOST.CONN}", "label_location": "0", "x": "111", "y": "61", "iconid_disabled": "0", "iconid_maintenance": "0", "elementsubtype": "0", "areatype": "0", "width": "200", "height": "200", "viewtype": "0", "use_iconmap": "0", "show_label": "1", "zindex":"0", "elements": [ { "hostid": "10084" } ], "urls": [], "tags": [] } ], "links": [ { "linkid": "23", "sysmapid": "3", "selementid1": "10", "selementid2": "11", "drawtype": "0", "color": "00CC00", "label": "", "show_label": "1", "indicator_type": "0", "itemid": "0", "linktriggers": [], "thresholds": [], "highlights": [] } ], "users": [ { "sysmapuserid": "1", "userid": "2", "permission": "2" } ], "userGroups": [ { "sysmapusrgrpid": "1", "usrgrpid": "7", "permission": "2" } ], "shapes":[ { "sysmap_shapeid":"1", "type":"0", "x":"0", "y":"0", "width":"680", "height":"15", "text":"{MAP.NAME}", "font":"9", "font_size":"11", "font_color":"000000" } ] } ] } ``` -------------------------------- ### LoadModule Configuration Examples Source: https://www.zabbix.com/documentation/current/en/manual/appendix/config/zabbix_server Examples of how to specify modules to be loaded at Zabbix server startup. Modules extend server functionality and must be located in the directory specified by LoadModulePath or have a preceding path. ```zabbix_config LoadModule=my_module.so ``` ```zabbix_config LoadModule=modules/my_module.so ``` ```zabbix_config LoadModule=/etc/zabbix/modules/my_module.so ``` -------------------------------- ### Task Get Response Example Source: https://www.zabbix.com/documentation/current/en/manual/api/reference/task/get This is an example response for the task.get method when retrieving a task by its ID. It includes detailed information about the task's status, execution details, and associated requests. ```json { "jsonrpc": "2.0", "result": [ { "taskid": "1", "type": "7", "status": "3", "clock": "1601039076", "ttl": "3600", "proxyid": null, "request": { "alerting": { "stats": [ "alerts" ], "top": { "media.alerts": 10 } }, "lld": { "stats": "extend", "top": { "values": 5 } } }, "result": { "data": { "alerting": { "alerts": 0, "top": { "media.alerts": [] }, "time": 0.000663 }, "lld": { "rules": 0, "values": 0, "top": { "values": [] }, "time": 0.000442 } }, "status": "0" } } ], "id": 1 } ``` -------------------------------- ### Create a basic item prototype Source: https://www.zabbix.com/documentation/current/en/manual/api/reference/itemprototype/create This snippet demonstrates how to create a basic item prototype for monitoring free disk space. It specifies essential parameters like name, key, hostid, ruleid, type, value_type, interfaceid, and delay. ```json { "jsonrpc": "2.0", "method": "itemprototype.create", "params": { "name": "Free disk space on {#FSNAME}", "key_": "vfs.fs.size[{#FSNAME},free]", "hostid": "10197", "ruleid": "27665", "type": 0, "value_type": 3, "interfaceid": "112", "delay": "30s" }, "id": 1 } ``` ```json { "jsonrpc": "2.0", "result": { "itemids": [ "27666" ] }, "id": 1 } ``` -------------------------------- ### Redis Slowlog Count Source: https://www.zabbix.com/documentation/current/en/manual/config/items/itemtypes/zabbix_agent/zabbix_agent2 Gets the number of slow log entries since Redis was started. ```APIDOC ## redis.slowlog.count[connString,] ### Description The number of slow log entries since Redis was started. ### Parameters * **connString** - the URI or session name; * **password** - the Redis password. ``` -------------------------------- ### SSH Options Examples Source: https://www.zabbix.com/documentation/current/en/manual/config/items/itemtypes/ssh_checks Provides examples of passing additional SSH options to the ssh.run item key, such as cipher suites and key types. ```text ssh.run[KexAlgorithms,127.0.0.1,,,Ciphers=aes128-ctr] ``` ```text ssh.run[KexAlgorithms,,,,"KexAlgorithms=diffie-hellman-group1-sha1;HostkeyAlgorithms=ssh-rsa,ssh-dss,ecdh-sha2-nistp256"] ``` ```text ssh.run[PubkeyAcceptedKeyTypes,127.0.0.1,,,PubkeyAcceptedKeyTypes=ssh-rsa] ``` -------------------------------- ### HTTP Header Configuration Example Source: https://www.zabbix.com/documentation/current/en/manual/web_monitoring Shows how to define HTTP headers for web scenario requests, following standard HTTP protocol syntax. These headers are applied to scenario steps. ```text Accept-Charset=utf-8 Accept-Language=en-US ``` -------------------------------- ### Get Processor Load with Zabbix Get Source: https://www.zabbix.com/documentation/current/en/manual/concepts/get Example of using zabbix_get to retrieve the average 1-minute processor load from a Zabbix agent. Ensure you are in the 'bin' directory or provide the full path to the executable. ```bash cd bin ./zabbix_get -s 127.0.0.1 -p 10050 -k system.cpu.load[all,avg1] ```