Skip to content

Commit 22aacb1

Browse files
committed
feat(logs): add CLM
1 parent e31c74f commit 22aacb1

1 file changed

Lines changed: 68 additions & 1 deletion

File tree

logs.rst

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ Logs are initially written to a temporary in-memory directory to prevent potenti
1212

1313
3. **Custom Syslog Forwarder**: Logs can be sent to a remote syslog server.
1414

15-
The next paragraph will explain how to configure this latter option.
15+
4. **Cloud Log Manager**: Logs can be forwarded to the Nethesis Cloud Log Manager (CLM) service.
16+
17+
The next paragraphs will explain how to configure these latter options.
1618

1719
Forwarding to a remote server
1820
=============================
@@ -48,6 +50,71 @@ It is possible also to configure RFC 5424 using the same syntax: ::
4850

4951
It is possible to configure multiple forwarders by repeating the operation using a different configuration name like ``clm2``.
5052

53+
Forwarding to Cloud Log Manager
54+
================================
55+
56+
.. admonition:: Service entitlement required
57+
58+
You need to purchase a subscription for the CLM service from Nethesis and obtain the tenant identifier.
59+
The service is currenlty reserved to Enterprise customers. For more information, please contact Nethesis sales.
60+
61+
The ``ns-clm`` package forwards syslog messages to the Nethesis Cloud Log Manager (CLM) service.
62+
It provides the ``ns-clm-forwarder`` daemon, which tails ``/var/log/messages`` and tracks its read position in ``/var/run/ns-clm/last_offset``.
63+
New syslog lines are parsed, batched, and sent as JSON via HTTP POST to the CLM endpoint.
64+
The daemon polls for new lines every 10 seconds, detects log rotation automatically, and persists the offset on shutdown so it can resume after a restart.
65+
66+
The package is not included by default on NethSecurity 8.7.2 or earlier, but it is available in the package repository and can be
67+
manually installed.
68+
Install it with: ::
69+
70+
opkg update
71+
opkg install ns-clm
72+
73+
The UCI configuration is stored in ``/etc/config/ns-clm``:
74+
75+
.. list-table::
76+
:header-rows: 1
77+
:widths: 20 30 50
78+
79+
* - Option
80+
- Default
81+
- Description
82+
* - ``enabled``
83+
- ``0``
84+
- Enable (``1``) or disable (``0``) the forwarder
85+
* - ``uuid``
86+
- (empty)
87+
- Unique identifier for the device, generated with ``uuidgen`` and prefixed with "L" to ensure it starts with a letter
88+
- This is required for the CLM service to identify the source of the logs
89+
- Example: ``L3d50ca11-4415-4e46-9ee9-b1da0f62c337``
90+
* - ``address``
91+
- ``https://nar.nethesis.it``
92+
- CLM server address
93+
* - ``tenant``
94+
- (empty)
95+
- CLM tenant identifier, available inside the CLM portal, under ``Users and Companies`` -> ``Companies``
96+
* - ``debug``
97+
- ``0``
98+
- Enable debug output to stderr (``1``)
99+
100+
To enable the forwarder and set the tenant identifier, run: ::
101+
102+
uci set ns-clm.config.uuid="L$(uuidgen)"
103+
uci set ns-clm.config.enabled=1
104+
uci set ns-clm.config.tenant=<tenant_id>
105+
uci commit ns-clm
106+
reload_config
107+
108+
You can find the tenant identifier in the CLM portal, under ``Users and Companies`` -> ``Companies``.
109+
110+
To also enable the service at boot: ::
111+
112+
/etc/init.d/ns-clm enable && /etc/init.d/ns-clm start
113+
114+
To stop and disable the forwarder: ::
115+
116+
/etc/init.d/ns-clm stop && /etc/init.d/ns-clm disable
117+
51118
Log rotation size
52119
=================
53120

0 commit comments

Comments
 (0)