Skip to content

Instantly share code, notes, and snippets.

@kenshinx
kenshinx / chk_haproxy.sh
Last active January 3, 2016 08:09
Keepalived + Haproxy VIP: 123.125.22.90 Master: 123.125.22.97 Backup: 123.125.22.98 Server1: 123.125.22.99 Server2: 123.125.22.100
# author: weizhifeng
status=$(ps aux|grep haproxy | grep -v grep | grep -v bash | wc -l)
if [ "${status}" = "0" ]; then
/etc/init.d/haproxy start
status2=$(ps aux|grep haproxy | grep -v grep | grep -v bash |wc -l)
if [ "${status2}" = "0" ]; then
/etc/init.d/keepalived stop
@kenshinx
kenshinx / rsyslog.conf
Created December 15, 2014 10:11
rsyslog configure sample
# rsyslog configuration file
# note that most of this config file uses old-style format,
# because it is well-known AND quite suitable for simple cases
# like we have with the default config. For more advanced
# things, RainerScript configuration is suggested.
# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html
#### MODULES ####