Skip to content

Instantly share code, notes, and snippets.

@tyr0chen
Last active August 29, 2015 14:15
Show Gist options
  • Save tyr0chen/ce417ab6a3b68e7dedba to your computer and use it in GitHub Desktop.
Save tyr0chen/ce417ab6a3b68e7dedba to your computer and use it in GitHub Desktop.
analyse pam failure
#!/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