diff --git a/00logwatch b/00logwatch
index 628bc09..5a867ea 100755
--- a/00logwatch
+++ b/00logwatch
@@ -6,9 +6,9 @@
# This script will email a logwatch report
MAILTO="support@comprofix.com"
-MAILFROM="support@comprofix.com"
THISSERVER=$(hostname -f)
-SMTP="mail.comprofix.com"
+MAILFROM="$THISSERVER@comprofix.com"
+SMTP="comprofix-com.mail.protection.outlook.com"
#Check if removed-but-not-purged
test -x /usr/share/logwatch/scripts/logwatch.pl || exit 0
@@ -17,3 +17,5 @@ test -x /usr/share/logwatch/scripts/logwatch.pl || exit 0
/usr/sbin/logwatch > /tmp/logwatch
sendemail -o tls=no -s $SMTP -t $MAILTO -f "$THISSERVER <$MAILFROM>" -u "[$THISSERVER] Logwatch" -m "$(cat /tmp/logwatch)" -q
+
+rm /tmp/logwatch
\ No newline at end of file
diff --git a/check_updates_deb b/check_updates_deb
index 9b02875..f086a7c 100755
--- a/check_updates_deb
+++ b/check_updates_deb
@@ -16,9 +16,9 @@
#
MAILTO="support@comprofix.com"
-MAILFROM="support@comprofix.com"
THISSERVER=$(hostname -f)
-SMTP="webserver.home.comprofix.com"
+MAILFROM="$THISSERVER@comprofix.com"
+SMTP="comprofix-com.mail.protection.outlook.com"
AUTOUPDATE="no"
LOGFILE="/var/log/server_maint.log"
diff --git a/check_updates_rpm b/check_updates_rpm
deleted file mode 100755
index 37c6df1..0000000
--- a/check_updates_rpm
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/bin/bash
-# Script Name: check_updates_rpm
-# Author Name: Matt McKinnon
-# Date: 7th June 2016
-# Description: For use on rpm based distros ie CentOS, Red Hat, Fedora
-# This script will:
-# Clean up the local rpm repository of retrieved packages (yum clean)
-# Resync the package index (yum makecache)
-# If called with AUTOUPDATE set to yes then SECURITY updates will be downloaded and applied. (The package yum-plugin-security is required Install using
-# yum install yum-plugin-security)
-
-#
-# Make user configuration changes in this section
-#
-
-MAILTO="support@comprofix.com"
-AUTOUPDATE="no"
-LOGFILE="/var/log/server_maint.log"
-THISSERVER=$(hostname -f)
-
-#
-# End of user configuration section
-#
-
-DASHES="---------------------------------------------------------------------------------"
-DASHES2="================================================================================="
-
-
-# Check if the script is being run as root exit if it is not.
-
-if [ $(id -u) -ne 0 ]
-then
-echo "ur not root bro"
- exit 1
-fi
-
-startlogging() {
- echo $DASHES2 >> $LOGFILE
- echo "$0 started running at `date`" >> $LOGFILE
- echo $DASHES2 >> $LOGFILE
-}
-
-stoplogging() {
- echo "`date` [MESSAGE] $0 finished runnning" >> $LOGFILE
- echo $DASHES >> $LOGFILE
-}
-
-check_return() {
- if [ "$?" -ne "0" ]
- then
- echo "$(date) [ERROR] $1 failed to run" >> $LOGFILE
- send_error_email $1
- stoplogging
- exit 1
- fi
- echo "$(date) [SUCCESS] $1 ran without error" >> $LOGFILE
-}
-
-send_error_email() {
-echo "Hello,
-
-Whilst running the update script ($0) on $THISSERVER there was a problem.
-
-[ERROR] "$1" failed to run
-
-The server has the following network interfaces configured ${SERVERADDS[@]}.
-
-Please log in via ssh (e.g. ssh root@${IPADDR[0]}) and check the log file:
-
-vim $LOGFILE
-
-Regards." | /bin/mail -s "[$THISSERVER] There was an error whilst running $0" $MAILTO
-}
-
-# IP Address stuff
-declare -a IPADDR
-declare -a NICINTERFACE
-declare -a SERVERADDS
-index=0
-
-for i in $( ifconfig | grep 'inet addr' | awk '{print $2}'| sed 's#addr:##g' );
-do
- IPADDR[$index]=$i
- let "index += 1"
-done
-
-index=0
-
-for i in $( ifconfig | grep 'eth' | awk '{print $1}' );
-do
- SERVERADDS[$index]="$i ${IPADDR[$index]}"
- let "index += 1"
-done
-
-# End IP Address stuff
-
-
-startlogging
-
-yum clean all > /dev/null
-check_return "yum clean all"
-
-yum makecache > /dev/null
-check_return "yum makecache"
-
-if [[ "$AUTOUPDATE" == "yes" ]]
-then
- yum -y update --security > /dev/null
- check_return "yum -y update --security"
-else
- PACKAGES_TO_BE_UPGRADED=`yum list updates -q`
- check_return "yum list updates -q"
-fi
-
-if [[ -z $PACKAGES_TO_BE_UPGRADED ]]
-then
- echo "$(date) [MESSAGE] No packages need updating." >> $LOGFILE
-else
-
-echo "
-Hello,
-
-Packages requiring updates onto $THISSERVER.
-
-$PACKAGES_TO_BE_UPGRADED
-
-The server has the following network interfaces configured ${SERVERADDS[@]}.
-
-To update the server log in via ssh (e.g. ssh root@${IPADDR[0]}) and run the following command:
-
-yum upgrade
-
-See the logfile for more info: vim $LOGFILE
-
-Regards. " | /bin/mail -s "[$THISSERVER] server may need some updates applied" $MAILTO
-
- echo "`date` [MESSAGE] Packages need updating email sent to $MAILTO" >> $LOGFILE
-fi
-
-stoplogging
-exit 0
diff --git a/dbbackup b/dbbackup
index 6e8a8cb..994da35 100755
--- a/dbbackup
+++ b/dbbackup
@@ -16,10 +16,12 @@
MAILTO="support@comprofix.com"
-MAILFROM="support@comprofix.com"
-SQLSERVER="mysql.comprofix.xyz"
+THISSERVER=$(hostname -f)
+MAILFROM="$THISSERVER@comprofix.com"
SMTP="comprofix-com.mail.protection.outlook.com"
+SQLSERVER="mysql.comprofix.xyz"
+
BAKDATE=$(date +%Y%m%d)
SUBJECT="$SQLSERVER Database Backup Completed - $BAKDATE"
DBUSER='dbbackup'
diff --git a/diskalert b/diskalert
index fbde460..216c602 100755
--- a/diskalert
+++ b/diskalert
@@ -6,8 +6,8 @@
# This script will email when diskspace is high.
MAILTO="support@comprofix.com"
-MAILFROM="support@comprofix.com"
THISSERVER=$(hostname -f)
+MAILFROM="$THISSERVER@comprofix.com"
SMTP="comprofix-com.mail.protection.outlook.com"
LOGFILE="/var/log/diskalert.log"
diff --git a/mailQWatch b/mailQWatch
deleted file mode 100755
index f9cf7f3..0000000
--- a/mailQWatch
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-# Script Name: mailQWatch
-# Author: Matt McKinnon
-# Date: 7th June 2016
-# Description:
-# This script will email a report mailq on postfix is high.
-
-QUEUELIMIT=75
-SUBJECT="Mail Queue on $HOST is currently $QUEUECOUNT"
-MAILTO="support@comprofix.com"
-
-HOST=$(/bin/hostname)
-POSTQUEUE=$(which postqueue)
-QUEUELENGTH=$($POSTQUEUE -p | tail -n1 | awk '{print $5}')
-QUEUECOUNT=$(echo $QUEUELENGTH | grep "[0-9]")
-
-if [ "$QUEUECOUNT" == "" ]; then
- exit;
-elif [ "$QUEUECOUNT" -gt "$QUEUELIMIT" ]; then
- $POSTQUEUE -p | /bin/mail -s "$SUBJECT" "$MAILTO"
-fi
diff --git a/nasbackup b/nasbackup
deleted file mode 100755
index d649104..0000000
--- a/nasbackup
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-
-
-MAILTO="support@comprofix.com"
-MAILFROM="support@comprofix.com"
-THISSERVER=$(hostname -f)
-SMTP="mail.comprofix.com"
-
-
-SUBJECT="Backup Log `date +%d-%m-%Y`"
-LOGFOLDER=/var/log/nasbackup
-LOGFILE=$LOGFOLDER/backuplog-`date +%d-%m-%Y.log`
-THISSERVER=`hostname --fqdn`
-N_DAYS=7
-
-startlogging() {
- echo $DASHES2 >> $LOGFILE
- echo "$0 started running at $(date)" >> $LOGFILE
- echo $DASHES2 >> $LOGFILE
-}
-
-stoplogging() {
- echo "$(date) [MESSAGE] $0 finished runnning" >> $LOGFILE
- echo $DASHES >> $LOGFILE
-}
-
-DASHES="---------------------------------------------------------------------------------"
-DASHES2="================================================================================="
-
-startlogging
-
-mkdir -p $LOGFOLDER
-
-rsync -urtlOv --partial --delete --exclude 'kvm' /data/ /media/nas/ >> $LOGFILE
-
-FILES=$(find $LOGFOLDER -type f -mtime +$N_DAYS -name '*.log' | wc -l)
-
-if [ $FILES -eq 0 ];
-then
- echo "$(date) [MESSAGE] No Old Log Files Found" >> $LOGFILE
-else
- echo "$(date) [MESSAGE] Older than $N_DAYS days will be deleted" >> $LOGFILE
- find $LOGFOLDER/* -mtime +$N_DAYS -exec rm {} \;
-fi
-
-echo "$(date) [MESSAGE] Backup completed $LOGFILE has been emailed." >> $LOGFILE
-
-stoplogging
-
-
-sendemail -o tls=no -s $SMTP -t $MAILTO -f "$THISSERVER <$MAILFROM>" -u "$SUBJECT" -a "$LOGFILE" -m "$SUBJECT" -q
diff --git a/nasbackup.ps1 b/nasbackup.ps1
deleted file mode 100755
index c0ef192..0000000
--- a/nasbackup.ps1
+++ /dev/null
@@ -1,29 +0,0 @@
-#Map Network Drive
-New-PSDrive -Persist -Name "Z" -PSProvider "FileSystem" -Root "\\NAS\backup" -Confirm:$false
-
-# set variables
-$date = get-Date -UFormat "%d-%m-%Y"
-$SourceFolder = "D:\"
-$DestinationFolder = "Z:\DATA"
-$Logfile = "backup-$date.log"
-$EmailParams = @{
- From = "support@comprofix.com"
- To = "support@comprofix.com"
- Subject = "Backup Log $date"
- SMTPServer = "mail.comprofix.local"
- Port = "25"
-}
-
-
-# copy
-ROBOCOPY.EXE $SourceFolder $DestinationFolder /E /J /PURGE /MIR /X /FP /NS /NDL /ETA /TEE /np /LOG:$LogFile /XD "$RECYCLE.BIN" "System Volume Information" ".session"
-
-
-# build email body
-$EmailBody = (Get-Content $Logfile | % { "$_
" -replace "`t"," " -replace " "," " })
-
-#send email
-Send-MailMessage @EmailParams -Bodyashtml "