

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
27 messages in ru.sysoev.nginxRe: Feature request: Run a script whe...| From | Sent On | Attachments |
|---|---|---|
| Rt Ibmer | Apr 28, 2008 8:44 am | |
| Cliff Wells | Apr 28, 2008 10:20 am | |
| mike | Apr 28, 2008 11:53 am | |
| Rt Ibmer | Apr 28, 2008 2:02 pm | |
| Cliff Wells | Apr 28, 2008 2:18 pm | |
| Manlio Perillo | Apr 28, 2008 2:37 pm | |
| Rt Ibmer | Apr 28, 2008 6:10 pm | |
| Rt Ibmer | Apr 28, 2008 6:19 pm | |
| Manlio Perillo | Apr 29, 2008 1:18 am | |
| Manlio Perillo | Apr 29, 2008 1:25 am | |
| Rt Ibmer | Apr 29, 2008 8:11 am | |
| François Battail | Apr 29, 2008 10:46 am | |
| Rt Ibmer | Apr 29, 2008 1:41 pm | |
| Manlio Perillo | Apr 29, 2008 1:57 pm | |
| François Battail | Apr 29, 2008 2:27 pm | |
| Aleksandar Lazic | Apr 29, 2008 2:36 pm | |
| François Battail | Apr 29, 2008 11:20 pm | |
| Mansoor Peerbhoy | Apr 30, 2008 1:46 am | |
| Manlio Perillo | Apr 30, 2008 2:36 am | |
| François Battail | Apr 30, 2008 3:54 am | |
| Mansoor Peerbhoy | Apr 30, 2008 5:03 am | |
| Grzegorz Nosek | Apr 30, 2008 5:18 am | |
| Cliff Wells | Apr 30, 2008 10:40 am | |
| Manlio Perillo | Apr 30, 2008 12:16 pm | |
| Manlio Perillo | May 1, 2008 2:42 am | |
| Grzegorz Nosek | May 1, 2008 11:28 am | |
| Manlio Perillo | May 1, 2008 12:02 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: Feature request: Run a script when upstream detected down/up | Actions... |
|---|---|---|
| From: | François Battail (fb-f...@public.gmane.org) | |
| Date: | Apr 29, 2008 10:46:20 am | |
| List: | ru.sysoev.nginx | |
Rt Ibmer <rtibmx@...> writes:
Thank you. Can you provide a hint as to what .c file(s) I would need to
modify and what types of system calls I should look at? Maybe all I need to do is find the spot where nginx deems it should skip a downed server, and immediately after that add this code:
You should look at the file:
nginx/src/http/ngx_http_upstream_round_robin.c
if (fork() == 0) execl("/bin/sh","/path/to/upstream_down.sh","ID of down upsteam
goes here", NULL);
It's not as easy to do.
Any other considerations I need to worry about?
Also if I make this change might it be adopted and incorporated into the
product? I would not want to have to keep applying my own patch every time I compile a new version of nginx and am happy to contribute my work to this excellent product and project. Thank you.
Well, from my point of view your solution is not good engineering and not in the spirit of Nginx. I understand your need but good supervision and monitoring is what is needed. I don't believe Igor is likely to call fork() to execute a script in response to an event in its code.
As I'm not a completely negative guy ;-) I propose a more general solution to monitor Nginx cleanly and to do whatever your want.
Just need to create a shared memory area named nginx for example and put data as in the /proc filesystem. It's like stub_status module but using shared memory instead of HTTP. In the case of upstream servers status writing on shared memory during a state change (down/up) has no significant cost.
The script/agent will just read the shared memory and act according to data.
The bad thing is that the nagios and collectd plugins will need a rewrite!
I've used this technique on a mission critical application (40 processes, ~ 700 threads) running on an AIX box, it was useful to collect statistics and benchmark data without stressing the system.
So Dear List, what do you think?







