Page 1 of 1
check_ncpa disk/mount
Posted: Tue Oct 29, 2019 10:42 am
by hbouma
I have an NFS mount on a Red Hat box that I am attempting to monitor via the NCPA agent. I can see all the other mounts from the GUI, but not this one. Mount is /XXX/YYY
I can run the following curl command and get a response:
Code: Select all
curl -k -vvv https://SERVER:5693/api/disk/mount/%7CXXX%7CYYY/?token=TOKEN&warning=80&critical=90&check=1
Response is:
{
"|XXX|YYY": {
"fstype": "nfs",
"opts": "INFORMATION",
"device_name": [
"INFORMATION"
]
}
I see no disk usage information in the response. Am I not able to monitor disk usage on a mount?
Re: check_ncpa disk/mount
Posted: Tue Oct 29, 2019 10:57 am
by mbellerue
In your /usr/local/ncpa/etc/ncpa.cfg file there is a setting labeled exclude_fs_types. One of the entries in there should be nfs. Just remove that entry, and then run systemctl restart ncpa_listener.service. Then try your check again.
Re: check_ncpa disk/mount
Posted: Tue Oct 29, 2019 12:05 pm
by hbouma
That is already done, and we can monitor other NFS mounts on the server, just not this one.
Although, the other NFS mounts allow us to monitor them as disk/logical. This one will only show up if we use disk/mount in the command or API call.
Re: check_ncpa disk/mount
Posted: Tue Oct 29, 2019 12:45 pm
by lmiltchev
The
disk/mount API doesn't show the disk usage. You will have to use
disk/logical...
Example:
Code: Select all
[root@localhost ~]# mount
rootfs on / type rootfs (rw)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=4088684k,nr_inodes=1022171,mode=755)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime)
/dev/sda1 on / type ext4 (rw,noatime,barrier=1,data=ordered)
/proc/bus/usb on /proc/bus/usb type usbfs (rw,relatime)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
192.168.x.x:/mnt/backup on /mnt/backup type nfs4 (rw,relatime,vers=4,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.x.x,minorversion=0,local_lock=none,addr=192.168.x.x)
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 99G 39G 59G 40% /
devtmpfs 3.9G 144K 3.9G 1% /dev
tmpfs 4.0G 0 4.0G 0% /dev/shm
/dev/sda1 99G 39G 59G 40% /
192.168.x.x:/mnt/backup
491G 84G 382G 18% /mnt/backup
example01.PNG
Re: check_ncpa disk/mount
Posted: Tue Oct 29, 2019 12:50 pm
by hbouma
I would love to, but the check doesn't work when using disk/logical:
Code: Select all
curl -k -vvv https://SERVER:5693/api/disk/logical/%7CXXX%7CYYY/?token=TOKEN&warning=80&critical=90&check=1
"error": {
"node": "|XXX|YYY",
"path": "/api/disk/logical/|XXX|YYY/",
"message": "The node requested does not exist. You may be trying to access the '|' node.",
"code": 100
Re: check_ncpa disk/mount
Posted: Tue Oct 29, 2019 1:23 pm
by lmiltchev
It works for me both ways - when using curl or check_ncpa.py...
Code: Select all
[root@main-nagios-xi libexec]# curl -k "https://x.x.x.x:5693/api/disk/logical/%7Cmnt%7Cbackup?token=mytoken&warning=80&critical=90&check=1"
{
"perfdata": "'used_percent'=17.90%;80;90;",
"returncode": 0,
"stdout": "OK: Used disk space was 17.90 % (Used: 83.35 GiB, Free: 381.70 GiB, Total: 489.89 GiB) | 'used'=83.35GiB;392;441; 'free'=381.70GiB;392;441; 'total'=489.89GiB;392;441;"
}
[root@main-nagios-xi libexec]#./check_ncpa.py -H x.x.x.x -t 'mytoken' -M 'disk/logical/|mnt|backup' -w 80 -c 90
OK: Used disk space was 17.90 % (Used: 83.34 GiB, Free: 381.70 GiB, Total: 489.89 GiB) | 'used'=83.34GiB;392;441; 'free'=381.70GiB;392;441; 'total'=489.89GiB;392;441;
What is the version of the NCPA agent that you are currently using? Can you show us the actual mount (path)? You can PM me the info.
Re: check_ncpa disk/mount
Posted: Tue Oct 29, 2019 1:36 pm
by hbouma
PM Sent
Re: check_ncpa disk/mount
Posted: Tue Oct 29, 2019 2:12 pm
by lmiltchev
Replied via PM.
Re: check_ncpa disk/mount
Posted: Tue Oct 29, 2019 2:56 pm
by hbouma
The issue is now fixed. The Nagios user didn't have correct permissions to the NFS mount.