Jump to content

Zabbix

From Parasol
Revision as of 15:55, 28 October 2020 by Sebastian (talk | contribs)

Add Host

Test: zabbix_get -s <IP / DNS> -p 10050 -k "agent.ping"

Maintenance

Query most triggered items

SELECT DISTINCT `history_uint`.`itemid`, count(`history_uint`.`itemid`) AS CountOf, `items`.`itemid`, `items`.`name` FROM `history_uint` LEFT JOIN `items` ON `history_uint`.`itemid` = `items`.`itemid` GROUP BY `history_uint`.`itemid` ORDER BY CountOf DESC

Configuration

Host name

{psl}.{ber|dus}.{ns125|rds26}.{vh|hh|fb|hh|...}.{ug|eg|1og|...}.{kind e.g. vserver}.{machine name, e.g. pslsrv32}. Example:

psl.dus.ns125.fb.1ug.vserver.pslsrv15

Visible name

{PSL} | {BER|DUS} | {NS125|RDS26} | {VH|HH|FB|HH|...} | {UG|EG|1OG|...} | {kind e.g. vServer} | {machine name, e.g. PSLSRV15} ({Short Description}). Example:

PSL | DUS | NS125 | FB | 1UG | vServer | PSLSRV15 (Preview Webserver)


Hostgroups

  • By Kind, e.g. "#Apache2 Webservers"
  • By Logical Group, e.g. "*Parasol OS", "*ANM"
  • By Purpose, e.g. "Storage Units", "Rendernodes"
  • By Availability Level, e.g. "_Mission Critical 24/7"

Monitoring


SQL

https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/mysql

CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '{PASSWORD}';

GRANT USAGE,REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';

Use Client templates from /etc/zabbix/zabbix_agentd.d


Apache2

Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/apache_agent

On the Host (Zabbix Agent installed)

  1. a2enmod status
  2. Create "/etc/apache2/conf-available/zabbix.conf", e.g. "nano /etc/apache2/conf-available/zabbix.conf"

<syntaxhighlight lang="apache"> <Location "/server-status">

 SetHandler server-status
 Require host localhost
 Require ip 127.0.0.1
 Require ip 192.168
 Require ip 10

</Location> </syntaxhighlight>

  1. a2enconf zabbix
  2. service apache2 restart

In Zabbix

  1. Enable Template: "Template App Apache by Zabbix agent"

Snippets

RegEx Replace Text Output to Int

https://www.schatenseite.de/2018/04/05/zabbix-item-preprocessing-und-regular-expressions/

(.*) > \1:Off=0:On=1

(On|Off)(?=.*:\1=(\d)) > \2


Error creating thumbnail: File missing