Monitoring Citrix XENSERVER Host and VMs based on Python XENApi. Orginal library taken from: https://share.zabbix.com/cat-app/cluster/monitoring-citrix-xenserver-host-and-vms-based-on-pyton-xenapi
Installation notes
XenAPi attached to repo, was taken from: https://github.com/xapi-project/xen-api/tree/master/scripts/examples/python.
Copy file XENApi.py to directory /usr/local/lib/python3.9 (or similar existing) to the zabbix host or the zabbix proxy host.
If you want to change, please change line sys.path.append('/usr/local/lib/python3.9') to sys.path.append('
Default is /usr/lib/zabbix/externalscripts to the zabbix host or the zabbix proxy host.
Remember that script will be run as zabbix user not the root.
Import the templates zbx_export_templates.xml --> contains both templates for VM and Host
Set macros (Global on on all host you use this templates)
{$XENMASTER} --> Masterserver of XENCLUSTER
{$XENUSERNAME} --> Username for connect to XENCLUSTER
{$XENPASSWORD} --> Password for connect to XENCLUSTER
Example:
/usr/lib/zabbix/externalscripts/citrix.xenserver.py -m "\
Check if you see data gathered from xenmaster in /tmp/xenapi.
There should be 3 per hostname.