Configuring nrdp.cfg - Check multiple volumes in one check

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Configuring nrdp.cfg - Check multiple volumes in one check

Postby targettor » Fri Jun 08, 2018 7:41 am

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
targettor
 
Posts: 2
Joined: Tue May 29, 2018 6:40 am

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

Postby npolovenko » Fri Jun 08, 2018 2:42 pm

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 1824
Joined: Mon May 15, 2017 5:00 pm

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

Postby targettor » Tue Jul 10, 2018 12:35 pm

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!
targettor
 
Posts: 2
Joined: Tue May 29, 2018 6:40 am

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

Postby cdienger » Wed Jul 11, 2018 11:38 am

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 1508
Joined: Tue Feb 07, 2017 11:26 am


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 13 guests