[-]
[+]
|
Changed |
nprobe.changes
|
|
[-]
[+]
|
Changed |
nprobe.init.rh
^
|
@@ -42,6 +42,9 @@
case "$1" in
start)
echo "Starting nprobe ..."
+ if [ "${NPROBE_COLLECTORS}" == "" ] ; then
+ NPROBE_COLLECTORS="none"
+ fi
for ADDR in ${NPROBE_COLLECTORS} ; do
COLLECTOR_OPTS="${COLLECTOR_OPTS} -n ${ADDR}"
@@ -67,32 +70,59 @@
;;
esac
fi
- for IFACE in ${NPROBE_IFACE} ; do
- echo -n "instance on interface ${IFACE} "
- if [ "${NPROBE_USE_ZMQ}" == "no" ] ; then
- daemon --pidfile /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN -G -g /var/run/nprobe/nprobe-${IFACE}.pid -i ${IFACE} ${NF_VERSION} ${COLLECTOR_OPTS} ${NPROBE_OPTS}
- RETVAL=$?
- elif [ "${NPROBE_USE_ZMQ}" == "yes" ] ; then
- daemon --pidfile /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN -G -g /var/run/nprobe/nprobe-${IFACE}.pid -i ${IFACE} ${NF_VERSION} ${COLLECTOR_OPTS} ${NPROBE_OPTS} --zmq tcp://${NPROBE_ZMQ_BINDADDRESS}:${NPROBE_ZMQ_PORTBASE}
- RETVAL=$?
- NPROBE_ZMQ_PORTBASE=`expr ${NPROBE_ZMQ_PORTBASE} + 1`
- fi
+
+ if [ "${NPROBE_COLLECTOR_MODE}" == "no" ] ; then
+ for IFACE in ${NPROBE_IFACE} ; do
+ echo -n "instance on interface ${IFACE} "
+ if [ "${NPROBE_USE_ZMQ}" == "no" ] ; then
+ daemon --pidfile /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN -G -g /var/run/nprobe/nprobe-${IFACE}.pid -i ${IFACE} ${NF_VERSION} ${COLLECTOR_OPTS} ${NPROBE_OPTS}
+ RETVAL=$?
+ elif [ "${NPROBE_USE_ZMQ}" == "yes" ] ; then
+ daemon --pidfile /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN -G -g /var/run/nprobe/nprobe-${IFACE}.pid -i ${IFACE} ${NF_VERSION} ${COLLECTOR_OPTS} ${NPROBE_OPTS} --zmq tcp://${NPROBE_ZMQ_BINDADDRESS}:${NPROBE_ZMQ_PORTBASE}
+ RETVAL=$?
+ NPROBE_ZMQ_PORTBASE=`expr ${NPROBE_ZMQ_PORTBASE} + 1`
+ fi
+ echo
+ [ $RETVAL -eq 0 ] && touch ${lockfile}-${IFACE}
+ done
+ elif
+ if [ -z "${NPROBE_COLLECTOR_PORT}" ] ; then
+ NPROBE_COLLECTOR_PORT="6661"
+ fi
+
+ if [ "${NPROBE_USE_ZMQ}" == "no" ] ; then
+ daemon --pidfile /var/run/nprobe/nprobe.pid $NPROBE_BIN -g /var/run/nprobe/nprobe.pid --collector-port ${NPROBE_COLLECTOR_PORT} ${NF_VERSION} ${COLLECTOR_OPTS} ${NPROBE_OPTS}
+ RETVAL=$?
+ elif [ "${NPROBE_USE_ZMQ}" == "yes" ] ; then
+ daemon --pidfile /var/run/nprobe/nprobe.pid $NPROBE_BIN -g /var/run/nprobe/nprobe.pid --collector-port ${NPROBE_COLLECTOR_PORT} ${NF_VERSION} ${COLLECTOR_OPTS} ${NPROBE_OPTS} --zmq tcp://${NPROBE_ZMQ_BINDADDRESS}:${NPROBE_ZMQ_PORTBASE}
+ RETVAL=$?
+ fi
echo
- [ $RETVAL -eq 0 ] && touch ${lockfile}-${IFACE}
- done
+ [ $RETVAL -eq 0 ] && touch ${lockfile}
+ fi
;;
stop)
echo "Shutting down nprobe ..."
- for IFACE in ${NPROBE_IFACE} ; do
- echo -n " instance on interface ${IFACE} "
- killproc -p /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN
+ if [ "${NPROBE_COLLECTOR_MODE}" == "no" ] ; then
+ for IFACE in ${NPROBE_IFACE} ; do
+ echo -n " instance on interface ${IFACE} "
+ killproc -p /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN
+ RETVAL=$?
+ echo
+ if [ $RETVAL -eq 0 ] ; then
+ rm -f ${lockfile}-${IFACE} ${pidfile}
+ fi
+ done
+ elif
+ echo -n " "
+ killproc -p /var/run/nprobe/nprobe.pid $NPROBE_BIN
RETVAL=$?
- echo
- if [ $RETVAL -eq 0 ] ; then
- rm -f ${lockfile}-${IFACE} ${pidfile}
- fi
- done
+ echo
+ if [ $RETVAL -eq 0 ] ; then
+ rm -f ${lockfile} ${pidfile}
+ fi
+ fi
;;
try-restart|condrestart)
if test "$1" = "condrestart"; then
@@ -111,12 +141,17 @@
;;
status)
echo "Checking for service nprobe ..."
-
- for IFACE in ${NPROBE_IFACE} ; do
- echo -n "instance on interface ${IFACE} "
- status -p /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN
+ if [ "${NPROBE_COLLECTOR_MODE}" == "no" ] ; then
+ for IFACE in ${NPROBE_IFACE} ; do
+ echo -n "instance on interface ${IFACE} "
+ status -p /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN
+ RETVAL=$?
+ done
+ elif
+ echo -n " "
+ status -p /var/run/nprobe/nprobe.pid $NPROBE_BIN
RETVAL=$?
- done
+ fi
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
|
[-]
[+]
|
Changed |
nprobe.init.suse
^
|
@@ -109,6 +109,9 @@
echo "Starting nprobe ..."
## Start daemon with startproc(8). If this fails
## the return value is set appropriately by startproc.
+ if [ "${NPROBE_COLLECTORS}" == "" ] ; then
+ NPROBE_COLLECTORS="none"
+ fi
for ADDR in ${NPROBE_COLLECTORS} ; do
COLLECTOR_OPTS="${COLLECTOR_OPTS} -n ${ADDR}"
done
@@ -133,28 +136,46 @@
;;
esac
fi
- for IFACE in ${NPROBE_IFACE} ; do
- echo -n "instance on interface ${IFACE} "
+ if [ "${NPROBE_COLLECTOR_MODE}" == "no" ] ; then
+ for IFACE in ${NPROBE_IFACE} ; do
+ echo -n "instance on interface ${IFACE} "
+ if [ "${NPROBE_USE_ZMQ}" == "no" ] ; then
+ /sbin/startproc -p /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN -g /var/run/nprobe/nprobe-${IFACE}.pid -i ${IFACE} ${NF_VERSION} ${COLLECTOR_OPTS} ${NPROBE_OPTS}
+ rc_status -v
+ elif [ "${NPROBE_USE_ZMQ}" == "yes" ] ; then
+ /sbin/startproc -p /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN -g /var/run/nprobe/nprobe-${IFACE}.pid -i ${IFACE} ${NF_VERSION} ${COLLECTOR_OPTS} ${NPROBE_OPTS} --zmq tcp://${NPROBE_ZMQ_BINDADDRESS}:${NPROBE_ZMQ_PORTBASE}
+ NPROBE_ZMQ_PORTBASE=`expr ${NPROBE_ZMQ_PORTBASE} + 1`
+ fi
+ done
+ else
+ if [ -z "${NPROBE_COLLECTOR_PORT}" ] ; then
+ NPROBE_COLLECTOR_PORT="6661"
+ fi
+
if [ "${NPROBE_USE_ZMQ}" == "no" ] ; then
- /sbin/startproc -p /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN -g /var/run/nprobe/nprobe-${IFACE}.pid -i ${IFACE} ${NF_VERSION} ${COLLECTOR_OPTS} ${NPROBE_OPTS}
+ /sbin/startproc -p /var/run/nprobe/nprobe.pid $NPROBE_BIN -g /var/run/nprobe/nprobe.pid --collector-port ${NPROBE_COLLECTOR_PORT} ${NF_VERSION} ${COLLECTOR_OPTS} ${NPROBE_OPTS}
rc_status -v
elif [ "${NPROBE_USE_ZMQ}" == "yes" ] ; then
- /sbin/startproc -p /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN -g /var/run/nprobe/nprobe-${IFACE}.pid -i ${IFACE} ${NF_VERSION} ${COLLECTOR_OPTS} ${NPROBE_OPTS} --zmq tcp://${NPROBE_ZMQ_BINDADDRESS}:${NPROBE_ZMQ_PORTBASE}
- NPROBE_ZMQ_PORTBASE=`expr ${NPROBE_ZMQ_PORTBASE} + 1`
+ /sbin/startproc -p /var/run/nprobe/nprobe.pid $NPROBE_BIN -g /var/run/nprobe/nprobe.pid --collector-port ${NPROBE_COLLECTOR_PORT} ${NF_VERSION} ${COLLECTOR_OPTS} ${NPROBE_OPTS} --zmq tcp://${NPROBE_ZMQ_BINDADDRESS}:${NPROBE_ZMQ_PORTBASE}
+ rc_status -v
fi
- done
+ fi
;;
stop)
echo "Shutting down nprobe ..."
## Stop daemon with killproc(8) and if this fails
## killproc sets the return value according to LSB.
- /sbin/killproc -TERM $NPROBE_BIN
- for IFACE in ${NPROBE_IFACE} ; do
- echo -n " instance on interface ${IFACE} "
- /sbin/killproc -p /var/run/nprobe/nprobe-${IFACE}.pid -TERM $NPROBE_BIN
+ if [ "${NPROBE_COLLECTOR_MODE}" == "no" ] ; then
+ for IFACE in ${NPROBE_IFACE} ; do
+ echo -n " instance on interface ${IFACE} "
+ /sbin/killproc -p /var/run/nprobe/nprobe-${IFACE}.pid -TERM $NPROBE_BIN
+ rc_status -v
+ done
+ else
+ /sbin/killproc -p /var/run/nprobe/nprobe.pid -TERM $NPROBE_BIN
rc_status -v
- done
+ fi
;;
try-restart|condrestart)
@@ -196,11 +217,17 @@
# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
# NOTE: checkproc returns LSB compliant status values.
- for IFACE in ${NPROBE_IFACE} ; do
- echo -n "instance on interface ${IFACE} "
- /sbin/checkproc -p /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN
- rc_status -v
- done
+ if [ "${NPROBE_COLLECTOR_MODE}" == "no" ] ; then
+ for IFACE in ${NPROBE_IFACE} ; do
+ echo -n "instance on interface ${IFACE} "
+ /sbin/checkproc -p /var/run/nprobe/nprobe-${IFACE}.pid $NPROBE_BIN
+ rc_status -v
+ done
+ else
+ echo -n " "
+ /sbin/checkproc -p /var/run/nprobe/nprobe.pid $NPROBE_BIN
+ rc_status -v
+ fi
;;
probe)
## Optional: Probe for the necessity of a reload, print out the
|
[-]
[+]
|
Changed |
sysconfig.nprobe
^
|
@@ -60,3 +60,17 @@
# ZMQ bind address
#
NPROBE_ZMQ_BINDADDRESS="127.0.0.1"
+
+## Type: yesno
+## Default: no
+#
+# activate collector-mode for teeing
+#
+NPROBE_COLLECTOR_MODE="no"
+
+## Type: int
+## Default: 6661
+#
+# nprobe collector port
+#
+NPROBE_COLLECTOR_PORT="6661"
|