If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

[RESOLVED] Multiple values for ws_arbiter

Hello everyone,

Here is some context for my questions:

I plan to do some passive monitoring with Shinken and Graphite. I have a custom agent on a distant machine and this agents reports in every 20 minutes with data.
I saw the ws_arbiter module and I enabled it. It works as advertised ;D I can receive data on a web service and ultimately send it to the graphing solution (the Graphite broker).
Everything works well, a simple curl command can send a metric value.

Now, I want to receive more data in a single POST request. I looked at the code of the ws_arbiter and I found a way.
The Bottle Web Framework used in the ws_arbiter allows us to recover more data in a single POST.
I created a new version of the ws_arbiter which accepts more than one metric value. (here: http://nopaste.me/paste/328330054515c408d1bdda)
It does work! The new ws_arbiter can fetch more data in a single POST.

However, there is a problem.
The ws_arbiter adds the command in a command queue (with the method app.from_q.put()).
To my great surprise, if I add 3 commands to the queue, only the last one will end up on the Graphite broker.

Here is an example:

I send the values for a metric:
(73% at 07:58, 74% at 07:59, 75% at 08:00)

Re: Multiple values for ws_arbiter

I think the key is in the scheduler in fact. Each &quot;turn&quot; you can only have on result for an element. So the last one is erasing the previous &quot;check&quot; object with the new value. Will be hard to avoid this problem, because it was design like this in the whole scheduler. We can try to print on the scheduler if it&#039;s what happened really.

No direct support by personal message. Please open a thread so everyone can see the solution

Re: Multiple values for ws_arbiter

With the new ws_arbiter module I wrote, I can send more than one value to the webservice and the values are sent to Graphite. I tested 2 hosts with 2 services by host. Everything worked OK.

Problems only occur when I send the same metric (Host/Service) with multiple values. I can&#039;t send the following data properly:
Host1/Service1/Value1/Timestamp1, Host1/Service1/Value2/Timestamp2
I can&#039;t buffer metrics for a few minutes and then send the metrics in bulk. The scheduler seems to filter out &quot;old&quot; results. This behavior is built into shinken itself.

I will mark this post as [RESOLVED] and open a &quot;suggestion thread&quot; on github.