Option to replace running processes with the tail of journalctl or other configured log
I think it would be quite handy to have an option (perhaps a toggle) to switch between the running processes and the tail of journalctl or other configured log.
It would be even more powerful if that display could be filtered to just errors, warnings, or other custom filter.
I'll try to get familiar with the code to suggest a solution but others will likely be much faster and better coders than me.
Hi @ashrama
This is a good idea but need discussion regarding the implementation detail.
First of all, you said that you want to replace the running process list (processlist plugin) by the tail log plugin. Why ? Every plugin can be enable or disable through the configuration file or command line options. So we can choose to display the tail log plugin additionally to the processlist It is also possible to reduce the number of processes to display through the max_process_display option (see https://github.com/nicolargo/glances/blob/develop/conf/glances.conf#L33).
Second discussion is the refresh time. By default Glances is refreshed every 2 seconds (it's configurable) but it is an optimal value between the CPU consumption and the user experience. For the tail plugin, if there is a lot of messages, it can be an issue (an error message can be miss).
Technically speaking, we had to find a way to write a pure Python script that can do this in a non-blocking call (see discussion here: https://stackoverflow.com/questions/12523044/how-can-i-tail-a-log-file-in-python). The code should be compliant with both Linux, Windows and MacOS operating systems and last but not least it should not consume lot of CPU.
PS: Just for the record, a contributor has try to push a pull request with a "tail plugin" feature but it was never finished: see https://github.com/nicolargo/glances/pull/3071
First of all, you said that you want to replace the running process list (processlist plugin) by the tail log plugin. Why ? Every plugin can be enable or disable through the configuration file or command line options.First of all, you said that you want to replace the running process list (processlist plugin) by the tail log plugin. Why ? Every plugin can be enable or disable through the configuration file or command line options.
Yes sorry, not replace it completely but but to be able to specify which one you want displayed, or even better to be able to toggle between the two in real time.
For the tail plugin, if there is a lot of messages, it can be an issue (an error message can be miss).
Yes, this would have to be understood. But also being able to filter for only errors or warnings or even a specific process would reduce information being missed.
Technically speaking, we had to find a way to write a pure Python script that can do this in a non-blocking call (see discussion here: https://stackoverflow.com/questions/12523044/how-can-i-tail-a-log-file-in-python). The code should be compliant with both Linux, Windows and MacOS operating systems and last but not least it should not consume lot of CPU.
PS: Just for the record, a contributor has try to push a pull request with a "tail plugin" feature but it was never finished: see https://github.com/nicolargo/glances/pull/3071
Thanks, I'll go check both of these out and see how they can inform this idea.
This issue is stale because it has been open for 3 months with no activity.