First page Back Continue Last page Overview Graphics
Other I/O
"read" builtin to prompt user for variable (or to read one line from an input file)
- Use with caution due to security implications
"logger" to send syslog messages
Send things to /bin/mail to output things to email
- Simple log analysis script example:
TODAY=`date "+%b %d"`
COUNT = $(
grep $TODAY /var/log/messages |
grep “authentication failure” |
wc -l
)
if [ $COUNT -gt 4 ]
then
echo -e “There have been $COUNT authentication failures today. \nPlease investigate.” |
/bin/mail -s “Security Alert from `hostname`” jeremy@
- Note, requires properly configured mail susbystem
Notes: