Question on Zabbix and HDD S.M.A.R.T monitoring

Hi, I realize this not a Nethserver question but I did follow the procedure to install Zabbix 5.0 on Nethserver which worked great. I am trying to monitor the health of my disks which has resulted in failures so far. I tried this procedure under Proxmox :

The procedure has to be adapted a bit, no need for SUDO under Proxmox for example. There is also a mention of a zabbix-agent user which I don’t know where that comes from.

Anyways, if someone did try to install SMART monitoring using this procedure or has a better one, I would appreciate it.

Thanks.

For those interested, I abandoned that procedure and instead used this one which worked great.

For anyone interested in monitoring their HDDs, SSDs, NVMEs, install this.

4 Likes

Congratulations @tessierp you found a solution :+1:

Short ( I hope smooth) further introduction in the linux-world,
It’s good practice to run a daemon (service) with it’s own restricted user, just to be sure this daemon can’t be a devil.
So on installation a user and a group is created for the service-application you just installed. And typically this user is granted privileges to do/run only that it needs to do. hence the :

chmod -R 750 /opt/zabbix/
chown -R root:zabbix /opt/zabbix/

750 means :
7 owner (user) can do everything read/write/execute,
5 group can read/execute
0 others can do nothing

root:zabbix means :
user=root
group=zabbix

EDIT:
the above being said, the author of the script makes a little mistakes:

Add in /etc/sudoers

Defaults:zabbix !requiretty
zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl
zabbix ALL=(root) NOPASSWD: /opt/zabbix/smartctl-storage-discovery.sh

The last line means the smartctl-storage-discovery.sh bash-script runs as zabbix with SUperuserDO (=root) privilages. The author should have used “sudo” in the script where needed instead of running the whole script as root.
Note: do not see malicious (devils) code in the bash script, hence a little mistake

Best wishes for the upcoming New Year,

Mark

Thanks, slowly getting into the Linux world and setting up servers. Been getting a lot of help and doing a lot of research.

Thinking of security, wouldn’t it been better to set the user as ‘zabbix’?

Good observation, thanks for pointing that out.

Best wishes to you too!

From a security respective It better to set root as user (=owner) and give the zabbix group (with one member: zabbix) less privileges. And it makes is better “readable” as in code: if a sysadmin sees this the intentions are very clear.

grtz Mark

ggtrz,

Thanks for the input! Much appreciated! Cheers!