forked from Finn10111/XMPPNotify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testmsg.py
executable file
·31 lines (25 loc) · 1.08 KB
/
testmsg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3
from pprint import pprint
from xmppnotify import build_argparser, build_message
commonargs = \
["--hostname", "HOSTNAME",
"--hostdisplayname", "HOSTDISPLAYNAME",
"-o", "outputline1\noutputline2",
"--hostaddress", "127.0.0.1",
"--hostaddress6", "::1",
"--icingaweb2url", "ICINGAWEB2URL",
"--state", "STATE", "--longdatetime", "2019-12-31 23:59:59"]
if __name__ == '__main__':
parser = build_argparser()
args = parser.parse_args(commonargs +
["--notificationtype", "PROBLEM",
"-e", "servicename",
"--servicedisplayname", "servicedisplayname"])
pprint(build_message(args))
args = parser.parse_args(commonargs +
["--notificationtype", "RECOVERY",
"--notificationauthorname",
"NOTIFICATIONAUTHORNAME",
"--notificationcomment",
"NOTIFICATIONCOMMENT\nMORE COMMENTS"])
pprint(build_message(args))