Event handlers for handling Windows services

Andy andy at droidmcse.com
Wed Sep 18 19:39:40 CEST 2002


I have another idea.  Probably exposes some security risks.....but
that's another discussion.

Have your service check on Nagios pipe some arguments out to a file and
then ftp them to a windows server.  From there, have a task scheduler
job run on windows with enough permissions to be able to use the params
in the ftp'd file to act on it.

I have been thinking about this and thought about this scenario.

Nagios checks a web server
Web server fails
Nagios executes a script that has $HOSTNAME$ $SERVICEDESC$
$SERVICESTATE$ $SERVICEATTEMPT$
In the script, it eventually runs it and all of the checks line up and
then the script would create a small text file with the hostname and the
service - probably a good idea to adjust this to be the actual line that
would start / stop the service (eg: netsvc IISADMIN \\hostname /stop)
Then have a script on the ftp server that is able to run that script.

Again, this leave open all kinds of holes for someone to arbitrarily
start and stop services....but you could throw in some text to act like
a password and also restrict ftp from certain hosts.  My intent is only
to show a way to pull this off.

Andy 

-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Carroll,
Jim P [Contractor]
Sent: Wednesday, September 18, 2002 11:15 AM
To: nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] Event handlers for handling Windows services

The question can be answered if you can answer the question, "Can you
start/stop Windows services from the command line?"  I think.

If you install Cygwin, you have the option of turning on an SSH daemon
service.  Once you get the proper authentication set up (most likely
using a
null passphrase), so long as you can access the start/stop command from
within the Cygwin environment (might require copying/linking the
authroitative Windows command), then I don't see why not.

If you try this approach, let us know how it works out.

jc

> -----Original Message-----
> From: Greg Vickers [mailto:g.vickers at qut.edu.au]
> Sent: Wednesday, September 18, 2002 2:46 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Event handlers for handling Windows services
> 
> 
> Hi all,
> I was wondering if there is a way to stop/start windows services from 
> linux? (i.e. event handlers with Nagios and Win2K servers)
> 
> TIA,
> 
> =================================
> Greg Vickers
> Computer Systems Officer
> Student Support and Systems
> Teaching and Learning Support Systems, QUT
> Kelvin Grove Campus, CRICOS No 00213J
> 
> Ph: 07 3864 8276 Fax: 07 3864 5425
> Mob: 0416 001 674 SD: x6147
> 
> 
> 
> -------------------------------------------------------
> This SF.NET email is sponsored by: AMD - Your access to the experts
> on Hammer Technology! Open Source & Linux Developers, register now
> for the AMD Developer Symposium. Code: EX8664
> http://www.developwithamd.com/developerlab
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> 


-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts
on Hammer Technology! Open Source & Linux Developers, register now
for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users



-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts
on Hammer Technology! Open Source & Linux Developers, register now
for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab




More information about the Users mailing list