is there any installation instructions step by step?You can have a look at my scripts, made to monitor a whole cluster (just point zabbix at one node, which will monitor everything else) : https://git.fws.fr/fws/zabbix-agent-addons
in zabbix_scripts, you'll find disco_pve_sudo and check_pve_sudo which will do the hardwork (it's calling pvesh to get data from the API). in zabbix_conf you'll find pve.conf, which must be added to the agent's config on the node you monitor, and in zabbix_templates you'll find the associated template named Template_App_PVE_Cluster.xml
All this together will :
Hope it helps.
- Discover all nodes and collect stats (resources usage) and triggers (not all nodes online, non quorate cluster, high load etc.)
- Discover all guests and collect stats (resources usages, uptime
- Disover VM pools to also collect pool wide stats
- Discover storage with triggers when one is nearly full
Cheers,
Daniel
I think I did all the step so far except this one:No step by step doc written, but here are the main steps :
Discovery rules should detect all your VM, nodes, pools, storage and monitor them automaticaly
- Put disco_pve_sudo and check_pve_sudo on the PVE host you want to monitor. For example in /var/lib/zabbix/bin. Makes sure the scripts are executable. You might need to install some perl libs if they are not already installed (libconfig-simple-perl, libjson-perl and libfile-which-perl)
- Add the content of zabbix_conf/pve.conf to the Zabbix agent conf. Either in the main zabbix_agentd.conf file or included. You might need to adapt the path of the scripts if it's not /var/lib/zabbix/bin
- Makes sure zabbix user can run scripts with sudo permissions without password. See an example in conf/sudo.conf file
- Import the file zabbix_templates/Template_App_PVE_Cluster.xml file on your Zabbix server.
- Create a new host pointing at your PVE node, and add the Template_App_PVE_Cluster template on it
The Agent is installed, but I still have no idea on how to quote "zabbix user can run scripts with sudo permissions without password"You need a zabbix agent running on the pve node
Thank you very much for your help.OK. So, the zabbix user account running Zabbix agent on your PVE must be able to run the scripts with sudo, without password. You should be able to just drop conf/sudo.conf in /etc/sudoers.d/zabbix_agent.conf and it should work. (just adapt the path if you use something else than /var/lib/zabbix/bin)
Yes I`ve configured zabbix_agentd.conf and set the IP of the Zabbix Server, also there is no firewall restricting port 10050 on the PVEThis is really more a Zabbix issue than a PVE one. On the PVE node, you have to check you have allowed your server (or proxy, depending on your setup) in /etc/zabbix/zabbix_agentd.conf with the Server directive. You also need to have the port 10050 reachable
{"data":[{"{#PVE_NODE_IP}":"192.168.2.253","{#PVE_NODE_LOCAL}":1,"{#PVE_NODE_NAME}":"pve002253","{#PVE_NODE_ID}":0}]}
ZBX_NOTSUPPORTED
/var/lib/zabbix/bin/check_pve_sudo --cluster
/var/lib/zabbix/bin/check_pve_sudo --node=pve1
/var/lib/zabbix/bin/check_pve_sudo --guest=110
/var/lib/zabbix/bin/check_pve_sudo --storage=local-zfs
zabbix_agentd -t pve.check.all[cluster]
zabbix_agentd -t pve.check.all[node,pve1]
zabbix_agentd -t pve.check.all[guest,110]
zabbix_agentd -t pve.check.all[storage,local-zfs]
Ok - that was my fault. Now the start on command line give me results.If this is working then the agent config is fine
PVE Cluster: info
2020-11-27 21:06:05 We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. sudo: no tty present and no askpass program specified
When does sudo ignore a file in /etc/sudoers?
If your /etc/sudoers file contains the line:
#includedir /etc/sudoers.d
then sudo will read files in the directory /etc/sudoers.d.
Exceptions are:
- Files whose names end in ~
- Files whose names contain a . character
This is done (a) for the convenience of package managers and also (b) so that backup files from editors are ignored.
Not sure if you figured it out by now but I got it working using some of this info and put together a few notes to help out.I too am having errors. Guess that is what happens when someone is new and has no instructions on how to use something.