Naereen / uLogMe

:bar_chart: :chart_with_upwards_trend: Automatically collect and visualize usage statistics on Ubuntu, with :musical_keyboard: key frequencies and :computer: window titles →
https://Naereen.GitHub.io/uLogMe/
MIT License
67 stars 14 forks source link

No data in the dashboard #30

Closed HaoZeke closed 6 years ago

HaoZeke commented 6 years ago

I love the idea of the dashboard, however, I am somehow not able to get any output.

The error is rather descriptive but I was wondering if there is a simple fix:

  File "/usr/lib/python3.7/http/server.py", line 426, in handle
    self.handle_one_request()
  File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request
    method()
  File "/home/haozeke/Git/Github/Linux/uLogMe/scripts/ulogme_serve.py", line 100, in do_POST
    updateEvents()  # defined in export_events.py
  File "/home/haozeke/Git/Github/Linux/uLogMe/scripts/export_events.py", line 157, in updateEve
nts
    with open(fwrite, "w") as f:
FileNotFoundError: [Errno 2] No such file or directory: '../render/json/events_1539567000.json'
Naereen commented 6 years ago

Hi @HaoZeke, thanks for your interest! I have never seen this issue. Maybe you can try this step:

$ cd /home/haozeke/Git/Github/Linux/uLogMe/render/
$ mkdir json/

to force to create the json folder. It might be that the bash script coudn't save the log files if the folder is not there.

Naereen commented 6 years ago

Hum actually, if you just launch the dashboard script well there is no way the system has collected data, you need to launch both the data collection script (ulogme_data.sh, as explained here "To start recording") and the dashboard script (ulogme_serve.sh)!

HaoZeke commented 6 years ago

Hum actually, if you just launch the dashboard script well there is no way the system has collected data, you need to launch both the data collection script (ulogme_data.sh, as explained here "To start recording") and the dashboard script (ulogme_serve.sh)!

No the script was running, I used the tmux script... Plus I definitely have log files:

.
├── keyfreq_1539567000.txt
├── keyfreq_1539653400.txt
├── keyfreq_today.txt -> keyfreq_1539653400.txt
├── window_1539567000.txt
└── window_1539653400.txt   

I have also noticed that the keylogging script is not terminated when I CTRL-C and I need to kill it manually with killall -9 keyfreq.sh

HaoZeke commented 6 years ago

Hi @HaoZeke, thanks for your interest! I have never seen this issue. Maybe you can try this step:

$ cd /home/haozeke/Git/Github/Linux/uLogMe/render/
$ mkdir json/

to force to create the json folder. It might be that the bash script coudn't save the log files if the folder is not there.

That worked! A simple workaround is to create folders if they don't exist, perhaps this should be automated?

Great dashboard!

Naereen commented 6 years ago

Thanks for the feedback.

The json/ folder

It was already supposed to be automated, see https://github.com/Naereen/uLogMe/blob/d2b91c783a40eeaf400f397372d647df32ad1a85/scripts/export_events.py#L169 but it was done too late in the script, so I changed this, and it should be fixed. Thanks!

The keylogging script

If you launch the ulogme_tmux.sh script, which launches the ulogme_data.sh, I do not know how to do differently than detach one of the script (I choosed the keylogging instead of the window title logging, arbitrarily…). See https://github.com/Naereen/uLogMe/blob/d2b91c783a40eeaf400f397372d647df32ad1a85/scripts/ulogme_data.sh#L15 Any idea to do it differently?

ulogme_data.sh cannot require to be in tmux (it is an optional dependency).