Open Kornelius777 opened 1 year ago
Dear @takala-jp,
while trying to get your script running, I'm not getting anywhere.
My tests run fine:
root@proxmox-1:/etc/zabbix# /usr/bin/zabbix_sender -v -c /etc/zabbix/zabbix_agentd.conf -s PVECluster -k promox.cluster.quorate -o 1 Response from "192.168.150.20:10051": "processed: 1; failed: 0; total: 1; seconds spent: 0.000090" sent: 1; skipped: 0; total: 1 root@proxmox-1:/etc/zabbix# /usr/bin/zabbix_sender -v -c /etc/zabbix/zabbix_agentd.conf -s PVECluster -k proxmox.nodes.discovery -o '{"data": [{"{#NODE}": "proxmox-1"}, {"{#NODE}": "proxmox-2"}, {"{#NODE}": "proxmox-3"}]}' Response from "192.168.150.20:10051": "processed: 1; failed: 0; total: 1; seconds spent: 0.000130" sent: 1; skipped: 0; total: 1
However, when running my cron:
*/4 * * * * root /etc/zabbix/scripts/proxmox_cluster.py -a proxmox-1.lan.xxxxxx.de -u zabbix@pve -p XXXXXXXX -s -t PVECluster -v
I receive this error message:
{ "status": { "quorate": 1, "cpu_total": 12, "cpu_usage": 6.687758518756563, "ram_total": 11933937664, "ram_used": 10407415808, "ram_free": 1526521856, "ram_usage": 87.20856519466398, "ksm_sharing": 0, "vcpu_allocated": 17, "vram_allocated": 9663676416, "vhdd_allocated": 0, "vram_used": 3754319872, "vram_usage": 38.84980943467882, "vms_running": 3, "vms_stopped": 0, "vms_total": 3, "lxc_running": 12, "lxc_stopped": 0, "lxc_total": 12, "vm_templates": 0, "nodes_total": 3, "nodes_online": 3 }, "nodes": { "proxmox-1": { "online": 1, "vms_total": 1, "vms_running": 1, "lxc_total": 4, "lxc_running": 4, "vcpu_allocated": 5, "vram_allocated": 2684354560, "vhdd_allocated": 0, "vram_used": 471769088, "ksm_sharing": 0, "cpu_total": 4, "cpu_usage": 4.05476566614007, "ram_total": 3977629696, "ram_used": 3402174464, "ram_free": 575455232, "ram_usage": 85.5327097799302 }, "proxmox-2": { "online": 1, "vms_total": 1, "vms_running": 1, "lxc_total": 5, "lxc_running": 5, "vcpu_allocated": 6, "vram_allocated": 3221225472, "vhdd_allocated": 0, "vram_used": 1108971520, "ksm_sharing": 0, "cpu_total": 4, "cpu_usage": 10.939139559286499, "ram_total": 3977629696, "ram_used": 3438993408, "ram_free": 538636288, "ram_usage": 86.4583601499741 }, "proxmox-3": { "online": 1, "vms_total": 1, "vms_running": 1, "lxc_total": 3, "lxc_running": 3, "vcpu_allocated": 6, "vram_allocated": 3758096384, "vhdd_allocated": 0, "vram_used": 2173579264, "ksm_sharing": 0, "cpu_total": 4, "cpu_usage": 5.069370330843119, "ram_total": 3978678272, "ram_used": 3566247936, "ram_free": 412430336, "ram_usage": 89.63398626869422 } }, "storage": { "storage/proxmox-1/ZFSPool-1": { "disk_use": 17804296192, "disk_max": 719943892992, "disk_use_p": 2.4730116284489188 }, "storage/proxmox-3/ZFSPool-3": { "disk_use": 19384537088, "disk_max": 719943892992, "disk_use_p": 2.692506635126829 }, "storage/proxmox-2/local": { "disk_use": 7899578368, "disk_max": 67605540864, "disk_use_p": 11.684809066007386 }, "storage/proxmox-3/local": { "disk_use": 8080879616, "disk_max": 67605540864, "disk_use_p": 11.95298419733977 }, "storage/proxmox-1/local": { "disk_use": 9029054464, "disk_max": 67605540864, "disk_use_p": 13.355494754732417 }, "storage/proxmox-2/ZFSPool-2": { "disk_use": 24378494976, "disk_max": 719943892992, "disk_use_p": 3.3861659517224205 }, "storage/proxmox-2/NFS-NAS": { "disk_use": 3476255408128, "disk_max": 3932981428224, "disk_use_p": 88.38728256333918 }, "storage/proxmox-3/NFS-NAS": { "disk_use": 3476255408128, "disk_max": 3932981428224, "disk_use_p": 88.38728256333918 }, "storage/proxmox-1/NFS-NAS": { "disk_use": 3476255408128, "disk_max": 3932981428224, "disk_use_p": 88.38728256333918 } } } PVECluster promox.cluster.quorate 1669544282 1 PVECluster promox.cluster.cpu_total 1669544282 12 PVECluster promox.cluster.cpu_usage 1669544282 6.687758518756563 PVECluster promox.cluster.ram_total 1669544282 11933937664 PVECluster promox.cluster.ram_used 1669544282 10407415808 PVECluster promox.cluster.ram_free 1669544282 1526521856 PVECluster promox.cluster.ram_usage 1669544282 87.20856519466398 PVECluster promox.cluster.ksm_sharing 1669544282 0 PVECluster promox.cluster.vcpu_allocated 1669544282 17 PVECluster promox.cluster.vram_allocated 1669544282 9663676416 PVECluster promox.cluster.vhdd_allocated 1669544282 0 PVECluster promox.cluster.vram_used 1669544282 3754319872 PVECluster promox.cluster.vram_usage 1669544282 38.84980943467882 PVECluster promox.cluster.vms_running 1669544282 3 PVECluster promox.cluster.vms_stopped 1669544282 0 PVECluster promox.cluster.vms_total 1669544282 3 PVECluster promox.cluster.lxc_running 1669544282 12 PVECluster promox.cluster.lxc_stopped 1669544282 0 PVECluster promox.cluster.lxc_total 1669544282 12 PVECluster promox.cluster.vm_templates 1669544282 0 PVECluster promox.cluster.nodes_total 1669544282 3 PVECluster promox.cluster.nodes_online 1669544282 3 PVECluster proxmox.node.online.[proxmox-1] 1669544282 1 PVECluster proxmox.node.vms_total.[proxmox-1] 1669544282 1 PVECluster proxmox.node.vms_running.[proxmox-1] 1669544282 1 PVECluster proxmox.node.lxc_total.[proxmox-1] 1669544282 4 PVECluster proxmox.node.lxc_running.[proxmox-1] 1669544282 4 PVECluster proxmox.node.vcpu_allocated.[proxmox-1] 1669544282 5 PVECluster proxmox.node.vram_allocated.[proxmox-1] 1669544282 2684354560 PVECluster proxmox.node.vhdd_allocated.[proxmox-1] 1669544282 0 PVECluster proxmox.node.vram_used.[proxmox-1] 1669544282 471769088 PVECluster proxmox.node.ksm_sharing.[proxmox-1] 1669544282 0 PVECluster proxmox.node.cpu_total.[proxmox-1] 1669544282 4 PVECluster proxmox.node.cpu_usage.[proxmox-1] 1669544282 4.05476566614007 PVECluster proxmox.node.ram_total.[proxmox-1] 1669544282 3977629696 PVECluster proxmox.node.ram_used.[proxmox-1] 1669544282 3402174464 PVECluster proxmox.node.ram_free.[proxmox-1] 1669544282 575455232 PVECluster proxmox.node.ram_usage.[proxmox-1] 1669544282 85.5327097799302 PVECluster proxmox.node.online.[proxmox-2] 1669544282 1 PVECluster proxmox.node.vms_total.[proxmox-2] 1669544282 1 PVECluster proxmox.node.vms_running.[proxmox-2] 1669544282 1 PVECluster proxmox.node.lxc_total.[proxmox-2] 1669544282 5 PVECluster proxmox.node.lxc_running.[proxmox-2] 1669544282 5 PVECluster proxmox.node.vcpu_allocated.[proxmox-2] 1669544282 6 PVECluster proxmox.node.vram_allocated.[proxmox-2] 1669544282 3221225472 PVECluster proxmox.node.vhdd_allocated.[proxmox-2] 1669544282 0 PVECluster proxmox.node.vram_used.[proxmox-2] 1669544282 1108971520 PVECluster proxmox.node.ksm_sharing.[proxmox-2] 1669544282 0 PVECluster proxmox.node.cpu_total.[proxmox-2] 1669544282 4 PVECluster proxmox.node.cpu_usage.[proxmox-2] 1669544282 10.939139559286499 PVECluster proxmox.node.ram_total.[proxmox-2] 1669544282 3977629696 PVECluster proxmox.node.ram_used.[proxmox-2] 1669544282 3438993408 PVECluster proxmox.node.ram_free.[proxmox-2] 1669544282 538636288 PVECluster proxmox.node.ram_usage.[proxmox-2] 1669544282 86.4583601499741 PVECluster proxmox.node.online.[proxmox-3] 1669544282 1 PVECluster proxmox.node.vms_total.[proxmox-3] 1669544282 1 PVECluster proxmox.node.vms_running.[proxmox-3] 1669544282 1 PVECluster proxmox.node.lxc_total.[proxmox-3] 1669544282 3 PVECluster proxmox.node.lxc_running.[proxmox-3] 1669544282 3 PVECluster proxmox.node.vcpu_allocated.[proxmox-3] 1669544282 6 PVECluster proxmox.node.vram_allocated.[proxmox-3] 1669544282 3758096384 PVECluster proxmox.node.vhdd_allocated.[proxmox-3] 1669544282 0 PVECluster proxmox.node.vram_used.[proxmox-3] 1669544282 2173579264 PVECluster proxmox.node.ksm_sharing.[proxmox-3] 1669544282 0 PVECluster proxmox.node.cpu_total.[proxmox-3] 1669544282 4 PVECluster proxmox.node.cpu_usage.[proxmox-3] 1669544282 5.069370330843119 PVECluster proxmox.node.ram_total.[proxmox-3] 1669544282 3978678272 PVECluster proxmox.node.ram_used.[proxmox-3] 1669544282 3566247936 PVECluster proxmox.node.ram_free.[proxmox-3] 1669544282 412430336 PVECluster proxmox.node.ram_usage.[proxmox-3] 1669544282 89.63398626869422 PVECluster proxmox.storage.disk_use.[storage/proxmox-1/ZFSPool-1] 1669544282 17804296192 PVECluster proxmox.storage.disk_max.[storage/proxmox-1/ZFSPool-1] 1669544282 719943892992 PVECluster proxmox.storage.disk_use_p.[storage/proxmox-1/ZFSPool-1] 1669544282 2.4730116284489188 PVECluster proxmox.storage.disk_use.[storage/proxmox-3/ZFSPool-3] 1669544282 19384537088 PVECluster proxmox.storage.disk_max.[storage/proxmox-3/ZFSPool-3] 1669544282 719943892992 PVECluster proxmox.storage.disk_use_p.[storage/proxmox-3/ZFSPool-3] 1669544282 2.692506635126829 PVECluster proxmox.storage.disk_use.[storage/proxmox-2/local] 1669544282 7899578368 PVECluster proxmox.storage.disk_max.[storage/proxmox-2/local] 1669544282 67605540864 PVECluster proxmox.storage.disk_use_p.[storage/proxmox-2/local] 1669544282 11.684809066007386 PVECluster proxmox.storage.disk_use.[storage/proxmox-3/local] 1669544282 8080879616 PVECluster proxmox.storage.disk_max.[storage/proxmox-3/local] 1669544282 67605540864 PVECluster proxmox.storage.disk_use_p.[storage/proxmox-3/local] 1669544282 11.95298419733977 PVECluster proxmox.storage.disk_use.[storage/proxmox-1/local] 1669544282 9029054464 PVECluster proxmox.storage.disk_max.[storage/proxmox-1/local] 1669544282 67605540864 PVECluster proxmox.storage.disk_use_p.[storage/proxmox-1/local] 1669544282 13.355494754732417 PVECluster proxmox.storage.disk_use.[storage/proxmox-2/ZFSPool-2] 1669544282 24378494976 PVECluster proxmox.storage.disk_max.[storage/proxmox-2/ZFSPool-2] 1669544282 719943892992 PVECluster proxmox.storage.disk_use_p.[storage/proxmox-2/ZFSPool-2] 1669544282 3.3861659517224205 PVECluster proxmox.storage.disk_use.[storage/proxmox-2/NFS-NAS] 1669544282 3476255408128 PVECluster proxmox.storage.disk_max.[storage/proxmox-2/NFS-NAS] 1669544282 3932981428224 PVECluster proxmox.storage.disk_use_p.[storage/proxmox-2/NFS-NAS] 1669544282 88.38728256333918 PVECluster proxmox.storage.disk_use.[storage/proxmox-3/NFS-NAS] 1669544282 3476255408128 PVECluster proxmox.storage.disk_max.[storage/proxmox-3/NFS-NAS] 1669544282 3932981428224 PVECluster proxmox.storage.disk_use_p.[storage/proxmox-3/NFS-NAS] 1669544282 88.38728256333918 PVECluster proxmox.storage.disk_use.[storage/proxmox-1/NFS-NAS] 1669544282 3476255408128 PVECluster proxmox.storage.disk_max.[storage/proxmox-1/NFS-NAS] 1669544282 3932981428224 PVECluster proxmox.storage.disk_use_p.[storage/proxmox-1/NFS-NAS] 1669544282 88.38728256333918 Error while sending items: Command '['/usr/bin/zabbix_sender', '-c/etc/zabbix/zabbix_agentd.conf', '-T', '-i', '-']' returned non-zero exit status 2.
my zabbix_agentd.conf is:
PidFile=/run/zabbix/zabbix_agentd.pid LogFile=/var/log/zabbix-agent/zabbix_agentd.log LogFileSize=0 Server=192.168.150.20 ServerActive=192.168.150.20 Hostname=proxmox-1.lan.xxxxxxxx.de AllowRoot=1 Include=/etc/zabbix/zabbix_agentd.conf.d/*.conf
What am I missing?
Kind regards,
I just read the last paragraph in your Readme. Shame on me - I should have read it before. Everything works. Sorry for bothering.
Kind regards!
Dear @takala-jp,
while trying to get your script running, I'm not getting anywhere.
My tests run fine:
However, when running my cron:
I receive this error message:
my zabbix_agentd.conf is:
What am I missing?
Kind regards,