sistemas:suap:zabbix

Essa é uma revisão anterior do documento!


host: pgsql-suap.ifce.edu.br

Primeiramente foi feito uma verificação para saber qual versão do Ubuntu Server estava rodando na máquina:

monitoramento@pgsql-suap:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial

Para instalar o Zabbix Agent é necessário adicionar o repositório do Zabbix. O Zabbix configurado na máquina zabbix.ifce.edu.br está na versão 3.2 logo devemos baixar o arquivo .deb encontrado no site https://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/ referente a versão xenial

monitoramento@pgsql-suap:~$ cd /tmp/
monitoramento@pgsql-suap:/tmp$ wget https://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb
monitoramento@pgsql-suap:/tmp$ sudo dpkg -i zabbix-release_3.2-1+xenial_all.deb 

Nesse momento ocorreu um erro ao tentar adicionar o repositório pois o diretório /boot estava com a capacidade máxima. Foi necessária fazer a limpeza do diretório /boot para prosseguir a instalação

Primeiro foi alterado o usuário para root e verificado a versão do kernel que tá sendo utilizada:

monitoramento@pgsql-suap:~$ uname -r
4.4.0-62-generic

Com essa informação podemos liberar os arquivos do diretório:

root@pgsql-suap:/boot# ls -lah
total 144M
drwxr-xr-x  4 root root 4,0K Jul 25 08:49 .
drwxr-xr-x 23 root root 4,0K Jul 25 08:44 ..
-rw-r--r--  1 root root 1,2M Jan 18  2017 abi-4.4.0-62-generic
-rw-r--r--  1 root root 1,2M Jun 26 16:45 abi-4.4.0-83-generic
-rw-r--r--  1 root root 1,2M Jul 18 12:00 abi-4.4.0-87-generic
-rw-r--r--  1 root root 186K Jan 18  2017 config-4.4.0-62-generic
-rw-r--r--  1 root root 186K Jun 26 16:45 config-4.4.0-83-generic
-rw-r--r--  1 root root 186K Jul 18 12:00 config-4.4.0-87-generic
drwxr-xr-x  5 root root 1,0K Jul 25 08:48 grub
-rw-r--r--  1 root root  37M Jul 25 08:43 initrd.img-4.4.0-62-generic
-rw-r--r--  1 root root  37M Jul 25 08:45 initrd.img-4.4.0-83-generic
-rw-r--r--  1 root root  37M Jul 25 08:49 initrd.img-4.4.0-87-generic
drwx------  2 root root  12K Mar  9 13:01 lost+found
-rw-------  1 root root 3,7M Jan 18  2017 System.map-4.4.0-62-generic
-rw-------  1 root root 3,8M Jun 26 16:45 System.map-4.4.0-83-generic
-rw-------  1 root root 3,8M Jul 18 12:00 System.map-4.4.0-87-generic
-rw-------  1 root root 6,8M Jan 18  2017 vmlinuz-4.4.0-62-generic
-rw-------  1 root root 6,8M Jun 26 16:45 vmlinuz-4.4.0-83-generic
-rw-------  1 root root 6,8M Jul 18 12:00 vmlinuz-4.4.0-87-generic

OBS: Isso é apenas um esboço do que realmente tinha lá pois já havia sido liberado o espaço.

Em seguida, utilizando o comando:

root@pgsql-suap:/boot# cat /dev/null > arquivo

Onde arquivo é um dos arquivos do diretório /boot e não pode ser o da versão atual, no caso, 4.4.0-62-generic

Exemplo:

root@pgsql-suap:/boot# cat /dev/null > initrd.img-4.4.0-87-generic

Com o espaço máximo possível liberado, pode se usar os seguintes comandos:

apt-get install -f
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
root@pgsql-suap:/tmp# cd /tmp/
root@pgsql-suap:/tmp# dpkg -i zabbix-release_3.2-1+xenial_all.deb
root@pgsql-suap:/tmp# apt update
root@pgsql-suap:/tmp# apt install zabbix-agent zabbix-get

Depois de terminar a instalação do Zabbix Agent é necessário editar o arquivo de configuração /etc/zabbix/zabbix_agentd.conf e atualizar as seguintes linhas:

...

### Option: Server
#       List of comma delimited IP addresses (or hostnames) of Zabbix servers.
#       Incoming connections will be accepted only from the hosts listed here.
#       If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
#
# Mandatory: no
# Default:
# Server=

Server=zabbix.ifce.edu.br,127.0.0.1

...

### Option: ServerActive
#       List of comma delimited IP:port (or hostname:port) pairs of Zabbix servers for active checks.
#       If port is not specified, default port is used.
#       IPv6 addresses must be enclosed in square brackets if port for that host is specified.
#       If port is not specified, square brackets for IPv6 addresses are optional.
#       If this parameter is not specified, active checks are disabled.
#       Example: ServerActive=127.0.0.1:20051,zabbix.domain,[::1]:30051,::1,[12fc::1]
#
# Mandatory: no
# Default:
# ServerActive=

ServerActive=127.0.0.1,zabbix.ifce.edu.br

...

### Option: HostnameItem
#       Item used for generating Hostname if it is undefined. Ignored if Hostname is defined.
#       Does not support UserParameters or aliases.
#
# Mandatory: no
# Default:

HostnameItem=system.hostname

...

### Option: Include
#       You may include individual files or all files in a directory in the configuration file.
#       Installing Zabbix will create include directory in /usr/local/etc, unless modified during the compile time.
#
# Mandatory: no
# Default:
# Include=

Include=/etc/zabbix/zabbix_agentd.d/*.conf

...
  • sistemas/suap/zabbix.1501076349.txt.gz
  • Última modificação: 2021/08/25 10:33
  • (edição externa)