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>
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>
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>
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>
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>
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>
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>
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>
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>
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