smokeping

I’ve been using smokeping for various reasons all over campus and the ICCN lately.
I find it excellent for what I want it to do. I do however, find it a pain to set up.
It seems the author merely tarred up a directory and posts it to the website. Thus, users have to edit each and every script/cgi to reflect the actual locations of libraries and binaries on their system.
This isn’t hard, its just annoying.

Anyway, what isn’t included is an init script for RedHat or CentOS, so I wrote one.
Of course, you’ll have to edit it to reflect where your actual binaries are.
#!/bin/bash
#
# chkconfig: - 16 84
# description: A smokeping init script for RHEL
#
# processname: smokeping
# config: /usr/local/smokeping/etc/config

# source function library
. /etc/rc.d/init.d/functions

RETVAL=0
prog="smokeping"

case "$1" in
start)
echo -n $"Starting $prog: "
daemon /usr/bin/smokeping
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/smokeping
echo
;;
stop)
echo -n $"Shutting down $prog: "
killproc smokeping
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/smokeping
echo
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/smokeping ]; then
$0 stop
$0 start
fi
RETVAL=$?
;;
status)
status smokeping
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
exit 1
esac

exit $RETVAL

One Response to “smokeping”

  1. john says:

    perfect!
    thank you!

Leave a Reply