Feature request: Run a script when upstream detected down/up

François Battail fb at francois.battail.name
Wed Apr 30 10:20:42 MSD 2008


Aleksandar Lazic <al-nginx at ...> writes:

> I think for this the embedded script language
> (perl/neko/lua/python/your_preferd_lang will be very helpfull 

I'm not too sure. If for writing *some bytes* on memory we need to instantiate
an interpretor or a VM and after writing these bytes running a garbage
collector, there's something wrong. 

> Brainstorming:
> 
> 1.) add hook into upstream module, maybe some other modules also 
> 2.) use this hook in $EMBEDDED_SCRIPT (current only perl) to write into
>      $OUTPUT_THING (file/shm/...) 
> 3.) use external program which monitor the $OUTPUT_THING
> 
> The benefit to use a embedded script language is that the user can write
> some infos into the output string and some predefined variables from
> nginx.

Yes, but it is not the idea. It's about monitoring indicators like:

counters on connections state (same as sub_status module)
upstream servers statuses
error counters (like out of fd...)
min max avg on resource allocation
...

That way it will be possible to have useful information for tuning or monitoring
servers running Nginx in an efficient way. It's not designed to 
help debugging an application.

Best regards.






More information about the nginx mailing list