Page 1 of 1

Configuring nrdp.cfg - Check multiple volumes in one check

Posted: Fri Jun 08, 2018 7:41 am
by targettor
Hi

I have configured passive checks using NCPA clients and the NRDP server add-on (1.5.2) on top of (Nagios Core 4.3.4).
Passive checks are working correctly so far.

I noticed, that on a CentOS 7 linux system (to be monitored), the passive disk check reports just on the root volume "/", and not on any other volumes.

Now, I would like to configure my client NCPA client (using /usr/local/ncpa/etc/ncpa.cfg.d/nrdp.cfg) in a way, that it checks all disks associated with the base OS.
In my case, this will be "/" and "/boot".

Code: Select all

# df -Ph | grep '^/'
/dev/mapper/root-root   20G  2.0G   19G  10% /
/dev/sda1              922M  756M  120M  87% /boot
Notice, that the root volume is LVM-based, whilst the "/boot" volume is just a formatted partition.

This is my nrdp.cfg:

Code: Select all

# cat /usr/local/ncpa/etc/ncpa.cfg.d/nrdp.cfg
[passive checks]
%HOSTNAME%|__HOST__ = system/agent_version
%HOSTNAME%|DISK_OS_passive = disk/logical/|/used_percent --warning 85 --critical 90
This is, what the Nagios Core server ist logging to /var/log/nagios/nagios.log:

Code: Select all

[1528460781] PASSIVE SERVICE CHECK: myhost;DISK_OS_passive;0;OK: Used_percent was 9.60 %
Notice, that in this given example, the status should be "WARNING" rather than "OK", because the volume "/boot" is above 85% usage.

How do I configure nrdp.cfg to check on multiple volumes?
Is there a documentation for it? I did not find my answer in the API reference (https://www.nagios.org/ncpa/help/2.0/api.html).
Or asked differently, is it possible to check all mounted local volumes (ignoring remote fs like nfs mounts)?

Thanks
Toni

Re: Configuring nrdp.cfg - Check multiple volumes in one che

Posted: Fri Jun 08, 2018 2:42 pm
by npolovenko
Hi, @targettor. Your command looks right, but NCPA will not autodiscover&include all logical disks automatically. Instead, you'd need to create a separate check for each logical disk.
%HOSTNAME%|DISK_OS_passive = disk/logical/|C:/used_percent --warning 85 --critical 90
%HOSTNAME%|DISK_OS_passive2 = disk/logical/|D:/used_percent --warning 85 --critical 90
Where C and D are the logical disks.

Re: Configuring nrdp.cfg - Check multiple volumes in one che

Posted: Tue Jul 10, 2018 12:35 pm
by targettor
Hi @npolovenko
Many thanks for your help, it is working now.
However, this is a very complicated and error-prone way of doing it, as every volume needs needs its own check service definition on the client as well as on the Nagios server.
It would be desireable if ncpa could submit a list of volume names/usage to Nagios NRDP in one check command - just as one would do with active checks. I was just wondering if this is possible somehow?

The other thing to mention is how odd it is to add mount points in the nrdp.cfg config.
1. Remove the leading slash "/"
2. Replace all other slashes with a pipe symbol "|"

Example for multiple volumes:

Code: Select all

%HOSTNAME%|DISK_OS_passive_root =                    disk/logical/|/used_percent --warning 85 --critical 90
%HOSTNAME%|DISK_OS_passive_boot =                    disk/logical/|boot/used_percent --warning 85 --critical 90
%HOSTNAME%|DISK_APP_passive_local =                  disk/logical/|local/used_percent --warning 85 --critical 90
%HOSTNAME%|DISK_APP_passive_local.appdata.data =     disk/logical/|local|appdata|data/used_percent --warning 85 --critical 90
%HOSTNAME%|DISK_APP_passive_local.appdata.translog = disk/logical/|local|appdata|translog/used_percent --warning 85 --critical 90
%HOSTNAME%|DISK_APP_passive_opt.ibm =                disk/logical/|opt|ibm/used_percent --warning 85 --critical 90
many thanks anyway!

Re: Configuring nrdp.cfg - Check multiple volumes in one che

Posted: Wed Jul 11, 2018 11:38 am
by cdienger
Separate checks are needed for each drive. You could of course create a custom plugin to check the drives in a preferable manner and execute it with NCPA:

https://support.nagios.com/kb/article/n ... a-722.html