How to start/stop a windows service using nagios
Anthony Montibello
amontibello at gmail.com
Fri Apr 11 04:55:54 CEST 2008
Yes this can be done in NC_Net
but depending on your goals the service could also be configured to restart
if it stop
For NC_Net
First make sure you are using a current version of Nc_Net
Sourceforge is the only location that NC_Net should be downloaded from.
http://sourceforge.net/projects/nc-net
Use the RUNSCRIPT command check help for syntex
./check_nc_net --help=RUNSCRIPT
create a batch that runs the net start command.
copy it into the script folder of NC_Net install folder.
Make sure your startup.cfg is configured approprialty for running scripts.
(documentation is clear for these settings in the Startup.cfg file in the
config folder of NC_NEt install location)
if you modified the starup make sure to restart NC_NEt
Then configure a event script for nagios that calls check_nt
-v RUNSCRIPT -l "Scriptname"
Tony (Author of NC_NEt)
On Thu, Apr 10, 2008 at 2:12 PM, Frost, Mark {PBG} <mark.frost1 at pepsi.com>
wrote:
> There might be more than one way to do this, but my experience/suggestion
> would be to
>
> 1) setup an event to act when the service goes critical. See the Nagios
> docs about how to write a simple event script. Mostly you're making sure
> that you'll only attempt to start the service on HARD/CRITICAL events.
>
> 2) I'm not too familiar with NC_NET, but I believe it's not dissimilar
> from NSClient++ or other NRPE agents in that it can accept NRPE protocol
> requests. You'd define an NRPE command (say "start_service") that run "net
> start $ARG1$" where $ARG1$ is the name of the service to start. It's
> possible that NC_NET has some built-in capability to manage services too
> without resorting to an actual NRPE command.
>
> 3) Your script from #1 would then run
>
> check_nrpe -H <hostname> -c start_service\!<servicename>
>
> to start a service. Stopping is similar, of course.
>
> Mark
>
>
>
> ------------------------------
> *From:* nagios-users-bounces at lists.sourceforge.net [mailto:
> nagios-users-bounces at lists.sourceforge.net] *On Behalf Of *Joe Astrologo
> *Sent:* Thursday, April 10, 2008 1:39 PM
> *To:* Nagios-users at lists.sourceforge.net
> *Subject:* [Nagios-users] How to start/stop a windows service using nagios
>
> I have nagios 2.3 server installed on a RedHat Linux.
>
> I have NC_Net and nagios event_log agents installed on various windows
> clinets.
>
> I want nagios to re-start a windows service based on an application Event
> Log messages.
>
> How do I do it?
>
> Thanks.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
>
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080410/36a043ed/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
-------------- next part --------------
_______________________________________________
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