Based on your description it looks like you only want to filter the source 
data, not necessarily trigger alerts from that data. Is that correct? If it 
is I would recommend using the `|where(lambda: "tablespace_used" > 0.6)` 
node instead of the alert node. 

If you do want to track alerts based on the data, then it seems like maybe 
you want to ignore the `OK` recovery alerts it is sending, since those 
alerts will have a value below the threshold. In that case add a 
`.noRecoveries()` to the alert node to instruct it to not send recovery 
events.

For #2 see https://docs.influxdata.com/kapacitor/v1.1/nodes/eval_node/#keep

On Monday, November 14, 2016 at 8:55:47 AM UTC-7, Hallur, Jayanna(CONT) 
wrote:
>
> Hi All
>
>  
>
> I have posted this question here and someone recommended to send the email 
> to this email address.
>
>  
>
> Here is simple code which simple condition. But the Kapacitor is ignoring 
> the condition and write the alert info to file & influxDB everytime 
> irrespective of condition matched or not.
>
>  
>
> Please do the needful.  
>
>  
>
>  
>
> https://github.com/influxdata/docs.influxdata.com/issues/875
>
>  
>
> I have written the TICK script to query the data from InfluxDB, calculate 
> tablespace_used and I want to write back to InfluxDB if the tablespace_used 
> is > 0.6 in this example.
>
> The below TICK is able to query the data and write the data back to 
> InfluxDB successfully.
>
> However, it is writing the entry into Database 
> (Oracle_Intellix_TableSpace_Alerts meansurement) and to 
> /tmp/batch_alerts.log even if the value of tablespace used is less than 
> 0.6. I do see the entries in the DB and also in File /tmp/batch_alerts.log 
> with tablespace_used value as 0.02, 0.5, 0.8, 0.9..etc.
>
>    1. Why the script is writing the entries for the tablespace_used 
>    values less than 0.6???
>    2. How to pass USED_MB, TOTAL_MB and other parameters of 
>    Oracle_Intellix_TableSpace measurement like serverName back into InfluxDB 
>    measurement created for alert (i.e Oracle_Intellix_TableSpace_Alerts)?
>
> var tablespace_errors = batch
> |query('''
> SELECT * FROM "comm_qa"."default"."Oracle_Intellix_TableSpace"
> ''')
> .period(15m)
> .every(10m)
>
> tablespace_errors
> |eval(lambda: "USED_MB" / "TOTAL_MB")
> .as('tablespace_used')
> |alert()
> .crit(lambda: "tablespace_used" > 0.6)
> // Whenever we get an alert write it to a file.
> .log('/tmp/batch_alerts.log')
> |influxDBOut()
> .cluster('emmo_relays')
> .database('comm_qa')
> .measurement('Oracle_Intellix_TableSpace_Alerts')
>
> ====
>
> Kapacitor 1.1
> InfluxDB 1.0
>
> Best Regards
>
> Jayanna
>
> ------------------------------
>
> The information contained in this e-mail is confidential and/or 
> proprietary to Capital One and/or its affiliates and may only be used 
> solely in performance of work or services for Capital One. The information 
> transmitted herewith is intended only for use by the individual or entity 
> to which it is addressed. If the reader of this message is not the intended 
> recipient, you are hereby notified that any review, retransmission, 
> dissemination, distribution, copying or other use of, or taking of any 
> action in reliance upon this information is strictly prohibited. If you 
> have received this communication in error, please contact the sender and 
> delete the material from your computer.
>

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" 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/982db500-374c-4840-88c6-d5724bbd3e66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to