thelan / ceph-zabbix

Zabbix plugin for Ceph monitoring
65 stars 81 forks source link

Error initializing cluster client - proxmox ceph cluster #12

Closed miketheknife closed 8 years ago

miketheknife commented 8 years ago

Hey there, thank you for developing a zabbix-ceph monitoring! I have managed to install the monitor script on the ceph server node and configured the zabbix client. I have a 4 node proxmox cluster with ceph enabled. On the ceph server i have set the setuid bit on the /opt/ceph-status.sh. and I can read successfully from it:

-r-sr-xr-x 1 root root 5831 Jun 15 21:49 ceph-status.sh

root@vmhost01:/opt# /opt/ceph-status.sh wrbps 56546

now when I import the templates to the zabbix server and enable the template on my host then i get a status not supported and then the following error (on all the ceph cluster items):

Received value [Error initializing cluster client: Error('error calling conf_read_file: errno EACCES',)Error initializing cluster client: Error('error calling conf_read_file: errno EACCES',)0] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]

Can you help me on this please? Kind regards Mike

miketheknife commented 8 years ago

Now its working, I had to edit /etc/zabbix/zabbix_agentd.conf to allow the agent to run under root "AllowRoot=1", now it can collect the data without any error. I still wonder tho why the zabbix agant cannot run the script as normal user when the setuid bit on the script is set.

If you have any idea, please let me know

Thanks again for the templates and the script! Mike

thelan commented 8 years ago

Basicly, i would not recommend to run the zabbix agent as Root (for security purpose) It would be better to use sudo as wrapper.

instead, check permissions on ceph keyring file. For instance do: chmod 660 /etc/ceph/ceph.client.admin.keyring chown ceph.ceph /etc/ceph/ceph.client.admin.keyring

Be sure to do that on the kerying you are using to connect to the cluster.

then add zabbix to ceph group: usermod -a -G ceph zabbix