We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The described permissions for sudoers.d are unfortunately not sufficient for Zabbix to do a discovery, nor to read out SMART attributes for MegaRAID.
Is there any workaround?
Details are below:
[root@io02 ~]# sudo -u zabbix groups zabbix disk
[root@io02 ~]# sudo -u zabbix /usr/sbin/smartctl --scan /dev/sda -d scsi # /dev/sda, SCSI device /dev/sdb -d scsi # /dev/sdb, SCSI device /dev/sdd -d scsi # /dev/sdd, SCSI device (megaraid devices are not found...)
[root@io02 ~]# sudo -u zabbix /usr/sbin/smartctl -a /dev/bus/0 -d megaraid,65 smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.0-1062.4.3.el7.x86_64] (local build) Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
Smartctl open device: /dev/bus/0 [megaraid_disk_65] failed: cannot open /dev/megaraid_sas_ioctl_node or /dev/megadev0
[root@io02 ~]# ll /dev/megaraid_sas_ioctl_node cr--r----- 1 root root 243, 0 Jul 28 10:49 /dev/megaraid_sas_ioctl_node
On the other hand, as "root" it is possible to do the discovery scan and readout:
[root@io02 ~]# /usr/sbin/smartctl --scan /dev/sda -d scsi # /dev/sda, SCSI device /dev/sdb -d scsi # /dev/sdb, SCSI device /dev/sdd -d scsi # /dev/sdd, SCSI device /dev/bus/0 -d megaraid,38 # /dev/bus/0 [megaraid_disk_38], SCSI device /dev/bus/0 -d megaraid,39 # /dev/bus/0 [megaraid_disk_39], SCSI device /dev/bus/0 -d megaraid,40 # /dev/bus/0 [megaraid_disk_40], SCSI device /dev/bus/0 -d megaraid,41 # /dev/bus/0 [megaraid_disk_41], SCSI device ...
[root@io02 ~]# /usr/sbin/smartctl -a /dev/bus/0 -d megaraid,65 | grep defect Grown defects during certification Elements in grown defect list: 0
The text was updated successfully, but these errors were encountered:
AFAIK you are not escalating privileges with zabbix, just executing it with its user.
Try to login as zabbix: sudo -u zabbix /bin/bash and then executing those commands while sudoing, for example: sudo /usr/sbin/smartctl --scan.
sudo -u zabbix /bin/bash
sudo /usr/sbin/smartctl --scan
Sorry, something went wrong.
No branches or pull requests
The described permissions for sudoers.d are unfortunately not sufficient for Zabbix to do a discovery, nor to read out SMART attributes for MegaRAID.
Is there any workaround?
Details are below:
[root@io02 ~]# sudo -u zabbix groups
zabbix disk
[root@io02 ~]# sudo -u zabbix /usr/sbin/smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device
/dev/sdd -d scsi # /dev/sdd, SCSI device
(megaraid devices are not found...)
[root@io02 ~]# sudo -u zabbix /usr/sbin/smartctl -a /dev/bus/0 -d megaraid,65
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.0-1062.4.3.el7.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
Smartctl open device: /dev/bus/0 [megaraid_disk_65] failed: cannot open /dev/megaraid_sas_ioctl_node or /dev/megadev0
[root@io02 ~]# ll /dev/megaraid_sas_ioctl_node
cr--r----- 1 root root 243, 0 Jul 28 10:49 /dev/megaraid_sas_ioctl_node
On the other hand, as "root" it is possible to do the discovery scan and readout:
[root@io02 ~]# /usr/sbin/smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device
/dev/sdd -d scsi # /dev/sdd, SCSI device
/dev/bus/0 -d megaraid,38 # /dev/bus/0 [megaraid_disk_38], SCSI device
/dev/bus/0 -d megaraid,39 # /dev/bus/0 [megaraid_disk_39], SCSI device
/dev/bus/0 -d megaraid,40 # /dev/bus/0 [megaraid_disk_40], SCSI device
/dev/bus/0 -d megaraid,41 # /dev/bus/0 [megaraid_disk_41], SCSI device
...
[root@io02 ~]# /usr/sbin/smartctl -a /dev/bus/0 -d megaraid,65 | grep defect
Grown defects during certification
Elements in grown defect list: 0
The text was updated successfully, but these errors were encountered: