summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMy Name2014-12-11 00:47:01 +0100
committerMy Name2014-12-11 00:47:01 +0100
commitdd9a6048bb109494072d94281701ad9734d2b275 (patch)
tree116e23217a56169d55c1fae19ddc65b47fac6737
parent510493a04ccf84b301a271b56687ecf729b2c61a (diff)
downloaddotfiles-dd9a6048bb109494072d94281701ad9734d2b275.tar.gz
Added ZNC init + monit script, rtorrent + zabbix-server monit config and fixed typos
-rwxr-xr-xinitrc/rtorrent (renamed from rtorrent/init.sh)0
-rwxr-xr-xinitrc/znc37
-rw-r--r--monit/memcached.conf2
-rw-r--r--monit/nginx-vhost.conf2
-rw-r--r--monit/rtorrent.conf10
-rw-r--r--monit/zabbix-server.conf7
-rw-r--r--monit/znc.conf5
7 files changed, 61 insertions, 2 deletions
diff --git a/rtorrent/init.sh b/initrc/rtorrent
index 7f36a74..7f36a74 100755
--- a/rtorrent/init.sh
+++ b/initrc/rtorrent
diff --git a/initrc/znc b/initrc/znc
new file mode 100755
index 0000000..7f7bcb0
--- /dev/null
+++ b/initrc/znc
@@ -0,0 +1,37 @@
+#!/bin/bash
+set -e
+
+USER="horus"
+DATADIR="/home/${USER}/.znc"
+NAME=znc
+DESC="ZNC, the IRC Bouncer"
+
+DAEMON="/usr/bin/znc"
+DAEMON_OPTS="--foreground --datadir=$DATADIR"
+
+PIDFILE="/var/run/${NAME}.pid"
+
+START_OPTS="--start --background --make-pidfile --pidfile ${PIDFILE} --chuid $USER"
+END_OPTS="--stop --pidfile ${PIDFILE}"
+
+case "$1" in
+ start)
+ echo "Starting ${DESC}"
+ start-stop-daemon $START_OPTS --exec ${DAEMON} -- $DAEMON_OPTS
+ ;;
+ stop)
+ echo "Stopping ${DESC}"
+ start-stop-daemon $END_OPTS
+ rm -f "${PIDFILE}"
+ ;;
+ restart)
+ "$0" stop
+ rm -f "${PIDFILE}"
+ sleep 1
+ "$0" start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
+esac
diff --git a/monit/memcached.conf b/monit/memcached.conf
index 49f8875..947b632 100644
--- a/monit/memcached.conf
+++ b/monit/memcached.conf
@@ -1,4 +1,4 @@
-check process with pidfile /var/run/memcached.pid
+check process memcached with pidfile /var/run/memcached.pid
start program = "/etc/init.d/memcached start"
stop program = "/etc/init.d/memcached stop"
if failed host localhost port 11211 protocol MEMCACHE then restart
diff --git a/monit/nginx-vhost.conf b/monit/nginx-vhost.conf
index 1a33323..a34ea1a 100644
--- a/monit/nginx-vhost.conf
+++ b/monit/nginx-vhost.conf
@@ -1,6 +1,6 @@
server {
listen 443 ssl;
- server_name monit.example.org
+ server_name monit.example.org;
ssl_certificate /etc/nginx/ssl/example.crt;
ssl_certificate_key /etc/nginx/ssl/example.key;
diff --git a/monit/rtorrent.conf b/monit/rtorrent.conf
new file mode 100644
index 0000000..052498c
--- /dev/null
+++ b/monit/rtorrent.conf
@@ -0,0 +1,10 @@
+check process rtorrent with pidfile "/var/run/rtorrent.pid"
+ start program = "/etc/init.d/rtorrent start"
+ stop program = "/etc/init.d/rtorrent stop"
+ if 2 restarts within 3 cycles then timeout
+ if totalmem > 100 Mb then alert
+ if children > 255 for 5 cycles then stop
+ if cpu usage > 95% for 3 cycles then restart
+ if failed host 127.0.0.1 port 5000 then restart
+ if 3 restarts within 3 cycles then alert
+ if 5 restarts within 5 cycles then timeout
diff --git a/monit/zabbix-server.conf b/monit/zabbix-server.conf
new file mode 100644
index 0000000..7f75704
--- /dev/null
+++ b/monit/zabbix-server.conf
@@ -0,0 +1,7 @@
+check process zabbix_server with pidfile /var/run/zabbix/zabbix_server.pid
+ start program = "/etc/init.d/zabbix-server start"
+ stop program = "/etc/init.d/zabbix-server stop"
+ if failed port 10051 type tcp for 3 times within 5 cycles then alert
+ if failed port 10051 type tcp for 5 times within 10 cycles then restart
+ if 3 restarts within 3 cycles then alert
+ if 5 restarts within 5 cycles then timeout
diff --git a/monit/znc.conf b/monit/znc.conf
new file mode 100644
index 0000000..b4c4d4d
--- /dev/null
+++ b/monit/znc.conf
@@ -0,0 +1,5 @@
+check process ZNC with pidfile /var/run/znc.pid
+ start program = "/etc/init.d/znc start"
+ stop program = "/etc/init.d/znc stop"
+ if failed host localhost port 9999 then restart
+ if 5 restarts within 5 cycles then timeout