OutsideIT / FireMotD

:fire: Fire Framework Linux MoTD Generator :fire:
https://outsideit.net/firemotd
GNU General Public License v3.0
175 stars 45 forks source link

most functions no more supported in Raspbian GNU/Linux 9 (stretch) #65

Closed dirkclemens closed 6 years ago

dirkclemens commented 7 years ago

since upgrading to Stretch most functions no longer report correct values:

#          Ip = Unknown
##     Release = Unknown
##      Kernel = Unknown
##    Platform = Unknown
##      Uptime = 2 day(s). 13:4:11
##   Installed = Unknown
##   CPU Usage = 4.33% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
##    CPU Load = 1m: 0.83, 5m: 0.25, 15m: 0.09
##      Memory = Free: 0.06GB (7%), Used: 0.88GB (93%), Total: 0.94GB
##        Swap = Free: 0.07GB (79%), Used: 0.02GB (21%), Total: 0.09GB
##        Root = Free: 49.98GB (76%), Used: 15.13GB (24%), Total: 68.24GB
##     Updates = Unknown Unknown updates available
##    Sessions = 1 sessions
##   Processes = 166 running processes of 32768 maximum processes
##      Apache = Version: Unknown
##       nginx = Version: Unknown
##       MySQL = Version: Unknown Distribution: Unknown
##  PostgreSQL = Version: Unknown
##         PHP = Version: Unknown, Memory Limit: Unknown
willemdh commented 7 years ago

@dirkclemens You need to configure the cronjob to get and store this information in FireMotD.json. The information you do see is generated at logon, the rest needs to be generated with a cronjob. (unless you edit the FireMotD.json yourself)

/usr/local/bin/FireMotD -S

Let me know how it goes.

ThomDietrich commented 7 years ago

@willemdh to prevent this misunderstanding in future maybe it would be a good idea to show a warning when the json is old or missing?

willemdh commented 7 years ago

@ThomDietrich Good idea, I'll see about adding that. Also you need the packages moreutilsand jq to make it work.

mikechabot commented 6 years ago

+1 for the ability to dynamically generate the JSON during each run. Maybe a "-D" flag or something, although I understand it may not be super optimized.

I'm using a custom template to show a limited block of information on a 3.5" touchscreen.

############################################################
############################################################
## Ip -> 192.168.1.144
## Release -> Raspbian GNU/Linux 9 (stretch)
## Kernel -> Linux 4.14.34-v7+
## Platform -> Raspberry Pi 3 Model B Plus Rev 1.3
## Updates -> 18 apt updates available.
############################################################
############################################################

After running sudo apt-get update and sudo apt-get dist-upgrade, I was still shown the output above, although my IP had changed, and the packages had been updated.

I stumbled across this issue and /usr/local/bin/FireMotD -S did the trick:

############################################################
############################################################
## Ip -> 192.168.1.73
## Release -> Raspbian GNU/Linux 9 (stretch)
## Kernel -> Linux 4.14.34-v7+
## Platform -> Raspberry Pi 3 Model B Plus Rev 1.3
## Updates -> 0 apt updates available.
############################################################
############################################################

I wouldn't mind waiting N seconds for the file to generate before being displayed, just so long as its up-to-date 👍

Killer lib by the way!

willemdh commented 6 years ago

@mikechabot you can already define in the template when information is updated. Just put @logon instead of @cron check https://github.com/OutsideIT/FireMotD/blob/master/FireMotD-reference.json

mikechabot commented 6 years ago

@willemdh Ugh, how'd I miss that. Awesome, tyvm.

willemdh commented 6 years ago

Closing this, a warning is shown when the exportfile is unexistant