What I want to do is to write a script that gathers some information (like cpu temperature and bandwidth usage) and logs it into a file.
I can't figure out how to get a single sample of the current used bandwidth: I've found that there's plenty of tools to get this information from command line, but the majority of them are curses based, so I can't take their output to put it into a file. Among these I've found bmon, that has a nice ascii output. The problem is that this output is updated constantly, while what I want is a single "sample" per program call.
Is there a way to get this done with bmon or someone knows another program to accomplish this task?