Hi All,
I am trying to monitor a new Sanoid setup using a non-root user from my monitoring agent and am running into a weird issue.
Here is the error I am getting:
vmhost02:~$ sudo -u zabbix /usr/sbin/sanoid --monitor-snapshots
print() on closed filehandle FH at /usr/sbin/sanoid line 1543.
print() on closed filehandle FH at /usr/sbin/sanoid line 1544.
Could not write to $cache!\n at /usr/sbin/sanoid line 829.
I’ve given the user zabbix
sudo permissions to execute the /usr/sbin/sanoid file using the following in the /etc/sudoers
file:
zabbix ALL=NOPASSWD: /usr/sbin/sanoid
What is strange is that if I run the same command on my user who has full sudo rights, it works. If I try again on my zabbix
user, everything works. Eventually the command stops working on zabbix
user.
I do notice that the /var/cache/sanoid/snapshots.txt
file gets updated when the issue starts.
Here is my sanoid.conf
file:
sanoid.conf
#Catch All incase a dataset was missed
[zpool1/vm-images]
process_children_only = yes
recursive = yes
frequently = 0
hourly = 0
daily = 30
monthly = 3
yearly = 0
autosnap = yes
autoprune = ye
[zpool1/vm-images/q36001/c-drive]
use_template = production
[zpool1/vm-images/q36001/q-drive]
use_template = production
#############################
#templates below this line #
#############################
[template_production]
frequently = 0
hourly = 36
daily = 30
monthly = 3
yearly = 0
autosnap = yes
autoprune = yes
Sometimes it just randomly starts working again.
I’m very new to Sanoid so there may be something I am doing wrong.
Not sure if this helps but here is my /var/cache/sanoid/snapshots.txt
file
vmhost02:~$ ls -l /var/cache/sanoid/snapshots.txt
-rw-r--r-- 1 root root 8794 May 27 20:45 /var/cache/sanoid/snapshots.txt
Sanoid Version
vmhost02:~$ sanoid --version
/usr/sbin/sanoid version 2.2.0
(Getopt::Long::GetOptions version 2.54; Perl version 5.38.2)
Any help is greatly appreciated!