Commit Graph

66 Commits

Author SHA1 Message Date
jimmylomro
257b576221 add python bindings 2022-03-15 21:35:11 +00:00
Matheus Rambo
cabc2a1ea3 feat: Filter by process #217
It is possible to filter by process id!
Add the -P <pid> flag.
Example: `nethogs -P 123 -P 333` to filter the processes: 123 and 333
2022-02-28 21:00:11 -03:00
Matheus Rambo
b94cd9f227 feat: Add basename support
Now, the user can decide to show only the program name, instead of the
full program path. It is useful, when you have a very long hierarchy of
directories, which, with the full path name, the user might not see the
program name.
2021-12-22 10:01:00 -03:00
Matheus Rambo
82a30bb644 refactor: Change bughunt mode to 'x' 2021-12-22 09:58:45 -03:00
Naïm Favier
afb5759cc3 Disable capability check, handle failure better
Fixes #214
2021-12-02 14:04:08 +01:00
kretcheu
455daf357d Fix compilation error with [-Werror=format-security]
When compiling with [-Werror=format-security] in Debian packaging occurs this error:
```
cui.cpp: In function ‘void show_ncurses(Line**, int)’:                                          
cui.cpp:377:73: error: format not a string literal and no format arguments [-Werror=format-security]
  377 |   mvprintw(3 + 1 + i, cols - COLUMN_WIDTH_UNIT, desc_view_mode[viewMode]);              
      |                                                                         ^               
cui.cpp:379:29: warning: zero-length gnu_printf format string [-Wformat-zero-length]            
  379 |   mvprintw(totalrow + 1, 0, "");                                                        
      |                             ^~      
```

This patch solve the problem.

[]'s
kretcheu
2021-10-09 16:37:10 -03:00
Kondo Takeo
8b2c55c3f3 Fix log message. 2021-02-17 23:13:50 +09:00
Kondo Takeo
b97fb4cfdf Issue: #96 - Garbage collect inodeproc once every 50 ui refresh as default.
- Reduce default frequency to avoid performance issue.
- The frequency of it can be modified with `-g` option
  and can be disabled with `-g 0`.
2021-02-17 23:02:27 +09:00
takeoverjp
12dbf5e28a Update src/inode2prog.cpp
Co-authored-by: Arnout Engelen <arnout@engelen.eu>
2021-02-17 22:31:21 +09:00
Kondo Takeo
0a54596bc6 Issue: #96 - Garbage collect inodeproc on each ui refresh. 2021-02-16 22:42:47 +09:00
Kondo Takeo
a4d2e550cb Fix typo in help message. 2021-02-05 22:39:01 +09:00
Kondo Takeo
b7a42786bd Issue: #62 - Fix conninode_test. 2021-02-05 00:12:21 +09:00
Kondo Takeo
18629a3b33 Issue: #62 - Treat unlisted traffic as 'unknown UDP/TCP' 2021-02-04 23:43:29 +09:00
Kondo Takeo
ccda1b50c4 Issue: #62 - Parse udp proc only when catchall mode. 2021-02-04 23:35:52 +09:00
Kondo Takeo
e024d3eb33 Issue: #62 - UDP support 2021-02-04 00:31:40 +09:00
Aaron France
a3f0586ef8 fix: Expose to_ms / packet buffer timeout to libnethogs 2019-10-01 00:24:04 +02:00
Andreas Wieland
9ccb3538db Issue: #176 - removes exit in inode2prog:
* removes the exit calls in inode2prog which was called if an error
occured while reading /proc/<pid>/cmdline file. Instead an Exception is
thrown with an error message
* adds catch block for all exception while reading cmdline file
2019-06-24 11:51:18 +02:00
Andreas Wieland
2cd523868d run make format with clang-format:
* reformats the repo as adviced in the readme
2019-06-12 15:00:40 +02:00
Andreas Wieland
9dc99c9e14 fixes issues #144, #145:
* adds a try catch block surrounding read_file in the method getcmdline.
  To avoid crashes if a pid is removed while reading was not finished.
2019-06-12 14:38:27 +02:00
Peter M. Petrakis
677baffe6a Add MB/s and GB/s view modes
- Refactored units presentation into a lookup table
- Other minor refactoring
- Updated man page
- Cleaned up trailing white space in the vicinity
2018-12-03 13:55:54 -05:00
d4ryus
51ccf42cea Fix libnethogs handle memory leak
Calling nethogsmonitor_loop, canceling it with nethogsmonitor_breakloop
and then calling it again will lead to a Segmentation fault.

This is due to handles not getting reset to NULL which leads to a
invalid list since the old list will be reused by

  new handle(newhandle, current_dev->name, handles);

in nethogsmonitor_init(). If handles is reset to NULL it will also
remove the only reference to the old list, hence it should be freed to
avoid memory leaks.

This change will reset handles to NULL after freeing all handles when
nethogsmonitor_clean_up is called.
2018-11-11 11:31:44 +01:00
PAVAN
b32ae097ce unknown udp added... 2018-05-18 20:22:44 +05:30
PAVAN
2a1e068dee added unknown udp.... 2018-05-18 19:45:07 +05:30
PAVAN
9baa4aaf34 unknown udp added... 2018-05-15 21:34:29 +05:30
PAVAN
a251024bff fixes issue #110 - dynamic DEV column length, MIN=5, MAX=15 2018-05-03 19:46:48 +05:30
PAVAN
0984d92d90 fixes issue #110 - dynamic DEV column length, MIN=5, MAX=15 2018-05-03 19:12:06 +05:30
PAVAN
5e2763d40f fixes issue #110 - DEV colum length to 15 2018-05-02 00:05:54 +05:30
Arnout Engelen
7093964413 Merge pull request #137 from jantman/issues/29
fixes #29 - change all sent/recv counters from int32 to int64 to prevent wraparound
2017-08-27 16:54:43 +02:00
Jason Antman
2a2ce7c909 fixes #29 - change all sent/recv counters from int32 to int64 to prevent wraparound 2017-08-27 10:46:21 -04:00
Jason Antman
76ced1b8d8 issue #119 - add warnings about capture filter being experimental 2017-08-27 10:37:13 -04:00
Jason Antman
7f02b84ced fixes #119 - add support for pcap capture filters 2017-08-27 09:07:44 -04:00
Arnout Engelen
e5455240c9 Merge pull request #134 from jantman/issues/129
fixes #129 - libnethogs support for limiting to specific devices
2017-08-27 13:49:52 +02:00
Jason Antman
a7c14c842a fixes #129 - libnethogs support for limiting to specific devices 2017-08-26 15:34:30 -04:00
Jason Antman
226ec6ccdb issue #130 - have Process::gettotal include closed connections removed from ConnList 2017-08-26 09:56:43 -04:00
anomen
b27fb233e4 fix compiler warning - type of refreshdelay 2017-01-01 21:24:42 +01:00
Arnout Engelen
ff82eebb6b Merge pull request #108 from anomen-s/issue-23-r
Add -l option to show full command line (fixes #23)
2017-01-01 21:20:18 +01:00
anomen
2d829675a8 cleanup 2017-01-01 20:49:38 +01:00
Arnout Engelen
cfc83336c9 Merge pull request #106 from anomen-s/doc-for-a-option
fix docs of -a option
2016-12-13 15:39:25 +01:00
anomen
5e2c35700b Add -l option to show full command line (fixes #23) 2016-12-05 08:23:50 +01:00
anomen
276d648c33 fix docs of -a option 2016-11-21 21:42:07 +01:00
Arnout Engelen
5400ed3af1 Better error message when dispatching fails
In #104 an error while dispatching is logged, but gives insufficient context
to explain the problem.
2016-11-19 21:00:47 +01:00
Arnout Engelen
8e9de7a17d Remove confusing 'waiting for first packet' message
Users are unlikely to run into this problem anymore, and
might get confused when seeing this message when there's
actually nothing wrong.
2016-11-12 18:29:41 +01:00
Arnout Engelen
9defe58674 Determine version based on git tag or pwd (fixes #92) 2016-07-12 08:16:02 +02:00
Chris
4fbecbe54c Fixes screen flickering on urxvt.
Erase() is ncurses optimal for screen refresh. Clear() blanks the
entire screen first, which produces a flickering output on urxvt.
2016-06-19 01:58:46 -07:00
Hajimu UMEMOTO
d5ac7db5a7 Fix condition 2016-05-16 15:10:58 +09:00
Hajimu UMEMOTO
a359d1bbd4 Support for FreeBSD 2016-05-16 14:46:39 +09:00
Jakub Wilk
0518642c03 Fix typos 2016-04-30 23:04:56 +02:00
Arnout Engelen
9d692b101a Merge pull request #72 from rain-1/master
Detect capabilities when NEEDROOT=0
2016-04-21 19:57:19 +02:00
rain1
30f1072946 * src/main.cpp: Bug fix - nul terminate the result of readlink after checking for failure. 2016-04-18 18:34:08 +01:00
rain1
b6a595ae00 * src/main.cpp: Made cap test conditional on __linux__. Improved the error message.
* src/nethogs.cpp: Reduced the scope of the includes moving them out of this file.
* src/nethogs.h: Removed NEEDROOT variable.
2016-04-18 18:04:37 +01:00