Page 2 of 2

Re: NCP Agent not detecting XFS File System

Posted: Fri May 07, 2021 4:30 pm
by Sampath.Basireddy
This is very strange. fstype & device name commands works just fine, but used_percent fails. What am I doing wrong, am confused.

Code: Select all

[root@ nagios1 ~]# /usr/local/nagios/libexec/check_ncpa.py -H xx.xx.xx.xxx -t <Token> -P 5693 -M 'disk/mount/|var|lib|ceph|osd|ceph-11/fstype'
OK: Fstype was ['xfs']

Code: Select all

[root@ nagios1 ~]# /usr/local/nagios/libexec/check_ncpa.py -H xx.xx.xx.xxx -t <Token> -P 5693 -M 'disk/mount/|var|lib|ceph|osd|ceph-11/device_name'
OK: Device_name was ['/dev/sdw3']

Code: Select all

[root@ nagios1 ~]# /usr/local/nagios/libexec/check_ncpa.py -H xx.xx.xx.xxx -t <Token> -P 5693 -M 'disk/mount/|var|lib|ceph|osd|ceph-11/used_percentage' -c 90 -w 85
UNKNOWN: The node (used_percentage) requested does not exist.

Re: NCP Agent not detecting XFS File System

Posted: Fri May 07, 2021 4:53 pm
by vtrac
Hi,
If you follow the "curl" outputs file, it will let you know where "use_percent" is in the tree.

Code: Select all

        "logical": {
            "|boot": {
                "used_percent": [
                    40.8, 
                    "%"
                ], 
As you can see from above, "used_percent" belong to "disk/logical/|boot/used_percent" for the "|boot" filesystem.

Your earlier command:
/usr/local/nagios/libexec/check_ncpa.py -H xx.xx.xx.xxx -t <Token> -P 5693 -M 'disk/mount/|var|lib|ceph|osd|ceph-11/used_percentage' -c 90 -w 85

There is not "used_percent" for "|var|lib|ceph|osd|ceph-11".

The only available option for "|var|lib|ceph|osd|ceph-63" are "fstype", "opts" and "device_name" (see below):

Code: Select all

    "disk": {
        "mount": {
            "|var|lib|ceph|osd|ceph-63": {
                "fstype": "xfs", 
                "opts": "rw,noatime,attr2,inode64,noquota", 
                "device_name": [
                    "/dev/sdd3"
                ]
            }, 
Based on the output of "curl", "used_percent" are only available for "|boot" and "|" (please see below):

Code: Select all

disk:
        "logical": {
            "|boot": {
                "used_percent": [
                    40.8, 
                    "%"
                ], 
                "used": [
                    0.07, 
                    "GiB"
                ], 
                "inodes_used": [
                    295, 
                    "inodes"
                ], 
                "free": [
                    0.11, 
                    "GiB"
                ], 
                "device_name": [
                    "/dev/sda3"
                ], 
                "inodes_free": [
                    16089, 
                    "inodes"
                ], 
                "inodes": [
                    16384, 
                    "inodes"
                ], 
                "fstype": "ext2", 
                "total": [
                    0.19, 
                    "GiB"
                ], 
                "opts": "rw,relatime", 
                "inodes_used_percent": [
                    2.0, 
                    "%"
                ]
            }, 
            "|": {
                "used_percent": [
                    17.1, 
                    "%"
                ], 
                "used": [
                    7.95, 
                    "GiB"
                ], 
                "inodes_used": [
                    135381, 
                    "inodes"
                ], 
                "free": [
                    38.62, 
                    "GiB"
                ], 
                "device_name": [
                    "/dev/mapper/os-root"
                ], 
                "inodes_free": [
                    3141419, 
                    "inodes"
                ], 
                "inodes": [
                    3276800, 
                    "inodes"
                ], 
                "fstype": "ext4", 
                "total": [
                    49.08, 
                    "GiB"
                ], 
                "opts": "rw,relatime,errors=panic,stripe=32411,data=ordered", 
                "inodes_used_percent": [
                    5.0, 
                    "%"
                ]
            }
        }, 

From the outputs of "curl" .... you must follow the tree (json) structure down.
Anything listed there is what you will get .... :-)

You can search "Nagios Exchange" page for other module(s) that might fit your needs better.
https://exchange.nagios.org/


Best Regards,
Vinh

Re: NCP Agent not detecting XFS File System

Posted: Fri May 07, 2021 4:59 pm
by vtrac
Here's the curl command again, run this on the system you want to check .... please do one at a time.

curl -k 'https://x.x.x.x:5693/api/disk/?token=yourToken'

Once you get the output .... follow the json tree structure from top down.

NOTE: You can only check with what is / are listed.

Re: NCP Agent not detecting XFS File System

Posted: Wed May 12, 2021 12:54 pm
by Sampath.Basireddy
So, that means I cannot monitor XFS disk usage with NCPA, correct?

Is this a limitation with the NCPA? Are there any other plugins that I can use to monitor XFS or should I write one myself?

Re: NCP Agent not detecting XFS File System

Posted: Wed May 12, 2021 3:29 pm
by vtrac
Hi,
Hope you are having a good day!!

Based on the "curl-output.txt" file, those "xfs" file are under "mount", so you can not check "used_percent".

"used_percent" only available for "/boot" and "/", based on the "curl-output.txt".

You can try searching the Nagios Exchange web site and see if anything that might fit your need:
https://exchange.nagios.org/


Best Regards,
Vinh