Trying to monitor disk with ncpa-2.1.9 on windows server

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Trying to monitor disk with ncpa-2.1.9 on windows server

Post by Alan »

I am running Nagios Core version 4.1.1. I am using the ncpa-2.1.9 and got the default setup done and a few windows server hosts in the Nagios UI. It is currently monitoring CPU usage, Memory Usage, and Process Count which is the default of the template that I copied from the Create Nagios checks of the Monitoring Windows Machines tutorial located here - https://assets.nagios.com/downloads/nag ... ndows.html
When I login to the windows host and go to the location - C:\Program Files (x86)\Nagios\NCPA\etc\ncpa.cfg.d and open the nrdp.cfg file this is the contents of the file:

Code: Select all

#
# AUTO GENERATED NRDP CONFIG FROM WINDOWS INSTALLER
#

[passive checks]

# Host check  - This is to stop "pending check" status in Nagios
%HOSTNAME%|__HOST__ = system/agent_version

# Service checks
%HOSTNAME%|CPU Usage = cpu/percent --warning 80 --critical 90 --aggregate avg
%HOSTNAME%|Disk Usage = disk/logical/C:|/used_percent --warning 80 --critical 90 --units Gi
%HOSTNAME%|Swap Usage = memory/swap --warning 60 --critical 80 --units Gi
%HOSTNAME%|Memory Usage = memory/virtual --warning 80 --critical 90 --units Gi
%HOSTNAME%|Process Count = processes --warning 300 --critical 400
So what I tried to do was add a disk entry to the ncpa.cfg file on the Nagios server where the CPU usage, Memory Usage, and Process Count are. This is what I tired to add:

Code: Select all

define service {
    host_name               Svr-Veeam
    service_description     Disk Usage
    check_command           check_ncpa!-t 'CMPublic' -P 5693 -M disk/logical/C:|/used_percent -w 80 -c 90 -u G
    max_check_attempts      5
    check_interval          5
    retry_interval          1
    check_period            24x7
    notification_interval   60
    notification_period     24x7
    contacts                nagiosadmin
    register                1
}
Then I re-started the Nagios services and logged back into the Nagios UI and it did add the disk, but it was critical. Then under Status Information it says (Return code of 127 is out of bounds - plugin may be missing) and is always stays Critical. I have also added it a few different ways in the ncpa.cfg file which was really one line that I changed:

Code: Select all

check_command check_ncpa!-t 'CMPublic' -P 5693 -M disk/logical/C:|/used_percent --warning 80 --critical 90 --units Gi
check_command check_ncpa!-t 'CMPublic' -P 5693 -M disk/logical/C:|/used_percent -w 80 -c 90 -u G
So I am not sure how to add the C:\ to be monitored by Nagios. When I login to the NCPA on the windows box it shows disks and interfaces. I would like to get both of these added if I can.

When I navigate to this path - /usr/local/nagios/libexec and run the command:

Code: Select all

./check_ncpa.py -H 172.17.20.4 -t CMPublic -M 'disk/logical/C:|/used_percent' --warning 90 --critical 95
It comes back with - OK: Used_percent was 75.70 % | 'used_percent'=75.70%;90;95;
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Trying to monitor disk with ncpa-2.1.9 on windows server

Post by scottwilkerson »

I think you need to change this line

Code: Select all

    check_command           check_ncpa!-t 'CMPublic' -P 5693 -M disk/logical/C:|/used_percent -w 80 -c 90 -u G
to this

Code: Select all

    check_command           check_ncpa!-t 'CMPublic' -P 5693 -M 'disk/logical/C:|/used_percent' -w 80 -c 90
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Trying to monitor disk with ncpa-2.1.9 on windows server

Post by scottwilkerson »

If you get the same response for the above, please post the command definition for the check_ncpa command

Also, the output of the following commands:

Code: Select all

su nagios
head -2 /usr/local/nagios/libexec/check_ncpa.py
which python
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: Trying to monitor disk with ncpa-2.1.9 on windows server

Post by Alan »

Thanks a lot changing the check_command to check_command check_ncpa!-t 'CMPublic' -P 5693 -M 'disk/logical/C:|/used_percent' -w 80 -c 90
totally fixed it. Thanks for that.

I have been trying to use the Nagios Support Knowledge-base and I was looking under Disk Space Checks for for NCPA and it has the check command. Which is cool do you now of any site that shows the ncpa.cfg file syntax for adding things? I am now wanting to add interface monitoring like I can see when I login to the NCPA UI on the windows server - https://localhost:5693/gui/stats. Do you have any idea what the check_command syntax would be for adding an interface to both the ncpa configuration file on the windows host and the Nagios ncpa.cfg file on the Nagios server?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Trying to monitor disk with ncpa-2.1.9 on windows server

Post by scottwilkerson »

Unfortunately at present there is no way to get the streaming graphs in Nagios like you see in NCPA interface.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: Trying to monitor disk with ncpa-2.1.9 on windows server

Post by Alan »

Is there anyway to monitor interfaces?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Trying to monitor disk with ncpa-2.1.9 on windows server

Post by scottwilkerson »

Alan wrote:Is there anyway to monitor interfaces?
Sure, if you login to the NCPA interface, click API, you can see the interface endpoint
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: Trying to monitor disk with ncpa-2.1.9 on windows server

Post by Alan »

Ok thanks. I was just thinking there was away to get the informtion in the Nagios sever under the View Status Detail For This Host, like I can see the CPU Usage, Disk Usage, Memory Usage, and Process Count.

I did have one other question when I login to the NCPA interface, then I look at the Nagios server after the Nagios refreshe 90 seconds it shows that host as being down. Then the host does not change it status to up until I close the NCPA interface. Then after the 90 second refresh it show up.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Trying to monitor disk with ncpa-2.1.9 on windows server

Post by scottwilkerson »

Alan wrote:I did have one other question when I login to the NCPA interface, then I look at the Nagios server after the Nagios refreshe 90 seconds it shows that host as being down. Then the host does not change it status to up until I close the NCPA interface. Then after the 90 second refresh it show up.
I've never seen this happen before, can you show the host detail page when it is showing down?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: Trying to monitor disk with ncpa-2.1.9 on windows server

Post by Alan »

It is weird it only seems to happen when I go in to the live stats. When I sit on the Dashboard it does not seem to do it.
Attachments
3 Live Status DisksNagios(View Status Detail For This Host).png
2 Live Status DisksNagios.png
1 Live Status Disks.png
Locked