14 messages in ru.sysoev.nginxRe: Feature requestED: monitoring Ngi...
FromSent OnAttachments
François BattailApr 30, 2008 12:29 pm 
Manlio PerilloApr 30, 2008 1:16 pm 
François BattailApr 30, 2008 1:39 pm 
Manlio PerilloMay 1, 2008 1:30 am 
François BattailMay 1, 2008 1:58 am 
Manlio PerilloMay 1, 2008 2:39 am 
François BattailMay 1, 2008 5:42 am 
Rt IbmerMay 1, 2008 9:59 am 
Grzegorz NosekMay 1, 2008 11:35 am 
Manlio PerilloMay 1, 2008 11:57 am 
François BattailMay 1, 2008 1:25 pm 
Manlio PerilloMay 2, 2008 1:52 am 
François BattailMay 2, 2008 6:50 am 
Rt IbmerMay 2, 2008 10:31 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Feature requestED: monitoring Nginx from the outsideActions...
From:Manlio Perillo (manl@public.gmane.org)
Date:Apr 30, 2008 1:16:23 pm
List:ru.sysoev.nginx

François Battail ha scritto:

I've almost finished the module (read: compilation reports no error) and want to take some time to discuss about some potential issues.

Good.

1) Interaction with Nginx

[...]

2) API

The API consist in one call:

void ngx_register_monitoring_value (ngx_str_t * name, ngx_atomic_t * value) ;

This function should be called by an Nginx module during it's initialization to tell the monitoring module that this variable should be added to the pool for watching. That's all. The module just continue to do what it wants with its ngx_atomic_t value, I will do the rest.

I may have some issue because my module has three states: initializing, registering, running so may be the order of modules may be problematic.

When actually happens the running phase? At the end of the HTTP request? At regular intervals?

Note that since you don't know when a variable will be updated, you may miss important changes in the variable.

As an example, in the upstream module if a peer is down, the variable peer.down will be set to 1, but if *all* the peers are down, then all the variables are set to 0, for a fast restart in the successive request.

3) Configuration

[...]

4) Scripts

A script should have read access to where nginx.pid is and will do the following pseudo code:

shm_id = ftok ("path.to.nginx.monitoring") ; mem = attach_to_shared_mem (shm_id) ; values = parse (mem) do_what_you_want_with_values (values)

I can't see any form of synchronization here.

for example: update RRD databases, search for an anormal error count, search for an event unexpected...

It's no more my problem :-)

5) Conclusion

Dear List, tell me what you think and I will release soon this module (under A BSD-like licence of course) for review and comments.

Best regards.