286 Commits

Author SHA1 Message Date
Robert Dower df94f719ab archive repository 2025-08-07 14:08:16 -07:00
Alex Jaramillo 0c34fab4fa configure.ac: bump version
Small improvements after static code analysis.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
v2.4.3-rc1
2025-04-17 15:29:59 -07:00
Alex Jaramillo bd51b7c692 Use O_NOFOLLOW in open calls
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-04-03 13:53:55 -07:00
Alex Jaramillo 77874c9c40 Add missing free
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-04-03 13:53:55 -07:00
Alex Jaramillo 6a91a71475 Simplify resource disposition
Close file descriptor in one place instead of three.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-04-03 13:53:55 -07:00
Alex Jaramillo 0b10f69f2b Update security policy
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-04-02 15:19:08 -07:00
Alex Jaramillo b7f5eb0a7c README: note about tarball signature
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-04-01 21:49:08 -07:00
Alex Jaramillo 4d32436b6c configure.ac: bump version
Includes static analysis fixes.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
v2.4.2
2025-04-01 10:42:58 -07:00
Alex Jaramillo 3a73ca4e75 Insure body is null terminated
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
v2.4.1
2025-04-01 10:02:15 -07:00
Alex Jaramillo b506773879 Add missing free
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-04-01 10:02:15 -07:00
Alex Jaramillo 3b3f882c3a Include null terminator from str
memcpy should copy the null terminator too. The code as it is works
because the destination has null terminators, but we should not relly on
those. We should copy the str and it's null termination.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-03-31 21:07:42 -07:00
Alex Jaramillo 4f97b51f10 Handle curl_easy_setopt return codes
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-03-31 21:07:42 -07:00
Alex Jaramillo f3e29b5e5a TOCTOU mitigation
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-03-31 21:07:42 -07:00
Alex Jaramillo 5820a1b959 Fix potential resource leak
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-03-31 21:07:42 -07:00
Alex Jaramillo 44d423a7c4 Use correct license file name in make dist
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-03-27 10:11:22 -07:00
Alex Jaramillo 1bcaf35a6c Make the license detectable
This change updates the project's license file to ensure it is detectable
by GitHub, enhancing its visibility on the project landing page.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-03-27 09:35:45 -07:00
Alex Jaramillo 00556dde05 Update github action
- Use latest version of checkout action.
- Checkout the head of the PR commit.
- Install json-c dependency.
- Use libcheck from OS.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-03-27 09:15:55 -07:00
Alex Jaramillo d162311e31 telemetry.c: improvements
- tm_set_payload: check payload for NULL value before duplication, this
  is desirable due the use of strnlen and strndup.

- tm_set_payload: replace strlen with strnlen to use MAX_PAYLOAD_LENGTH
  during function call instead of checking after the fact.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2025-03-19 15:35:45 -07:00
Alex Jaramillo f23bc1ae12 configure.ac: bump version
Replace clear text record format with json to transmit records to
telemetry collector.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
v2.4.0
2025-03-13 18:32:18 -07:00
Brett T. Warden d0ee68ba43 Publish a JSON message to telemetry server
Replace the custom HTTP headers and plain text payload with a JSON
object. This is the new v3 API implementation.
2025-03-10 12:06:12 -07:00
Brett T. Warden 9bb9288153 Link telemetry post daemon against json-c
also link its test
2025-03-10 12:06:12 -07:00
Brett T. Warden b9ec06fe9a Check for json-c
json-c is now required, in order to construct the JSON payload.
2025-03-10 12:06:12 -07:00
Brett T. Warden 32b306daa9 Update default URL API to v3
Updating the HTTP API from v2 to v3 to support JSON message
encapsulation instead of custom HTTP headers with a single-field POST
field for the payload.
2025-03-10 12:06:12 -07:00
Alex Jaramillo c3b8d81b6d configure.ac: bump version
Increase the version to 2.3.5 to release fix for missing records in
journal and preempt klogscanner service start inside containers.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
v2.3.5
2020-02-24 21:37:06 +00:00
Alex Jaramillo f4f012af7b fix first record missing from journal
This change fixes the condition when the first record after telempostd
starts is not inserted in the telemetry journal.

Notice! there is a change in the logic, while previously records
where inserted to juornal as soon the record was processed. After this
change records will be inserted in the journal only when successfully
delivered or record_server_delivery_enabled is set to false.
2020-02-24 13:27:32 -08:00
Thiago Macieira 9db4e1d8c9 Don't try to start the klogscanner service inside a container
We can't access the klog.

● klogscanner.service - Telemetrics Kernel Log Scanner
     Loaded: loaded (/usr/lib/systemd/system/klogscanner.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Fri 2020-01-31 10:44:58 PST; 8min ago
    Process: 21 ExecStart=/usr/bin/klogscanner (code=exited, status=1/FAILURE)
   Main PID: 21 (code=exited, status=1/FAILURE)

Jan 31 10:44:58 <MACHINENAME> systemd[1]: Started Telemetrics Kernel Log Scanner.
Jan 31 10:44:58 <MACHINENAME> klogscanner[21]: ERROR: Cannot read size of kernel ring buffer: Operation not permitted
Jan 31 10:44:58 <MACHINENAME> systemd[1]: klogscanner.service: Main process exited, code=exited, status=1/FAILURE
Jan 31 10:44:58 <MACHINENAME> systemd[1]: klogscanner.service: Failed with result 'exit-code'.
2020-02-05 10:06:08 -08:00
Alex Jaramillo a0efa230b7 configure.ac: bump version
Increase the version to 2.3.4 to release CI configuration changes,
memory leaks fixes, and crash probe frame counter fix.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
v2.3.4
2020-01-30 21:58:59 +00:00
Juro Bystricky f14d6ff4c5 crash_probe.c: process_corefile: reset frame counter
process_corefile may be called twice due to retry logic.
Make sure frame_counter is initialized each time.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2020-01-30 13:11:26 -08:00
Alex Jaramillo b61b152cb0 replace travis badge for github workflows 2020-01-27 11:05:46 -08:00
Alex Jaramillo ee25d1568d random shift to hprobe timer 2020-01-24 10:47:55 -08:00
avjarami 622fcfca10 pr comments and actions update 2020-01-22 16:08:15 -08:00
avjarami 33609c5607 update CI configuration 2020-01-22 16:08:15 -08:00
avjarami 8ebc882955 fix potential leaks 2020-01-22 16:08:15 -08:00
avjarami d30eb663b3 fixing memory leaks in tests 2020-01-22 16:08:15 -08:00
avjarami 885e325e1e valgrind check for tests 2020-01-22 16:08:15 -08:00
avjarami fffe18a96b Trigger verification on PR opening 2020-01-22 18:03:24 +00:00
Juro Bystricky d9925e1f96 configure.ac: bump version
Increase the version to 2.3.3 due to the fixed buffer
overrun in telemctl.c.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
v2.3.3
2020-01-09 13:32:30 -08:00
Juro Bystricky c3ae907651 telemctl.c: fix buffer overflow
The function "concatargs" allocated a buffer for concatenated strings
that was 1 byte short of needed, not accounting for the terminating
NULL char.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2020-01-09 08:53:42 -08:00
Juro Bystricky 8ca299314c configure.ac: bump version
Increase the version to 2.3.2 to reflect the fact that
bertprobe was entirely removed. The bertprobe functionality
was moved to klogscanner.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
v2.3.2
2019-12-17 18:39:20 -08:00
Juro Bystricky 53d4c229a7 klog_scanner.c: truncate payload if needed
Payloads can exceed MAX_PAYLOAD_SIZE, in which case the probe
will fail to send any data to the backend server. This was observed
with BERT payloads, but other payload types can exceed the maximum
size as well.

This patch truncates the payload if needed. It is better to receive
a truncated report than none.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-12-16 10:49:50 -08:00
Juro Bystricky 7a3082eb59 Merge BERT probe with klogscanner
New Linux kernels detect/interpret/display BERT errors in klog.
This makes bertprobe unnecessary, as all the information can
be simply grabbed from klog. This also removes the need to
encode the binary data into HEX/ASCII, so all the encoding
code can be removed as well, including the test suite.

The change was implemented by adding a new pattern for BERT
in the oops_parser.c with some additional minor changes.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-12-13 15:16:20 -08:00
avjarami 071ad2c883 configure.ac: bump version to v2.3.1
Bump version to release fixes to BERT probe.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
v2.3.1
2019-11-25 18:32:38 +00:00
Juro Bystricky 72ea0d9360 bertprobe: fix failures and logging
Fix a reported problem: https://github.com/clearlinux/telemetrics-client/issues/170

This patch fixes the case when there is no error reported via BERT data
and yet the probe fails with error such as:
"Failed to read payload from: /sys/firmware/acpi/tables/data/BERT"
Which then results in journalprobe reporting:
"bert-probe.service: Main process exited, code=exited, status=1/FAILURE"

The file BERT data file now has root only read permissions:

 $ ls -al /sys/firmware/acpi/tables/data/BERT
-r-------- 1 root root 32768 Nov 25 07:37 /sys/firmware/acpi/tables/data/BERT

Hence the user "telemetry" cannot read it anymore. In addition, the file size
can be more than max payload size (4k). However, the file can be completely
blank. The probe inspects the block_status for any present errors.
If there aren't any, probe does not report anything.

While in there, for consistency reasons, modified "printf" statements with
error messages to telem_log(LOG_ERR, msg)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-11-25 10:22:31 -08:00
Juro Bystricky 49823eae83 configure.ac: bump version to v2.3.0
Bump due to switching from opt-out to opt-in.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
v2.3.0
2019-11-12 10:26:30 -08:00
Juro Bystricky a12c1d8761 telemctl.c: validate privileges
Not all commands need to be run as root.
In particular "is-active".
While in there, some minor formatting fixes.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-11-12 10:26:30 -08:00
Auke Kok eb1e670b5f Add github actions CI. 2019-11-07 14:04:14 -08:00
Alex Jaramillo 5cbd31cbf2 Require explicit telemctl opt-in
telemetrics-client installation starts when the package is installed,
this change makes sure that to start telemetry the first time two steps
are needed: 1- telemctl opt-in and 2- telemctl start

Signed-off-by: Alex Jaramillo <alex.jch@gmail.com>
2019-10-14 11:02:20 -07:00
Juro Bystricky 4119bdea33 configure.ac: bump version to 2.2.3
Version bump to reflect changes in the package.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
v2.2.3
2019-10-08 09:53:02 -07:00
Juro Bystricky 2395f6bf3e python-probe.c: remove python probe
Remove all references to python probe. The python exceptions
are handled entirely in Python code. This telemetrics-client
package does not need to be aware of the Python code exception handling
and does not need to make any provisions for it (such as creating
services and directories).
It is the responsibility of Python exception handling to properly
interface with the telemetry library.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-10-08 09:52:35 -07:00
Tian Baofeng bc7e2610ee pstore_probe.c: add ramoops file support in pstore probe for cl telemetry
Add support for ramoops files in pstore probe, get the crash information
from "/sys/fs/pstore/dmesg-ramoops-x" files.
Add the "-f" cmd option support to input runtime config file when
running the probe.

Change-Id: Id7f26d6e07a7c215027b9be039356b2633d4869f
Signed-off-by: Tian Baofeng <baofeng.tian@intel.com>
2019-09-16 14:16:40 -07:00