How to create check for disk space below 10gb

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
sho7x
Posts: 6
Joined: Wed Mar 20, 2019 10:57 am

How to create check for disk space below 10gb

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

It depends on the type of server and agent.

Here are some guides
https://assets.nagios.com/downloads/nag ... start.html
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
sho7x
Posts: 6
Joined: Wed Mar 20, 2019 10:57 am

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

Post by sho7x »

thank you for your prompt response. will be monitoring windows servers and using nsclient++
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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/
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: How to create check for disk space below 10gb

Post by scottwilkerson »

Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
sho7x
Posts: 6
Joined: Wed Mar 20, 2019 10:57 am

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

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
sho7x
Posts: 6
Joined: Wed Mar 20, 2019 10:57 am

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

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked