# BSD 3-Clause License # # Copyright (c) 2019, Alban Vidal # All rights reserved. # # Please see license file on root of this directory ################################################################################ # !! GIT FILE !! # https://framagit.org/zorval/scripts/check-nrpe ################################################################################ # ConnTrack files FILE_CONNTRACK_MAX="/proc/sys/net/netfilter/nf_conntrack_max" FILE_CONNTRACK_COUNT="/proc/sys/net/netfilter/nf_conntrack_count" if [[ ! -f "$FILE_CONNTRACK_MAX" || ! -f "$FILE_CONNTRACK_COUNT" ]] ; then echo "Error, one of this files does not exists :" echo " - $FILE_CONNTRACK_MAX" echo " - $FILE_CONNTRACK_COUNT" exit2 fi ################################################################################ # Little script which check systemd status RETURN_CODE=0 # Check systemd status STATUS=$(systemctl --failed --no-pager --no-legend) # Test if return is OK if [ -z "$STATUS" ]; then echo "OK" else echo "Systemd error" echo "$STATUS" RETURN_CODE=2 fi exit "$RETURN_CODE"