nagios startup options
Donnell Lewis
donnell.lewis at icoretechnology.com
Tue Nov 14 23:24:29 CET 2006
I always like using the nagios process check myself rather than checking
for the ".pid" file as I have had nagios die off and the ps wasn't
telling me anything, I use this which works pretty good for me, I also
use this along with additonal and modified to check our nagios primary
to make sure it's up and if not startup slave etc.
Might want to give this a try, edit according to your install of
course :
#!/bin/bash
plugindir="/usr/local/nagios/libexec"
cmdstart='/sbin/service nagios start'
#Check nagios with check_nagios plugin
$plugindir/check_nagios -e 5 -F /usr/local/nagios/var/nagios.log
-C /usr/local/nagios/bin/nagios
if [ "${?}" != 0 ] ; then
echo "CRITICAL:Nagios not found running..."
$cmdstart
else
echo "OK:Nagios runnning..."
fi
exit
-Donnell Lewis
On Tue, 2006-11-14 at 22:29 +0100, Hugo van der Kooij wrote:
> On Tue, 14 Nov 2006, Brian Loe wrote:
>
> > On 11/14/06, Hugo van der Kooij <hvdkooij at vanderkooij.org> wrote:
> > >
> > >
> > > Sounds like a bad idea. If you make a typo in the config your system will
> > > respawn itself a lot as it will start and die in quick succesion.
> > >
> > > A watchdog script can be smarter. And my nagios uptime is almost identical
> > > to my OS uptime. (Which equals the amount of time it takes to run my
> > > Sxxnagios script in rc3.d after boot up.)
> >
> > Do you have such a watchdog script you can share? :)
>
> Well. I do not have one because nagios is quite stable. But it might
> contain a check like:
>
> ps ax|egrep "^`cat /var/run/nagios.pid`"
>
> And verify is still is the nagios process.
>
> Other check might work just as well.
>
> > Do you kick it off from an rc file as well?
>
> Sure. Multiple Centos 4 system all running nagios from DAG's rpm packages.
> Everything except the actual nagios config files was a breeze to install.
>
> Hugo.
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at 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
More information about the Users
mailing list