Re: email Alert & webconfig [need help!]

From: Vincenzo Farruggia <h1ddenm4n#gmail.com>
Date: Thu, 29 Jan 2009 08:52:43 +0000


Hi,
to implement a web-based configuration I think that it's not very easy because when you change a config from web you will ensure that only for newer requests will be used new parameters. I think that an easy way to do it, is make a gui written in php/perl where you access via web and when you modify something it modify haproxy.cfg and reload haproxy process.
For emaill-alert feature on haproxy i think that you will modify these files: 1- include/types/global.h

    Add some member vars in global struct ex.

     struct global {
          .....
          char* alert_cmd;
     }
2- src/cfgparse.c
     in int cfg_parse_global(const char *file, int linenum, char
**args, int inv)
     before last else { add
    else if (!strcmp(args[0], "alert_cmd")) {
           global.alert_cmd = strdup(args[1]);
    }
3- src/checks.c

   in static void set_backend_down(struct proxy *be)    add:

      if ( global.alert_cmd )
         system( global.alert_cmd );

This's only an example and you will do more check's and other stuff, but I believe that it works only modifying these files. Bye

2009/1/29 surachet ch. <surachet.ch#gmail.com>:
> hello all.
> i tried to modified HAProxy sourcecode for "send email alert" when backend
> server go down/up (or any event) through e-mail
> and "webpage configure" to make its easy for admin to manage HAProxy system
> through webpage (somthing like statistics page).
> anyone have idea/sourcecode for me, help me please.
> thank forward for every help from yours.
> PS. sorry about my english.
> --
> ¢ÍáÊ´§¤ÇÒÁ¹Ñº¶×Í
> Best Regards
> ÊØÃàªÉ®ì ªèÇÂä¸Ê§
> (Surachet Chuaythaisong)
Received on 2009/01/29 09:52

This archive was generated by hypermail 2.2.0 : 2009/01/29 10:00 CET