Zabbix + UserParameter + Expressões Regulares = Monitoramento otimizado

Olá pessoal! Hoje o artigo será sobre zabbix (open-source monitoring software tool), no qual irei abordar um recurso importante, que é o userparameter. Atrelado à isso, vou exemplificar usando expressões regulares para automatizar o monitoramento da sua infra de TI.

Níveis de infraestrutura do Zabbix.
Arquivo de configuração Zabbix Agent.
$ systemctl status mariadb
● mariadb.service - MariaDB 10.1.41 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Qui 2019-09-05 09:43:11 -03; 1h 19min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 20130 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 20090 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 20088 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 20102 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 44
Memory: 146.1M
CGroup: /system.slice/mariadb.service
└─20102 /usr/sbin/mysqld
$ ps axu | grep -v grep | grep mysql | wc -l
1
$ systemctl status mariadb | grep Active | sed -n '/ago$/p' | sed 's/.\{62\}//'
1h 27min ago
$ mysql -V
mysql Ver 15.1 Distrib 10.1.41-MariaDB, for Linux (x86_64) using readline 5.1
$ mysql -V | awk '/^mysql/ {print $1,$2,$3,$4,$5}'
mysql Ver 15.1 Distrib 10.1.41-MariaDB,
$ systemctl status mariadb | grep Status
Status: "Taking your SQL requests now..."
$ systemctl status mariadb | grep -i tasks
Tasks: 47
$ systemctl status mariadb | grep -i active | cut -d " " -f 4,5,6
Active: active (running)
Tela de aplicação do Zabbix.
UserParameter=<key>,<command>$ zabbix_get -s 127.0.0.1 -p 10050 -k service
Active: active (running)
Arquivo do zabbix-agent.
Tela de criação de item
Dados recentes do zabbix.
Monitoramento dos ativos do MariaDB.

Senior Linux Administrator at IBM

Senior Linux Administrator at IBM