[influxdb] Re: kapacitor: error while evaluating WHERE expression: no field or tag exists for tcp_inerrs

2016-06-15 Thread nathaniel
Do you get the error for all points or just some of them? If its just some 
of them that could explain it. While the field key may exist in the data 
set its still possible that a single points doesn't have the field.

In this case you can use the default node to set the field if its missing, 
thus avoiding the error in the log.

stream
 |from()
 .measurement('net')
 |default()
 .field('tcp_inerrors', 0)
 |where(lambda: "tcp_inerrors" > 0)


Looks like you are using Telegraf. We should probably look into why points 
can arrive without the field. 

On Wednesday, June 15, 2016 at 5:21:46 PM UTC-6, Moti Levy wrote:
>
> I can't seem to get Kapacitor to work with specific fields for some reason.
>
> Example tick : 
>
>>
>> ID: global-net_tcp_inerrs
>> Error:
>> Type: stream
>> Status: enabled
>> Executing: true
>> Created: 15 Jun 16 21:22 UTC
>> Modified: 15 Jun 16 23:17 UTC
>> LastEnabled: 15 Jun 16 23:17 UTC
>> Databases Retention Policies: ["telegraf"."default"]
>> TICKscript:
>> stream
>> |from()
>> .measurement('net')
>> .where(lambda: "tcp_inerrs" > 0)
>>
>> DOT:
>> digraph global-net_tcp_inerrs {
>> graph [throughput="0.00 points/s"];
>> stream0 [avg_exec_time_ns="0" ];
>> stream0 -> from1 [processed="566"];
>> from1 [avg_exec_time_ns="56.09µs" ];
>> }
>
>
> results in : 
>
> error while evaluating WHERE expression: no field or tag exists for 
>> tcp_inerrs
>
>
> Yet the field is there :( 
>
> > show field keys from net
>> name: net
>> -
>> fieldKey
>> bytes_recv
>> bytes_sent
>> drop_in
>> drop_out
>> err_in
>> err_out
>> icmp_inaddrmaskreps
>> icmp_inaddrmasks
>> icmp_incsumerrors
>> icmp_indestunreachs
>> icmp_inechoreps
>> icmp_inechos
>> icmp_inerrors
>> icmp_inmsgs
>> icmp_inparmprobs
>> icmp_inredirects
>> icmp_insrcquenchs
>> icmp_intimeexcds
>> icmp_intimestampreps
>> icmp_intimestamps
>> icmp_outaddrmaskreps
>> icmp_outaddrmasks
>> icmp_outdestunreachs
>> icmp_outechoreps
>> icmp_outechos
>> icmp_outerrors
>> icmp_outmsgs
>> icmp_outparmprobs
>> icmp_outredirects
>> icmp_outsrcquenchs
>> icmp_outtimeexcds
>> icmp_outtimestampreps
>> icmp_outtimestamps
>> icmpmsg_intype0
>> icmpmsg_intype11
>> icmpmsg_intype3
>> icmpmsg_intype8
>> icmpmsg_outtype0
>> icmpmsg_outtype3
>> icmpmsg_outtype5
>> icmpmsg_outtype8
>> ip_defaultttl
>> ip_forwarding
>> ip_forwdatagrams
>> ip_fragcreates
>> ip_fragfails
>> ip_fragoks
>> ip_inaddrerrors
>> ip_indelivers
>> ip_indiscards
>> ip_inhdrerrors
>> ip_inreceives
>> ip_inunknownprotos
>> ip_outdiscards
>> ip_outnoroutes
>> ip_outrequests
>> ip_reasmfails
>> ip_reasmoks
>> ip_reasmreqds
>> ip_reasmtimeout
>> packets_recv
>> packets_sent
>> tcp_activeopens
>> tcp_attemptfails
>> tcp_currestab
>> tcp_estabresets
>> tcp_incsumerrors
>> tcp_inerrs
>> tcp_insegs
>> tcp_maxconn
>> tcp_outrsts
>> tcp_outsegs
>> tcp_passiveopens
>> tcp_retranssegs
>> tcp_rtoalgorithm
>> tcp_rtomax
>> tcp_rtomin
>> udp_ignoredmulti
>> udp_incsumerrors
>> udp_indatagrams
>> udp_inerrors
>> udp_noports
>> udp_outdatagrams
>> udp_rcvbuferrors
>> udp_sndbuferrors
>> udplite_ignoredmulti
>> udplite_incsumerrors
>> udplite_indatagrams
>> udplite_inerrors
>> udplite_noports
>> udplite_outdatagrams
>> udplite_rcvbuferrors
>> udplite_sndbuferrors
>
>
> Anything I am missing ? 
>
> Moti 
>
>
>  
>

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/7ac7706e-fae5-4f8b-944d-dd88c7dd7403%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] Re: Several doubts about AlertNodes and tickscript in kapacitor

2016-06-15 Thread nathaniel
Carlos,

What you have looks good.

You are correct that to get different behaviors you need to use two 
different alert nodes. 

Here is a example of what I think you want to do:

var warn = lambda: "usage_idle" < 40
var crit = lambda: "usage_idle" < 20

var stats = stream
|from()
.database('monitoring')
.measurement('cpu')
.where (lambda: "cpu" == 'cpu-total')
// To filter on prod vs non-prod you need a tag that 
identifies prod, I'll use the tag `env` as an example
   .groupBy ('project','roles','stage', 'env')

// influxdb/slack alerts
stats
|alert()
  .id('')
  .warn(warn)
  .crit(crit)
  .slack()
|influxDBOut()
  .database('alerts')
  .retentionPolicy('default')
  .measurement('errors')
  // some tags

// Crit alerts
stats
// Filter by prod events only
|where(lambda: "env" == 'production')
|alert()
  .id('')
  .warn(warn)
  .crit(crit)
  .stateChanges()
  .email()


That should send all events to InfluxDB and slack, while only sending state 
changes for prod CRITICAL/OK alerts via email.
Hope that helps. Let me know if you have more questions.

On Wednesday, June 15, 2016 at 10:01:45 AM UTC-6, Carlos Peñas wrote:
>
> We are tiying to define an alert flow based on measurements taken by 
> telegraf and stored in influx. 
>
> Started with the basic: 
>
> var stats = stream
> | from()
> .database('monitoring')
> .measurement('cpu')
> .where (lambda: "cpu" == 'cpu-total')
> | groupBy ('project','roles','stage')
> | alert()...
>
>
> This will alert for all hosts that are gathering metrics... is there a way 
> to "refine" the filter stream in the alert node and apply different 
> thresholds or must I define different streams?
>
> We need also
>
>  * register any evaluated state in influx or log
>  * send to slack any state change
>  * send to mail any CRITICAL / OK state change from any alerts  tagged 
> "production"
>
> For the first two tried to do something like 
>
>
>   ...  | alert()
> .id('')
> .warn(lambda: "usage_idle" < 40)
>
>
> stats | influxDBOut()
> .database('alerts')
> .retentionPolicy('default')
> .measurement('errors')
> // some tags
>
>
> stats.slack()
>
> .channel('#kapacitor')
> .stateChangesOnly(30m)
> .message('{{ .ID }} is {{ .Level}} ({{ index .Fields 
> "usage_idle"}})
> 
>
>
> It's valid but only state changes get pumped in influxdb, and I expected 
> to have any "OK" evaluatuon there. Must I define two separate | alert nodes 
> to have disctint behaviour?
>
> Whe also tried to add 
>
> stats.crit(lambda: "usage_idle" < 20)
> .email()
>
>
> (whe have no idea how to filter "production ones" there) but also we get 
> the same result ¿This will be another | alert node perhaps with its own | 
> from node? 
>
> Thanks!. I'm just starting with tickscript (two days so far)
>
>

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/1df265a8-d0a0-4b92-a103-aa7aadbbcd4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [influxdb] InfluxDBClientError: 400 in InfluxDB v0.13

2016-06-15 Thread Melissa Flores
data = client.query("SELECT * FROM bmspoint WHERE time > now() - 10m AND
"name" = 'B10_Area3for2_E_MtrEl17_PwrActv'")

Output:

File "", line 1
data = client.query("SELECT * FROM bmspoint WHERE time > now() - 10m AND
"name" = 'B10_Area3for2_E_MtrEl17_PwrActv'")
^ SyntaxError: invalid syntax


On Wed, Jun 15, 2016 at 8:39 PM, Ross McDonald  wrote:

> Can you paste the full query and error output? It sounds like there might
> be something else off with the query syntax.
>
> Thanks,
> Ross
>
> On Tue, Jun 14, 2016 at 8:45 PM, Melissa Flores 
> wrote:
>
>> When I attempted to use double quotes around 'name' , I received
>> "SyntaxError: invalid syntax"
>>
>> On Tue, Jun 14, 2016 at 10:02 PM, Ross McDonald 
>> wrote:
>>
>>> The word "name" is a keyword within InfluxQL, so you have to wrap it in
>>> double-quotes. Do you get the same error if you update the query to the
>>> following (wrapping 'name' in double-quotes)?
>>>
>>> > SELECT * FROM bmspoint WHERE time > now() - 10m AND "name" =
>>> 'B10_Area3for2_E_MtrEl6_PwrActv'
>>>
>>> You can find more information on proper quoting in the InfluxDB
>>> documentation FEI here
>>> 
>>> .
>>>
>>> Thanks,
>>> Ross
>>>
>>> On Mon, Jun 13, 2016 at 10:01 PM,  wrote:
>>>
 I'm trying to collect data from a particular sensor, so I used the
 following code to retrieve the data.

 data = client.query("SELECT * FROM bmspoint WHERE time > now() - 10m
 AND name = 'B10_Area3for2_E_MtrEl6_PwrActv'")


 Although data does exist for this sensor in this particular time frame,
 I receive the following error.

 InfluxDBClientError   Traceback (most recent call
 last)
  in ()
   4 if n.find(request) != -1:
   5 print ("True")
 > 6 data2 = client.query("SELECT * FROM bmspoint WHERE time
 > now() - 10m AND name = 'B10_Area3for2_E_MtrEl6_PwrActv'")
   7 print data2
   8 else:

 /Users/3for2/anaconda/lib/python2.7/site-packages/influxdb/_dataframe_client.pyc
 in query(self, query, chunked, database)
  77
  78 """
 ---> 79 results = super(DataFrameClient, self).query(query,
 database=database)
  80 if query.upper().startswith("SELECT"):
  81 if len(results) > 0:

 /Users/3for2/anaconda/lib/python2.7/site-packages/influxdb/client.pyc
 in query(self, query, params, epoch, expected_response_code, database,
 raise_errors)
 323 params=params,
 324 data=None,
 --> 325 expected_response_code=expected_response_code
 326 )
 327

 /Users/3for2/anaconda/lib/python2.7/site-packages/influxdb/client.pyc
 in request(self, url, method, params, data, expected_response_code, 
 headers)
 246 return response
 247 else:
 --> 248 raise InfluxDBClientError(response.content,
 response.status_code)
 249
 250 def write(self, data, params=None,
 expected_response_code=204):

 InfluxDBClientError: 400: {"error":"error parsing query: found NAME,
 expected identifier, string, number, bool at line 1, char 53"}


 I did not receive this error when I used other tags. Any advice?

 Thanks!

 --
 Remember to include the InfluxDB version number with all issue reports
 ---
 You received this message because you are subscribed to the Google
 Groups "InfluxDB" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to influxdb+unsubscr...@googlegroups.com.
 To post to this group, send email to influxdb@googlegroups.com.
 Visit this group at https://groups.google.com/group/influxdb.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/influxdb/b93de22f-af40-48df-804d-3c570bb01803%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> --
>>> Remember to include the InfluxDB version number with all issue reports
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "InfluxDB" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/influxdb/1xO89WxckRs/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> influxdb+unsubscr...@googlegroups.com.
>>> To post to this group, send email to influxdb@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/influxdb.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/influxdb/CAD8sRLD46J39p0jcYYv%3DmSWcRGqWpKqa7H0TuP_twpFn%2BAq-MA%40mail.gmail.com
>>> 

[influxdb] Re: [1.0.0-beta1] Compaction frequency after 24 hours

2016-06-15 Thread Paul Dix
With 1M unique series you may need to move to SSDs. Can you test that out 
and let us know how it looks?
>
>

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/8551cf9b-6263-47db-89e3-687a6dc0234d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] Re: writing annotations to InfluxDB

2016-06-15 Thread Timothy Appnel
I was rushing and made a couple of mistake in my last message. I'm running 
v0.13.0 and this is the correct link to my test code: 

https://gist.github.com/tima/d709da1f88f7e29e0536311f4d9835c2

On Wednesday, June 15, 2016 at 5:08:09 PM UTC-4, Timothy Appnel wrote:
>
> What is the proper way to write an annotation like that start of a new 
> application deploy to InfluxDB?
>
> I'm trying to write a python script that writes one, but I'm having 
> difficulties figuring out where I'm going wrong. The docs and sample code 
> I've found isn't working out for me. I'm not seeing any errors, I see the 
> measurement and one set of the tags (nothing that indicates each event) 
> thru the GUI. Grafana shows nothing ever. 
>
> The code examples I've found are several months old or more, with all the 
> breaking changes to the API that have happened in the past I was wondering 
> if that is where things are going wrong for me. I'm not convinced. I'm 
> pretty sure that it's me doing something dumb, but I'm stuck figuring out 
> what that is my on my own.
>
> https://gist.github.com/anonymous/dccdd51f91918e5907ce42e5fe4af357
>
> I'm using the latest stable version (v13.1) in my tests.
>
> Thanks.
>
>
>

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/abe24cf8-e05f-4823-9283-a3ff3fa1b1fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] kapacitor: error while evaluating WHERE expression: no field or tag exists for tcp_inerrs

2016-06-15 Thread Moti Levy
I can't seem to get Kapacitor to work with specific fields for some reason.

Example tick : 

>
> ID: global-net_tcp_inerrs
> Error:
> Type: stream
> Status: enabled
> Executing: true
> Created: 15 Jun 16 21:22 UTC
> Modified: 15 Jun 16 23:17 UTC
> LastEnabled: 15 Jun 16 23:17 UTC
> Databases Retention Policies: ["telegraf"."default"]
> TICKscript:
> stream
> |from()
> .measurement('net')
> .where(lambda: "tcp_inerrs" > 0)
>
> DOT:
> digraph global-net_tcp_inerrs {
> graph [throughput="0.00 points/s"];
> stream0 [avg_exec_time_ns="0" ];
> stream0 -> from1 [processed="566"];
> from1 [avg_exec_time_ns="56.09µs" ];
> }


results in : 

error while evaluating WHERE expression: no field or tag exists for 
> tcp_inerrs


Yet the field is there :( 

> show field keys from net
> name: net
> -
> fieldKey
> bytes_recv
> bytes_sent
> drop_in
> drop_out
> err_in
> err_out
> icmp_inaddrmaskreps
> icmp_inaddrmasks
> icmp_incsumerrors
> icmp_indestunreachs
> icmp_inechoreps
> icmp_inechos
> icmp_inerrors
> icmp_inmsgs
> icmp_inparmprobs
> icmp_inredirects
> icmp_insrcquenchs
> icmp_intimeexcds
> icmp_intimestampreps
> icmp_intimestamps
> icmp_outaddrmaskreps
> icmp_outaddrmasks
> icmp_outdestunreachs
> icmp_outechoreps
> icmp_outechos
> icmp_outerrors
> icmp_outmsgs
> icmp_outparmprobs
> icmp_outredirects
> icmp_outsrcquenchs
> icmp_outtimeexcds
> icmp_outtimestampreps
> icmp_outtimestamps
> icmpmsg_intype0
> icmpmsg_intype11
> icmpmsg_intype3
> icmpmsg_intype8
> icmpmsg_outtype0
> icmpmsg_outtype3
> icmpmsg_outtype5
> icmpmsg_outtype8
> ip_defaultttl
> ip_forwarding
> ip_forwdatagrams
> ip_fragcreates
> ip_fragfails
> ip_fragoks
> ip_inaddrerrors
> ip_indelivers
> ip_indiscards
> ip_inhdrerrors
> ip_inreceives
> ip_inunknownprotos
> ip_outdiscards
> ip_outnoroutes
> ip_outrequests
> ip_reasmfails
> ip_reasmoks
> ip_reasmreqds
> ip_reasmtimeout
> packets_recv
> packets_sent
> tcp_activeopens
> tcp_attemptfails
> tcp_currestab
> tcp_estabresets
> tcp_incsumerrors
> tcp_inerrs
> tcp_insegs
> tcp_maxconn
> tcp_outrsts
> tcp_outsegs
> tcp_passiveopens
> tcp_retranssegs
> tcp_rtoalgorithm
> tcp_rtomax
> tcp_rtomin
> udp_ignoredmulti
> udp_incsumerrors
> udp_indatagrams
> udp_inerrors
> udp_noports
> udp_outdatagrams
> udp_rcvbuferrors
> udp_sndbuferrors
> udplite_ignoredmulti
> udplite_incsumerrors
> udplite_indatagrams
> udplite_inerrors
> udplite_noports
> udplite_outdatagrams
> udplite_rcvbuferrors
> udplite_sndbuferrors


Anything I am missing ? 

Moti 


 

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/6da2ef3a-ea43-4e70-a510-943671b323b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] writing annotations to InfluxDB

2016-06-15 Thread Timothy Appnel
What is the proper way to write an annotation like that start of a new 
application deploy to InfluxDB?

I'm trying to write a python script that writes one, but I'm having 
difficulties figuring out where I'm going wrong. The docs and sample code 
I've found isn't working out for me. I'm not seeing any errors, I see the 
measurement and one set of the tags (nothing that indicates each event) 
thru the GUI. Grafana shows nothing ever. 

The code examples I've found are several months old or more, with all the 
breaking changes to the API that have happened in the past I was wondering 
if that is where things are going wrong for me. I'm not convinced. I'm 
pretty sure that it's me doing something dumb, but I'm stuck figuring out 
what that is my on my own.

https://gist.github.com/anonymous/dccdd51f91918e5907ce42e5fe4af357

I'm using the latest stable version (v13.1) in my tests.

Thanks.


-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/534b8563-37ea-4fce-b6de-22441e295c2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] Re: How to query using "SHOW TAG VALUES WITH KEY" instead of SELECT ?

2016-06-15 Thread Quick Query
Please let me know if this is possible using InfluxDB ?

Cheers!


On Wednesday, June 15, 2016 at 10:27:30 AM UTC-7, Quick Query wrote:
>
> Hi Everyone,
>
> I can get the docker container ID list using the following query:
> SELECT container_id from docker_container_net where host='' 
>
> timecontainer_id
> 2016-06-15T17:14:41Z ""
>
>
> But, can I do this using a "SHOW TAG VALUES WITH KEY ..." query instead?
>
> Appreciate any pointers/help.
>
> Cheers!
>
>

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/3e71dc01-f769-42cb-b12e-a1ec14f91c45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] How to query using "SHOW TAG VALUES WITH KEY" instead of SELECT ?

2016-06-15 Thread Quick Query
Hi Everyone,

I can get the docker container ID list using the following query:
SELECT container_id from docker_container_net where host='' 

timecontainer_id
2016-06-15T17:14:41Z ""


But, can I do this using a "SHOW TAG VALUES WITH KEY ..." query instead?

Appreciate any pointers/help.

Cheers!

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/d895a493-72ce-4d5e-a4c2-c2f9e8772a73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] Several doubts about AlertNodes and tickscript in kapacitor

2016-06-15 Thread Carlos Peñas
We are tiying to define an alert flow based on measurements taken by 
telegraf and stored in influx. 

Started with the basic: 

var stats = stream
| from()
.database('monitoring')
.measurement('cpu')
.where (lambda: "cpu" == 'cpu-total')
| groupBy ('project','roles','stage')
| alert()...


This will alert for all hosts that are gathering metrics... is there a way 
to "refine" the filter stream in the alert node and apply different 
thresholds or must I define different streams?

We need also

 * register any evaluated state in influx or log
 * send to slack any state change
 * send to mail any CRITICAL / OK state change from any alerts  tagged 
"production"

For the first two tried to do something like 


  ...  | alert()
.id('')
.warn(lambda: "usage_idle" < 40)


stats | influxDBOut()
.database('alerts')
.retentionPolicy('default')
.measurement('errors')
// some tags


stats.slack()

.channel('#kapacitor')
.stateChangesOnly(30m)
.message('{{ .ID }} is {{ .Level}} ({{ index .Fields "usage_idle"}})



It's valid but only state changes get pumped in influxdb, and I expected to 
have any "OK" evaluatuon there. Must I define two separate | alert nodes to 
have disctint behaviour?

Whe also tried to add 

stats.crit(lambda: "usage_idle" < 20)
.email()


(whe have no idea how to filter "production ones" there) but also we get 
the same result ¿This will be another | alert node perhaps with its own | 
from node? 

Thanks!. I'm just starting with tickscript (two days so far)

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/36ae5d12-488f-4132-adcd-bb0ab6dfe5ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] Re: Deadman problem - ignores new points

2016-06-15 Thread elad . talby
For reference - 
Here's the *DERIVATIVE* example I've configured, but still sending alerts 
for existing/new points:
-
stream 
   |from() 
   .measurement('delaware:last_completed') 
   .where(lambda: "name" == 'exchange_hourly') 
   |stats(1m) 
   |derivative('emitted') 
   .unit(1m) 
   .nonNegative() 
   |alert() 
   .id('{{ .TaskName }}') 
   .message('service is dead') 
   .crit(lambda: "emitted" < 1.0) 
   .log() 
   .slack() 
   .channel('#alerts')
-
(Also tried to implement this derivative within a batch script. same 
behavior)

Please advise, as many of our services depends on this feature :/
thanks a lot.

On Wednesday, June 15, 2016 at 5:42:54 PM UTC+3, elad@adk2.com wrote:
>
> Hello,
>
> We're trying to setup a *deadman* check for two measurements, 
> but after long hours and QA to this function - I cannot get rid of the 
> false-positives it sends.
>
> Could you please take a look at this TICK and let me know what am I doing 
> wrong?
> Here's the TICK file:
>
> stream 
>|from() 
>   .measurement('last_completed') 
>   .where(lambda: "name" == 'data') 
> //|eval(lambda: "value").as('value') 
>|deadman(1.0, 1m) 
>   .message('Service:{{ index .Tags "name"}} is {{ if eq .Level "OK" 
> }}alive{{ else }}dead - not running for 1m {{ end }}') 
>   .log() 
>   .slack() 
>   .channel('#alerts')
>
>
> And here's an example data set:
>
>
> 2016-06-15T14:05:47.769283954Z "data" 1
> 2016-06-15T14:05:56.17229738Z "data" 1
> 2016-06-15T14:06:04.216883312Z "data" 3
> 2016-06-15T14:06:12.028630147Z "data" 2
> 2016-06-15T14:06:20.21923461Z "data" 2
> 2016-06-15T14:06:28.37728243Z "data" 0
> 2016-06-15T14:06:36.239360137Z "data" 1
> Although there are new points every 8 seconds approx, deadman is alerting 
> every minute.
> I've tried all kind of times & limits.. (checks for every minute, hour, 
> two hours).
>
> What could be the reason for this?
>
> Important -- 
> I've also tried to convert the above STREAM tick to a BATCH and the 
> behavior was the same.
> Also tried to use the DERIVATIVE instead of the deadman - and it still 
> ignores the new points and alerting :(
>
>
> Influx 0.13.0
> Kapacitor 1.0.0-beta
> (the above was tried on both 0.13.1 and the new beta)
>
> THANKS!
> Elad
>

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/af6962fd-7da1-47f4-8162-30ef9ebd1b09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] Deadman problem - ignores new points

2016-06-15 Thread elad . talby
Hello,

We're trying to setup a *deadman* check for two measurements, 
but after long hours and QA to this function - I cannot get rid of the 
false-positives it sends.

Could you please take a look at this TICK and let me know what am I doing 
wrong?
Here's the TICK file:

stream 
   |from() 
  .measurement('last_completed') 
  .where(lambda: "name" == 'data') 
//|eval(lambda: "value").as('value') 
   |deadman(1.0, 1m) 
  .message('Service:{{ index .Tags "name"}} is {{ if eq .Level "OK" 
}}alive{{ else }}dead - not running for 1m {{ end }}') 
  .log() 
  .slack() 
  .channel('#alerts')


And here's an example data set:


2016-06-15T14:05:47.769283954Z "data" 1
2016-06-15T14:05:56.17229738Z "data" 1
2016-06-15T14:06:04.216883312Z "data" 3
2016-06-15T14:06:12.028630147Z "data" 2
2016-06-15T14:06:20.21923461Z "data" 2
2016-06-15T14:06:28.37728243Z "data" 0
2016-06-15T14:06:36.239360137Z "data" 1
Although there are new points every 8 seconds approx, deadman is alerting 
every minute.
I've tried all kind of times & limits.. (checks for every minute, hour, two 
hours).

What could be the reason for this?

Important -- 
I've also tried to convert the above STREAM tick to a BATCH and the 
behavior was the same.
Also tried to use the DERIVATIVE instead of the deadman - and it still 
ignores the new points and alerting :(


Influx 0.13.0
Kapacitor 1.0.0-beta
(the above was tried on both 0.13.1 and the new beta)

THANKS!
Elad

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/c44c7ac2-75ea-4a0e-b7c0-70c8a0f7d686%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[influxdb] [1.0.0-beta1] Compaction frequency after 24 hours

2016-06-15 Thread karl . jeacle
How often should compaction run after 24 hours and how long should it take?

We are running 1.0.0-beta1 with just over 1 million series. Server has 16 cores 
and 32GB of RAM. Writing less than 5000 points per second.

For the first 24 hours, query response time is less than a second. Level 1/2 
compaction takes place every 20 minutes and completes in seconds. Everything is 
fast.

Then, after the 24 hours configured in "compact-full-write-cold-duration", full 
compaction kicks in and runs continuously and performance takes a noticeable 
hit. Queries can take several seconds to complete.

The compaction appears to be ongoing after 24 hours - running every minute for 
more than a minute and constantly writing at approx 100MB/s to disk (RAID array 
not SSD).

Is this normal?

If so, are there config parameters that can be tweaked? or will a move to SSDs 
resolve the problem?

Here's an example where the influx process was restarted at about 11:20am on 
2016/06/14 - after 24 hours, you can see in the log file the switch from 
infrequent level 1/2 to ongoing full compaction before and after 11:20am.

% grep "files into" influxdb.log
[tsm1] 2016/06/15 09:10:24 compacted level 1 group 0 of 2 files into 1 files in 
12.953107399s
[tsm1] 2016/06/15 09:10:44 compacted level 2 group 0 of 2 files into 1 files in 
20.321327593s
[tsm1] 2016/06/15 09:28:29 compacted level 1 group 0 of 2 files into 1 files in 
14.123922529s
[tsm1] 2016/06/15 09:47:39 compacted level 1 group 0 of 2 files into 1 files in 
13.128642782s
[tsm1] 2016/06/15 09:47:57 compacted level 2 group 0 of 2 files into 1 files in 
17.759666145s
[tsm1] 2016/06/15 10:06:34 compacted level 1 group 0 of 2 files into 1 files in 
11.840285989s
[tsm1] 2016/06/15 10:26:02 compacted level 1 group 0 of 2 files into 1 files in 
12.742921103s
[tsm1] 2016/06/15 10:26:21 compacted level 2 group 0 of 2 files into 1 files in 
18.407723192s
[tsm1] 2016/06/15 10:43:52 compacted level 1 group 0 of 2 files into 1 files in 
11.848901735s
[tsm1] 2016/06/15 11:03:10 compacted level 1 group 0 of 2 files into 1 files in 
13.017833455s
[tsm1] 2016/06/15 11:03:28 compacted level 2 group 0 of 2 files into 1 files in 
18.295207874s
[tsm1] 2016/06/15 11:05:06 compacted level 3 group 0 of 4 files into 1 files in 
1m36.54105056s
[tsm1] 2016/06/15 11:06:19 compacted full 2 files into 1 files in 
1m13.027526301s
[tsm1] 2016/06/15 11:22:07 compacted level 1 group 0 of 2 files into 1 files in 
12.6243752s
[tsm1] 2016/06/15 11:30:51 compacted full 2 files into 1 files in 479.64141ms
[tsm1] 2016/06/15 11:32:42 compacted full 2 files into 2 files in 
1m52.257509758s
[tsm1] 2016/06/15 11:32:55 compacted full 2 files into 2 files in 2m4.496843095s
[tsm1] 2016/06/15 11:33:53 compacted full 2 files into 2 files in 1m9.375094851s
[tsm1] 2016/06/15 11:34:00 compacted full 2 files into 2 files in 1m3.399309336s
[tsm1] 2016/06/15 11:34:56 compacted full 2 files into 2 files in 1m2.215633678s
[tsm1] 2016/06/15 11:35:08 compacted full 2 files into 2 files in 1m7.2966692s
[tsm1] 2016/06/15 11:36:00 compacted full 2 files into 2 files in 1m2.651181158s
[tsm1] 2016/06/15 11:36:15 compacted full 2 files into 2 files in 1m6.527896164s
[tsm1] 2016/06/15 11:37:05 compacted full 2 files into 2 files in 1m4.387296019s
[tsm1] 2016/06/15 11:37:31 compacted full 2 files into 2 files in 
1m14.593487299s

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/5662f7cc-7514-4105-b175-eb110da6dc74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [influxdb] InfluxDBClientError: 400 in InfluxDB v0.13

2016-06-15 Thread Ross McDonald
Can you paste the full query and error output? It sounds like there might
be something else off with the query syntax.

Thanks,
Ross

On Tue, Jun 14, 2016 at 8:45 PM, Melissa Flores  wrote:

> When I attempted to use double quotes around 'name' , I received
> "SyntaxError: invalid syntax"
>
> On Tue, Jun 14, 2016 at 10:02 PM, Ross McDonald  wrote:
>
>> The word "name" is a keyword within InfluxQL, so you have to wrap it in
>> double-quotes. Do you get the same error if you update the query to the
>> following (wrapping 'name' in double-quotes)?
>>
>> > SELECT * FROM bmspoint WHERE time > now() - 10m AND "name" =
>> 'B10_Area3for2_E_MtrEl6_PwrActv'
>>
>> You can find more information on proper quoting in the InfluxDB
>> documentation FEI here
>> 
>> .
>>
>> Thanks,
>> Ross
>>
>> On Mon, Jun 13, 2016 at 10:01 PM,  wrote:
>>
>>> I'm trying to collect data from a particular sensor, so I used the
>>> following code to retrieve the data.
>>>
>>> data = client.query("SELECT * FROM bmspoint WHERE time > now() - 10m AND
>>> name = 'B10_Area3for2_E_MtrEl6_PwrActv'")
>>>
>>>
>>> Although data does exist for this sensor in this particular time frame,
>>> I receive the following error.
>>>
>>> InfluxDBClientError   Traceback (most recent call
>>> last)
>>>  in ()
>>>   4 if n.find(request) != -1:
>>>   5 print ("True")
>>> > 6 data2 = client.query("SELECT * FROM bmspoint WHERE time
>>> > now() - 10m AND name = 'B10_Area3for2_E_MtrEl6_PwrActv'")
>>>   7 print data2
>>>   8 else:
>>>
>>> /Users/3for2/anaconda/lib/python2.7/site-packages/influxdb/_dataframe_client.pyc
>>> in query(self, query, chunked, database)
>>>  77
>>>  78 """
>>> ---> 79 results = super(DataFrameClient, self).query(query,
>>> database=database)
>>>  80 if query.upper().startswith("SELECT"):
>>>  81 if len(results) > 0:
>>>
>>> /Users/3for2/anaconda/lib/python2.7/site-packages/influxdb/client.pyc in
>>> query(self, query, params, epoch, expected_response_code, database,
>>> raise_errors)
>>> 323 params=params,
>>> 324 data=None,
>>> --> 325 expected_response_code=expected_response_code
>>> 326 )
>>> 327
>>>
>>> /Users/3for2/anaconda/lib/python2.7/site-packages/influxdb/client.pyc in
>>> request(self, url, method, params, data, expected_response_code, headers)
>>> 246 return response
>>> 247 else:
>>> --> 248 raise InfluxDBClientError(response.content,
>>> response.status_code)
>>> 249
>>> 250 def write(self, data, params=None,
>>> expected_response_code=204):
>>>
>>> InfluxDBClientError: 400: {"error":"error parsing query: found NAME,
>>> expected identifier, string, number, bool at line 1, char 53"}
>>>
>>>
>>> I did not receive this error when I used other tags. Any advice?
>>>
>>> Thanks!
>>>
>>> --
>>> Remember to include the InfluxDB version number with all issue reports
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "InfluxDB" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to influxdb+unsubscr...@googlegroups.com.
>>> To post to this group, send email to influxdb@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/influxdb.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/influxdb/b93de22f-af40-48df-804d-3c570bb01803%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> Remember to include the InfluxDB version number with all issue reports
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "InfluxDB" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/influxdb/1xO89WxckRs/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> influxdb+unsubscr...@googlegroups.com.
>> To post to this group, send email to influxdb@googlegroups.com.
>> Visit this group at https://groups.google.com/group/influxdb.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/influxdb/CAD8sRLD46J39p0jcYYv%3DmSWcRGqWpKqa7H0TuP_twpFn%2BAq-MA%40mail.gmail.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Melissa Flores
> The University of Texas at Austin
> Cockrell School of Engineering | Architectural Engineering
> Senate of College Councils | Co-Chair, Undergraduate Research Committee
>
> --
> Remember to include the InfluxDB version number with all issue reports
> ---
> You received th

Re: [influxdb] Nanoseconds to Human readable Time Format

2016-06-15 Thread Ross McDonald
When you are in the `influx` CLI, you can switch the display to
human-readable timestamps by issuing the command:

```
> precision rfc3339
```

Or you can set it before logging into the instance by adding the parameter
`-precision rfc3339` to the CLI option, for example:

```
influx -precision rfc3339
```

Thanks,
Ross

On Tue, Jun 14, 2016 at 11:50 PM, sangkook Noh  wrote:

>
> My Fluxdb Query Result is bellow
> time column formant is nanoseconds
> So I want change the time formant to human readable like next
> How can I change
>
> [root@DBAnode01GH ~]# influx
> > use test
> Using database test
> > select * from cpu;
> name: cpu
> -
> timehostregion  value
> 1465799105917130413 serverA us_west 0.64
>
>
>
> I hopoe
> > select * from cpu;
> name: cpu
> -
> timehostregion  value
> 2016-10-01 12:00:00 serverA us_west 0.64
>
> --
> Remember to include the InfluxDB version number with all issue reports
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to influxdb+unsubscr...@googlegroups.com.
> To post to this group, send email to influxdb@googlegroups.com.
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/influxdb/d6a56784-b636-422e-b5ca-3ddb199e1e91%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CAD8sRLC%3DaiLUpRq1LjahKqqsvuMaiadCAw6g0vMJ4ODu6Dzq9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.