2019-09-30 20:22:34 +02:00
|
|
|
#!/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
|
2021-04-10 08:00:46 +02:00
|
|
|
if [ -f /etc/zorval/env_check_disk ] ; then
|
|
|
|
source /etc/zorval/env_check_disk
|
2019-09-30 20:22:34 +02:00
|
|
|
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 \
|
2020-10-27 00:58:07 +01:00
|
|
|
--iwarning=$CHECK_DISK_INODE_WARN \
|
2019-09-30 20:22:34 +02:00
|
|
|
--icritical=$CHECK_DISK_INODE_CRIT \
|
|
|
|
$CHECK_DISK_EXCLUDE_TYPE
|