Commit Graph

88 Commits (master)

Author SHA1 Message Date
Andreas Eversberg 2ccfba7f2c Use uniform log format for default config files
Related: OS#6272
Change-Id: If737fb3aa92735a3f4280170370ec48c89134526
2023-12-01 12:53:48 +01:00
Oliver Smith 056bd5c43b debian: set compat level to 10
Related: OS#5958
Change-Id: Ib3d33f323b0c3004911ec026612934c12c1162aa
2023-04-25 16:48:33 +02:00
Pau Espin 1beada2f21 Bump version: → 0.3.2
Change-Id: I8ba5b82c4c12911bfa9c8f21e304616e910f5a1a
2022-06-28 18:27:29 +02:00
Harald Welte 2a64700250 update git URLs (git -> https; gitea)
Change-Id: I01bc2d56f43b24df3603b0ff7c07e61dd446d66d
2022-06-18 14:00:32 +02:00
Pau Espin 66838cf775 Drop unneeded ax_check_compile_flag.m4
The macro is no longer used since

Change-Id: I7b8967f804f1a8dc421d8fe4725ba72c2540ac07
2022-01-11 18:18:29 +01:00
Oliver Smith 1600221949 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I1f6db5f930fe97ce2336bce416470b807d7a57b7
2021-12-14 12:22:29 +01:00
Pau Espin bd14455b45 Bump version: → 0.3.1
Change-Id: I906f8046b599f2ad6824facfefd9c5cf96adf36d
2021-11-16 14:46:06 +01:00
Oliver Smith 0d9d5e78e4 configure: don't turn some warnings into errors
Do not turn some compiler warnings into errors by default. This part was
copied from openbsc.git 34f012 ("Turn some compiler warnings into
errors"), where it was added before --enable-werror was available.

We build with --enable-werror during development and in CI. If the code
is built with a different compiler that throws additional warnings, it
should not stop the build.

Related: OS#5289
Change-Id: I56fb9de59174344b2cb11c60226ae3db43d68766
2021-11-04 11:13:28 +01:00
Harald Welte 032c1fb97b add on what this repository is about
Change-Id: I37ae2fa34ee1240d64dd655c91cae5b8e8469a47
2021-03-21 23:14:01 +01:00
Oliver Smith e3f31bedd3 set -std=gnu11
Change-Id: I708fe349fd506613af0e62a62bf6cbe611a06eef
2021-01-27 17:57:44 +01:00
Harald Welte faea029a46 Bump version: → 0.3.0
Change-Id: I4b5c06efd20e98e9c1e77d4b3f3df62ef50708ac
2021-01-06 16:56:14 +01:00
Harald Welte efd1ea3353 Make and debian/control agree on versions
Change-Id: I9ec8176618585ff74e36fa6f2458fbe8e0c89ca6
2021-01-06 16:55:49 +01:00
Harald Welte 8984bea461 exit(2) on unsupported positional arguments on command line
Change-Id: I32f9565c649a149638878a7283ddd8407ddff1ed
2019-12-03 22:29:26 +01:00
Daniel Willmann ebbfbbdbc7 Add oneshot mode that exits after one iteration
Change-Id: Id920c4afee633b8da6919b7b318f9c868890a176
2019-11-11 14:55:46 +01:00
Daniel Willmann 85d0fb2b38 Cleaner output if sections are empty
Even with a completely empty config we still get the following output:

    load: 0.87/0.92/0.98
    ram: 243/168/0
    uptime: 1d 22:18:19

With this patch the sections are skipped if there are no entries and the
command no sysinfo can be used to skip displaying the system

Change-Id: I429fe7626b43aef74ff7458f5c2864888fa9a562
2019-11-11 14:55:46 +01:00
Daniel Willmann 66a83f495f simple_ctrl: Don't cause an error if GET response is empty
Change-Id: I0be48c89595e71ac4dfa1b8ad1890296f2013476
Sponsored-by: On-Waves ehf.
2019-07-18 17:35:58 +02:00
Harald Welte 7648a0eb18 Bump version: → 0.2.0
Change-Id: I34ef32535a0d6a07feeb43a7e4ebf405d7d68c44
2019-07-14 08:04:51 +08:00
Oliver Smith c1871cd9cd contrib/ run "make maintainer-clean"
Related: OS#3047
Change-Id: I7b39a97243de93383c77a0e172d737263d48053a
2019-07-10 13:25:45 +02:00
Pau Espin 9784c815aa Depend on liboping 1.7.0 instead of 1.9.0
Debian8 provides 1.7.0. Let's depend on it so we can build packages for

Change-Id: Idba4494102d48d125bcd215dd0d3fdf42bbd409e
2019-03-20 14:35:05 +01:00
Pau Espin a15a6d7832 debian: Add missing libmnl-dev dependency
Change-Id: I1157b1f0edabac16d664c2d4ad2250d3802dcc60
2019-03-20 14:33:41 +01:00
Pau Espin b1720a39c9 Bump version: → 0.1.0
Change-Id: Ie98bb286d9333158985ddb80edf7208d69702d73
2019-03-20 13:14:31 +01:00
Pau Espin 814882bf5e Add debian packaging content
Change-Id: I2bcacca040364f77aa6b17edf53acf53c820c17b
2019-03-20 13:12:54 +01:00
Pau Espin 9342f1c574 Add missing bits to have make release working
Change-Id: I2758561ff2b08e33042161253a3bd36ce73bf259
2019-03-19 17:41:19 +01:00
Pau Espin 9201677917 Add vty option to print output of shell cmd on every poll step
Change-Id: I005773b75f81fa5f6c90f53af508fc6debea208b
2019-03-19 13:25:42 +01:00
Pau Espin d7321347b9 openvn: Fix missing break in last commit
Fixes: a3a92ecc5c
Change-Id: I6d5aeea965cc9d2f417be24dbeca0278d2f83567
2019-03-16 18:27:45 +01:00
Pau Espin 778ac848d3 openvpn: Remove useless conditional block in parse_state
tok != NULL is already checked in the for loop conditions.

Change-Id: I86e42e4537060b2ed8c860c0b71a225c5fe026c7
2019-03-15 20:58:13 +01:00
Pau Espin 3d13718ce7 openvpn: Fix garbage printed after remote port
Last strtok() returns chunk from last "," until end of strig. Since
openvpn sends a trailing new line + "END" string, that was being copied
into the remote port.

Change-Id: Ie24fed9c64bc482fd5af8bc9d03d37937c6471bf
2019-03-15 20:58:13 +01:00
Pau Espin a3a92ecc5c openvpn: log status description
Useful specially during RECONNECTING and EXITING to show reason of the
disconnect according to openvpn documentation.

Change-Id: I9f47f5d843bb550a4ce7956c89d31f06394201cf
2019-03-15 20:58:13 +01:00
Pau Espin b91013259f openvpn: String returned from openvpn is not null-terminated
wireshark shows strings returned by OpenVPN management interface as an
aswer to "state" cmd contain no null character at the end. As a
consequence, osmo_strlcpy cannot be used since it calls strlen() on the
Probably previous implementation was harmless because we zero-fill msgb
buffers prior to filling them.

Change-Id: I4356dc08324a6d877c9e8112306570aabbf6e777
2019-03-15 20:58:13 +01:00
Pau Espin 0813db372b openvpn: Set reconnect timeout to a much lower value
It's a connection towards localhost, so it doesn't hurt reconnecting in
a timely fashion, otherwise upon openvpn restart user needed to wait for
1 minute to see changes.

Change-Id: Ie9638120d1ce5bfa43bc7c15f05cf81de37624c5
2019-03-15 20:58:13 +01:00
Pau Espin 53f507372e openvpn: Improve logging and status information
New strings are far more comprehensive to understand the current status
during (re)connect to openvpn management socket.

Change-Id: Ifd0f821ed2d237740b6d3381a7190ad7058ce889
2019-03-15 20:58:04 +01:00
Pau Espin 69d80b7b46 Integrate sleeping/printing loop into osmo main loop
Among other possibles issue, it should avoid sporadic print loop hanging if no events are fired in osmocom main loop.

Change-Id: Ie2f0983eaf75826483b5b70f58b4d4acb842d6ea
2019-03-15 18:46:08 +01:00
Max 4554730bbc Update config example
Add OpenVPN and ping probe entries to example config.

Change-Id: I78025027d48a1213b2a23252c8261d9cb4564027
Related: SYS#2655
2019-02-22 21:28:19 +00:00
Oliver Smith 433f705c2b osmo-sysmon -h: s/OsmoHLR/osmo-sysmon/
Fix program name in help output.

Change-Id: I45d4e43b92833a22ae31d1cdc2b4d397f572ca34
2019-02-22 10:42:38 +01:00
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 1234' in
OpenVPN's config).

The output looks as follows:
      status: CONNECTED
      status: management interface incompatible
      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 14474d3c66 remove obsolete comments
Change-Id: Ia2b3769811e9409d99f3698c490f6e3abe6a3c12
2019-01-31 16:08:12 +01: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:
      IP: 2a02:6b8::2:242
      dropped: 3/3
      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
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.


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 3b25774db5 Merge "Add cmdline option parsing support" 2018-12-13 14:33:22 +00:00
Harald Welte e649fb2d75 Merge "Move source code to src subdir" 2018-12-13 13:45:02 +00: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
Pau Espin a3e43220f3 Add m4 missing files to fix build
Same files are available in other osmocom projects, otherwise configure
fails with "Please install autoconf-archive; re-run 'autoreconf -fi' for
it to take effect.".

Change-Id: Iabe3207fff8f076a3f4ddc81720bb7fdc671a46c
2018-12-12 19:08:32 +01:00