Monitoring new filesystems

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
paul.omalley
Posts: 12
Joined: Mon Jan 29, 2018 10:29 am

Monitoring new filesystems

Post by paul.omalley »

Hello:
I am reaching out to inquire about how I might be able to recognize a newly added local filesystem automatically and have a service added to monitor it using the NCPA agent?

Basically, I want to do the following:

1) A new local filesystem /fs3 is added to server A
2) The 'check_disk' plugin runs on server A and lists all local filesystems
3) The plugin sees /fs3 as new and a new service is added using default thresholds and notifications

Are there any techniques for doing this built into any Nagios XI plugins?

And, we would need a way to exclude certain patterns (ex. /var/lib/docker).

Thanks,
Paul
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Monitoring new filesystems

Post by npolovenko »

Hello, @paul.omalley.
We don't officially have this feature but recently I was thinking of a way to implement this. Here is what I've discovered.

There is a query in NCPA to automatically detect and show all logical volumes.

Code: Select all

curl -k https://192.168.4.172:5693/api/disk/logical?token=mytoken
Where token is the ncpa token, and IP is the IP of the remote server with NCPA installed.

This is the output from the query. |boot and | are two logical volumes automatically detected.

Code: Select all

"logical": {
        "|boot": {
            "used_percent": [
                60.1, 
                "%"
            ], 
            "inodes_free": [
                511641, 
                "inodes"
            ], 
            "used": [
                0.29, 
                "GiB"
            ], 
            "opts": "rw,relatime,attr2,inode64,noquota", 
            "device_name": [
                "/dev/sda1"
            ], 
            "total": [
                0.48, 
                "GiB"
            ], 
            "inodes": [
                512000, 
                "inodes"
            ], 
            "inodes_used": [
                359, 
                "inodes"
            ], 
            "free": [
                0.19, 
                "GiB"
            ], 
            "fstype": "xfs"
        }, 
        "|": {
            "used_percent": [
                12.6, 
                "%"
            ], 
            "inodes_free": [
                28758221, 
                "inodes"
            ], 
            "used": [
                3.48, 
                "GiB"
            ], 
            "opts": "rw,relatime,attr2,inode64,noquota", 
            "device_name": [
                "/dev/mapper/centos-root"
            ], 
            "total": [
                27.49, 
                "GiB"
            ], 
            "inodes": [
                28844032, 
                "inodes"
            ], 
            "inodes_used": [
                85811, 
                "inodes"
            ], 
            "free": [
                24.01, 
                "GiB"
            ], 
            "fstype": "xfs"
        }
    }
}
Here's our tutorial to deploy, install NCPA agents on remote Linux servers and automatically create services in XI with Ansible:
https://www.youtube.com/watch?v=Vkwf5Rp3Kj4

If you look at this Ansible task:

Code: Select all

/usr/local/nagiosxi/scripts/automation/ansible/ncpa_autoregister/roles/register_with_xi/tasks
It uses the API command to create a Disk Service in XI, but its only creating 1 disk check with generic root partition "|". It doesn't automatically parse the output from the first query I showed you. Because my query showed "|boot" and "|" logical volumes, and it's only adding the | volume.

So technically there should be another API command, just like this one but instead of | it should have |boot, to create another check for the boot volume.
Untitled.png
The conclusion is that what you're looking for is not supported yet. But you can implement it yourself if you find a way to parse logical volume names from the query #1 and put them in the API command that creates disk check services in XI.

Hope this helps.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
paul.omalley
Posts: 12
Joined: Mon Jan 29, 2018 10:29 am

Re: Monitoring new filesystems

Post by paul.omalley »

This is great information ! We have recently ordered Ansible and are in process of implementing. thanks!
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Monitoring new filesystems

Post by npolovenko »

@paul.omalley, Glad I could help!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked