feat: add various infrastructure check and automation scripts
This commit is contained in:
20
scripts/test_discord_webhook_infra.py
Normal file
20
scripts/test_discord_webhook_infra.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import urllib.request
|
||||
import json
|
||||
import ssl
|
||||
|
||||
ctx = ssl.create_default_context()
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
|
||||
webhook_url = "https://discord.com/api/webhooks/1566076777963593772/wKN30N0ZXVJKGP-prZ1_P9cp_u7Oakmh8R4bVh0qr8RFpyeGcJZrHfPQBJxtfzQqb4dn"
|
||||
payload = {
|
||||
"content": "✅ **[SnarfNet Ops] Alerting Audit: Discord Webhook Verification**\n- Testing `#infra-alerts` channel delivery."
|
||||
}
|
||||
req = urllib.request.Request(webhook_url, data=json.dumps(payload).encode('utf-8'),
|
||||
headers={"Content-Type": "application/json", "User-Agent": "SnarfNetOps/1.0"})
|
||||
try:
|
||||
resp = urllib.request.urlopen(req, context=ctx, timeout=10)
|
||||
print("Discord Webhook Status:", resp.getcode())
|
||||
except Exception as e:
|
||||
print("Discord Webhook Error:", e)
|
||||
|
||||
Reference in New Issue
Block a user