Skip to content

Commit dbc3cae

Browse files
committed
fix urlencode
1 parent 790e40b commit dbc3cae

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.idea/checkmk.iml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://seven.io/seven_outline_white.svg "seven Logo")
1+
![](https://www.seven.io/wp-content/uploads/Logo.svg "seven Logo")
22

33
seven notification plugin for checkmk
44

@@ -22,10 +22,10 @@ chmod +x /<omd-path>/sites/<sitename>/local/share/check_mk/notifications/seven
2222

2323
### Set API Key
2424

25-
Set your API Key as the first parameter or via environment variable `SEVEN_API_KEY`.
25+
Set your [API Key](https://help.seven.io/en/api-key-access) as the first parameter or via environment variable `SEVEN_API_KEY`.
2626

2727
## Support
2828

29-
Need help? Feel free to [contact us](https://www.sms77.io/en/company/contact).
29+
Need help? Feel free to [contact us](https://www.c.io/en/company/contact).
3030

3131
[![MIT](https://img.shields.io/badge/License-MIT-teal.svg)](LICENSE)

seven.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
api_key = os.environ.get('NOTIFY_PARAMETER_1', os.environ.get('SEVEN_API_KEY'))
1313
sender = os.environ.get('NOTIFY_PARAMETER_2', '')
14-
api_url = "https://gateway.sms77.io/api/sms"
14+
api_url = "https://gateway.seven.io/api/sms"
1515

1616
to = os.environ.get("NOTIFY_CONTACTPAGER")
1717
message = os.environ['NOTIFY_HOSTNAME'] + " "
@@ -22,8 +22,13 @@
2222
else:
2323
message += "is " + os.environ['NOTIFY_HOSTSTATE'] # Host message
2424

25-
url = "%s?" % api_url + urllib.urlencode([("p", api_key) ("from", sender),
26-
("to", to), ("text", message)])
25+
qs = urllib.urlencode({
26+
'from': sender,
27+
'p': api_key,
28+
'text': message,
29+
'to': to,
30+
})
31+
url = "%s?" % api_url + qs
2732

2833
try:
2934
handle = urllib.urlopen(url)

0 commit comments

Comments
 (0)