Does not seem to work with Zabbix 6.4.2
elyograg opened this issue · comments
SUMMARY
I added the template to my zabbix 6.4.2 server. It imported successfully. I then cloned the git repo and proceeded to run the deploy script on an agent running libvirtd. The deployment script created /etc/zabbix/zabbix_agentd.d and put a file in there. The only problem with that being ... I'm running zabbix_agent2, which uses /etc/zabbix/zabbix_agent2.d instead. I moved the file to the correct location and restarted zabbix-agent2.
Nothing is ever discovered. I tried manually running the discovery rules, and for all three of them the response is { "data":[ ] }
The agent logs are silent. The server log just has info about the discovery rules becoming not supported and then about 20 seconds later becoming supported.
OS / ENVIRONMENT / Used docker-compose files
Not using docker for zabbix. I installed using the zabbix APT repo onto Ubuntu Server 22.04.
The monitored system:
elyograg@smeagol:/etc/zabbix$ dpkg -l | grep zabbix
ii zabbix-agent2 1:6.4.2-1+ubuntu22.04 amd64 Zabbix network monitoring solution - agent
ii zabbix-release 1:6.4-1+ubuntu22.04 all Zabbix official repository configuration
ii zabbix-sender 1:6.4.2-1+ubuntu22.04 amd64 Zabbix network monitoring solution - sender
elyograg@smeagol:/etc/zabbix$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
elyograg@smeagol:/etc/zabbix$ uname -a
Linux smeagol 6.1.0-1012-oem #12-Ubuntu SMP PREEMPT_DYNAMIC Tue May 9 17:12:06 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
The zabbix server:
elyograg@boromir:~$ dpkg -l | grep zabbix
ii zabbix-agent2 1:6.4.2-1+ubuntu22.04 amd64 Zabbix network monitoring solution - agent
ii zabbix-apache-conf 1:6.4.2-1+ubuntu22.04 all Zabbix network monitoring solution - apache configuration for front-end
ii zabbix-frontend-php 1:6.4.2-1+ubuntu22.04 all Zabbix network monitoring solution - PHP front-end
ii zabbix-get 1:6.4.2-1+ubuntu22.04 amd64 Zabbix network monitoring solution - get
ii zabbix-js 1:6.4.2-1+ubuntu22.04 amd64 Zabbix network monitoring solution - js
ii zabbix-release 1:6.4-1+ubuntu22.04 all Zabbix official repository configuration
ii zabbix-sender 1:6.4.2-1+ubuntu22.04 amd64 Zabbix network monitoring solution - sender
ii zabbix-server-mysql 1:6.4.2-1+ubuntu22.04 amd64 Zabbix network monitoring solution - server (MySQL)
ii zabbix-sql-scripts 1:6.4.2-1+ubuntu22.04 all Zabbix network monitoring solution - sql-scripts
ii zabbix-web-service 1:6.4.2-1+ubuntu22.04 amd64 Zabbix network monitoring solution - web-service
elyograg@boromir:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
elyograg@boromir:~$ uname -a
Linux boromir 6.1.0-1012-oem #12-Ubuntu SMP PREEMPT_DYNAMIC Tue May 9 17:12:06 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
CONFIGURATION
The only thing changed in the server config file is info about the database. On the agents, I actually don't change the main config file, I just add things to zabbix_agent2.d.
elyograg@smeagol:/etc/zabbix/zabbix_agent2.d$ ll
total 52
drwxr-xr-x 3 root root 4096 May 23 21:52 ./
drwxr-xr-x 4 root root 4096 May 23 22:04 ../
-rw-r--r-- 1 root root 23 Aug 29 2021 allow_key.conf
-rw-r--r-- 1 root root 64 Nov 22 17:54 pacemaker.conf
drwxr-xr-x 2 root root 4096 Apr 25 14:11 plugins.d/
-rw-r--r-- 1 root root 814 Dec 23 2021 userparameter_apcupsd.conf
-rw-r--r-- 1 root root 131 Mar 9 2022 userparameter_megaraid.conf
-rw-rw-r-- 1 elyograg elyograg 304 May 23 21:44 virbix.conf
-rw-r--r-- 1 root root 60 Feb 19 11:49 zabbix_lsof.conf
-rw-r--r-- 1 root root 100 Sep 1 2021 zabbix_postfix.conf
-rw-r--r-- 1 root root 57 Jan 11 2022 zfs.conf
-rw-r--r-- 1 root root 30 Aug 9 2021 zz-hostname.conf
-rw-r--r-- 1 root root 153 May 23 08:58 zz-server.conf
elyograg@smeagol:/etc/zabbix/zabbix_agent2.d$ cat zz-hostname.conf
Hostname=smeagol.elyograg.org
elyograg@smeagol:/etc/zabbix/zabbix_agent2.d$ cat zz-server.conf
Server=boromir.elyograg.org
ServerActive=boromir.elyograg.org
TLSConnect=psk
TLSAccept=psk
TLSPSKFile=/etc/zabbix/secret.psk
TLSPSKIdentity=elyograg.org
STEPS TO REPRODUCE
Import the template on the server and add it to a host.
Deploy to the agent, move the config file to the proper location for zabbix_agent2, restart the agent.
I figured this out. I found over 700 messages from sudo telling me all about what zabbix was trying to run as root:
The deployment script assumes the zabbix user has unrestricted ability to run anything as root via sudo with no password. I have zabbix pretty well locked down to only what it actually needs. This is the contents of /etc/sudoers.d/zabbix
after adding /usr/bin/virsh
to the list of commands it is allowed to run as root:
Defaults:zabbix !requiretty
Cmnd_Alias ZABBIX_CMD = /sbin/fuser, /usr/bin/lsof, /usr/sbin/dmidecode, /sbin/mii-tool, /sbin/ethtool, /usr/bin/ipmitool, /usr/sbin/iptstate, /usr/bin/ocaudit, /usr/sbin/smartctl, /usr/bin/nmap, /opt/MegaRAID/MegaCli/MegaCli64, /usr/bin/mailq, /usr/sbin/crm_mon,/usr/bin/virsh
zabbix ALL = (other_user) NOPASSWD: ALL
zabbix ALL = (root) NOPASSWD: ZABBIX_CMD
Thanks @elyograg for reporting this. Sorry to hear that this plugin didn't meet your expectations. The idea of the plugin was not to replace virt-manager or to report domain metrics. That can be achieved with the normal monitoring agent (e.g. zabbix-agent) installed in the virtual machine.
In any case, I will take this feedback and improve the documentation to avoid a misalignment with the expectations.