Windows Machine Monitor Disk usage

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.
Locked
Hoygen83
Posts: 16
Joined: Mon Oct 28, 2019 10:30 am

Windows Machine Monitor Disk usage

Post by Hoygen83 »

Hello,
I have nagios core 4.4.5 and ncpa 2.2.0
I followed this guide:
https://assets.nagios.com/downloads/nag ... ndows.html and installed n
then followed this guide https://assets.nagios.com/downloads/nag ... erview.pdf
added a cfg in the windows machine under C:\Program Files (x86)\Nagios\NCPA\etc\ncpa.cfg.d\ with the following lines.

[passive checks]
%HOSTNAME%|__HOST__ = system/agent_version
%HOSTNAME%|CPU Usage = cpu/percent --warning 60 --critical 80 --aggregate avg
%HOSTNAME%|Memory Usage = memory/virtual --warning 80 --critical 90 --units Gi
%HOSTNAME%|Process Count = processes --warning 300 --critical 400
%HOSTNAME%|Disk Usage = disk/logical/C:|/used_percent --warning 80 --critical 90 --units Gi

I found the check for disk usage in the example.cfg provided with ncpa2.2.0 in the windows machine.

Now I have a question:
In the guides there is no explanation on how I should define the "Disk Usage" service check in nagios core.
If I give journalctl -xe in nagios core I don't see any particular anomalies.
I can see the Cpu Usage, Memory Usage, Process Count, __HOST__ checks but I can't see the Disk Usage.

The configuration file in nagios core for the windows machine is this one:
define host {
host_name SERVER_NAME
address IP_ADDRESS
check_command check_ncpa!-t 'TOKEN' -P 5693 -M system/agent_version
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
contacts nagiosadmin
notification_interval 60
notification_period 24x7
notifications_enabled 1
icon_image ncpa.png
statusmap_image ncpa.png
register 1
}

define service {
host_name SERVER_NAME
service_description CPU Usage
check_command check_ncpa!-t 'TOKEN' -P 5693 -M cpu/percent -w 20 -c 40 -q 'aggregate=avg'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}

define service {
host_name SERVER_NAME
service_description Memory Usage
check_command check_ncpa!-t 'TOKEN' -P 5693 -M memory/virtual -w 50 -c 80 -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
}

define service {
host_name SERVER_NAME
service_description Process Count
check_command check_ncpa!-t 'TOKEN' -P 5693 -M processes -w 150 -c 200
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}

I tried adding this to the machine cfg file inside nagios core server:

define service {
host_name SERVER_NAME
service_description Disk Usage
check_command check_ncpa!-t 'TOKEN' -P 5693 -M disk -w 80 -c 90 -u Gi
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}

the result is an error.
https://ibb.co/1MspL7n
UNKNOWN: Unable to run check on node without check method. Requested 'disk' node.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Windows Machine Monitor Disk usage

Post by mbellerue »

The service check you defined for the Disk Check is an active check, which will work, too. Active checks tend to put more work on the Nagios server, where passive checks put more load on the monitored server. Here's a quick doc on submitting passive checks in Nagios Core.
https://assets.nagios.com/downloads/nag ... hecks.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Hoygen83
Posts: 16
Joined: Mon Oct 28, 2019 10:30 am

Re: Windows Machine Monitor Disk usage

Post by Hoygen83 »

thank you for your time and answer.
I don't understand why the active check is giving me that error I mentioned before.
I will try alsto your passive check suggestion.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Windows Machine Monitor Disk usage

Post by mbellerue »

Oh, I see what's going on. I think the disk check just needs extra parameters, since there are a number of ways you can check on the disks. Try this for your check command.

Code: Select all

check_command check_ncpa!-t 'TOKEN' -P 5693 -M 'disk/logical/C:|' -w 80 -c 90 -u Gi
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Hoygen83
Posts: 16
Joined: Mon Oct 28, 2019 10:30 am

Re: Windows Machine Monitor Disk usage

Post by Hoygen83 »

mbellerue wrote:Oh, I see what's going on. I think the disk check just needs extra parameters, since there are a number of ways you can check on the disks. Try this for your check command.

Code: Select all

check_command check_ncpa!-t 'TOKEN' -P 5693 -M 'disk/logical/C:|' -w 80 -c 90 -u Gi
LIFESAVER
Thank you sir
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Windows Machine Monitor Disk usage

Post by scottwilkerson »

Hoygen83 wrote:
mbellerue wrote:Oh, I see what's going on. I think the disk check just needs extra parameters, since there are a number of ways you can check on the disks. Try this for your check command.

Code: Select all

check_command check_ncpa!-t 'TOKEN' -P 5693 -M 'disk/logical/C:|' -w 80 -c 90 -u Gi
LIFESAVER
Thank you sir
Glad we could help!

Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked