Auto adding new logical disk added on Linux NCPA?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gdksc
Posts: 20
Joined: Fri Feb 01, 2019 9:58 am

Auto adding new logical disk added on Linux NCPA?

Post by gdksc »

Hello. We have Nagios XI monitoring various Linux servers via NCPA.

When a new logical disk is added on a Linux NCPA, what would be best approach for automating creation of a new service check?

For example, if a new logical disk is added on a Linux NCPA, I would like to do something similar to the following:

1. Detect the new logical disk was added on the target NCPA

2. Send a notification that the new logical disk was detected

Optionally:

3. Automatically create a new Disk Usage service check for the target NCPA in XI

4. Apply the configuration

I'm assuming all of this can be scripted via API calls, but I'm curious if there's a better or more common approach, or if I'm perhaps overlooking something already in XI.

At the moment, I am manually adding new logical disks..

Thanks.

gd
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Auto adding new logical disk added on Linux NCPA?

Post by ssax »

Currently there isn't an automated method to do this, you would essentially need to script it out through the API or check all disks in a single check.

The problem with checking all disks in a single check is that if the number of metrics change on the check (a disk added or deleted) it will stop graphing because the backend RRD files (that stores the graph data) expect the exact number of data sources from creation otherwise the data will not insert into it. That can be resolved by either deleting the RRD file so that it can be rebuilt (losing historical data) or by doing one of these:

https://support.nagios.com/kb/article/n ... e-497.html
https://support.nagios.com/kb/article/n ... g-149.html

NOTE: Development intends to move away from RRDs in the future

You could write a plugin that is run through NCPA (active or passive) that checks for new disks and if one is detected have it add the new service through the API. Or you could have it submit it through NRDP and then use Admin > Unconfigured Objects > Auto-Configure settings to auto-import it.

https://assets.nagios.com/downloads/nag ... ith_XI.pdf
gdksc
Posts: 20
Joined: Fri Feb 01, 2019 9:58 am

Re: Auto adding new logical disk added on Linux NCPA?

Post by gdksc »

Thanks for the guidance, @ssax.

That answers my questions.