Skip to content

Commit a05e2a0

Browse files
Update audit_linux_system.sh
Tune for other prod
1 parent 73cadfe commit a05e2a0

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

audit_linux_system.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@
1414
##
1515
#
1616
# Script installation:
17-
#
1817
# echo "cd /etc/bacula/scripts && git clone https://github.com/MykolaPerehinets/auditlinuxsystem.git"
1918
#
20-
# Script function: Audit Linux systems/services for correct backup process
19+
# Script function:
20+
# Audit and Inventory All Configurations files/Services on Linux servers/hosts (for Bacula Bare-Metal Recovery)
2121
#
22-
# Script requirements:
23-
# yum install bacula-client vim parted pciutils yum-plugin-security yum-plugin-verify yum-plugin-changelog lsusb lshw usbutils lsscsi pigz mlocate time glances tuned redhat-lsb-core etckeeper firewalld mailx policycoreutils-python policycoreutils-newrole policycoreutils-restorecond setools-console lsof iotop htop tree mutt psacct
22+
# Script requirements 1:
23+
# yum update && yum install bacula-client vim parted pciutils yum-plugin-security yum-plugin-verify yum-plugin-changelog lsusb lshw usbutils lsscsi pigz mlocate time glances tuned redhat-lsb-core etckeeper firewalld mailx policycoreutils-python policycoreutils-newrole policycoreutils-restorecond setools-console lsof iotop htop tree mutt psacct
2424
#
25-
# Addditional requirements: for initial etckeeper run next command from root
25+
# Script requirements 2: for initial setup the etckeeper, please run next command from root user
2626
# cd /etc
2727
# sudo etckeeper init
2828
# sudo etckeeper commit "Initial import"
2929
# git config --global user.name "root"
30-
# git config --global user.email root@"HOSTNAME"."DOMAIN"
30+
# git config --global user.email root@localhost.localdomain
3131
#
32-
# Addditional requirements: for initial bacula scripts run next command from root
32+
# Addditional requirements: for initial setup the bacula scripts, please run next command from root user
3333
# cd /etc/bacula/scripts
3434
# setenforce 0
3535
# tail -fn 0 /var/log/audit/audit.log | grep bacula > /etc/bacula/bacula-audit.log
36-
# * (run a backup job that has a pre-script)
36+
# * (run a simple backup job that has a pre-script)
3737
# chcon system_u:object_r:bacula_exec_t:s0 /etc/bacula/scripts
3838
# semanage fcontext -a -t bacula_exec_t "/etc/bacula/scripts(/.*)?"
3939
# restorecon -R -v /etc/bacula/scripts
@@ -66,22 +66,23 @@
6666
# DONE
6767
# setenforce 1
6868
#
69-
# Script Submitted and Deployment in production environments by:
69+
#
70+
# Script Submitted and Deployment in Production environments by:
7071
# Mykola Perehinets (mperehin)
7172
# Tel: +380 67 772 6910
7273
7374
#
7475
#######################################################################################################################
7576
# Script modified date
76-
Version=04072017
77+
Version=06012022
7778
#
7879
#######################################################################################################################
7980
# Exit code
8081
ERR=0
8182
# Basic script configuration, etc...
8283
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
8384
#
84-
#ADMIN="root@"HOSTNAME"."DOMAIN""
85+
#ADMIN="root@localhost.localdomain"
8586
8687
#
8788
#HOSTNAME=`hostname -s`
@@ -381,12 +382,12 @@ echo "##########################################################################
381382
#
382383
# Create and verify other parameters
383384
/bin/chmod 0644 $auditlogdir/server_inventory_$HOSTNAME.log
384-
echo "Create backup inventory data and store in $auditlogdir/server_inventory_$HOSTNAME.log"
385-
echo "This data file is needed for Disaster Recovery Plan using in Corporate Backup System Bacula!"
385+
echo "Create new backup inventory data and store in $auditlogdir/server_inventory_$HOSTNAME.log"
386+
echo "This audit/data file is needed for Disaster Recovery Plan using in Corporate Backup System Bacula!"
386387
#echo "OK... Audit your system has been DONE... Thank you..."
387388
#
388-
# Sending copy of data to admins MailGroup
389-
msg="This is copy of inventory data on HOST: $HOSTNAME, verify at $DATE_START. This file is needed for recovery procedures... -->"
389+
# Sending copy of data to DevOps MailGroup
390+
msg="This is copy of inventory data from HOST: $HOSTNAME, verify at $DATE_START. This audit/data file is needed for bare metal recovery procedures... -->"
390391
#echo $msg
391392
#sed -e 's/$/\r/' $auditlogdir/server_inventory_$HOSTNAME.log | pigz --best --independent > $auditlogdir/server_inventory_$HOSTNAME.log.win.txt.gz
392393
sed -e 's/$/\r/' $auditlogdir/server_inventory_$HOSTNAME.log > $auditlogdir/server_inventory_$HOSTNAME.log.win.txt
@@ -399,7 +400,7 @@ cd /
399400
#echo "$msg" | mail -s "WARNING: inventory of HOST: $HOSTNAME -->" -a $auditlogdir/server_inventory_$HOSTNAME.log.win.txt $ADMIN
400401
#echo -n $msg $msg_body | mail -s "WARNING: inventory of HOST: $HOSTNAME -->" $ADMIN
401402
echo -n $msg | mutt -s "WARNING: inventory of HOST: $HOSTNAME -->" -a $auditlogdir/server_inventory_$HOSTNAME.log.win.txt $ADMIN
402-
echo "Sending copy this data file to admins - MailGroup: $ADMIN "
403+
echo "Sending copy of this audit/data file to DevOps - MailGroup: $ADMIN "
403404
echo "OK... Very well... Please Start-up next Corporate Bacula Backup System procedures..."
404405
#
405406
# Exit code script status

0 commit comments

Comments
 (0)