Commit ca3211ae authored by fwinkler's avatar fwinkler

Added collect status in job control script.

parent 5f60136b
......@@ -9,6 +9,17 @@ function pika_clean() {
rm -rf /opt/pika/*
}
function pika_status() {
COLLECTD_PID=`ps -eo pid,cmd | grep -v grep | grep "pika_collectd" | awk '{print $1}'`
# check if COLLECTD_PID is empty
if [ -z "$COLLECTD_PID" ]; then
echo "PIKA collectd is not running."
else
echo "PIKA collectd is running. PID=$COLLECTD_PID"
fi
}
function pika_install() {
mkdir -p ${PIKA_INSTALL_PATH}
echo -e "tar xzf ${PIKA_PACKAGE_PATH} -C ${PIKA_INSTALL_PATH}/.."
......@@ -32,9 +43,12 @@ function pika_stop() {
if [ ! $# -eq 1 ]; then
echo "One argument required!"
echo "./pika_control [purge|install|start|stop]"
echo "./pika_control [status|purge|install|start|stop]"
else
case "$1" in
status)
pika_status
;;
purge)
pika_stop
pika_clean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment