-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from blackcobra1973/develop
Develop
- Loading branch information
Showing
25 changed files
with
10,972 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
*~ | ||
\#* | ||
build/ | ||
dist/ | ||
src/vpoller.egg-info/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# conf.d file for vpoller-proxy | ||
|
||
## Standalone proxy | ||
#USER=vpoller | ||
#GROUP=vpoller | ||
### Proxy on zabbix server | ||
USER=zabbix | ||
GROUP=zabbix | ||
|
||
#### | ||
DESC="vpoller-proxy daemon" | ||
DAEMON=/usr/bin/vpoller-proxy | ||
MGMT_INTERFACE="tcp://localhost:9999" | ||
CONF_DIR=/etc/vpoller | ||
CONF_FILE=${CONF_DIR}/vpoller.conf | ||
PID_DIR=/var/run/vpoller | ||
LOG_DIR=/var/log/vpoller | ||
PID_FILE=${PID_DIR}/vpoller-proxy.pid | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# conf.d file for vpoller-worker | ||
|
||
### Select which user to use | ||
## Standalone proxy | ||
#USER=vpoller | ||
#GROUP=vpoller | ||
### Proxy on zabbix server | ||
USER=zabbix | ||
GROUP=zabbix | ||
|
||
#### | ||
DESC="vpoller-worker daemon" | ||
DAEMON=/usr/bin/vpoller-worker | ||
MGMT_INTERFACE="tcp://localhost:10000" | ||
CONF_DIR=/etc/vpoller | ||
CONF_FILE=${CONF_DIR}/vpoller.conf | ||
PID_DIR=/var/run/vpoller | ||
LOG_DIR=/var/log/vpoller | ||
PID_FILE=${PID_DIR}/vpoller-worker.pid | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#!/bin/sh | ||
### BEGIN INIT INFO | ||
# Provides: vpoller-proxy | ||
# Required-Start: $remote_fs $network | ||
# Required-Stop: $remote_fs | ||
# X-Start-Before: | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: 0 1 6 | ||
# Short-Description: vPoller Proxy daemon | ||
### END INIT INFO | ||
|
||
# | ||
# Author: Kurt Dillen | ||
# | ||
|
||
### Change depending on installation: standalone or together with zabbix | ||
USER=zabbix | ||
GROUP=zabbix | ||
|
||
### Variables | ||
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin | ||
DESC="vpoller-proxy daemon" | ||
NAME=vpoller-proxy | ||
DAEMON=`which $NAME` | ||
DAEMON_ARGS="-d start" | ||
SCRIPTNAME=/etc/init.d/"$NAME" | ||
MGMT_INTERFACE="tcp://localhost:9999" | ||
PID_DIR=/var/run/vpoller | ||
LOG_DIR=/var/log/vpoller | ||
PID=${PID_DIR}/vpoller-proxy.pid | ||
|
||
### Create needed directories and set right permissions | ||
if [ ! -d ${PID_DIR} ]; then | ||
mkdir -p ${PID_DIR} | ||
chown ${USER}:${GROUP} ${PID_DIR} | ||
fi | ||
if [ ! -d ${LOG_DIR} ]; then | ||
mkdir -p ${LOG_DIR} | ||
chown ${USER}:${GROUP} ${LOG_DIR} | ||
fi | ||
|
||
# Read configuration variable file if it is present | ||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME | ||
|
||
# Load the VERBOSE setting and other rcS variables | ||
. /lib/init/vars.sh | ||
|
||
# Define LSB log_* functions. | ||
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present | ||
# and status_of_proc is working. | ||
. /lib/lsb/init-functions | ||
|
||
# | ||
# Function that starts the daemon/service | ||
# | ||
do_start() { | ||
start-stop-daemon --start --quiet --pidfile $PID \ | ||
--exec $DAEMON --chuid $USER:$GROUP -- $DAEMON_ARGS >/dev/null 2>&1 || return 2 | ||
} | ||
|
||
do_stop() { | ||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PID --name $NAME | ||
RETVAL="$?" | ||
[ "$RETVAL" = 2 ] && return 2 | ||
rm -f $PID | ||
return "$RETVAL" | ||
} | ||
|
||
do_full_status() { | ||
${DAEMON} -e ${MGMT_INTERFACE} status | ||
} | ||
|
||
case "${1}" in | ||
start) | ||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" | ||
do_start | ||
case "$?" in | ||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; | ||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; | ||
esac | ||
;; | ||
reset|stop) | ||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" | ||
do_stop | ||
case "$?" in | ||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; | ||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; | ||
esac | ||
;; | ||
status) | ||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? | ||
;; | ||
fullstatus) | ||
do_full_status | ||
;; | ||
reload|restart|force-reload) | ||
do_stop | ||
do_start | ||
;; | ||
*) | ||
log_success_msg "usage: ${0} {start|stop|status|fullstatus||reload|restart|force-reload|reset}" >&2 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#!/bin/sh | ||
### BEGIN INIT INFO | ||
# Provides: vpoller-worker | ||
# Required-Start: $remote_fs $network | ||
# Required-Stop: $remote_fs | ||
# X-Start-Before: | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: 0 1 6 | ||
# Short-Description: vPoller Worker daemon | ||
### END INIT INFO | ||
|
||
# | ||
# Author: Kurt Dillen | ||
# | ||
|
||
### Change depending on installation: standalone or together with zabbix | ||
USER=zabbix | ||
GROUP=zabbix | ||
|
||
### Variables | ||
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin | ||
DESC="vpoller-worker daemon" | ||
NAME=vpoller-worker | ||
DAEMON=`which vpoller-worker` | ||
DAEMON_ARGS="-d start" | ||
SCRIPTNAME=/etc/init.d/"$NAME" | ||
MGMT_INTERFACE="tcp://localhost:10000" | ||
PID_DIR=/var/run/vpoller | ||
LOG_DIR=/var/log/vpoller | ||
PID=${PID_DIR}/vpoller-worker.pid | ||
|
||
### Create needed directories and set right permissions | ||
if [ ! -d ${PID_DIR} ]; then | ||
mkdir -p ${PID_DIR} | ||
chown ${USER}:${GROUP} ${PID_DIR} | ||
fi | ||
if [ ! -d ${LOG_DIR} ]; then | ||
mkdir -p ${LOG_DIR} | ||
chown ${USER}:${GROUP} ${LOG_DIR} | ||
fi | ||
|
||
# Read configuration variable file if it is present | ||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME | ||
|
||
# Load the VERBOSE setting and other rcS variables | ||
. /lib/init/vars.sh | ||
|
||
# Define LSB log_* functions. | ||
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present | ||
# and status_of_proc is working. | ||
. /lib/lsb/init-functions | ||
|
||
# | ||
# Function that starts the daemon/service | ||
# | ||
do_start() { | ||
start-stop-daemon --start --quiet --pidfile $PID \ | ||
--exec $DAEMON --chuid $USER:$GROUP -- $DAEMON_ARGS >/dev/null 2>&1 || return 2 | ||
} | ||
|
||
do_stop() { | ||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PID --name $NAME | ||
RETVAL="$?" | ||
[ "$RETVAL" = 2 ] && return 2 | ||
rm -f $PID | ||
return "$RETVAL" | ||
} | ||
|
||
do_full_status() { | ||
${DAEMON} -e ${MGMT_INTERFACE} status | ||
} | ||
|
||
case "${1}" in | ||
start) | ||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" | ||
do_start | ||
case "$?" in | ||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; | ||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; | ||
esac | ||
;; | ||
reset|stop) | ||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" | ||
do_stop | ||
case "$?" in | ||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; | ||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; | ||
esac | ||
;; | ||
status) | ||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? | ||
;; | ||
fullstatus) | ||
do_full_status | ||
;; | ||
reload|restart|force-reload) | ||
do_stop | ||
do_start | ||
;; | ||
*) | ||
log_success_msg "usage: ${0} {start|stop|status|fullstatus||reload|restart|force-reload|reset}" >&2 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.