sysklog配置脚本!

今天研究了一下sysklog服务,做了两个小脚本。望哪位高手指点下。

syslog-client.sh

#!/bin/bash
# syslog client script!
mv /etc/syslog.conf /etc/syslog.conf.backup
touch /etc/syslog.conf
echo "Please enter syslog Server's ipaddress or hostname!!"
read logserver
echo "*.info;mail.none;authpriv.none;cron.none @$logserver" >>/etc/syslog.conf
echo "messages log is configure okey!!"
echo "authpriv.* @$logserver" >>/etc/syslog.conf
echo "secure log is configure okey!!"
echo "mail.* @$logserver" >>/etc/syslog.conf
echo "maillog log is configure okey!!"
unset logserver
/etc/rc.d/init.d/syslog restart
 

 

syslog-server.sh

#!/bin/bash
# syslog server's script!!
mv /etc/sysconfig/syslog /etc/sysconfig/syslog.back
touch /etc/sysconfig/syslog
echo 'SYSLOGD_OPTIONS="-r -m 0"' >>/etc/sysconfig/syslog
echo 'KLOGD_OPTIONS="-x"' >>/etc/sysconfig/syslog
echo 'SYSLOG_UMASK=077' >>/etc/sysconfig/syslog
echo "Please enter your messages logfile's storage path and filename!!"
read messages
tail -n 0 -f /var/log/messages >>$messages &
echo "Please enter your secure logfile's storage path and filename!!"
read secure
tail -n 0 -f /var/log/secure >>$secure &
echo "Please enter your mail logfile's storage path and filename!!"
read mail
tail -n 0 -f /var/log/maillog >>$mail &
unset messages
unset secure
unset mail
echo "syslog server is configure okey!!"

 

你可能感兴趣的:(职场,syslog,休闲,sysklog)