On 18/05/2016 00:47, entr0py wrote:
Paul Warren:
On 17/05/2016 22:27, entr0py wrote:
After a period of inactivity, iftop removes each line from the main display.
Is it possible to force all lines to persist until cleared?
Do either "P" or "o" do what you want?
Thanks for the reply! Unfortunately, no. IIUC, P prevents further updates to the display and 'o' prevents the addition of additional sources / destinations - so again, static.
I would like iftop to function exactly the way it does now except I don't want any of the generated lines to disappear / fade from the main display until I manually clear the screen.
The motivation behind this request is that I would like to leave iftop running and be able to return to it several hours / days later and be able to see all of the connections and traffic that occurred while away. With the current options, I'll only be able to see this information for connections that were active the entire time.
The simple hack would be to change the following in iftop.c
if(d->last_write == history_pos) { addr_pair key = *(addr_pair*)(n->key); hash_delete(history, &key); free(d); } else { d->recv[history_pos] = 0; d->sent[history_pos] = 0; }
to
if(0) { ...
This would give you what you want, although the only way to remove hosts would be to restart iftop.
If you wanted to provide a mechanism for deleting stuff, you'd need to write something that iterated over "history" and remove hosts that had only zeroed data.
Paul