Hello I have the following problem when I try to configure kapacitor with Chronograf and influx db, everything works correctly I can send alerts on Slack or Alerta. For the moment when I stopped Chronograf service which contains the settings property i faced a issue .
In kapacitor i can see in the logs : [kapacitor ***service Alerta / Slack *** is not enabled]
in other words how to tell kapacitor to play the configuration present /etc/kapacitor/kapacitor.conf and not the settings in chronoaf DB.
I have the impression that this one is overloaded in influxdb
For information this the config kapacitor working wih alerta with chronograf
[alerta]
# Configure Alerta.
enabled = true
# The Alerta URL.
url = "http://serverwww3301.ovh.as44099.net:9443/api"
# Default authentication token.
token = "XXXXXXXXXXXXXXO93IEjffv5hOuPNT0C9zyl8du"
# Default token prefix
# If you are on older versions of alerta you may need to change this to "Key"
token-prefix = "Key"
# Default environment.
environment = "production"
# Default origin.
origin = "kapacitor"
is there a way to work kapacitor and influxdb without chronograf service ?
Hello,
You can configure Kapacitor to subsribe to your database in the influxdb configuration in the Kapacitor conf file.
You can set multiple database subscriptions by repeating the whole [[influxdb]] block.
Configure that to use your database,. The enable tasks with Kapacitor:
-
Save your task as a .tick file
-
Copy to a location on your server
-
sudo kapacitor define TaskName -type stream OR batch -tick /Path_To_TickFile -dbrp YourDatabase.RetentionPolicy
-
sudo kapacitor enable TaskName
That should define your task and run it without the need for Chronograf.
you can track whether the tasks are running with
sudo kapacitor list tasks - Shows all defined tasks
kapacitor show task TaskName - Shows a breakdown of the nodes in your script, how many points are processed and if there are any errors
kapacitor watch TaskName - shows the task as it runs, any queries that are processed. I use this to check downsampling and make sure the queries completed successfully
Presonally i only use Chronograf to generate a base template for a script. Once i have that i copy it to an IDE and save it, removing the task from Chronograf afterwards.
Additional, i mentioned defining multiple databases. you don’t need to do this if you have 2 database’s on the same influx instance.
You can define one default database, but in your tick scripts you can specify a different database. you just need to update the -dbrp parameter to use the second database and retention policy.
Hope that helps
@hello Philb
thanks for your reply
I have succesfully enable my task like below:
kapacitor list tasks
ID Type Status Executing Databases and Retention Policies
Application-services-V1 stream enabled true ["sys_metrics"."one_month"]
as a reminder when I configure kapacitor via the chronograf admin interface it works I just don’t want to connect to chronograf to configure my alerts since anyway I go to the command line
but whitout chronograf i have the following issue in logs kapacitor:
the config alerta is above this thread.
kapacitor version Kapacitor OSS 1.6.2 and alerta service : Alerta Release 8.7
ts=2022-01-17T14:32:35.419+01:00 lvl=error msg="failed to send event to Alerta" service=alerta task=Application-services-V1 err="service is not enabled"
I’m out of ideas if you have a lead it will help me a lot
regards
Julien
How to execute the func TestServer_DoServiceTest ?
in Kapacitor CLI ?
kapacitor service-tests alerta
Service Success Message
alerta false service is not enabled