<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>stopping and starting NDO daemon</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.5726" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=546490120-20042009><FONT face=Arial
color=#0000ff size=2>Hello Greg,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=546490120-20042009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=546490120-20042009><FONT face=Arial
color=#0000ff size=2>here it is, simply took one of RHEL's init-scripts and
modified it:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=546490120-20042009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=546490120-20042009><FONT face=Arial
color=#0000ff size=2>[root@atvies00nx libexec]# cat /etc/init.d/ndo2db<BR>#!
/bin/sh</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=546490120-20042009><FONT face=Arial
color=#0000ff size=2># ndo2db init file<BR></FONT></SPAN><FONT face=Arial
color=#0000ff size=2></FONT></DIV>
<DIV dir=ltr align=left><SPAN class=546490120-20042009><FONT face=Arial
color=#0000ff size=2># For RedHat and cousins:<BR># chkconfig: 2345 98 02<BR>#
description: NDO daemon to write data to database<BR># processname:
ndo2db</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=546490120-20042009><FONT face=Arial
color=#0000ff size=2># be aware that ndo2db has to be started before nagios
!</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV><SPAN
class=546490120-20042009>
<DIV dir=ltr align=left><BR><FONT face=Arial color=#0000ff size=2>### BEGIN INIT
INFO<BR># Provides: ndo2db<BR># Required-Start: $local_fs $network $nagios<BR>#
Required-Stop: $local_fs $network<BR># Should-Start:<BR>### END INIT
INFO</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2>NDO2DB_BIN=/opt/nagios/bin/ndo2db<BR>NDO2DB_CONF=/opt/nagios/etc/ndo2db.cfg<BR>NDO2DB_OPTS="-c
$NDO2DB_CONF"</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2># Source function
library<BR>. /etc/rc.d/init.d/functions</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2>RETVAL=0<BR>prog=ndo2db<BR>pidfile=/var/lock/subsys/ndo2db</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2>start()<BR>{<BR> echo -n
$"Starting $prog: "<BR> daemon
$NDO2DB_BIN $NDO2DB_OPTS<BR>
RETVAL=$?<BR>
echo<BR> [ $RETVAL = 0 ] &&
touch $pidfile<BR> return
$RETVAL<BR>}</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2>stop()<BR>{<BR> echo -n
$"Shutting down $prog: "<BR> killproc
$NDO2DB_BIN<BR>
RETVAL=$?<BR>
echo<BR> rm -f
$pidfile<BR> return
$RETVAL<BR>}</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>case "$1"
in<BR>
start)<BR>
start<BR>
;;<BR>
stop)<BR>
stop<BR>
;;<BR>
restart)<BR>
stop<BR>
start<BR>
;;<BR>
try-restart)<BR>
if [ -f $pidfile ];
then<BR>
stop<BR>
start<BR>
fi<BR>
;;<BR>
status)<BR>
status
$prog<BR>
RETVAL=$?<BR>
;;<BR>
*)<BR>
echo $"Usage: $0
{start|stop|restart|try-restart|status}"<BR>
RETVAL=3<BR>esac</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>exit
$RETVAL</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV dir=ltr align=left></SPAN><SPAN class=546490120-20042009><FONT face=Arial
color=#0000ff size=2>christian</FONT></SPAN></DIV>
<DIV> </DIV><!-- Converted from text/plain format -->
<P><FONT size=2>--<BR>"I sense much NT in you, NT leads to Blue Screen.<BR>Blue
Screen leads to downtime, downtime leads to suffering. NT is the path to the
darkside."<BR><BR>- Unknown Unix Jedi </FONT></P>
<DIV> </DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Frater, Greg J
[mailto:GJFRATER@bechtel.com] <BR><B>Sent:</B> Monday, April 20, 2009 9:44
PM<BR><B>To:</B> Nagios-users@lists.sourceforge.net<BR><B>Subject:</B>
[Nagios-users] stopping and starting NDO daemon<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/rtf format -->
<P><FONT face=Arial size=2>Hi All, </FONT></P>
<P><FONT face=Arial size=2>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 (</FONT><A
href="http://article.gmane.org/gmane.network.nagios.user/52477/match=ndo+init"><U><FONT
face=Arial color=#0000ff
size=2>http://article.gmane.org/gmane.network.nagios.user/52477/match=ndo+init</FONT></U></A><FONT
face=Arial size=2>) 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?</FONT></P>
<P><FONT face=Arial size=2>Thanks, </FONT></P>
<P><FONT face=Arial size=2>-greg</FONT> </P><BR><BR></BLOCKQUOTE></BODY></HTML>