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
diff --git a/src/osysmon_openvpn.c b/src/osysmon_openvpn.c
index 148e3b8..8c95984 100644
--- a/src/osysmon_openvpn.c
+++ b/src/osysmon_openvpn.c
@@ -117,7 +117,7 @@
{
struct openvpn_client *vpn = osmo_stream_cli_get_data(conn);
- update_name(vpn->rem_cfg, "management interface unavailable");
+ update_name(vpn->rem_cfg, "disconnected from openvpn management socket");
vpn->connected = false;
talloc_free(vpn->tun_ip);
talloc_free(vpn->rem_cfg->remote_host);
@@ -131,7 +131,7 @@
{
struct openvpn_client *vpn = osmo_stream_cli_get_data(conn);
- update_name(vpn->rem_cfg, "management interface incompatible");
+ update_name(vpn->rem_cfg, "connected to openvpn management socket");
vpn->connected = true;
return 0;
@@ -149,7 +149,7 @@
bytes = osmo_stream_cli_recv(conn, msg);
if (bytes < 0)
- OVPN_LOG(msg, vpn, "unable to receive message in callback\n");
+ OVPN_LOG(msg, vpn, "read on openvpn management socket failed (%d)\n", bytes);
else
parse_state(msg, vpn);
@@ -174,7 +174,7 @@
if (!vpn->cfg)
goto dealloc;
- vpn->rem_cfg = host_cfg_alloc(vpn, "management interface unavailable", NULL, 0);
+ vpn->rem_cfg = host_cfg_alloc(vpn, "connecting to openvpn management socket", NULL, 0);
if (!vpn->rem_cfg)
goto dealloc;
@@ -191,7 +191,7 @@
osmo_stream_cli_set_disconnect_cb(vpn->mgmt, disconnect_cb);
if (osmo_stream_cli_open(vpn->mgmt) < 0) {
- OVPN_LOG(vpn->rem_cfg, vpn, "failed to connect to management interface\n");
+ OVPN_LOG(vpn->rem_cfg, vpn, "failed to connect to management socket\n");
goto dealloc;
}