permission denied on second /dev/fio device
Posted: Tue May 02, 2017 10:29 am
We have 2 partitions that are mounted on /dev/fioa and /dev/fiob respectively.
1. The first partition is reported correctly on the Nagios XI server:
DISK OK - free space: /var/lib/pgsql 1049755 MB (97% inode=99%):
2. The second partition is reporting a permission denied error:
DISK CRITICAL - /var/lib/pgsql/9.6/data/pg_xlog is not accessible: Permission denied
3. If performed on the monitored server itself the command executes properly:
[root@remotehost]# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /var/lib/pgsql/9.6/data/pg_xlog
DISK OK - free space: /var/lib/pgsql/9.6/data/pg_xlog 1072496 MB (99% inode=99%);| /var/lib/pgsql/9.6/data/pg_xlog=1062MB;904814;1017916;0;1131018
4. Additional details:
remotehost means centos server being monitored, not the Nagios XI server.
[root@remotehost]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md126p4 202G 129G 63G 68% /
tmpfs 32G 4.0K 32G 1% /dev/shm
/dev/md126p1 969M 57M 863M 7% /boot
/dev/md126p2 7.7G 51M 7.3G 1% /tmp
/dev/fioa 1.1T 24G 1.1T 3% /var/lib/pgsql
/dev/fiob 1.1T 1.1G 1.1T 1% /var/lib/pgsql/9.6/data/pg_xlog
[root@remotehost]# pwd
/var/lib
[root@remotehost]# ls -ld pgsql
drwxr-xr-x 4 postgres postgres 4096 May 1 11:32 pgsql
[root@remotehost]# pwd
/var/lib/pgsql/9.6/data
[root@remotehost]# ls -ld pg_xlog
drwxr-xr-x 4 postgres postgres 4096 Apr 28 16:07 pg_xlog
[root@remotehost]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 232.9G 0 disk
└─md126 9:126 0 221.2G 0 raid1
├─md126p1 259:0 0 1000M 0 md /boot
├─md126p2 259:1 0 7.9G 0 md /tmp
├─md126p3 259:2 0 7.9G 0 md [SWAP]
└─md126p4 259:3 0 204.4G 0 md /
sda 8:0 0 232.9G 0 disk
└─md126 9:126 0 221.2G 0 raid1
├─md126p1 259:0 0 1000M 0 md /boot
├─md126p2 259:1 0 7.9G 0 md /tmp
├─md126p3 259:2 0 7.9G 0 md [SWAP]
└─md126p4 259:3 0 204.4G 0 md /
fioa 252:0 0 1.1T 0 disk /var/lib/pgsql
fiob 252:16 0 1.1T 0 disk /var/lib/pgsql/9.6/data/pg_xlog
Thanks
1. The first partition is reported correctly on the Nagios XI server:
DISK OK - free space: /var/lib/pgsql 1049755 MB (97% inode=99%):
2. The second partition is reporting a permission denied error:
DISK CRITICAL - /var/lib/pgsql/9.6/data/pg_xlog is not accessible: Permission denied
3. If performed on the monitored server itself the command executes properly:
[root@remotehost]# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /var/lib/pgsql/9.6/data/pg_xlog
DISK OK - free space: /var/lib/pgsql/9.6/data/pg_xlog 1072496 MB (99% inode=99%);| /var/lib/pgsql/9.6/data/pg_xlog=1062MB;904814;1017916;0;1131018
4. Additional details:
remotehost means centos server being monitored, not the Nagios XI server.
[root@remotehost]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md126p4 202G 129G 63G 68% /
tmpfs 32G 4.0K 32G 1% /dev/shm
/dev/md126p1 969M 57M 863M 7% /boot
/dev/md126p2 7.7G 51M 7.3G 1% /tmp
/dev/fioa 1.1T 24G 1.1T 3% /var/lib/pgsql
/dev/fiob 1.1T 1.1G 1.1T 1% /var/lib/pgsql/9.6/data/pg_xlog
[root@remotehost]# pwd
/var/lib
[root@remotehost]# ls -ld pgsql
drwxr-xr-x 4 postgres postgres 4096 May 1 11:32 pgsql
[root@remotehost]# pwd
/var/lib/pgsql/9.6/data
[root@remotehost]# ls -ld pg_xlog
drwxr-xr-x 4 postgres postgres 4096 Apr 28 16:07 pg_xlog
[root@remotehost]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 232.9G 0 disk
└─md126 9:126 0 221.2G 0 raid1
├─md126p1 259:0 0 1000M 0 md /boot
├─md126p2 259:1 0 7.9G 0 md /tmp
├─md126p3 259:2 0 7.9G 0 md [SWAP]
└─md126p4 259:3 0 204.4G 0 md /
sda 8:0 0 232.9G 0 disk
└─md126 9:126 0 221.2G 0 raid1
├─md126p1 259:0 0 1000M 0 md /boot
├─md126p2 259:1 0 7.9G 0 md /tmp
├─md126p3 259:2 0 7.9G 0 md [SWAP]
└─md126p4 259:3 0 204.4G 0 md /
fioa 252:0 0 1.1T 0 disk /var/lib/pgsql
fiob 252:16 0 1.1T 0 disk /var/lib/pgsql/9.6/data/pg_xlog
Thanks