Add check: check_disk

This commit is contained in:
Alban VIDAL 2019-09-30 20:22:34 +02:00
parent c5a613f6bf
commit 00defc4231
2 changed files with 40 additions and 0 deletions

View File

@ -16,6 +16,7 @@
command[check_available_conntrack] = /usr/local/bin/check_available_conntrack command[check_available_conntrack] = /usr/local/bin/check_available_conntrack
command[check_cpu] = /usr/local/bin/check_cpu command[check_cpu] = /usr/local/bin/check_cpu
command[check_disk] = /usr/local/bin/check_disk
command[check_memory] = /usr/local/bin/check_memory command[check_memory] = /usr/local/bin/check_memory
command[check_systemd] = /usr/local/bin/check_systemd command[check_systemd] = /usr/local/bin/check_systemd

39
conf/usr/local/bin/check_disk Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
################################################################################
# BSD 3-Clause License
#
# Copyright (c) 2019, Alban Vidal <alban.vidal@zordhak.fr>
# All rights reserved.
#
# Please see license file on root of this directory
################################################################################
# !! GIT FILE !!
# https://framagit.org/zorval/scripts/check-nrpe
################################################################################
# If environnement file exist, we load it
if [ -f /etc/env_check_nrpe ] ; then
source /etc/env_check_nrpe
fi
################################################################################
# Chargement des éventuels surcharges des seuils
# Volumétrie restante :
CHECK_DISK_WARN=${CHECK_DISK_WARN:=20%}
CHECK_DISK_CRIT=${CHECK_DISK_CRIT:=10%}
# inodes restants :
CHECK_DISK_INODE_WARN=${CHECK_DISK_INODE_WARN:=20%}
CHECK_DISK_INODE_CRIT=${CHECK_DISK_INODE_CRIT:=10%}
# Types de FS exclus
CHECK_DISK_EXCLUDE_TYPE=${CHECK_DISK_EXCLUDE_TYPE:="--exclude-type=tmpfs --exclude-type=devtmpfs --exclude-type=tracefs"}
/usr/lib/nagios/plugins/check_disk \
--warning=$CHECK_DISK_WARN \
--critical=$CHECK_DISK_CRIT \
--iwarning=$CHECK_DISK_INODE_CRIT \
--icritical=$CHECK_DISK_INODE_CRIT \
$CHECK_DISK_EXCLUDE_TYPE