Compare commits

..

No commits in common. "c0ad1c5d166fad50ff38bf88fda65cb7bfd1fe2c" and "b3dbfd12cb661bd5c9aa5127a596377b69e96584" have entirely different histories.

2 changed files with 17 additions and 28 deletions

View File

@ -21,6 +21,7 @@ command[check_load] = /usr/local/bin/check_load
command[check_memory] = /usr/local/bin/check_memory
command[check_systemd] = /usr/local/bin/check_systemd
command[check_service] = /usr/local/bin/check_service
command[check_log] = /usr/local/bin/check_log
command[check_chrony] = /usr/local/bin/check_chrony
# with sudo
@ -29,4 +30,3 @@ command[check_reboot] = sudo /usr/sbin/needrestart -p -k
command[check_restart] = sudo /usr/sbin/needrestart -p -l
command[check_git] = sudo /usr/local/sbin/check_git
command[check_conf] = sudo /usr/local/sbin/check_conf
command[check_log] = sudo /usr/local/sbin/check_log

View File

@ -47,12 +47,8 @@ if [ "$PRINT_MODE" = true ]; then
fi
fi
# Répertoire des logs perso
# Répertoire des logs
REP_LOG="/var/log/check_log"
# Répertoire ulogd
REP_ULOGD="/var/log/ulog"
# Fichier iptables ou nftables
[ -f '/var/log/iptables.log' ] && FIC_TABLES_LOG='/var/log/iptables.log'
[ -f '/var/log/nftables.log' ] && FIC_TABLES_LOG='/var/log/nftables.log'
@ -65,7 +61,7 @@ LOG_ERR="ERROR"
################################################################################
# Si le répertoire des logs perso n'existe pas, on met un petit WARNING
# Si le répertoire n'existe pas, on met un petit WARNING
if [ ! -d "$REP_LOG" ] ; then
echo "[WARNING] Le répertoire $REP_LOG n'existe pas"
exit 1 # Sortie en Warning
@ -73,11 +69,8 @@ fi
################################################################################
# Fonction permettant de trouver les .log non vides d'un répertoire
function find_log() {
FIND_DIR=$1
# Cherche tous les fichiers .log présents dans le répertoire
LISTE_LOG=$(find $FIND_DIR ! -empty -type f -name '*.log')
LISTE_LOG=$(find $REP_LOG ! -empty -type f -name '*.log')
if [ "$LISTE_LOG" ] ; then
# Pour chaque fichier présent
@ -91,10 +84,6 @@ function find_log() {
else
$DEBUG && echo -e "DEBUG\t\t\t$LISTE_LOG est vide\t"
fi
}
find_log $REP_LOG
find_log $REP_ULOGD
################################################################################