Hello Greg,
 
here it is, simply took one of RHEL's init-scripts and modified it:
 
[r...@atvies00nx libexec]# cat /etc/init.d/ndo2db
#! /bin/sh
 
# ndo2db init file

# For RedHat and cousins:
# chkconfig: 2345 98 02
# description: NDO daemon to write data to database
# processname: ndo2db
 
# be aware that ndo2db has to be started before nagios !
 

### BEGIN INIT INFO
# Provides: ndo2db
# Required-Start: $local_fs $network $nagios
# Required-Stop: $local_fs $network
# Should-Start:
### END INIT INFO
 
NDO2DB_BIN=/opt/nagios/bin/ndo2db
NDO2DB_CONF=/opt/nagios/etc/ndo2db.cfg
NDO2DB_OPTS="-c $NDO2DB_CONF"
 
# Source function library
. /etc/rc.d/init.d/functions
 
RETVAL=0
prog=ndo2db
pidfile=/var/lock/subsys/ndo2db
 
start()
{
        echo -n $"Starting $prog: "
        daemon $NDO2DB_BIN $NDO2DB_OPTS
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch $pidfile
        return $RETVAL
}
 
stop()
{
        echo -n $"Shutting down $prog: "
        killproc $NDO2DB_BIN
        RETVAL=$?
        echo
        rm -f $pidfile
        return $RETVAL
}
 
case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart)
                stop
                start
                ;;
        try-restart)
                if [ -f $pidfile ]; then
                        stop
                        start
                fi
                ;;
        status)
                status $prog
                RETVAL=$?
                ;;
        *)
                echo $"Usage: $0 {start|stop|restart|try-restart|status}"
                RETVAL=3
esac
 
exit $RETVAL
 
 
christian
 

--
"I sense much NT in you, NT leads to Blue Screen.
Blue Screen leads to downtime, downtime leads to suffering. NT is the path to 
the darkside."

- Unknown Unix Jedi 

 


________________________________

        From: Frater, Greg J [mailto:gjfra...@bechtel.com] 
        Sent: Monday, April 20, 2009 9:44 PM
        To: Nagios-users@lists.sourceforge.net
        Subject: [Nagios-users] stopping and starting NDO daemon
        
        

        Hi All, 

        We've just setup nagios 3 using NDO (to support Nagvis) and I realized 
that NDO does not come with an init script.  I found one post to the list 
(http://article.gmane.org/gmane.network.nagios.user/52477/match=ndo+init 
<http://article.gmane.org/gmane.network.nagios.user/52477/match=ndo+init> ) 
from about a year ago, someone was asking for help incorporating the NDO daemon 
into the Nagios init script, but there were no responses.  I'm wondering how 
others are handling the stopping and starting of the NDO daemon?  Would it be 
better to incorporate it into the Nagios init script or should it have it's 
own, has somebody already done this that is willing to share with the list?

        Thanks, 

        -greg 



------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Reply via email to