Commit 63aaf931 authored by Christian Tacke's avatar Christian Tacke
Browse files

Message: Strip spaces, shorten Refs

Most xmpp clients display messages using a variable width
font. Aligning stuff using spaces doesn't work there.
On mobile clients spaces even add to the message's display
size without adding useful content.

So strip spaces!

{hostname} and {servicename} are the technical/config
names. Get them together on one line and call them "Ref:".
They're references to the config, really.
parent 424d00e1
......@@ -31,11 +31,10 @@ def build_message(args):
# service
message = """[{notificationtype}] {servicedisplayname} on {hostdisplayname} is {servicestate}!
Info: {serviceoutput}
Info: {serviceoutput}
When: {longdatetime}
Service: {servicename}
Host: {hostname}
When: {longdatetime}
Ref: {hostname}!{servicename}
Monitoring host: {monitoringhostname}\
""".format(
notificationtype=args.notificationtype,
......@@ -51,10 +50,10 @@ Monitoring host: {monitoringhostname}\
else:
message = """[{notificationtype}] {hostdisplayname} is {hoststate}!
Info: {hostoutput}
Info: {hostoutput}
When: {longdatetime}
Host: {hostname}
When: {longdatetime}
Ref: {hostname}
Monitoring host: {monitoringhostname}\
""".format(
notificationtype=args.notificationtype,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment