Closed ghorutest closed 4 years ago
What is 10.0.0.241 the IP of the host in zabbix or the actual zabbix server?
For the -t parameter you have to specify the name of the host in zabbix you configured for the cluster entity and attached the templates to. Zabbix sender will use it's configuration file to determine the server address.
The first thing to test is if zabbix_sender is working correctly by trying the following on the host where the script is going to run. This should return processed 1 and failed 0:
[root@zabbix ~]# /usr/bin/zabbix_sender -v -c /etc/zabbix/zabbix_agentd.conf -s proxmox.tokyo.prod -k promox.cluster.quorate -o 1
Response from "127.0.0.1:10051": "processed: 1; failed: 0; total: 1; seconds spent: 0.000036"
sent: 1; skipped: 0; total: 1
The value for the -s parameter is the host name (not the IP address) you configured in zabbix to receive the data and attached the template to. That is the same value you would use for the -t parameter with the script. (please note that the key value of the -k parameter is indeed promox.cluster.quorate an unfortunate typo but that is a different story).
Solved: man zabbix_sender ... -s, --host host Specify host name the item belongs to (as registered in Zabbix frontend). Host IP address and DNS name will not work. When used together with --config, overrides Hostname parameter specified in agentd configuration file. ...
root@pve1:~# /usr/share/zabbix-agent/proxmox_cluster.py -a 10.0.0.11 -u zabbix@pve -p password -t 10.0.0.241 -d Unable to open zabbix_sender: Command '['/usr/bin/zabbix_sender', '-c/etc/zabbix/zabbix_agentd.conf', '-s10.0.0.241', '-kproxmox.nodes.discovery', '-o{"data": [{"{#NODE}": "pve3"}, {"{#NODE}": "pve2"}, {"{#NODE}": "pve1"}]}']' returned non-zero exit status 2.
Same in bash: root@pve1:~# zabbix_sender -c/etc/zabbix/zabbix_agentd.conf -s10.0.0.241 -kproxmox.nodes.discovery -o{"data": [{"{#NODE}": "pve3"}, {"{#NODE}": "pve2"}, {"{#NODE}": "pve1"}]} zabbix_sender [1068585]: invalid parameter "[{{#NODE}:" zabbix_sender [1068585]: invalid parameter "pve3}," zabbix_sender [1068585]: invalid parameter "{{#NODE}:" zabbix_sender [1068585]: invalid parameter "pve2}," zabbix_sender [1068585]: invalid parameter "{{#NODE}:" zabbix_sender [1068585]: invalid parameter "pve1}]}"
Same in bash with quotation mark ' for -o key: root@pve1:~# zabbix_sender -c/etc/zabbix/zabbix_agentd.conf -s10.0.0.241 -kproxmox.nodes.discovery -o'{"data": [{"{#NODE}": "pve3"}, {"{#NODE}": "pve2"}, {"{#NODE}": "pve1"}]}' info from server: "processed: 0; failed: 1; total: 1; seconds spent: 0.000027" sent: 1; skipped: 0; total: 1
root@pve1:~ # pveversion --verbose proxmox-ve: 6.2-1 (running kernel: 5.4.44-1-pve) pve-manager: 6.2-6 (running version: 6.2-6/ee1d7754) pve-kernel-5.4: 6.2-3 pve-kernel-helper: 6.2-3 pve-kernel-5.3: 6.1-6 pve-kernel-5.4.44-1-pve: 5.4.44-1 pve-kernel-5.4.34-1-pve: 5.4.34-2 pve-kernel-5.3.18-3-pve: 5.3.18-3 pve-kernel-5.3.18-2-pve: 5.3.18-2 ceph: 14.2.9-pve1 ceph-fuse: 14.2.9-pve1 corosync: 3.0.3-pve1 criu: 3.11-3 glusterfs-client: 5.5-3 ifupdown: residual config ifupdown2: 3.0.0-1+pve2 ksm-control-daemon: 1.3-1 libjs-extjs: 6.0.1-10 libknet1: 1.15-pve1 libproxmox-acme-perl: 1.0.4 libpve-access-control: 6.1-1 libpve-apiclient-perl: 3.0-3 libpve-common-perl: 6.1-3 libpve-guest-common-perl: 3.0-10 libpve-http-server-perl: 3.0-5 libpve-storage-perl: 6.1-8 libqb0: 1.0.5-1 libspice-server1: 0.14.2-4~pve6+1 lvm2: 2.03.02-pve4 lxc-pve: 4.0.2-1 lxcfs: 4.0.3-pve2 novnc-pve: 1.1.0-1 proxmox-mini-journalreader: 1.1-1 proxmox-widget-toolkit: 2.2-7 pve-cluster: 6.1-8 pve-container: 3.1-8 pve-docs: 6.2-4 pve-edk2-firmware: 2.20200531-1 pve-firewall: 4.1-2 pve-firmware: 3.1-1 pve-ha-manager: 3.0-9 pve-i18n: 2.1-3 pve-qemu-kvm: 5.0.0-4 pve-xtermjs: 4.3.0-1 qemu-server: 6.2-3 smartmontools: 7.1-pve2 spiceterm: 3.1-1 vncterm: 1.6-1 zfsutils-linux: 0.8.4-pve1