Page 1 of 1

How to create check for disk space below 10gb

Posted: Tue Sep 10, 2019 9:29 am
by sho7x
Hi, I am trying to create a Nagios check to send an alert for servers with <10gb disk space. ive found articles for disk space checks for Nagios xi but couldn't find anything for core. any help would be much appreciated. thanks

Re: How to create check for disk space below 10gb

Posted: Tue Sep 10, 2019 9:32 am
by scottwilkerson
It depends on the type of server and agent.

Here are some guides
https://assets.nagios.com/downloads/nag ... start.html

Re: How to create check for disk space below 10gb

Posted: Tue Sep 10, 2019 9:49 am
by sho7x
thank you for your prompt response. will be monitoring windows servers and using nsclient++

Re: How to create check for disk space below 10gb

Posted: Tue Sep 10, 2019 9:56 am
by scottwilkerson
sho7x wrote:thank you for your prompt response. will be monitoring windows servers and using nsclient++
https://docs.nsclient.org/reference/windows/CheckDisk/

Re: How to create check for disk space below 10gb

Posted: Tue Sep 10, 2019 9:57 am
by scottwilkerson

Re: How to create check for disk space below 10gb

Posted: Tue Sep 10, 2019 10:25 am
by sho7x
thanks for the link. Do you know how I could tweak the command to alert when there is <10gb instead of a percentage of space available.

./check_nrpe -H 10.25.11.3 -c check_drivesize -a drive=C: 'warning=free<20%' 'critical=free<10%' show-all 'perf-config=*(unit:G)' detail-syntax='{${drive_or_name} ${free_pct}% free / ${size} total}' top-syntax='${status}: ${problem_list}'


Also, what is the ip for that is provided in the command?

Re: How to create check for disk space below 10gb

Posted: Tue Sep 10, 2019 10:29 am
by scottwilkerson
sho7x wrote:thanks for the link. Do you know how I could tweak the command to alert when there is <10gb instead of a percentage of space available.

Code: Select all

./check_nrpe -H 10.25.11.3 -c check_drivesize -a drive=C: 'warning=free<10g' 'critical=free<10g' show-all 'perf-config=*(unit:G)' detail-syntax='{${drive_or_name} ${free_pct}% free / ${size} total}' top-syntax='${status}: ${problem_list}'
sho7x wrote: Also, what is the ip for that is provided in the command?
The IP is the IP of your windows host

Re: How to create check for disk space below 10gb

Posted: Tue Sep 10, 2019 12:26 pm
by sho7x
Thank you so much for your help man. What if I want to select a host group in ql for the check to run against and not just a specific ip because im I want to run it against all windows hosts in my env. Do I just take out the -h along with the ip?

Re: How to create check for disk space below 10gb

Posted: Tue Sep 10, 2019 12:33 pm
by scottwilkerson
You can create the command like this

Code: Select all

$USER1$/check_nrpe -H $HOSTADDRESS$ -c check_drivesize -a drive=C: 'warning=free<10g' 'critical=free<10g' show-all 'perf-config=*(unit:G)' detail-syntax='{${drive_or_name} ${free_pct}% free / ${size} total}' top-syntax='${status}: ${problem_list}'
$HOSTADDRESS$ will be replaced with the address field of each of the hosts in the host group when Nagios runs the command