Commit Graph

12 Commits

Author SHA1 Message Date
Max 6cbdcaf5bb OpenVPN: track interface disconnect
Setup disconnection callback and use it to properly track management
interface availability.

Change-Id: I11b8bc71c1e9cbbf992ee3b7c1c9aae6e6f697e0
Requires: libosmo-netif I905adb2d6191216551a3bcdcd1aec1f96f01612a
Related: SYS#2655
2019-02-21 10:29:48 +01:00
Max 9a852f2dd8 Add OpenVPN probe
This adds support for OpenVPN status probe which uses OpenVPN's
management interface (configured via 'management 127.0.0.1 1234' in
OpenVPN's config).

The output looks as follows:
...
  OpenVPN
    127.0.0.1:1234
      status: CONNECTED
      tunnel: 10.8.0.15
      remote: 144.76.43.77:1194
    localhost:4242
      status: management interface incompatible
    127.0.0.1:4444
      status: management interface unavailable
...

We show tunnel's IP (if available) as well as remote (OpenVPN server
itself) address/port in addition to general connection status. If
management interface is unavailable it's reported as such. If we've
managed to establish connection with a given management interface but
are unable to obtain expected information than we report this
incompatibility as well.

Related: SYS#2655
Change-Id: I4493e19b9a09dcebd289457eacd1719f7f8cc31c
2019-02-07 17:38:19 +01:00
Max 5d42b8ec98 Introduce generic host config and related helpers
Add generic host config struct and related helpers for TCP-based probes
and use them for ctrl probe.

This will be used in follow-up patch for OpenVPN probe as well.

Change-Id: Ie321655a92cdbefbfaa056ac0d583397c83beccb
2019-02-07 17:33:45 +01:00
Max 9ce5bf90bb ctrl: log host/port on errors
In case of multiple ctrl-client entries in .cfg file it's impossible to
see which one is causing particular ctrl error. Fix this by introducing
macro wrapper for stderr logging which always show host:port relevant to
the error.

Change-Id: I788d51359965a66c54075a3971aa7824c3bfb0bf
Related: SYS#2655
2019-02-06 10:10:45 +00:00
Max ada0d1a481 Install signal handlers before processing config
It's easier to troubleshoot vty-related issues when we can send signals
to obtain talloc report.

Change-Id: I6dd1ad55a227db08595d844008be86f648fa92c1
2019-02-06 08:10:05 +00:00
Max 8066a41e78 Add ping probe support
Use liboping (new dependency) to add 'ping XXX' entries support in .cfg
file, where XXX can be either IP address or FQDN.

Sample output:
...
  ping
    ya.ru
      IP: 2a02:6b8::2:242
      dropped: 3/3
    8.8.8.8
      IP: 8.8.8.8
      dropped: 0/3
      latency: 20.4 ms
      TTL: 120
...

N. B: to gather actual ping statistic we have to be able to send ICMP
requests (have enough privileges to work with RAW sockets).

Related: SYS#2655
Change-Id: Ife32540b532fb54368f63c78fb7837b84d4e8c76
2019-01-31 10:19:44 +01:00
Max 65d937c45c Update Makefile.am
The simple_ctrl.c is used by 2 independent binaries. Let's build it as a
convenience libtool library [1] to make it easier to add further
external dependencies in future.

While at it, also move osmo-sysmon dependencies to program-specific
_CFLAGS from generic one.

[1] https://www.gnu.org/software/automake/manual/html_node/Libtool-Convenience-Libraries.html

Change-Id: Idfaba17b54983709278e1c24bf55edbbb4abd961
2019-01-30 12:28:17 +00:00
Max 18428bb4cf ctrl: separate config structure
Moving configuration data from anonymous struct into shared header as a
preparation for ctrl logging improvements in follow-up patches.

Change-Id: I3520e14ca6e1b8e270dbd4b1bf2378fe486991ce
Related: SYS#2655
2019-01-28 16:12:04 +01:00
Max f41973eeb2 Drop unused parameter
value_node_add() ignores it's first argument - let's drop it to make
code more compact.

Change-Id: I17c2fed4049e1c83307feda001aefc006dfbe6a3
2019-01-27 02:40:15 +01:00
Max 4618c73f2b Move shared libs into common LDADD
Change-Id: I8b2f2cd60426cf3b52dd463959a48fd7619cfcce
2018-12-20 15:51:11 +01:00
Pau Espin ae25399f75 Add cmdline option parsing support
Change-Id: I742974bd1440b09b49d26703c13361dd1c41008b
2018-12-12 19:37:02 +01:00
Pau Espin 2768f95086 Move source code to src subdir
Change-Id: I1aa2893e2b274f8d087a0d2f126486cd4afcbdfe
2018-12-12 19:19:14 +01:00