-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmsgd.1
More file actions
110 lines (96 loc) · 3.11 KB
/
Copy pathmsgd.1
File metadata and controls
110 lines (96 loc) · 3.11 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
.TH msgd 1 "5th August, 2020"
.SH \fBNAME\fP
msgd \- Simple UDP message reception service
\
.SH \fBSYNOPSIS\fP
msgd [OPTIONS]
\
.SH \fBDESCRIPTION\fP
Message Daemon:
A simple program to receive textual messages via UDP
and use the desktop environment's notification system to display the
message.
Allows optional logging of messages to a file.
Also allows the idea of "message types". For example, a message of type,
'alert' could take additional measures to notify somebody. A message type
of 'status' could be used for telemetry recording purposes. See the
\fBHANDLERS\fP section for more information on handler API.
.SH \fBOPTIONS\fP
.TP
\fB-b, --bindaddr ipv4_address\fP
\
.TP
\fB-p, --port udp_port\fP
Specify alternative destiantion UDP port to send messages to. Default
is 55555.
\
.TP
\fB-D, --debug\fP
Enable more debugging logging.
\
.TP
\fB-L, --logfile\fP
File that messages generated by the \fBmsgd\fP program itself are logged
to this file.
\
.TP
\fB-l, --msglog\fP
File that received messages are written to. Not used by default.
\
.TP
\fB-n, --no-dns\fP
Don't perform reverse-DNS lookups on the IP address of message senders.
Reverse-DNS lookups \fBare\fP performed by default.
\
.TP
\fB-T, --no-types\fP
Don't attempt to interpret or perform special handling for message types.
\
.TP
\fB-a, --always-notify\fP
\
.TP
\fB-a, --help\fP
Display help from command-line invocation.
\
.SH \fBTYPE HANDLERS\fP
The message's subtype, if present, is pre-pended to the message. For
example, for an 'alert' subtype, the following text should be pre-pended
to the supplied message:
[alert]message text here
If the text within the brackets matches a registered handler function,
then that function will be executed.
Handler functions are implemented as importable python source files. The
default location for these files is \fB/usr/share/msgd/handlers\fP. For
example, to handle 'alert' message types, then there must be a file at
\fB/usr/share/msgd/handlers/alert.py\fP and this file \fBMUST\fP contain
a \fBhandle_message()\fP function. This function signature is as follows:
\fBhandle_message(message, msglog=None, hostname=None)\fP
.BR message
is a \fBMessage\fP object (see msgd main source file for class
definition). This object does provide a convenient implementation for the
\fBrepr()\fP Python builtin.
\
.BR msglog
If not None, then it will be a Python file object, for the
file that received messages are being written to.
\
.BR hostname
If set to None, then msgd was launched with the \fB--no-dns\fP option and
thus, hostnames will not be looked up. The value of \fBmessage.from_ip\fP should
be used for the sender's IPv4 address. If hostname is
not None, it is still possible that it represents the sender's IPv4 address
in dotted-quad notation. This happens if there is no reverse-DNS entry for
the IP address.
\
This function should return True if it has shown a notification. Otherwise,
it should return False, and the main msgd message handling loop will take
care of displaying the notification.
\
.SH \fBFILES\fP
\
.TP
\fB/usr/share/msgd/handlers\fP
Python modules that implement message type handlers are stored here.
.SH \fBEXAMPLES\fP
\