
Aero AIO: netstat plugin
Source (link to git-repo or to original if based on someone elses unmodified work):
REQUIREMENTS: >= Aero AIO 0.9.1
>= Python 2.4
USAGE:
- Install the .aiz plugin via the Aero AIO config dialog
- The first column is the number of processes with the same name
- The second column is the port at which one of these processes is connecting out
- The third column is the name of the processes
- The fourth column is the IP address to which one of these processes is connecting
- You can adjust the update interval and font size in the config dialog. You can also ask the theme to use sudo to get a list of all processes, not just yours. You must add the appropriate permissions to /etc/sudoers (see config dialog)
- You can also ask the theme to not show processes connecting to localhost via the config dialog
ver 2.0.5
- Fixed a bug in the regexp
ver 2.0.4
- Use Aero AIO 0.9.1 API
ver 2.0.3
- Small change to the regexp to make it more robust. Fixes bug reported by jayenell
ver 2.0.2
- Fixed a bug in the reg-exps. I had assumed that process names consisted only of alpha-numeric characters. KDE uglification adds the period to some names. Changed to match on non space characters (\S)
ver 2.0.1
- Moved to the .aiz Aero AIO plugin format
ver 2.0.0
- Added optional display of IP addresses
- Added support for sudo to see all processes
- Moved the netstat output parsing code into the python script itself (should make for faster execution)
ver 1.0.1
- Added error handling code, should make error reporting easier for users
Ratings & Comments
16 Comments
Hello, I added the correct line in /etc/sudoers file, but it is not working. I tried the cmd line in the script and added sudo -S to it and it returns my connections like it should on the command line, but the plugin is blank. Any why to fix this? Thanks!!! Joe
Does it work without sudo accesss? Can you run SK in a terminal and post the error output.
When I run it from the command line, I get a whole lot of these: Traceback (most recent call last): File "/home/jgiles/.aero_aio/netstat_aio.py", line 119, in update karamba.changeText(widget, self.data, self.readData()) File "/home/jgiles/.aero_aio/netstat_aio.py", line 80, in readData res = self.pretty_pat.sub(self.prettyString, res) # Call self.prettyString for every match File "/home/jgiles/.aero_aio/netstat_aio.py", line 108, in prettyString count = self.rpad(str(self.processCounter[match.group(2)]), self.fields[2]) KeyError: '0' Also, with sudo enabled, I get connections UNTIL I try to connect from a remote box to my box. As an example, if I log into KDE, and start my mail client, I can see IMAP listing in the plugin. Also, if I ssh to my server, I see that as well. Now, if I ssh from another box to the box I am on running superkaramba, then the netstat plugin just goes blank. Everything is ok if I disable SUDO access. HOWEVER, I don't see some traffic that I would like to see. Thanks!!! Joe
Should be fixed in 2.0.5
Using SK 0.39, Python 2.4.3 and AERO AIO 0.8e This seems like a great plugin, but it doesn not show anything. I'm using the latest version and I restarted SK allready. I also saw there is no .sh-script in the scripts directory, but if I understand your changelogcorrectly it should not be there anymore, so that's ok. This is the output from the commandline: Traceback (most recent call last): File "/home/jayenell/.aero_aio/netstat_aio.py", line 111, in update karamba.changeText(widget, self.data, self.readData()) File "/home/jayenell/.aero_aio/netstat_aio.py", line 72, in readData res = self.pretty_pat.sub(self.prettyString, res) # Call self.prettyString for every match File "/home/jayenell/.aero_aio/netstat_aio.py", line 100, in prettyString count = self.rpad(str(self.processCounter[match.group(2)]), self.fields[2]) KeyError: '0'
Hmm...looks like something in your process list is causing a problem. Can you add the following to ~/.aero_aio/netstat_aio.py Above the line res = self.pretty_pat.sub(self.prettyString, res) # Call self.prettyString for every match add print "Result: ", res Then post the output from running the command. If its a lot, you can email it to me: kovid at theory dot caltech dot edu
just like the ps-plugin: very clever idea, great implementation, easy handling and useful - great!
Thanks. For both ps and this, I've tried to keep it as clean and simple as possible.
this is both usefull and cool! great job!
Thanks...it's good to be appreciated
I have a problem here: this is the output I get: Traceback (most recent call last): File "/home/tanis/Downloads/Karamba/Aero-AIO/aero_aio.py", line 276, in widgetUpdated page.update(widget) AttributeError: 'NoneType' object has no attribute 'update' How can i solve it? Thanks a lot!!
I need the error from the netstat_aio.py file to debug it. Start superkaramba like so superkaramba > log 2>&1 Click the netstat icon, if the error occurs, killall superkaramba Post the output of grep -A10 netstat log Thanks, Kovid.
Also could you run the netstat.sh file in the scripts directory and post the output
Forget it... It seems my fault. I reloaded the whole sk and redownloaded Aero-aio and now it works great. Thanks a lot!
Well what can I add? Ur theme is the lighter and well done...........another welcomed plug.
Thanks...I aim to please Kovid.