Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ##Logger script for RH/FC/CentOS
- Now2=$(date +%b\ %d)
- Now=$(date +%b\ %e)
- Hostname=$(hostname)
- Sender=log@$Hostname
- Recipient="your-own@whatever-mail.com" ## send email to here not localhost..
- Subject="Daily-Log-Fileof-SHELLBOX-$Hostname"
- last |grep "$Now" > /var/log/lastlogon.log.txt
- cat /var/log/secure |grep "Failed pass for:" |grep "$Now" >
- /var/log/faillogon.log.txt
- 1cat /var/log/secure |grep "subsystem request for sftp" -n1 |grep
- "$Now"
- > /var/log/sftp.log.txt
- cat /var/log/secure |grep "sudo:" |grep "$Now" > /var/log/sudo.log.txt
- cat /var/log/messages |grep "su(pam_unix)" |grep "$Now" > /var/log/su.log.txt
- cat /var/log/yum.log |grep "$Now2" >> /var/log/up2date.log.txt
- lastcomm --tty pts/0 pts/1 pts/2 pts/3 pts/4 pts/5 pts/6 tty1 tty2 tty3
- tty4 tty5 tty6 |grep "$Now" > /var/log/audit.log.txt
- cat /var/log/.history-timestamp |grep "$Now" > /var/log/history.log.txt
- du -sh /var/www/* > /var/log/www-size.log.txt
- #mailx -r $Sender -s $Subject -a /var/log/history.log -a
- /var/log/su.log -a /var/log/lastlogon.log -a /var/log/faillogon.log -a
- /var/log/sftp.log -a
- /var/log/sudo.log -a /var/log/up2date.log $Recipient <
- /root/send_secure_content
- ## might adjust this so it utilises simple 'mail' cmd.. -todo maybe, depends how good it works as is...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement