Answer the question
In order to leave comments, you need to log in
How to give access to the zabbix agent user to run commands?
There is an HP server with raid10 with installed proxmox.
It is necessary to configure disk array health monitoring via hpacucli.
An error occurred while running hpacucli as the zabbix user:
Error: You need to have administrator rights to continue.
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
zabbix ALL=(root) NOPASSWD: ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
Matching Defaults entries for zabbix on lbox:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User zabbix may run the following commands on lbox:
(root) NOPASSWD: ALL
Answer the question
In order to leave comments, you need to log in
What you are doing is extremely unsafe, it is more correct to give permission to run from root only the necessary files, add something like this to the /etc/sudoers.d/zabbix file (example from raid monitoring and smart status)
Cmnd_Alias ZABBIX = \
/opt/MegaRAID/MegaCli/MegaCli64,\
/usr/sbin/smartctl
Defaults:zabbix !requiretty
zabbix ALL=NOPASSWD: ZABBIX
After asking the Google search engine: "zabbix as run commands not out of root rights" (without quotes, of course), there was a link to one interesting topic on the unix.stackexchange.com website: https://unix.stackexchange.com/questions/234151/ho ... .
Look, it looks like there is a solution to your question.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question