Commit Graph

15 Commits

Author SHA1 Message Date
Juro Bystricky f516d85e59 telemctl: binary version
Create a binary executable "telemctl" that is equivalent
to the shell script "telemctl".
Main reason is to make (future) localization easier.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-08-06 09:57:29 -07:00
California Sullivan 4b777f71f7 journalprobe: don't process entire journal on restart
This adds an optional argument to journalprobe that allows seeking to
the end of the journal. This is then used in a new service file that is
called by telemctl on restart. This allows us to scan the entire journal
on boot, and only scan new journal entries when restarting, or opting
into telemetry manually. This reduces spam from repeated messages and
fixes a possible privacy concern, as previously running telemctl start
could include journal errors that occurred before telemetrics was opted
into.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
2019-02-18 09:09:39 -08:00
Juro Bystricky 57db31a2c8 pythonprobe: don't use inotify
Don't wait for new payload via inotify, let systemd path unit
detect any new payloads in /usr/lib/telemetry/python and start
the pythonprobe service.
Also set the sticky bit for the above folder, preventing users to
modify permissions.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-01-23 20:56:21 -08:00
Juro Bystricky 6b44aa21c7 klogscanner: merge functionality with oopsprobe
The previous sequence of operations was:
1. klogscanner waits for/monitors kernel buffer for messages.
2. If they come, it creates a "raw" file in /var/cache/telemetry/oops.
3. Once this file is placed into /var/cache/telemetry/oops, it is detected by oopsprobe.
4. oopsprobe parses the "raw" file, creates new payload and and sends it to the backend.

This commit merges the operations:
1. klogscanner waits for/monitors kernel buffer for messages.
2. If they come, parses the klog buffer, creates new payload and and sends it to the backend.

While at it, also declare routines as "static" when possible.
Fixed a few missplaced memory freeing.
Simplify the main loop operations, move allocate/free buffer outside
of the loop.

Return SUCCESS if terminated by the signal SIGTERM. This is a clean
way to stop the service. This prevents spamming the journal (and sending
journal/error telemetry data via journalprobe) each time telemetry is
restarted.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-01-20 21:18:58 -08:00
Juro Bystricky dce6e0ee1d python-probe: Initial commit
The purpose of the python-probe is to monitor a specific folder
(as defined by PYTHON_TELEMETRY_DIR) for any Python generated reports.
If any such file is detected, it is sent to the telemetry backend
for analysis.

The reports are typically tracebacks of unhandled Python exceptions
caused by Python programs residing in /usr/bin. It is the responsibility
of Python to generate the traceback files and place them in
PYTHON_TELEMTRY_DIR. The probe will only detect the presence of the files
and send the content of the files as a payload.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-01-15 16:05:04 -07:00
Alex Jaramillo bb6a08378c Fix for missing restart units
This change fixes a bug where the oops probe and journal probe are not
restarted when telemctl restart is executed.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2019-01-04 13:47:06 -07:00
Alex Jaramillo f81e4c7fba Telemetry refactoring
This change adds a daemon that handles telemetry record retention,
record reporting, and record limiting policies. This new daemon
receives records in a folder that is monitored by inotify.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
2018-09-06 09:57:01 -07:00
avjarami dc4f4e67e4 Addressing review
Addressing comments from first code review and fixing travis-ci
check_journal error in prune test.

Signed-off-by: avjarami <alex.v.jaramillo@intel.com>
2018-03-09 13:16:34 -08:00
avjarami 4a9d8212c8 Basic record journaling
This change adds a logging mechanism for records submitted to telemetry
client. A basic journal is added to keep track of the last 100 valid
records that the daemon processed.

This journal can be queried by a new command line interface that was
added as part of the change 'telem_journal'.

Signed-off-by: avjarami <alex.v.jaramillo@intel.com>
2018-03-09 13:16:34 -08:00
avjarami bc3c7b6a4d Improvements to telemctl
* Using variable instead of literal

* Simplifying filter that removes folders listed in configuration file
2017-12-07 16:01:01 -08:00
avjarami 15d32841f0 Remove work dirs on opt-out
This change removes working directories when the user opt-out of
reporting platform telemetry.
2017-12-07 16:01:01 -08:00
avjarami e3178e1624 Adding is-active option to telemctl
This change adds a simple way to determine if telemd.service is active.
2017-12-07 16:01:01 -08:00
avjarami 7de4351f16 Create working directries on start
telemd will not start or function properly if expected directories are
not present (i.e. spool dir), this change calls systemd-tempfiles to
create dirs listed listed in telemetrics-dirs.conf
2017-12-07 16:01:01 -08:00
Patrick McCarty 2deeef65ad Update path filter for uncrustify
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-05-10 12:07:26 -07:00
Robert Nesius 89c62aae4a First Commit 2016-07-01 20:16:54 +00:00