Files
MCO/check.sh
2024-02-07 13:54:22 +01:00

43 lines
934 B
Bash

#! /bin/bash
#
set -u
set -o pipefail
exec 1> $(date -I)_$(hostname).report
echo -ne "\n\n########## $(hostname) ##########\n"
echo -ne "\n\n########## RH UPDATES ########## \n"
test -x /usr/bin/yum && yum --security check-update
echo -ne "\n\n########## Debian UPDATES ########## \n"
test -x /usr/bin/apt-get && /usr/bin/apt-get --just-print upgrade | grep "^Inst.*-security.*" | cut -d ' ' -f 2 | sort
echo -ne "\n\n########## CERTIFICATES ##########\n"
test -x /usr/bin/certbot && /usr/bin/certbot certificates
echo -ne "\n\n########## UPTIME ##########\n"
uptime
echo -ne "\n\n########## SERVICE STATUS ##########\n"
systemctl --failed
echo -ne "\n\n########## BACKUP LIST ##########\n"
test -x /usr/sbin/burp && /usr/sbin/burp -a l
echo -ne "\n\n########## LAST USER ##########\n"
last | head
echo -ne "\n\########## LOG Warnings ##########\n"
journalctl --priority warning --no-pager --since "1 month ago"