check_ncpa disk/mount

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

check_ncpa disk/mount

Post 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?
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: check_ncpa disk/mount

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: check_ncpa disk/mount

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_ncpa disk/mount

Post 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
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: check_ncpa disk/mount

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_ncpa disk/mount

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: check_ncpa disk/mount

Post by hbouma »

PM Sent
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_ncpa disk/mount

Post by lmiltchev »

Replied via PM.
Be sure to check out our Knowledgebase for helpful articles and solutions!
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: check_ncpa disk/mount

Post by hbouma »

The issue is now fixed. The Nagios user didn't have correct permissions to the NFS mount.
Locked