Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending alert from uptime kuma #100

Closed
iptvcld opened this issue Aug 9, 2024 · 4 comments
Closed

Sending alert from uptime kuma #100

iptvcld opened this issue Aug 9, 2024 · 4 comments

Comments

@iptvcld
Copy link

iptvcld commented Aug 9, 2024

Hello; i am trying to send an alert from Kuma webhook using preset- multipart/form-data and i cannot just see the saw data coming into the webhook.

Is there a method or script i should be using to see the raw data coming in from Kuma?

@ncarlier
Copy link
Owner

Hello, thanks for reporting the problem. Indeed, multipart/form-data is not that well supported. I will fix this asap. However you can use Kuma's webhook using application/json preset. The JSON payload will be stored into the $1 variable.

@iptvcld
Copy link
Author

iptvcld commented Aug 10, 2024

Hello, thanks for reporting the problem. Indeed, multipart/form-data is not that well supported. I will fix this asap. However you can use Kuma's webhook using application/json preset. The JSON payload will be stored into the $1 variable.

Thanks I will try that. Is there a way to see the data come live on the screen?

@iptvcld
Copy link
Author

iptvcld commented Aug 10, 2024

Hello, thanks for reporting the problem. Indeed, multipart/form-data is not that well supported. I will fix this asap. However you can use Kuma's webhook using application/json preset. The JSON payload will be stored into the $1 variable.

I have to make a bash script to store $1 into a log file and then run the hook to view the file. Is there something built in that i can use that shows the incoming data thats in $1?

#!/bin/bash

# The first argument passed to the script ($1) is expected to be the JSON data
json_data=$1

# Define the log file path
log_file="/home/webhookd/scripts/logfile.log"

# Append the JSON data to the log file with a timestamp
echo "$(date +'%Y-%m-%d %H:%M:%S') - $json_data" >> "$log_file"

is there a way to see $1 without a script?

@ncarlier
Copy link
Owner

ncarlier commented Aug 10, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants