monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: monit in cygwin


From: Mike
Subject: Re: monit in cygwin
Date: Thu, 29 Jun 2006 09:26:58 -0500
User-agent: Mutt/1.4.2.1i

On Wed, 28 Jun 2006, Jan-Henrik Haukeland might have said:

> 
> On 28. jun. 2006, at 22.33, Mike wrote:
> 
> >My limited, uninformed testing shows that monit will run, monit
> >will start and stop programs, monit accepts './monit -c monit.test  
> >quit'
> >type commands including stopping and starting services.
> 
> Interesting.
> 
> 
> >I know there is a way to link statically a program so that it does  
> >not require
> >cygwin and should be executable outside of cygwin and bash.
> 
> Cygwin is posix or try to be afaik so maybe it is not so strange that  
> monit runs on it, although impressing. But outside, that is another  
> story. File-paths in the monit control file will probably be the  
> least of the problems. Anyway it is going to be interesting to learn  
> what you can make out of it.
> 
> 
> >I need the win32 capability for my next job. I don't need ICMP in the
> >win32 platform for the next job, so I will not miss it there. I do
> >need the 'check status'. I've started working on that code already.
> >
> >I also have an idea for deployment and synchronization that I'll do
> >after 'check status'.
> >
> >I've copied the developer list on this message. For the developer  
> >list,
> >what is the prefered method of creating a patch for someone else to  
> >test?
> 
> Do a cvs urN diff against monit's public CVS HEAD. See also https:// 
> savannah.nongnu.org/cvs/?group=monit

My currently employer's firewall does not allow access to external
CVS servers. I checked out monit from CVS on my home server and copied
it to my workstation. There seem several changes from the CVS version
to the published 4.8.1 version I am testing on. I am including at the
bottom of this message the very few changes I made to get version
4.8.1 to work under cygwin. I have executed monit in a dos box by
modifying the %PATH% variable to include the $CYGWIN_HOME\bin directory.

The changes I made to work with cygwin are:
- in monitor.h add a section at the bottom detecting __CYGWIN__
  and defining ICMP_ECHO as 8 and ICMP_ECHOREPLY as 0
- modify net.c putting a #ifdef __CYGWIN__ around icmp_echo() so
  if in a cygwin environment a stub function returns FALSE and
  disallows ICMP testing, in other environments the code compiles
  the real icmp_echo() function

Mike
--------------------------- diff -cr monit-4.8.1-cygwin monit-4.8.1-orig > x
diff -cr monit-4.8.1-cygwin/monitor.h monit-4.8.1-orig/monitor.h
*** monit-4.8.1-cygwin/monitor.h        Thu Jun 29 08:31:33 2006
--- monit-4.8.1-orig/monitor.h  Thu Apr 27 15:52:31 2006
***************
*** 63,77 ****
  #include <errno.h>
  #endif
  
- #ifdef __CYGWIN__
- #ifndef ICMP_ECHO
- #define ICMP_ECHO 8
- #endif /* ICMP_ECHO */
- #ifndef ICMP_ECHOREPLY
- #define ICMP_ECHOREPLY 0
- #endif /* ICMP_ECHOREPLY */
- #endif /* __CYGWIN__ */
- 
  #include "ssl.h"
  #include "socket.h"
  
--- 63,68 ----
diff -cr monit-4.8.1-cygwin/net.c monit-4.8.1-orig/net.c
*** monit-4.8.1-cygwin/net.c    Wed Jun 28 12:55:16 2006
--- monit-4.8.1-orig/net.c      Sun Jan  1 16:44:02 2006
***************
*** 632,642 ****
   * @param count How many pings to send
   * @return response time on succes, -1 on error
   */
- #ifdef __CYGWIN__
- double icmp_echo(const char *hostname, int timeout, int count) {
-       return -1;
- }
- #else
  double icmp_echo(const char *hostname, int timeout, int count) {
  
    struct hostent *hp;
--- 632,637 ----
***************
*** 776,782 ****
    return response;
   
  }
! #endif /* __CYGWIN__ */
  
  /* ----------------------------------------------------------------- Private 
*/
  
--- 771,777 ----
    return response;
   
  }
! 
  
  /* ----------------------------------------------------------------- Private 
*/
--------------------------- diff -cr monit-4.8.1-cygwin monit-4.8.1-orig > x




reply via email to

[Prev in Thread] Current Thread [Next in Thread]