<br><font size=2 face="sans-serif">Hi Greg,</font>
<br>
<br><font size=2 face="sans-serif">Here below is the script that we use
at office</font>
<br>
<br><font size=2 face="sans-serif">Hope it can help you.</font>
<br>
<br><font size=2 face="sans-serif">#!/bin/sh</font>
<br><font size=2 face="sans-serif">#</font>
<br><font size=2 face="sans-serif"># ndo2db This script starts and stops
the ndo2db daemon</font>
<br><font size=2 face="sans-serif">#</font>
<br><font size=2 face="sans-serif"># chkconfig: - 80 30</font>
<br><font size=2 face="sans-serif"># processname: ndo2db</font>
<br><font size=2 face="sans-serif"># description: ndo2db is a daemon process
which stores Nagios data in MySQL \</font>
<br>
<br><font size=2 face="sans-serif"># Source function library.</font>
<br><font size=2 face="sans-serif">. /etc/rc.d/init.d/functions</font>
<br>
<br><font size=2 face="sans-serif">OPTIONS="-c /usr/local/nagios/etc/ndo2db.cfg"</font>
<br><font size=2 face="sans-serif">DAEMON=/usr/local/nagios/bin/ndo2db</font>
<br><font size=2 face="sans-serif">NAME="NDO2DB"</font>
<br>
<br><font size=2 face="sans-serif">[ -f $DAEMON ] || exit 0</font>
<br><font size=2 face="sans-serif">PATH=$PATH:/usr/bin:/usr/local/bin</font>
<br>
<br><font size=2 face="sans-serif"># By default it's all good</font>
<br><font size=2 face="sans-serif">RETVAL=0</font>
<br>
<br><font size=2 face="sans-serif"># See how we were called.</font>
<br><font size=2 face="sans-serif">case "$1" in</font>
<br><font size=2 face="sans-serif">start)</font>
<br><font size=2 face="sans-serif"># Start daemon.</font>
<br><font size=2 face="sans-serif">if [ -r /usr/local/nagios/var/ndo.sock
]</font>
<br><font size=2 face="sans-serif">then</font>
<br><font size=2 face="sans-serif"> rm /usr/local/nagios/var/ndo.sock</font>
<br><font size=2 face="sans-serif">fi</font>
<br><font size=2 face="sans-serif">echo -n "Starting $NAME "</font>
<br><font size=2 face="sans-serif">daemon --user=nagios $NICELEVEL $DAEMON
$OPTIONS</font>
<br><font size=2 face="sans-serif">RETVAL=$?</font>
<br><font size=2 face="sans-serif">echo</font>
<br><font size=2 face="sans-serif">;;</font>
<br><font size=2 face="sans-serif">stop)</font>
<br><font size=2 face="sans-serif"># Stop daemons.</font>
<br><font size=2 face="sans-serif">echo -n "Shutting down $NAME: "</font>
<br><font size=2 face="sans-serif">killproc $DAEMON</font>
<br><font size=2 face="sans-serif">RETVAL=$?</font>
<br><font size=2 face="sans-serif">echo</font>
<br><font size=2 face="sans-serif">[ $RETVAL = 0 ]</font>
<br><font size=2 face="sans-serif">;;</font>
<br><font size=2 face="sans-serif">restart)</font>
<br><font size=2 face="sans-serif">$0 stop</font>
<br><font size=2 face="sans-serif">sleep 3</font>
<br><font size=2 face="sans-serif">$0 start</font>
<br><font size=2 face="sans-serif">;;</font>
<br><font size=2 face="sans-serif">condrestart)</font>
<br><font size=2 face="sans-serif">;;</font>
<br><font size=2 face="sans-serif">status)</font>
<br><font size=2 face="sans-serif">status $DAEMON</font>
<br><font size=2 face="sans-serif">RETVAL=$?</font>
<br><font size=2 face="sans-serif">;;</font>
<br><font size=2 face="sans-serif">*)</font>
<br><font size=2 face="sans-serif">echo "Usage: $0 {start|stop|restart|status}"</font>
<br><font size=2 face="sans-serif">RETVAL=1</font>
<br><font size=2 face="sans-serif">;;</font>
<br><font size=2 face="sans-serif">esac</font>
<br>
<br><font size=2 face="sans-serif">exit $RETVAL</font>
<br>
<br>
<br><font size=2 face="sans-serif">Cheers ;)</font>
<br>
<br><font size=2 face="sans-serif"><br>
[ENVOYE PAR INTERNET]<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>"Frater, Greg J"
<GJFRATER@bechtel.com></b> </font>
<p><font size=1 face="sans-serif">20/04/2009 21:43</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">A</font></div>
<td><font size=1 face="sans-serif"><Nagios-users@lists.sourceforge.net></font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Objet</font></div>
<td><font size=1 face="sans-serif">[spam?] [Nagios-users] stopping and
starting NDO daemon</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2 face="Arial">Hi All, </font>
<p><font size=2 face="Arial">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"><font size=2 color=blue face="Arial"><u>http://article.gmane.org/gmane.network.nagios.user/52477/match=ndo+init</u></font></a><font size=2 face="Arial">)
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><font size=2 face="Arial">Thanks, </font>
<p><font size=2 face="Arial">-greg</font><font size=3> </font>
<p><font size=3><br>
</font><font size=2><tt>------------------------------------------------------------------------------<br>
Stay on top of everything new and different, both inside and <br>
around Java (TM) technology - register by April 22, and save<br>
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.<br>
300 plus technical and hands-on sessions. Register today. <br>
Use priority code J9JMT32. http://p.sf.net/sfu/p_______________________________________________<br>
Nagios-users mailing list<br>
Nagios-users@lists.sourceforge.net<br>
https://lists.sourceforge.net/lists/listinfo/nagios-users<br>
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue. <br>
::: Messages without supporting info will risk being sent to /dev/null</tt></font>
<p>