Icinga2 : DISK CRITICAL – /sys/kernel/security is not accessible: Permission denied

First, I tried to run check_disk command with root user. It worked great. But when I tried to run check_disk command with nobody user, I got following.

 # su -s /bin/bash nobody
 bash-4.2$ /usr/lib64/nagios/plugins/check_disk -w 70% -c 80%
 DISK CRITICAL - /sys/kernel/security is not accessible: Permission denied

Then, I checked permission of /sys/kernel/security folder

# ls -ld /sys/kernel/security
 drwxr-xr-x 2 root root 0 Nov 25 03:24 /sys/kernel/security

seems okay to me. Then I checked permission of /sys/kernel

# ls -ld /sys/kernel/
 drwx------ 10 root root 0 Nov 28 03:28 /sys/kernel/

I Changed it to 755

 # chmod 755 /sys/kernel/
 # ls -ld /sys/kernel/
 drwxr-xr-x 10 root root 0 Nov 28 03:28 /sys/kernel/

At last, I ran the command and it worked.

# su -s /bin/bash nobody
 bash-4.2$ /usr/lib64/nagios/plugins/check_disk -w 70% -c 80%
 DISK OK - free space: / 287888 MB (96% inode=99%); /dev 32191 MB (100% inode=99%); /dev/shm 32224 MB (100% inode=99%); /run 32158 MB (99% inode=99%); /sys/fs/cgroup 32224 MB (100% inode=99%); /home 1482732 MB (99% inode=99%); /run/user/0 6444 MB (100% inode=99%);| /=10945MB;94455;62969;0;314850 /dev=0MB;9657;6438;0;32191 /dev/shm=0MB;9667;6444;0;32224 /run=66MB;9667;6444;0;32224 /sys/fs/cgroup=0MB;9667;6444;0;32224 /home=69MB;468653;312435;0;1562178 /run/user/0=0MB;1933;1288;0;6444

Leave a Reply

Your email address will not be published. Required fields are marked *