ET Pro Telemetry heartbeats not working

Started by Headless1919, December 23, 2019, 10:34:03 AM

Previous topic - Next topic
hearthbeat is working now, send telemetry is still not working

[root@myfw ~]# time /usr/local/opnsense/scripts/etpro_telemetry/send_telemetry.py

real    0m23.418s
user    0m0.367s
sys     0m0.048s

[root@myfw ~]# echo $?
255


Dec 28 06:31:00   /send_telemetry.py: telemetry data collected 1 records in 0.06 seconds @2019-12-28 01:18:01.170855
Dec 28 06:30:00   /send_telemetry.py: telemetry data collected 1 records in 0.07 seconds @2019-12-28 01:18:01.170855
Dec 28 06:29:00   /send_telemetry.py: telemetry data collected 1 records in 0.06 seconds @2019-12-28 01:18:01.170855
Dec 28 06:28:00   /send_telemetry.py: telemetry data collected 1 records in 0.06 seconds @2019-12-28 01:18:01.170855
Dec 28 06:27:00   /send_telemetry.py: telemetry data collected 1 records in 0.09 seconds @2019-12-28 01:18:01.170855
Dec 28 06:26:00   /send_telemetry.py: telemetry data collected 1 records in 0.06 seconds @2019-12-28 01:18:01.170855
Dec 28 06:25:00   /send_telemetry.py: telemetry data collected 1 records in 0.20 seconds @2019-12-28 01:18:01.170855
Dec 28 06:24:00   /send_telemetry.py: telemetry data collected 1 records in 0.06 seconds @2019-12-28 01:18:01.170855
Dec 28 06:23:00   /send_telemetry.py: telemetry data collected 1 records in 0.07 seconds @2019-12-28 01:18:01.170855
Dec 28 06:22:00   /send_telemetry.py: telemetry data collected 1 records in 0.05 seconds @2019-12-28 01:18:01.170855
Dec 28 06:21:00   /send_telemetry.py: telemetry data collected 1 records in 0.06 seconds @2019-12-28 01:18:01.170855
Dec 28 06:20:00   /send_telemetry.py: telemetry data collected 1 records in 0.20 seconds @2019-12-28 01:18:01.170855
Dec 28 06:19:00   /send_telemetry.py: telemetry data collected 1 records in 0.05 seconds @2019-12-28 01:18:01.170855
Dec 28 06:18:00   /send_telemetry.py: telemetry data collected 1 records in 0.23 seconds @2019-12-28 01:18:01.170855
Dec 28 06:17:00   /send_telemetry.py: telemetry data collected 1 records in 0.06 seconds @2019-12-28 01:18:01.170855
Dec 28 06:16:00   /send_telemetry.py: telemetry data collected 1 records in 0.15 seconds @2019-12-28 01:18:01.170855
Dec 28 06:15:00   /send_telemetry.py: telemetry data collected 1 records in 0.16 seconds @2019-12-28 01:18:01.170855
Dec 28 06:14:00   /send_telemetry.py: telemetry data collected 1 records in 0.06 seconds @2019-12-28 01:18:01.170855
https://www.signorini.ch
Protectli Pfsense Mi7500L6 Intel 7Th Gen Core I7 7500U 16Gb Ddr4 Ram
512Gb Msata Ssd
6 X Intel Gigabit Ethernet


NOW it's working, this morning I got a timeout after more than 20 second.

[root@myfw ~]# time /usr/local/opnsense/scripts/etpro_telemetry/send_telemetry.py

real    0m0.292s
user    0m0.269s
sys     0m0.024s
https://www.signorini.ch
Protectli Pfsense Mi7500L6 Intel 7Th Gen Core I7 7500U 16Gb Ddr4 Ram
512Gb Msata Ssd
6 X Intel Gigabit Ethernet

As it has been doing all along, assumptions are usually not very valuable.


# /usr/local/opnsense/scripts/etpro_telemetry/send_telemetry.py -h
usage: send_telemetry.py [-h] [-e ENDPOINT] [-i] [-c CONFIG] [-l LOG]
                         [-s STATE] [-d DAYS] [-D]

optional arguments:
  -h, --help            show this help message and exit
  -e ENDPOINT, --endpoint ENDPOINT
                        Endpoint url to reach
  -i, --insecure        Insecure, skip certificate validation
  -c CONFIG, --config CONFIG
                        rule downloader configuration
  -l LOG, --log LOG     log directory containing eve.json files
  -s STATE, --state STATE
                        persistent state (and lock) filename
  -d DAYS, --days DAYS  Maximum number of days to look back on initial run
  -D, --direct          do not sleep before send (disable traffic spread)                       <-------------------- !!




LOL I don't get why do you insist so much...

This morning it was not working, the command I executed is exactly the same, and it's what is in crontab.

Now it works

[root@myfw ~]# cat /usr/local/etc/cron.d/etpro-telemetry.cron
# DO NOT EDIT THIS FILE -- OPNsense auto-generated file
#
# User-defined crontab files can be loaded via /etc/cron.d
# or /usr/local/etc/cron.d and follow the same format as
# /etc/crontab, see the crontab(5) manual page.
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
#minute hour    mday    month   wday    who     command
0       *       *       *       *       root    /usr/local/opnsense/scripts/etpro_telemetry/send_heartbeat.py
*       *       *       *       *       root    /usr/local/opnsense/scripts/etpro_telemetry/send_telemetry.py

[root@myfw ~]# /usr/local/opnsense/scripts/etpro_telemetry/send_telemetry.py
[root@myfw ~]# echo $?
0

Compare this with the 23 seconds when IT WAS NOT WORKING

[root@myfw ~]# while true; do time /usr/local/opnsense/scripts/etpro_telemetry/send_telemetry.py; done

real    0m0.351s
user    0m0.312s
sys     0m0.040s

real    0m0.354s
user    0m0.293s
sys     0m0.062s

real    0m0.356s
user    0m0.265s
sys     0m0.092s

real    0m0.355s
user    0m0.317s
sys     0m0.040s

real    0m0.341s
user    0m0.278s
sys     0m0.063s

real    0m0.344s
user    0m0.299s
sys     0m0.046s

real    0m0.352s
user    0m0.297s
sys     0m0.056s

real    0m0.348s
user    0m0.279s
sys     0m0.070s

real    0m0.382s
user    0m0.342s
sys     0m0.040s

real    0m0.352s
user    0m0.330s
sys     0m0.024s

real    0m0.376s
user    0m0.322s
sys     0m0.055s

real    0m0.370s
user    0m0.308s
sys     0m0.063s

real    0m0.360s
user    0m0.321s
sys     0m0.040s

real    0m0.339s
user    0m0.285s
sys     0m0.055s

real    0m1.483s
user    0m0.494s
sys     0m0.031s

real    0m0.569s
user    0m0.490s
sys     0m0.064s

real    0m0.474s
user    0m0.392s
sys     0m0.063s

real    0m0.341s
user    0m0.318s
sys     0m0.023s

real    0m0.346s
user    0m0.300s
sys     0m0.048s

real    0m0.362s
user    0m0.285s
sys     0m0.078s
^C

Do you think I have no idea what I am speaking about, you are totally wrong

From where does YOUR "assumption" that it was working? You even didn't notice the issue before we post the case here. I did several test, and I tell you it was not working

Now I will stop reply since it's becoming ridiculous, I just posted a consideration in first post, no need to defend Telemetry
https://www.signorini.ch
Protectli Pfsense Mi7500L6 Intel 7Th Gen Core I7 7500U 16Gb Ddr4 Ram
512Gb Msata Ssd
6 X Intel Gigabit Ethernet

Only for reference, because code doesn't lie.

https://github.com/opnsense/plugins/blob/9c4b22815d1d4b2b954d84fae28f9f8c172cb27d/security/etpro-telemetry/src/opnsense/scripts/etpro_telemetry/send_telemetry.py#L87-L88

(random wait between 0 and 60 seconds, when not supplying the parameter in my previous posting and there's data to be processed)