Page 1 of 1

help on correct path for passive disk check

Posted: Thu Jul 16, 2020 10:15 am
by techgeek
Hey Folks,

Using ncpa passive checs to monitor disk space. Works fine for and the ones below except the very last one on the list (the linuxsfs9).

[root@serverx tmp]# df -h

Filesystem Size Used Avail Use% Mounted on
/dev/sda3 976M 616M 309M 67% /
tmpfs 37G 0 37G 0% /dev/shm
/dev/sda1 186M 116M 62M 66% /boot
/dev/mapper/vg00-home
2.0G 102M 1.8G 6% /home
/dev/mapper/vg00-opt 2.9G 924M 1.9G 33% /opt
/dev/mapper/vg00-tidal
2.0G 3.0M 1.9G 1% /opt/Tidal
/dev/mapper/vg00-tmp 12G 674M 11G 6% /tmp
/dev/mapper/vg00-usr 2.9G 951M 1.9G 34% /usr
/dev/mapper/vg00-var 2.9G 791M 2.0G 29% /var
/dev/mapper/disk1-oracle
50G 31G 17G 65% /home/oracle
/dev/mapper/disk1-admin
3.0G 4.6M 2.8G 1% /home/admin
/dev/mapper/disk1-root
30G 6.4G 22G 23% /root
/dev/mapper/disk1-software
50G 30G 18G 63% /software
/dev/mapper/disk1-devtmp
5.0G 11M 4.7G 1% /devtmp
/dev/mapper/disk2-u01
964G 523G 393G 58% /u01
/dev/mapper/vg00-crash
1.8G 769M 936M 46% /var/crash
linuxsfs9.glb.itcs.mycompany.net:/FileShare_PROD
500G 226G 275G 46% /profileshare

so in the nrdp config I have the below and again all good except Nagios GUI reports "UNKNOWN: The node (profileshare) requested does not exist."

# ***Disk space check - monitor mount points eg. var ***
%HOSTNAME%|File System Check U01 = /disk/logical/|u01/used_percent --warning 80 --critical 90
%HOSTNAME%|File System Check Usr = /disk/logical/|usr/used_percent --warning 80 --critical 90
%HOSTNAME%|File System Check Var = /disk/logical/|var/used_percent --warning 80 --critical 90
%HOSTNAME%|File System Check Profileshare = /disk/logical/|profileshare/used_percent --warning 80 --critical 90
%HOSTNAME%|File System Check Home Oracle = /disk/logical/|home|oracle/used_percent --warning 80 --critical 90

Can anyone tell me what I'm doing wrong - it's probably something very simple but I've tried all sorts or permutations for the /profileshare path and it just will not work. if itype cd /profileshare at command prompt it takes me right in.

Re: help on correct path for passive disk check

Posted: Fri Jul 17, 2020 11:09 am
by benjaminsmith
Hi,

The passive configuration definitions look OK. Can share the permissions of this mount point along with the permissions of one those that are working correctly?

Also, try to log into the GUI for NCPA, and let me know if the mount point is showing up in the API. The web guide is available at https://<ip address>:5693
ncpa-api.png
Benjamin

Re: help on correct path for passive disk check

Posted: Mon Jul 20, 2020 4:16 am
by techgeek
Hi,
Yeah turned out it was a permissions thing which threw me off as if I become Nagios and do a df -h I can see the % of all the mount points so I didn't join the dots until you said it.

Can't change the permissions so have done a custom script instead - below for reference for anyone else that may need to do the same

#!/bin/bash

RESULT=$(df -h | grep /profileshare | awk '{ print $4 }' | sed 's/%//g')
PERCENTAGE=$(df -h | grep /profileshare | awk '{ print $4 }')



if [ "$RESULT" -ge "80" ]; then
echo "WARNING: Used_percent was $RESULT%"
exit 1

else

if [ "$RESULT" -ge "90" ]; then
echo "CRITICAL: Used_percent was $RESULT%"
exit 2

else

echo "OK: Used_percent was $RESULT%"


exit 0


fi
fi

Re: help on correct path for passive disk check

Posted: Mon Jul 20, 2020 7:21 am
by scottwilkerson
Thanks for sharing your solution!

Locking thread