this image is to check your prisma cloud tenant respond.
206
This image is used for your prisma cloud tenant respond check, When your tenant is not responding, this image will send alert to your slack channel.
you will need your slack webhook URL
$ docker run --rm -e PCURL="[your prisma tenant API URL]" -e WHURL="[your slack webhook URL]" -e CHANNEL="[your slack channel name]" -d macnicadevops/prismachecker:1.0Example:
$ docker run --rm -e PCURL="https://asia-northeast1.cloud.twistlock.com/abc-3456789" -e WHURL="https://hooks.slack.com/services/O9D6H25KQ/BUHAN8JC8/cH4bO0uxKJYDSxD69pxT7eBC" -e NAME="prisma-alert" -d macnicadevops/prismachecker:1.0| Key | Value | default value |
|---|---|---|
| PCURL | URL for your Prisma cloud tenant API | "https://regionid.cloud.twistlock.com/xxx-00000000" |
| WHURL | Webhook URL for your slack | "https://hooks.slack.com/services/slack-webhook-url" |
| NAME | (Optional) Webhook User name | "Health-Checker" |
| TEXT | (Optional) Actual Alert Message in your Slack | "PrismaCloud-Ping-Error!!@channel" |
| INT | (Optional) Ping Interval to your Prisma Cloud tenant | 60 |
From ubuntu:18.04
RUN apt-get update && apt-get install -y curl
ENV PCURL="https://regionid.cloud.twistlock.com/xxx-00000000"
ENV WHURL="https://hooks.slack.com/services/slack-webhook-url"
ENV NAME="Health-Checker"
ENV TEXT="PrismaCloud-Ping-Error!!@channel"
ENV INT=60
COPY checker.sh /
RUN chmod +x checker.sh
ENTRYPOINT ["/checker.sh"]
#!/bin/bash
while :
do
result=`curl -k $PCURL"/api/v1/_ping"`
time=`date +%s`
if [ $result != "OK" ]; then
curl -X POST -d 'payload={"username":"'$NAME'","link_names": 1,"attachments": [{"pretext":"'$time'","text": "'$TEXT'"}]}' $WHURL ;
fi
sleep $INT
done
Content type
Image
Digest
Size
51 MB
Last updated
over 6 years ago
docker pull macnicadevops/prismachecker:1.0