Page 1 of 1

Windows Machine Monitor Disk usage

Posted: Thu Oct 31, 2019 3:24 am
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.

Re: Windows Machine Monitor Disk usage

Posted: Thu Oct 31, 2019 3:08 pm
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

Re: Windows Machine Monitor Disk usage

Posted: Mon Nov 04, 2019 5:58 am
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.

Re: Windows Machine Monitor Disk usage

Posted: Mon Nov 04, 2019 4:01 pm
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

Re: Windows Machine Monitor Disk usage

Posted: Fri Nov 15, 2019 8:48 am
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

Re: Windows Machine Monitor Disk usage

Posted: Fri Nov 15, 2019 9:49 am
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