Zabbix: Difference between revisions

From DWIKI
mNo edit summary
(59 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Links=
*[http://www.zabbix.org/ Homepage]
*[https://zabbix.org/wiki/Docs/DB_schema/4.0 zabbix 4 database schema]
*https://www.digitalocean.com/community/tutorials/introduction-to-queries-mysql
*[http://zabbix.org/wiki/Compilation_instructions compilation instructions]
*[http://www.zabbix.com/documentation Documentation]
*[https://dev.mysql.com/doc/mysql-tutorial-excerpt/8.0/en/examples.html Examples of Common Queries]
*[http://zabbixzone.com/zabbix/easy-update-on-custom-scripts/ Custom scripts]
*[https://github.com/q1x/zabbix-gnomes Various scripts to automate tasks in Zabbix]
*[https://www.percona.com/blog/2014/11/14/optimizing-mysql-zabbix/ Tuning mysql for zabbix]
*https://huyabbix.com
*[http://techblog.procurios.nl/k/n618/news/view/56429/14863/how-to-migrate-mysql-databases-without-downtime.html Migrating zabbix database with minimal downtime]
*[https://support.zabbix.com/browse/ZBX/ Bug tracker]
*[http://www.michaelfoster82.co.uk/zabbix-database-cleanup-delete-old-data/ Clean up database]
*[https://linux.die.net/man/8/zabbix_selinux Zabbix and selinux]
*[[ Zabbix on RHEL/Centos ]]
*[[Grafana]]


=Installing from git=
 
  git clone https://github.com/zabbix/zabbix.git
= Links =
 
*[http://www.zabbix.org/ Homepage]
*[https://zabbix.org/wiki/Docs/DB_schema/4.0 zabbix 4 database schema]
*[https://www.digitalocean.com/community/tutorials/introduction-to-queries-mysql https://www.digitalocean.com/community/tutorials/introduction-to-queries-mysql]
*[http://zabbix.org/wiki/Compilation_instructions compilation instructions]
*[http://www.zabbix.com/documentation Documentation]
*[https://dev.mysql.com/doc/mysql-tutorial-excerpt/8.0/en/examples.html Examples of Common Queries]
*[http://zabbixzone.com/zabbix/easy-update-on-custom-scripts/ Custom scripts]
*[https://github.com/q1x/zabbix-gnomes Various scripts to automate tasks in Zabbix]
*[https://www.percona.com/blog/2014/11/14/optimizing-mysql-zabbix/ Tuning mysql for zabbix]
*[https://huyabbix.com https://huyabbix.com]
*[http://techblog.procurios.nl/k/n618/news/view/56429/14863/how-to-migrate-mysql-databases-without-downtime.html Migrating zabbix database with minimal downtime]
*[https://support.zabbix.com/browse/ZBX/ Bug tracker]
*[http://www.michaelfoster82.co.uk/zabbix-database-cleanup-delete-old-data/ Clean up database]
*[https://linux.die.net/man/8/zabbix_selinux Zabbix and selinux]
*[https://github.com/a-schild/zabbix-ssl Apache/SSL checks]
*[[Zabbix_on_RHEL/Centos|Zabbix on RHEL/Centos]]
*[[Grafana|Grafana]]
*[https://blog.zabbix.com/zabbix-ha-cluster-setups/8264/ https://blog.zabbix.com/zabbix-ha-cluster-setups/8264/] Zabbix HA cluster]
 
*[https://geofrogger.net/review/zabbix20.svg Very old network diagram]
*[https://blog.zabbix.com/fighting-notification-floods-and-misleading-alerts-in-distributed-zabbix-deployments/11600/ Fighting zabbix alert floods]
 
 
 
== Zabbix API ==
 
*[https://www.zabbix.com/documentation/current/manual/api The Zabbix API]
*[https://www.zabbix.com/integrations/python API and python]
 
= Installing from git =
 
  git clone [https://github.com/zabbix/zabbix.git https://github.com/zabbix/zabbix.git]
  cd zabbix  
  cd zabbix  
  ./bootstrap.sh
  ./bootstrap.sh


 
= Zabbix error codes =
== Z3005 ==
Database issue
= Items =
== proc.mem ==
proc.mem[<name>,<user>,<mode>,<cmdline><memtype>]
=== name ===
??
=== cmdline ===
probably the one to look for
&nbsp;
&nbsp;
&nbsp;
= Templates =
*[https://github.com/zabbix/community-templates/ Community templates]
= Configuration =
== Zabbix agent active ==
=== On client ===
=== On server ===
Set Agent IP to 0.0.0.0
&nbsp;
= FAQ =
== SERVER ==
=== Adjust loglevel ===
zabbix_server --runtime-control log_level_increase=trapper
     
&nbsp;
=== Reload zabbix server configuration ===
You can't, but you might want
zabbix_server -c /etc/zabbix/zabbix_server.conf -R config_cache_reload
&nbsp;
=== No media defined for user ===
=== The frontend does not match Zabbix database. ===
Probably version conflict between frontend and server
&nbsp;
=== value cache working in low memory mode ===
Increase ValueCacheSize
&nbsp;
== PROXY ==
==Nodata and proxy==
https://www.zabbix.com/documentation/5.0/en/manual/introduction/whatsnew500#no-data-triggers-sensitive-to-proxy-availability
=== Zabbix does not support SQLite3 database upgrade. ===
Stop the proxy and (re)move the .db file
=== [Z3002] cannot create database 'zabbix_proxy': [0] unable to open database file ===
fix path
&nbsp;
=== Cannot parse heartbeat from active proxy ===
TBD, probably name issue
=== Troubleshoot high queue on proxy ===
*[https://blog.zabbix.com/how-to-troubleshoot-zabbix-proxy-high-queue/12244/ https://blog.zabbix.com/how-to-troubleshoot-zabbix-proxy-high-queue/12244/]
=== poller data processes ===


StartPollers


=Templates=
=== cannot obtain data from proxy "proxybox": ZBX_TCP_READ() failed: [104] Connection reset by peer ===
==Mysql template==


?????


=FAQ=
&nbsp;


=== force "sending configuration data to proxy" ===


zabbix_proxy -R config_cache_reload


&nbsp;
&nbsp;
&nbsp;
== Front end ==
=== Visable name vs hostname ===
Visible name: {HOST.NAME}
Hostname: {HOST.HOST}
Host IP: (as defined in Interface->IP/DNS) {HOST.CONN}
&nbsp;
=== Acknowledge multiple items ===
Monitor->Problems apply filters, select all, mass update
&nbsp;
=== No permissions to referred object or it does not exist! ===
Graph no longer exists. Porbably items no longer discovered
=== Cannot add host ===
??
== SNMP ==
=== Cannot find host interface on "xxxhost" for item key foo ===
Might mean you're trying to import an SNMP template before configuring SNMP for the host
&nbsp;
&nbsp;
=== No SNMP data ===
=== snmp_parse_oid(): cannot parse OID "IF-MIB::ifSpeed.3 ===
== Agent side ping check ==


==Agent side ping check==
  UserParameter=pingtime[*],fping -e $1|sed 's/^.*(\([0-9].*\) ms).*$/\1/g'
  UserParameter=pingtime[*],fping -e $1|sed 's/^.*(\([0-9].*\) ms).*$/\1/g'
  UserParameter=pingalive[*],fping $1|grep -q alive;echo $?
  UserParameter=pingalive[*],fping $1|grep -q alive;echo $?


==IPMI errors==
&nbsp;
===cannot connect to IPMI host: [22] Operation canceled===
 
&nbsp;
 
== IPMI ==
 
=== IPMI Monitoring account for zabbix ===
 
[https://www.thomas-krenn.com/en/wiki/Configuring_IPMI_under_Linux_using_ipmitool https://www.thomas-krenn.com/en/wiki/Configuring_IPMI_under_Linux_using_ipmitool]
 
&nbsp;
 
=== cannot connect to IPMI host: [22] Operation canceled ===
 
Usually temporary because of broken ipmi lib, ignore it
Usually temporary because of broken ipmi lib, ignore it


&nbsp;
=== cannot connect to IPMI host: [16777411] Unknown error 16777411 ===
classic, probably authentication problem
=== cannot connect to IPMI host: [22] Invalid argument ===
== zabbix_sender ==
=== processed: 0; failed: 1 ===
Possible causes:
*incorrect hostname
*incorrect item key
*item not in the server configuration cache yet
*Allowed hosts in trapper item
*phase of moon
*aliens
&nbsp;
=== Testing zabbix_sender ===
zabbix_sender stuff
== Filters ==
The regular expressions referred to in discovery are found under Administration->General, and then "Regular expressions" in the dropdown at top right of the page
=== cannot connect to IPMI host: [125] Operation canceled ===


===cannot connect to IPMI host: [125] Operation canceled===
possibly authentication method issue
possibly authentication method issue


==Discover: value must be a JSON object==
== Discover: value must be a JSON object ==
 
Could mean you need to escape slashes
Could mean you need to escape slashes


==Install recent zabbix on CentOS/RHEL==
&nbsp;
  rpm -ivh https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
 
== Cannot create item: Invalid first parameter ==
 
Problably a calculated item, try doublequoting the item key:
 
last("foo[bar]")
 
&nbsp;
 
== Install recent zabbix on CentOS/RHEL ==
 
  rpm -ivh [https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm]
  yum install zabbix-agent
  yum install zabbix-agent


==Discovery data example==
== Discovery data example ==
 
Output of a discovery script should look like:
Output of a discovery script should look like:


Line 60: Line 283:
  ]}
  ]}


==Backing up tables==
== Backing up tables ==
https://www.zabbix.org/wiki/Docs/howto/mysql_backup_script
 
[https://www.zabbix.org/wiki/Docs/howto/mysql_backup_script https://www.zabbix.org/wiki/Docs/howto/mysql_backup_script]
 
&nbsp;
 
== cannot send list of active checks ==


==cannot send list of active checks==
If in agent log: most likely ServerActive is defined in agent config, while not used at all
Most likely ServerActive is defined in agent config, while not used at all
 
It is also possible agent is sending some active check to server while host is monitored via proxy.
 
== active check configuration update started to fail ==
 
??
 
== Latest 20 issues ==


==Latest 20 issues==
DEFAULT_LATEST_ISSUES_CNT in/usr/share/zabbix/include/defines.inc.php
DEFAULT_LATEST_ISSUES_CNT in/usr/share/zabbix/include/defines.inc.php


==Zabbix unreachable poller processes more than 75% busy==
&nbsp;
 
== Zabbix unreachable poller processes more than 75% busy ==
 
Increase '''StartPollersUnreachable'''
Increase '''StartPollersUnreachable'''


==More than 100 items having missing data for more than 10 minutes==
&nbsp;
 
== Zabbix poller processes more than 75% busy ==
 
another mystery
 
== More than 100 items having missing data for more than 10 minutes ==
 
Could be high load. Also check Administration->Queue
Could be high load. Also check Administration->Queue


==Zabbix escalator processes more than 75% busy==
== Zabbix escalator processes more than 75% busy ==
 
probably high system load overall
probably high system load overall


==Check agent==
== Check agent ==
 
  zabbix_get -s my.host.com -k agent.version
  zabbix_get -s my.host.com -k agent.version


==ZBX_NOTSUPPORTED==
== ZBX_NOTSUPPORTED ==
 
Could be anything, enable logging on agent. It could be version mismatch. Check
Could be anything, enable logging on agent. It could be version mismatch. Check
  zabbix_get -s yourhost -k agent.version
  zabbix_get -s yourhost -k agent.version
If that works, you're calling for an undefined or unsupported key.
If that works, you're calling for an undefined or unsupported key.


==Incorrect trigger expression. Host "xx" does not exist or you have no access to this host.==
== Incorrect trigger expression. Host "xx" does not exist or you have no access to this host. ==
 
Means there's no related item.
Means there's no related item.


==zabbix_get returns nothing==
== zabbix_get returns nothing ==
 
best look at log on agent side
best look at log on agent side


==run playbook on single host==
== run playbook on single host ==
 
  ansible_playbook -l somehost somplay.yml
  ansible_playbook -l somehost somplay.yml


[[:Category:Monitoring]]
[[:Category:Monitoring]]


&nbsp;
== Zabbix server is not running: the information displayed may not be current ==
Might be selinux: [http://sysads.co.uk/2013/11/zabbix-server-running-alert/ http://sysads.co.uk/2013/11/zabbix-server-running-alert/]
&nbsp;
&nbsp;
&nbsp;
== Monitoring vmware ==
=== vmware.hv.cpu.usage[{$URL},{HOST.HOST}]" became not supported: Couldn't resolve host name ===
Set macro {$URL} to [https://your.ip/sdk/ https://your.ip/sdk/] (shouldn't discovery figure that out from {$HOST}&nbsp;?
     
=== Couldn't resolve host name ===
Sometimes it's a matter of waiting a few hours
&nbsp;
=== vmware events collector returned empty result ===
???
=== No "vmware collector" processes started. ===


==Zabbix server is not running: the information displayed may not be current==
Check StartVMwareCollectors on server or proxy
Might be selinux: http://sysads.co.uk/2013/11/zabbix-server-running-alert/


==vmware.hv.cpu.usage[{$URL},{HOST.HOST}]" became not supported: Couldn't resolve host name==
&nbsp;
Set macro {$URL} to https://your.ip/sdk/ (shouldn't discovery figure that out from {$HOST} ?
 
== unsupported item key ==


==unsupported item key==
This might mean it's expecting a value from the script you're calling.
This might mean it's expecting a value from the script you're calling.
  echo 1
  echo 1


==ansible or API not showing host groups==
=== became not supported: Not supported by Zabbix Agent ===
 
probably output by userparameter/script
 
== ansible or API not showing host groups ==
 
Permissions!! See Administration->User Groups
Permissions!! See Administration->User Groups


&nbsp;
== failed to update local proxy configuration copy: invalid field name "items.lastlogsize" ==
check everything&nbsp;:)
== Received value [11] is not suitable for value type [Numeric (unsigned)] and data type [Decimal] ==
This probably means the agent returned 1\n1
&nbsp;
== database is down: retrying in 10 seconds ==
try upping max_connections
== [Incorrect key file for table 'items'; try to repair it ==
Could be something /tmp related
&nbsp;
&nbsp;
== another network error, wait for 8 seconds ==
'''UnreachableDelay'''=8
&nbsp;
== failed: first network error ==
Setting '''Timeout '''in server configuration
also Timeout in agents?
&nbsp;
== no active checks on server ==
???
&nbsp;
&nbsp;
== show cpu utilization ==


==failed to update local proxy configuration copy: invalid field name "items.lastlogsize"==
Monitoring->host->graphs
check everything :)

Revision as of 12:15, 21 January 2022


Links

 

Zabbix API

Installing from git

git clone https://github.com/zabbix/zabbix.git
cd zabbix 
./bootstrap.sh

 

Zabbix error codes

Z3005

Database issue

Items

proc.mem

proc.mem[<name>,<user>,<mode>,<cmdline><memtype>]

name

??

cmdline

probably the one to look for

 

 

 

Templates

Configuration

Zabbix agent active

On client

On server

Set Agent IP to 0.0.0.0

 

FAQ

SERVER

Adjust loglevel

zabbix_server --runtime-control log_level_increase=trapper
      

 

Reload zabbix server configuration

You can't, but you might want

zabbix_server -c /etc/zabbix/zabbix_server.conf -R config_cache_reload

 

No media defined for user

The frontend does not match Zabbix database.

Probably version conflict between frontend and server

 

value cache working in low memory mode

Increase ValueCacheSize

 


PROXY

Nodata and proxy

https://www.zabbix.com/documentation/5.0/en/manual/introduction/whatsnew500#no-data-triggers-sensitive-to-proxy-availability

Zabbix does not support SQLite3 database upgrade.

Stop the proxy and (re)move the .db file

[Z3002] cannot create database 'zabbix_proxy': [0] unable to open database file

fix path

 

Cannot parse heartbeat from active proxy

TBD, probably name issue

Troubleshoot high queue on proxy

poller data processes

StartPollers

cannot obtain data from proxy "proxybox": ZBX_TCP_READ() failed: [104] Connection reset by peer

?????

 

force "sending configuration data to proxy"

zabbix_proxy -R config_cache_reload

 

 

 

Front end

Visable name vs hostname

Visible name: {HOST.NAME}

Hostname: {HOST.HOST}

Host IP: (as defined in Interface->IP/DNS) {HOST.CONN}

 

Acknowledge multiple items

Monitor->Problems apply filters, select all, mass update

 

No permissions to referred object or it does not exist!

Graph no longer exists. Porbably items no longer discovered

Cannot add host

??

SNMP

Cannot find host interface on "xxxhost" for item key foo

Might mean you're trying to import an SNMP template before configuring SNMP for the host

 

 

No SNMP data

snmp_parse_oid(): cannot parse OID "IF-MIB::ifSpeed.3

Agent side ping check

UserParameter=pingtime[*],fping -e $1|sed 's/^.*(\([0-9].*\) ms).*$/\1/g'
UserParameter=pingalive[*],fping $1|grep -q alive;echo $?

 

 

IPMI

IPMI Monitoring account for zabbix

https://www.thomas-krenn.com/en/wiki/Configuring_IPMI_under_Linux_using_ipmitool

 

cannot connect to IPMI host: [22] Operation canceled

Usually temporary because of broken ipmi lib, ignore it

 

cannot connect to IPMI host: [16777411] Unknown error 16777411

classic, probably authentication problem

cannot connect to IPMI host: [22] Invalid argument

zabbix_sender

processed: 0; failed: 1

Possible causes:

  • incorrect hostname
  • incorrect item key
  • item not in the server configuration cache yet
  • Allowed hosts in trapper item
  • phase of moon
  • aliens

 

Testing zabbix_sender

zabbix_sender stuff

Filters

The regular expressions referred to in discovery are found under Administration->General, and then "Regular expressions" in the dropdown at top right of the page

cannot connect to IPMI host: [125] Operation canceled

possibly authentication method issue

Discover: value must be a JSON object

Could mean you need to escape slashes

 

Cannot create item: Invalid first parameter

Problably a calculated item, try doublequoting the item key:

last("foo[bar]")

 

Install recent zabbix on CentOS/RHEL

rpm -ivh https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
yum install zabbix-agent

Discovery data example

Output of a discovery script should look like:

{"data":[
  {"{#VAR1}":"value11","#{VAR2":"value12"},
  {"{#VAR1}":"value21","#{VAR2":"value22"}
]}

Backing up tables

https://www.zabbix.org/wiki/Docs/howto/mysql_backup_script

 

cannot send list of active checks

If in agent log: most likely ServerActive is defined in agent config, while not used at all

It is also possible agent is sending some active check to server while host is monitored via proxy.

active check configuration update started to fail

??

Latest 20 issues

DEFAULT_LATEST_ISSUES_CNT in/usr/share/zabbix/include/defines.inc.php

 

Zabbix unreachable poller processes more than 75% busy

Increase StartPollersUnreachable

 

Zabbix poller processes more than 75% busy

another mystery

More than 100 items having missing data for more than 10 minutes

Could be high load. Also check Administration->Queue

Zabbix escalator processes more than 75% busy

probably high system load overall

Check agent

zabbix_get -s my.host.com -k agent.version

ZBX_NOTSUPPORTED

Could be anything, enable logging on agent. It could be version mismatch. Check

zabbix_get -s yourhost -k agent.version

If that works, you're calling for an undefined or unsupported key.

Incorrect trigger expression. Host "xx" does not exist or you have no access to this host.

Means there's no related item.

zabbix_get returns nothing

best look at log on agent side

run playbook on single host

ansible_playbook -l somehost somplay.yml

Category:Monitoring

 

Zabbix server is not running: the information displayed may not be current

Might be selinux: http://sysads.co.uk/2013/11/zabbix-server-running-alert/

 

 

 

Monitoring vmware

vmware.hv.cpu.usage[{$URL},{HOST.HOST}]" became not supported: Couldn't resolve host name

Set macro {$URL} to https://your.ip/sdk/ (shouldn't discovery figure that out from {$HOST} ?
      

Couldn't resolve host name

Sometimes it's a matter of waiting a few hours

 

vmware events collector returned empty result

???

No "vmware collector" processes started.

Check StartVMwareCollectors on server or proxy

 

unsupported item key

This might mean it's expecting a value from the script you're calling.

echo 1

became not supported: Not supported by Zabbix Agent

probably output by userparameter/script

ansible or API not showing host groups

Permissions!! See Administration->User Groups

 

failed to update local proxy configuration copy: invalid field name "items.lastlogsize"

check everything :)

Received value [11] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]

This probably means the agent returned 1\n1

 

database is down: retrying in 10 seconds

try upping max_connections

[Incorrect key file for table 'items'; try to repair it

Could be something /tmp related

 

 

another network error, wait for 8 seconds

UnreachableDelay=8

 

failed: first network error

Setting Timeout in server configuration

also Timeout in agents?

 

no active checks on server

???

 

 

show cpu utilization

Monitoring->host->graphs