-
-
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 #38 from blackcobra1973/develop
Develop
- Loading branch information
Showing
6 changed files
with
214 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
## Dependencies: | ||
|
||
- Make sure you have python 2.7 installed on your system | ||
|
||
- Unmask the following packages: | ||
|
||
net-libs/zeromq | ||
dev-libs/libsodium (required for version 4.x of zeromq) | ||
dev-python/docopt | ||
dev-python/tabulate | ||
|
||
- Emerge the packages: | ||
|
||
emerge pyzmq docopt tabulate zeromq jq | ||
|
||
- Switch to python 2.7 to install the manually requirements for the right python or use the right python binary. | ||
|
||
- Install pyVmomi | ||
|
||
git clone https://github.com/vmware/pyvmomi.git | ||
|
||
cd pyvmomi | ||
python2.7 setup.py install | ||
|
||
- Install pv-vconnector | ||
|
||
git clone https://github.com/dnaeon/py-vconnector.git | ||
|
||
cd py-vconnector | ||
python2.7 setup.py install | ||
|
||
- Create needed directories: | ||
|
||
mkdir /var/lib/vconnector /var/log/vpoller /var/log/vconnector /etc/vpoller /var/run/vpoller | ||
|
||
- Install py-vpoller | ||
|
||
git clone https://github.com/blackcobra1973/py-vpoller.git | ||
|
||
cd py-vpoller | ||
python2.7 setup.py install | ||
|
||
cp src/conf/vpoller.conf /etc/vpoller/ | ||
|
||
- Compile the c-client | ||
|
||
cd src/vpoller-cclient/ | ||
make | ||
mv vpoller-cclient /usr/local/bin/ | ||
|
||
- Install init scripts | ||
|
||
cp src/init.d/vpoller-proxy.gentoo /etc/init.d/vpoller-proxy | ||
cp src/init.d/vpoller-worker.gentoo /etc/init.d/vpoller-worker | ||
|
||
- Install the logrotate template | ||
|
||
cp src/logrotate.d/vpoller /etc/logrotate.d/ |
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,9 @@ | ||
[proxy] | ||
frontend = tcp://*:10123 | ||
backend = tcp://*:10124 | ||
mgmt = tcp://*:9999 | ||
|
||
[worker] | ||
db = /var/lib/vconnector/vconnector.db | ||
proxy = tcp://localhost:10124 | ||
mgmt = tcp://*:10000 |
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,57 @@ | ||
#!/sbin/runscript | ||
# Copyright 1999-2012 Gentoo Foundation | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
. /etc/init.d/functions.sh | ||
|
||
extra_started_commands="fullstatus" | ||
|
||
description_fullstatus="Gives the full status of the server." | ||
|
||
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 | ||
|
||
depend() { | ||
use logger net | ||
} | ||
|
||
checkconfig() { | ||
checkpath --directory -m 0755 -o zabbix:zabbix ${PID_DIR} | ||
checkpath --directory -m 0755 -o zabbix:zabbix ${LOG_DIR} | ||
} | ||
|
||
start() { | ||
checkconfig || return 1 | ||
|
||
ebegin "Starting ${DESC}" | ||
if [ ! -d ${CONF_DIR} ]; then | ||
eend 1 "${CONF_DIR} does not exist" | ||
return 1 | ||
fi | ||
if [ ! -f ${CONF_FILE} ]; then | ||
eend 1 "${CONF_FILE} does not exist" | ||
return 1 | ||
fi | ||
# $DAEMON -d start >/dev/null 2>&1 | ||
start-stop-daemon --start --quiet \ | ||
--user zabbix --group zabbix \ | ||
--exec ${DAEMON} -- \ | ||
-d start | ||
eend $? | ||
} | ||
|
||
stop() { | ||
ebegin "Stopping ${DESC}" | ||
${DAEMON} -e ${MGMT_INTERFACE} stop >/dev/null 2>&1 | ||
eend | ||
} | ||
|
||
fullstatus() { | ||
${DAEMON} -e ${MGMT_INTERFACE} status | ||
} | ||
|
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,58 @@ | ||
#!/sbin/runscript | ||
# Copyright 1999-2012 Gentoo Foundation | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
. /etc/init.d/functions.sh | ||
|
||
extra_started_commands="fullstatus" | ||
|
||
description_fullstatus="Gives the full status of the server." | ||
|
||
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 | ||
|
||
depend() { | ||
use logger net | ||
after vpoller-proxy | ||
} | ||
|
||
checkconfig() { | ||
checkpath --directory -m 0755 -o zabbix:zabbix ${PID_DIR} | ||
checkpath --directory -m 0755 -o zabbix:zabbix ${LOG_DIR} | ||
} | ||
|
||
start() { | ||
checkconfig || return 1 | ||
|
||
ebegin "Starting ${DESC}" | ||
if [ ! -d ${CONF_DIR} ]; then | ||
eend 1 "${CONF_DIR} does not exist" | ||
return 1 | ||
fi | ||
if [ ! -f ${CONF_FILE} ]; then | ||
eend 1 "${CONF_FILE} does not exist" | ||
return 1 | ||
fi | ||
# $DAEMON -d start >/dev/null 2>&1 | ||
start-stop-daemon --start --quiet \ | ||
--user zabbix --group zabbix \ | ||
--exec ${DAEMON} -- \ | ||
-d start | ||
eend $? | ||
} | ||
|
||
stop() { | ||
ebegin "Stopping ${DESC}" | ||
${DAEMON} -e ${MGMT_INTERFACE} stop >/dev/null 2>&1 | ||
eend | ||
} | ||
|
||
fullstatus() { | ||
${DAEMON} -e ${MGMT_INTERFACE} status | ||
} | ||
|
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,17 @@ | ||
# Copyright 1999-2011 Gentoo Foundation | ||
# Distributed under the terms of the GNU General Public License v2 | ||
# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/logrotate.mysql,v 1.2 2011/01/13 20:06:06 robbat2 Exp $ | ||
|
||
/var/log/vpoller/*.log { | ||
# rotate 4 | ||
# monthly | ||
# compress | ||
create 640 zabbix zabbix | ||
notifempty | ||
size 5M | ||
sharedscripts | ||
postrotate | ||
[ -f /etc/init.d/vpoller-proxy ] && /etc/init.d/vpoller-proxy restart > /dev/null 2>&1 | ||
[ -f /etc/init.d/vpoller-worker ] && /etc/init.d/vpoller-worker restart > /dev/null 2>&1 | ||
endscript | ||
} |
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