Last active
August 29, 2015 14:15
-
-
Save tyr0chen/ce417ab6a3b68e7dedba to your computer and use it in GitHub Desktop.
analyse pam failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#description:log failure information | |
#2014-11-? | |
#2014-11-21 change:just send today log,not the whole log | |
cat /var/log/auth.log | grep failure >> /home/log/pam.failure | |
cat /var/log/auth.log | grep failure > /tmp/log/pam.failure | |
test=`cat /tmp/log/pam.failure` | |
if [ -n "$test" ];then | |
mutt -s "ECS-pam failure" [email protected] < /tmp/log/pam.failure | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment