mverboom / zabbix-pve-api

Zabbix template for Proxmox
40 stars 13 forks source link

Import failed #3

Closed begize closed 3 years ago

begize commented 3 years ago

Hi:

I just created a zabbix 5.4 server, import zabbix-pve-api.xml appears Import failed: Cannot read XML: (41) Specification mandates value for attribute data-pjax-transient [Line: 81 | Column: 90].

How can I solve this problem?

mverboom commented 3 years ago

Hi,

Thanks for the message! It looks like during the upgrade to zabbix 5.4 the formula for the calculated item pveapi.node.lvm.used[{#PVENODELV}] was not converted to the new syntax introduced in 5.4. I've manually converted it. After exporting I imported the templates again on a test system, and it worked.

Could you test that this fix solves the problem for you?

Regards,

Mark

begize commented 3 years ago

Thank you for your help Can already import template successfully But have another problem...

my server ip :192.168.X.102 server name :pve102

I follow your steps API token established Create host: 192.168.X.102 templates: pve api datacenter macro's {$PVETOKENID}=root@pam!zabbix {$PVESECRET}=3c75001c-... {$PVESERVER}=pev102

The following error message appears when adding a host

Details Cannot add host Cannot find host interface on "192.168.X.102" for item key "pveapi.datacenter.master.resources".

How can I solve it? Can I add one more macro as needed?

mverboom commented 3 years ago

Hi,

I think I need to clear up the documentation on this. It is not required to install a zabbix agent on the target system. But the definition of the host does need an interface defined. This can be a zabbix agent that you point to the agent on the zabbix server (127.0.0.1).

When you define this, does it work?

Regards,

Mark

begize commented 3 years ago

Hi: Thank you for your explanation. I use the agent on the zabbix server (127.0.0.1), Server can finally add a host. After a period of time, zabbix server host new add a "pveapi datacenter discovery node: pve102". But there are other problems. Although the node is automatically added through the api, and the item of the node host has cpu, memory size, swap size... and other item items, and the status is enable, the data is not captured. The VM data in the node host cannot be captured either. Please give me guidance on how to solve this problem, thank you~~~

mverboom commented 3 years ago

Hi,

It's pretty difficult to say what is wrong with this little information.

It could be you created an API token that does not have sufficient permissions, you might want to look into that.

I'm closing this one as the import issue seems to be fixed.

Thanks for testing,

Mark

begize commented 3 years ago

Hi: As you said, I didn’t set API Tokens Permissions so I couldn’t get the data. If possible, please add the way of setting API Tokens permissions to your description, so that novices like me can have a basis. my step is: DataCenter -->Permissions -->add-->API Tokens Permission Path:/ API Token:your api token Roles:Administrator

If you have a better setting method, please tell me, thank you~~~

Mark Verboom @.***> 於 2021年6月17日 週四 下午1:06寫道:

Hi,

It's pretty difficult to say what is wrong with this little information.

It could be you created an API token that does not have sufficient permissions, you might want to look into that.

I'm closing this one as the import issue seems to be fixed.

Thanks for testing,

Mark

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mverboom/zabbix-pve-api/issues/3#issuecomment-862928039, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLJEUI7WSF4D6UZX5IMBRLTTF7ERANCNFSM46NE7TEQ .

mverboom commented 3 years ago

Hi, The documentation states that permissions need to be sufficient. I have not had the time to figure out what the minimum required permissions are. I don't want to state in the documentation the administartor role is required if it isn't.

This template is still a work in progress. The basics are there but it requires work in documentation and testing.

It is open source, so if you want to write documentation that makes it easier for new users to configure the template, that would be great!

Regards,

Mark