Adjust headers and add LOM check

This commit is contained in:
Joshua Boniface 2023-09-01 15:42:27 -04:00
parent 48fb21af75
commit b9ae4d1009
6 changed files with 59 additions and 14 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Backup check for Check_MK # Backup check for Check_MK
# Installed by BLSE 2.0 ansible # Installed by PVC ansible
SHARELIST=( $( cat /var/backups/shares ) ) SHARELIST=( $( cat /var/backups/shares ) )

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Apt and dpkg status check for Check_MK # Apt and dpkg status check for Check_MK
# Installed by BLSE 2.0 ansible # Installed by PVC ansible
TMP_DPKG="$( COLUMNS=200 dpkg --list )" TMP_DPKG="$( COLUMNS=200 dpkg --list )"
TMP_AWK="$( awk ' TMP_AWK="$( awk '

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Entropy availability check for Check_MK # Entropy availability check for Check_MK
# Installed by BLSE 2.0 ansible # Installed by PVC ansible
if [ -e /proc/sys/kernel/random/entropy_avail ]; then if [ -e /proc/sys/kernel/random/entropy_avail ]; then

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Open file handle freshness check for Check_MK # Open file handle freshness check for Check_MK
# Installed by BLSE 2.0 ansible # Installed by PVC ansible
OK=0 OK=0
WARNING=1 WARNING=1

View File

@ -0,0 +1,47 @@
#!/bin/bash
# Lights-out management reachability check for Check_MK
# Installed by PVC ansible
# We need a defined IPMI interface to continue
if [[ ! -f /etc/network/interfaces.d/ipmi ]]; then
exit
fi
# We need ipmitool and fping to continue
if ! which ipmitool >/dev/null 2>&1 || ! which fping >/dev/null 2>&1 ; then
exit
fi
echo "<<<ipmi>>>"
# Grab IPMI IP from interfaces file
IPMIIP_INTERFACES=$(grep 'ipmitool' /etc/network/interfaces.d/ipmi | grep -v 'defgw' | grep 'ipaddr' | awk '{ print $NF }')
if [[ -z ${IPMIIP_INTERFACES} ]]; then
echo "No IPMI IP defined in interfaces file"
exit
fi
# Grab IPMI IP from ipmitool
IPMIIP_IPMITOOL="$( ipmitool lan print 2>/dev/null | grep 'IP Address' | grep -v 'Source' | awk '{ print $NF }' )"
if [[ -z ${IPMIIP_IPMITOOL} ]]; then
echo "No IPMI IP returned by ipmitool"
exit
fi
if [[ ${IPMIIP_INTERFACES} != ${IPMIIP_IPMITOOL} ]]; then
echo "IPMI IP defined in interfaces file (${IPMIIP_INTERFACES}) is different from ipmitool (${IPMIIP_IPMITOOL})"
exit
fi
# Try pinging the IPMI IP; this should work and be quick
fping -q -t 200 ${IPMIIP_INTERFACES}
RESULT=$?
if [[ ${RESULT} -eq 0 ]]; then
echo "IPMI IP (${IPMIIP_INTERFACES}) is correct and reachable"
exit
else
echo "IPMI IP (${IPMIIP_INTERFACES}) is unreachable"
exit
fi

View File

@ -1,17 +1,17 @@
#!/bin/bash #!/bin/bash
# File ownership check for Check_MK # File ownership check for Check_MK
# Installed by BLSE 2.0 ansible # Installed by PVC ansible
UID_MAX=299 UID_MAX=199
# http://www.debian.org/doc/debian-policy/ch-opersys.html # http://www.debian.org/doc/debian-policy/ch-opersys.html
# 0-99: Globally allocated by the Debian project # 0-99: Globally allocated by the Debian project
# 100-199: (BLSE) Dynamically allocated system users and groups # 100-199: (PVC) Dynamically allocated system users and groups
# 200-299: (BLSE) BLSE users and groups # 200-299: (PVC) provisioning users
# 300-499: (BLSE) reserved # 300-499: (PVC) reserved
# 500-599: (BLSE) system administrators # 500-599: (PVC) system administrators
# 600-999: (BLSE) reserved # 600-999: (PVC) reserved
# 64045: (BLSE) ceph # 64045: (PVC) ceph
function is_element_of { function is_element_of {
local TO_FIND=$1 local TO_FIND=$1
@ -47,11 +47,9 @@ for FILESYSTEM in ${FILESYSTEMs[@]}; do
-not \( -type d -a \( -path /media -o -path /mnt \) \) \ -not \( -type d -a \( -path /media -o -path /mnt \) \) \
-not \( -name '.*.swp' -a -mtime -3 \) \ -not \( -name '.*.swp' -a -mtime -3 \) \
-not \( -path '*/.git' -o -path '*/.git/*' \) \ -not \( -path '*/.git' -o -path '*/.git/*' \) \
-not \( -path '*.dirtrack.Storable' \) \
-not \( -path '/home/*' \) \ -not \( -path '/home/*' \) \
-not \( -path '/tmp/*' \) \ -not \( -path '/tmp/*' \) \
-not \( -path '/var/home/*' \) \ -not \( -path '/var/home/*' \) \
-not \( -path '/var/log/gitlab/*' \) \
-print0 2>/dev/null ) -print0 2>/dev/null )
done done