summaryrefslogtreecommitdiffstats
path: root/upstream/archlinux/man8/ip-monitor.8
blob: ec033c691d6d696c6155b86d3786f09a4bd30447 (plain)
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.TH IP\-MONITOR 8 "13 Dec 2012" "iproute2" "Linux"
.SH "NAME"
ip-monitor, rtmon \- state monitoring
.SH "SYNOPSIS"
.sp
.ad l
.in +8
.ti -8
.BR "ip monitor" " [ " all " |"
.IR OBJECT-LIST " ] ["
.BI file " FILENAME "
] [
.BI label
] [
.BI all-nsid
] [
.BI dev " DEVICE "
]
.sp

.SH OPTIONS

.TP
.BR "\-t" , " \-timestamp"
Prints timestamp before the event message on the separated line in format:
    Timestamp: <Day> <Month> <DD> <hh:mm:ss> <YYYY> <usecs> usec
    <EVENT>

.TP
.BR "\-ts" , " \-tshort"
Prints short timestamp before the event message on the same line in format:
    [<YYYY>-<MM>-<DD>T<hh:mm:ss>.<ms>] <EVENT>

.SH DESCRIPTION
The
.B ip
utility can monitor the state of devices, addresses
and routes continuously. This option has a slightly different format.
Namely, the
.B monitor
command is the first in the command line and then the object list follows:

.BR "ip monitor" " [ " all " |"
.IR OBJECT-LIST " ] ["
.BI file " FILENAME "
] [
.BI label
] [
.BI all-nsid
] [
.BI dev " DEVICE "
]

.I OBJECT-LIST
is the list of object types that we want to monitor.
It may contain
.BR link ", " address ", " route ", " mroute ", " prefix ", "
.BR neigh ", " netconf ", "  rule ", " stats ", " nsid " and " nexthop "."
If no
.B file
argument is given,
.B ip
opens RTNETLINK, listens on it and dumps state changes in the format
described in previous sections.

.P
If the
.BI label
option is set, a prefix is displayed before each message to
show the family of the message. For example:
.sp
.in +2
[NEIGH]10.16.0.112 dev eth0 lladdr 00:04:23:df:2f:d0 REACHABLE
[LINK]3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default
    link/ether 52:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
.in -2
.sp

.P
If the
.BI all-nsid
option is set, the program listens to all network namespaces that have a
nsid assigned into the network namespace were the program is running.
A prefix is displayed to show the network namespace where the message
originates. Example:
.sp
.in +2
[nsid 0]10.16.0.112 dev eth0 lladdr 00:04:23:df:2f:d0 REACHABLE
.in -2
.sp

.P
If the
.BI file
option is given, the program does not listen on RTNETLINK,
but opens the given file, and dumps its contents. The file
should contain RTNETLINK messages saved in binary format.
Such a file can be generated with the
.B rtmon
utility. This utility has a command line syntax similar to
.BR "ip monitor" .
Ideally,
.B rtmon
should be started before the first network configuration command
is issued. F.e. if you insert:
.sp
.in +8
rtmon file /var/log/rtmon.log
.in -8
.sp
in a startup script, you will be able to view the full history
later.

.P
Nevertheless, it is possible to start
.B rtmon
at any time.
It prepends the history with the state snapshot dumped at the moment
of starting.

.P
If the
.BI dev
option is given, the program prints only events related to this device.

.SH SEE ALSO
.br
.BR ip (8)

.SH AUTHOR
Original Manpage by Michail Litvak <mci@owl.openwall.com>
.br
Manpage revised by Nicolas Dichtel <nicolas.dichtel@6wind.com>