prol2tpwatch - event watch application for ProL2TP  


prol2tpwatch [-T <timeout>] [-n <max_events>] [-v] [-p] [-c]
[-s <session_event_mask>] [-t <tunnel_event_mask>]  


The prol2tpwatch command line utility can be used to listen for L2TP tunnel and/or session events from the prol2tpd daemon and log them. Events are generated every time an L2TP tunnel or session is created, deleted or changes state. prol2tpwatch may be useful as a monitoring tool.

prol2tpwatch exits if prol2tpd terminates or if the configured number of events have occurred, or after the configured timeout.

The L2TP protocol defines some error codes which tell peers why a tunnel or session was torn down. This data is carried in L2TP control messages across the network. The Down and Deleted events include this data, when it is available. Refer to RFC2661 and RFC3371 for code definitions.

For information about the general features of ProL2TP please refer to the prol2tp(7) manual page.  


prol2tpd must be running before the first prol2tpwatch command is issued. ProL2TP uses private Unix sockets to communicate with prol2tpd, so the system must be capable of running Unix sockets.  


Sets the number of events to wait for before exiting. Default is unlimited.
Sets a timeout in seconds, after which prol2tpwatch will exit.
Sets the tunnel event types to be watched. This is specified as a comma-separated list. Valid event types are created, deleted, up and down. Default is created,deleted,up,down.
Sets the session event types to be watched. This is specified as a comma-separated list. Valid event types are created, deleted, up and down. Default is created,deleted,up,down.
Verbose output. This option causes extra information to be logged with each event. For tunnel events, this includes the protocol version, link encapsulation type and peer IP address. For session events, this includes the pseudowire type and interface name.
Prefix each line of the output with a timestamp.
Write output data in CSV format (comma-separated-values) instead of human-readable text. This can be useful if the event data is being parsed by another application.


Brief event listing.

# prol2tpwatch -p
Nov 29 12:50:54: TUNNEL CREATED: 51388 () Nov 29 12:50:54: TUNNEL UP: 51388 () Nov 29 12:50:54: SESSION CREATED: 51388/37082 () Nov 29 12:50:54: SESSION UP: 51388/37082 () Nov 29 12:51:04: TUNNEL DOWN: 51388 () Nov 29 12:51:04: SESSION DOWN: 51388/37082 () Nov 29 12:51:04: SESSION DELETED: 51388/37082 () Nov 29 12:51:08: TUNNEL DELETED: 51388 ()
Verbose event listing.

# prol2tpwatch -pv
Nov 29 12:05:50: TUNNEL CREATED: 10763 (one): L2TPv2 peer
Nov 29 12:05:51: TUNNEL UP: 10763 (one): L2TPv2 peer
Nov 29 12:05:51: SESSION CREATED: 10763/2760 (one): PPP
Nov 29 12:05:51: SESSION UP: 10763/2760 (one): PPP user test
Nov 29 12:06:01: TUNNEL DOWN: 10763 (one): L2TPv2 peer, reason 1/0
Nov 29 12:06:01: SESSION DOWN: 10763/2760 (one): PPP on ppp0 user test, reason 3/0
Nov 29 12:06:01: SESSION DELETED: 10763/2760 (one): PPP, reason 3/0
Nov 29 12:06:05: TUNNEL DELETED: 10763 (one): L2TPv2 peer, reason 1/0
CSV event listing.

# prol2tpwatch -cp
Nov 29 12:04:52,SESSION DELETED,45550,4888,"one",PPP,"","",3,0,""
Nov 29 12:04:54,TUNNEL DELETED,45550,0,"one",L2TPv2,UDP,,1,0,""
Nov 29 12:05:00,TUNNEL CREATED,36315,0,"one",L2TPv2,UDP,,0,0,""
Nov 29 12:05:00,TUNNEL UP,36315,0,"one",L2TPv2,UDP,,0,0,""
Nov 29 12:05:00,SESSION CREATED,36315,63688,"one",PPP,"","",0,0,""
Nov 29 12:05:01,SESSION UP,36315,63688,"one",PPP,"","test",0,0,""
Nov 29 12:05:10,TUNNEL DOWN,36315,0,"one",L2TPv2,UDP,,1,0,""
Nov 29 12:05:10,SESSION DOWN,36315,63688,"one",PPP,"ppp0","test",3,0,""
Nov 29 12:05:11,SESSION DELETED,36315,63688,"one",PPP,"","",3,0,""
Nov 29 12:05:15,TUNNEL DELETED,36315,0,"one",L2TPv2,UDP,,1,0,""
Do action if prol2tpd exits.

# prol2tpwatch > /dev/null
# do_action_commands_here



prol2tp(7), prol2tpd(8), prol2tpd.conf(5).




This document was created by man2html, using the manual pages.
Time: 13:53:45 GMT, May 25, 2018