Page 1 of 1

mount point monitoring through NCPA

Posted: Sun Sep 10, 2017 8:39 pm
by sunnynani4849
Hi ,

Iam trying to monitor the mount point (/opt/splunk/var/lib/splunk/cold/) via NCPA agent. I have searched some website that mount point monitoring cannot be done via NCPA agent.
So i am trying to monitor this via check_disk plugin through the NCPA agent, but getting the below errors. Please help with the below issue

Re: mount point monitoring through NCPA

Posted: Mon Sep 11, 2017 2:42 pm
by kyang
Hi @sunnynani4849,

It looks like the command arguments are not being passed correctly,

Try this, without -a and without agent

Code: Select all

-M 'plugins/check_disk/-w 10%/-c 20%/-p /tmp'
Or this one

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H 192.168.x.xxx -t '<token>' -M 'plugins/check_disk' -a '-w 10% -c 20% -p /tmp'
The output should be like this.

Code: Select all

DISK OK - free space: / 17556 MB (67.01% inode=91%);| /=8640MB;24838;22078;0;2759
Post your output or let me know if this helps

Re: mount point monitoring through NCPA

Posted: Mon Sep 11, 2017 4:01 pm
by dwhitfield
Thanks for the assist @kyang!

Re: mount point monitoring through NCPA

Posted: Wed Sep 13, 2017 10:40 pm
by sunnynani4849
Hi kyang,

Thanks for the update and sorry for the delay.

iam trying to monitor the mount points but its showing the output for only the '/' partition.

Re: mount point monitoring through NCPA

Posted: Thu Sep 14, 2017 10:37 am
by kyang
Hi @sunnynani4849,

Instead of passing the -p
try passing

Code: Select all

'w 10% -c 20% -M /opt'
disk.PNG
Let me know if this helps you.

Re: mount point monitoring through NCPA

Posted: Fri Sep 15, 2017 1:59 am
by sunnynani4849
Hi kyang,

After changing the option to -m for the mount point but still getting the same issue.

Re: mount point monitoring through NCPA

Posted: Fri Sep 15, 2017 3:18 pm
by tgriep
What version of NCPA do you have installed in the remote system and can you post your ncpa.cfg file?

Re: mount point monitoring through NCPA

Posted: Tue Sep 19, 2017 12:05 am
by sunnynani4849
hi tgriep,

on the client server NCPA 2.0.2 rpm is installed on the server. Please find the attached NCPA configuration file

Re: mount point monitoring through NCPA

Posted: Tue Sep 19, 2017 12:31 pm
by jomann
The -M for check_disk is case sensitive, but it actually does not take a value at all. You can only specify using -p. The -M command only shows the mount point instead of the partition in the output.

Code: Select all

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_nagios-lv_root
                       27G  8.9G   17G  35% /
tmpfs                 1.9G  440K  1.9G   1% /dev/shm
/dev/sda1             477M  127M  325M  29% /boot
The first run assumes / because you are not actually passing the -p value and -M displays the mount point. The second two are using a path, without -M. The last one uses -M and -p.

Code: Select all

[root@nagios libexec]# /usr/local/nagios/libexec/check_ncpa.py -H localhost -t 'mytoken' -M 'plugins/check_disk' -a '-w 10% -c 20% -M'
DISK OK - free space: /dev/mapper/vg_nagios-lv_root 17168 MB (65.53% inode=90%);| /dev/mapper/vg_nagios-lv_root=9028MB;24838;22078;0;27598

[root@nagios /]# /usr/local/nagios/libexec/check_ncpa.py -H localhost -t 'mytoken' -M 'plugins/check_disk' -a '-w 10% -c 20% -p /boot'
DISK OK - free space: / 17167 MB (65.53% inode=90%);| /=9028MB;24838;22078;0;27598

[root@nagios /]# /usr/local/nagios/libexec/check_ncpa.py -H localhost -t 'mytoken' -M 'plugins/check_disk' -a '-w 10% -c 20% -p /dev/shm'
DISK OK - free space: / 17167 MB (65.53% inode=90%);| /=9028MB;24838;22078;0;27598

[root@nagios libexec]# /usr/local/nagios/libexec/check_ncpa.py -H localhost -t 'mytoken' -M 'plugins/check_disk' -a '-w 10% -c 20% -p /boot -M'
DISK OK - free space: /dev/mapper/vg_nagios-lv_root 17167 MB (65.53% inode=90%);| /dev/mapper/vg_nagios-lv_root=9029MB;24838;22078;0;27598
Also it seems like the check_disk won't return the partition data, and if you wanted to get that, you could just do it with NCPA

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H localhost -t 'mytoken' -M 'disk/logical/|boot' -w 70 -c 90 -u M
OK: Used disk space was 28.10 % (Used: 132.94 MB, Total_size: 499.36 MB, Free: 340.20 MB) | 'used_percent'=28.10%;70;90;