by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 18 2016 15:33
    @satterly banned @sandeepl337
Lars Van Casteren
@cukal
I guess that's what I need
annu9103
@annu9103
hi ....could you please suggest me the curl command for last 10 min alert available in alert dashboard like $ curl http://localhost:8080/alerts?lastReceiveTime <= to-date (now) \
-H 'Authorization: Key demo-key' (i want alarm that are generated in last 10 min )
annu9103
@annu9103
@satterly.... hi ....could you please suggest me the curl command for last 10 min alert available in alert dashboard like $ curl http://localhost:8080/alerts?lastReceiveTime <= to-date (now) \
-H 'Authorization: Key demo-key' (i want alarm that are generated in last 10 min )
annu9103
@annu9103
@sandeepl337 could you please suggest me the curl command for last 10 min alert available in alert dashboard like $ curl http://localhost:8080/alerts?lastReceiveTime <= to-date (now) \
-H 'Authorization: Key demo-key' (i want alarm that are generated in last 10 min )
annu9103
@annu9103
??
annu9103
@annu9103
how to write api query for generate last 10 min alarm
Lars Van Casteren
@cukal
@satterly Hi Nick, thanks for Alerta!
I'm setting these env vars in docker-compose.yml (7.5.5) :
DEFAULT_EXPIRED_DELETE_HRS = 0
DEFAULT_INFO_DELETE_HRS = 0
but still closed tickets get removed. Checked inside the container and the env vars are set. Any idea where I should start looking?
Lars Van Casteren
@cukal
When checking the logs I do see:
web_1 | DELETE FROM alerts web_1 | WHERE (status IN ('closed', 'expired') web_1 | AND last_receive_time < (NOW() at time zone 'utc' - INTERVAL '2 hours'))
Lars Van Casteren
@cukal
hmm, it seems the crontab inside the docker container is doing the housekeeping call without--expired, defaulting it to 2h, possible?
Nick Satterly
@satterly
none of those variables are supported as environment variables
The docker readme lists all of the supported env vars https://hub.docker.com/repository/docker/alerta/alerta-web
if you need to set other variables use alertad.conf file
Lars Van Casteren
@cukal
Thanks for your reply! I backtracked the housekeeping command to the --expired value and figured that what's causing it because the env variable I set doesn't get used inside the container and indeed, it's not in the list. No worries, I'll add them. thanks again for Alerta Nick!
Nick Satterly
@satterly
No problem.
SergioT
@stiurin

running alerta 7.4.4 and kapacitor 1.5.5

running a kapacitor test alert, discovered '/alert' path gets prepended to the url var.
I presume production configuration would do the same.

I did not find a way how to change or remove this prepended path.
The only solution I can think of making alerts hit my custom webhook listener is to rename my custom webhook to 'alert'

is there a better-known supported solution?

Nick Satterly
@satterly
why do you want to remove /alert from the path? It won’t work without it.
SergioT
@stiurin
My assumption was Kapacitor is using a bespoke webhook JSON message
If I just use Alerta FQDN with no path to any custom webhook, then test alerts fail with 405 error
I just can't find documentation on what has to be enabled and configured on Alerta to accept Kapacitor messages
SergioT
@stiurin

Kapacitor config
url = "https://alerta.example.com"
would result in alerts being sent as
POST https://alerta.example.com/alert

to which Alerta would respond '405 Not Allowed'

Nick Satterly
@satterly
Is that the correct Alerta API endpoint? Are you using docker Alerta by any chance? If so it has /api on the end.
SergioT
@stiurin
you are genius, this has worked!
i am using Docker container, indeed
/api
and
token-prefix = "Key"
made it all work
i could not find this in documentation, thank you for guidance!
annu9103
@annu9103
any one suggest me curl command for last 10 min alert available in alert dashboard like $ curl http://api.local.alerta.io:8080/alerts?sort-by=lastReceiveTime&from-date=2020-05-29T14%3A27%3A54.931Z (i want alarm that generated in last 10 min ) this this hardcode ....
i have used sort-by=lastReceiveTime&from-date=$(date +%FT%T.%3NZ -d "- 10 minutes")
but i'm getting all the alarm
i have gone through the alerta doc and in search alert portion i got some curl command for fetching data using attribute
annu9103
@annu9103
curl --request GET ' http://api.local.alerta.io:8080/alerts?sort-by=lastReceiveTime=$(date +%FT%T.%3NZ -d "- 10 minutes")' --header 'Authorization: key==xxxxxxxx' i have used this ...and this command show me all alert
if any one have an answer please suggest me ..
“repeat=false” says only return the new alerts
Nick Satterly
@satterly
@stiurin Kapacitor can’t know how you have configured your Alerta server so they can only say put your endpoint in this configuration setting. If you take a look at the README for the Docker image it says quite clearly …
How to use this image

The API endpoint is at:

http://<docker>:<port>/api
annu9103
@annu9103
not working ..every time i get same alert
annu9103
@annu9103
infect all alert
Nick Satterly
@satterly
I don’t understand what you’re trying to do. just use the lastTime as we discussed in the other thread
annu9103
@annu9103
i want last 10 min alert only ...and i have used that you suggest ...and you suggest hard code date ...
Nick Satterly
@satterly
no i didn’t. i suggested you take the value for lastTime from the response and use that as the from-datein the next query
annu9103
@annu9103
like this sort-by=lastReceiveTime&from-date=$(lastTime)
is it possible
Nick Satterly
@satterly
Yes. That's what I've been suggesting.
annu9103
@annu9103
ok ..thanks but i have one more question is it possible to subtract this lastTime with 10 min
??
Nick Satterly
@satterly
Why would you want to do that ? Think about what lastTime is telling you.
Howie
@wo250012
Testing out alerta-contrib/snmptrap. I am trying to get logging to write to a file instead of the messages file when a trap is received. Any guidance on how to do that?
Howie
@wo250012
I only have the alerta-contrib repo installed on this server, not the full alerta install.
Howie
@wo250012
Never mind...Looks like I needed to add "-Lf LOG" to the OPTIONS in /etc/sysconfig/snmptrapd
Howie
@wo250012
so that worked but it is still logging to messages
ok, so it looks like that option just controls the actual output from snmptrad. The alerta logger is still writing to messages.
Hasso Tepper
@hasso
@satterly any progress regarding autounack? I'm stuck at the moment – heartbeats are broken in the version I have installed, but can't upgrade because it breaks alerts :)