Zabbix template

curly882

New Member
Sep 15, 2020
4
0
1
29
Hi all.
Which templates or custom scripts best for monitoring proxmox cluster whith zabbix agent?
Who what used?
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
2,530
274
88
hi,

you can use the regular linux templates which come with zabbix - that will cover your most needs.

if you need to monitor anything specific you can easily create items or scripts according to your needs
 

danielb

Active Member
Jun 1, 2018
165
39
33
34
Bordeaux (france)
www.firewall-services.com
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 :
  • 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
Hope it helps.
Cheers,
Daniel
 

josifbg

New Member
Nov 21, 2020
5
0
1
45
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 :
  • 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
Hope it helps.
Cheers,
Daniel
is there any installation instructions step by step?
 

danielb

Active Member
Jun 1, 2018
165
39
33
34
Bordeaux (france)
www.firewall-services.com
No step by step doc written, but here are the main steps :
  • 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
Discovery rules should detect all your VM, nodes, pools, storage and monitor them automaticaly
 

josifbg

New Member
Nov 21, 2020
5
0
1
45
No step by step doc written, but here are the main steps :
  • 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
Discovery rules should detect all your VM, nodes, pools, storage and monitor them automaticaly
I think I did all the step so far except this one:
  • Makes sure zabbix user can run scripts with sudo permissions without password. See an example in conf/sudo.conf file
I am not sure I understand it correctly. Zabbix agent will connect to the PVE and will execute the 2 scripts in /var/lib/zabbix/bin without password? Is that right? If so then how should I do it?
 

josifbg

New Member
Nov 21, 2020
5
0
1
45
You need a zabbix agent running on the pve node
The Agent is installed, but I still have no idea on how to quote "zabbix user can run scripts with sudo permissions without password"
The conf/sudo.conf example don`t ring any bell for me... I don`t understand it
 
Last edited:

danielb

Active Member
Jun 1, 2018
165
39
33
34
Bordeaux (france)
www.firewall-services.com
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)
 

josifbg

New Member
Nov 21, 2020
5
0
1
45
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)
Thank you very much for your help.

Unfortunately and for some reason I`ve got an error:


Zabbix agent item "pve.check.all[cluster]" on host "PVE" failed: first network error, wait for 15 seconds

And this is really strange as I have no problem with my network for sure.
 

danielb

Active Member
Jun 1, 2018
165
39
33
34
Bordeaux (france)
www.firewall-services.com
This 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
 

josifbg

New Member
Nov 21, 2020
5
0
1
45
This 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
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 PVE
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!