nagios reboot XP

Palle L Jensen palleje at gmail.com
Tue May 13 21:51:10 CEST 2008


Sorry about the late response, been assigned other tasks here. Thanks for
the replies. Getting back to Nagios and slowly getting a hang of this, I
will try this.

Thanks,
PJ

> -----Original Message-----
> From: Hari Sekhon [mailto:hpsekhon at googlemail.com]
> Sent: Thursday, May 08, 2008 7:38 AM
> To: Palle L Jensen
> Cc: 'Valdinger, Stephen (DOV, MSX)'; 'Anthony Montibello'; 'Jon Terry';
> nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] nagios reboot XP
> 
> Palle L Jensen wrote:
> >
> > I guess I should have been more specific, sorry about that.
> >
> > I am running Nagios 3.0.1 on openSUSE 10.3, and I am only monitoring
> > windows hosts. On the windows hosts I am running NSClient++. That
> > seems to work good and I would prefer not to change to any other client.
> >
> > I have read about the event handlers in the Nagios documentation, but
> > the samples there only refers to nrpe and scripts on the server. I
> > understand how to define the service in Nagios, but I am not sure how
> > to create the script that executes the batch file on the windows host?
> > Maybe I am not getting the point and understanding on the documentation.
> >
> > Lets say I created a batch file that will start or restart a service,
> > this batch file is located in c:\NSclient++\scripts folder. And then
> > defined the service and command in Nagios:
> >
> > define service{
> >         host_name              somehost
> >         service_description    sql-service
> >         max_check_attempts     4
> >         event_handler          restart-sqlagent
> >         }
> >
> > define command{
> >         command_name   restart-sqlagent
> >         command_line   what do I add here?? It has to be something that
> can be sent to the Nsclient++/windows host and execute the batch script in
> c:\NSclient++\scripts folder
> >         }
> >
> > The command line on the eventhandler documentation shows a path to a
> > local script and local command "/etc/rc.d/init.d/httpd restart"
> >
> > So creating and event handler for services or others on the box where
> > Nagios is running, I understand. But not how to do it remotely to a
> > windows host.
> >
> > If you could shed some more light over this I would very much
> > appreciate it.
> >
> > Thanks,
> >
> > PJ
> >
> You need a Unix-side script to execute and handle the condition
> appropriately, for example to only call the restart when the service is
> in hard failure. A sample Bash script is given in the docs to get you
> started.
> 
> If using Bash (which I recommend) the Bash script should check the state
> and perform the logic control, calling the batch or script on the
> windows side though an NRPE call to nsclient++ to execute the script on
> the windows host.
> 
> -h
> 
> --
> Hari Sekhon


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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