Bug 253410

Summary: [NEW PORT] net/p5-Net-Connection-ncnetstat A netstat like utility that supports color and searching
Product: Ports & Packages Reporter: Zane C. Bowers-Hadley <vvelox>
Component: Individual Port(s)Assignee: Steve Wills <swills>
Status: Closed FIXED    
Severity: Affects Only Me CC: swills
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on: 253406, 253408, 253409, 253690    
Bug Blocks:    
Attachments:
Description Flags
svn diff
none
svn diff for 0.6.2
none
svn diff
none
svn diff
none
svn diff
none
svn diff
none
svn diff none

Description Zane C. Bowers-Hadley 2021-02-10 12:49:09 UTC
Created attachment 222337 [details]
svn diff

Provides a enhances colorized netstat like tool that is
capable of doing searches.

The search criteria can be any of the following.

 * CIDR
 * port
 * host
 * PTR
 * pctcpu
 * pctmem
 * Regex PTR
 * state
 * UID
 * username
 * wait channel

Among other unique features it can also display the full
command, PctMem, and PctCPU of the process with the connection.

WWW: https://metacpan.org/release/Net-Connection-ncnetstat
Comment 2 Steve Wills freebsd_committer freebsd_triage 2021-02-16 04:42:45 UTC
Built the dependent ports and installed this and got:

Can't locate Net/Connection/lsof.pm in @INC (you may need to install the Net::Connection::lsof module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.32 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.32/mach /usr/local/lib/perl5/5.32) at /usr/local/lib/perl5/site_perl/Net/Connection/ncnetstat.pm line 9.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/Net/Connection/ncnetstat.pm line 9.
Compilation failed in require at /usr/local/bin/ncnetstat line 6.
BEGIN failed--compilation aborted at /usr/local/bin/ncnetstat line 6.
Comment 3 Zane C. Bowers-Hadley 2021-02-16 08:28:41 UTC
(In reply to Steve Wills from comment #2)

Doh! Just realized there is a old use line I accidentally left from the previous version that did not use sockstat, only used lsof. Sweet. Fixing. Thank for the catch!
Comment 4 Zane C. Bowers-Hadley 2021-02-16 08:41:23 UTC
Created attachment 222484 [details]
svn diff for 0.6.2
Comment 5 Zane C. Bowers-Hadley 2021-02-16 08:42:05 UTC
(In reply to Steve Wills from comment #2)

And now fixed in 0.6.2. That has been pushed to CPAN and I've updated the diff.
Comment 6 Steve Wills freebsd_committer freebsd_triage 2021-02-16 14:41:02 UTC
(In reply to Zane C. Bowers-Hadley from comment #5)
Hmm, seems the same:

Can't locate Net/Connection/lsof.pm in @INC (you may need to install the Net::Connection::lsof module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.32 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.32/mach /usr/local/lib/perl5/5.32) at /usr/local/lib/perl5/site_perl/Net/Connection/ncnetstat.pm line 18.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/Net/Connection/ncnetstat.pm line 18.
Compilation failed in require at /usr/local/bin/ncnetstat line 6.
BEGIN failed--compilation aborted at /usr/local/bin/ncnetstat line 6.

The category in these ports doesn't match the categories in the titles.

There's a dependency issue:

p5-Data-Unixish>=1.570:devel/p5-Data-Unixish/pkg-plist

shouldn't have "/pkg-plist".

COMMENT is not supposed to begin with 'A ', 'An ', or 'The '.

portlint and poudriere find these issues, it would be a good idea if to run them before submitting.
Comment 7 Zane C. Bowers-Hadley 2021-02-16 16:14:40 UTC
(In reply to Steve Wills from comment #6)

Was about to ask for the output of $^O there. Found that apparently use will always be evaluated. I'll need to swap that for require.



That said need to cleanup a few of the depend ports, derp. Realized I made a few small mistakes when I knocked this out and submitted while sleep deprived. Sorry about the problems there, I'll get that taken care of tomorrow night. :)
Comment 8 Zane C. Bowers-Hadley 2021-02-16 16:38:03 UTC
Okay, 0.6.3 uploaded to CPAN.

I'll get the rest fixed tomorrow night. Getting late in the morning and sleep is needed or I am likely to botch something else silly. =^.^=
Comment 9 Zane C. Bowers-Hadley 2021-02-17 10:31:27 UTC
Created attachment 222523 [details]
svn diff

Portlint and poudriere all happy now.
Comment 10 Steve Wills freebsd_committer freebsd_triage 2021-02-18 03:26:42 UTC
(In reply to Zane C. Bowers-Hadley from comment #9)
Better, but now when I run it, I just get:

Use of uninitialized value in getservbyname at /usr/local/lib/perl5/site_perl/Net/Connection.pm line 343.

repeatedly.
Comment 11 Zane C. Bowers-Hadley 2021-02-18 04:04:34 UTC
(In reply to Steve Wills from comment #10)

Okay. That is strange. Utterly unable to reproduce that here.

Also what version of FreeBSD and Perl are you running? Also what does the output of 'sockstat -46s' look like?

What is the exact command you are using that results in it?
Comment 12 Steve Wills freebsd_committer freebsd_triage 2021-02-18 04:32:05 UTC
(In reply to Zane C. Bowers-Hadley from comment #11)
I emailed you sockstat output separately from this bug for privacy reasons. The command I'm running is "ncnetstat". I have perl5-5.32.1_1. I am running FreeBSD 14.0-CURRENT, main-n244529-29f37e9bcc6.
Comment 13 Zane C. Bowers-Hadley 2021-02-18 05:05:57 UTC
(In reply to Steve Wills from comment #12)

Awesome. I see exactly what is happening. The output from sockstat on your system is mangled. It looks like it does not handle real long IPv6 addresses well and sometimes does not separate the columns, joining two together with out any space.

Looks like like I am going to revert the change to using sockstat.
Comment 14 Zane C. Bowers-Hadley 2021-02-19 13:06:06 UTC
Created attachment 222634 [details]
svn diff

New version, 0.7.0, that just uses lsof after depreciating sockstat.

Thanks for the help in locating the formatting issue with sockstat.
Comment 15 Zane C. Bowers-Hadley 2021-02-19 16:44:12 UTC
Created attachment 222644 [details]
svn diff

Update to 0.7.1.
Comment 16 Zane C. Bowers-Hadley 2021-02-19 16:55:10 UTC
Created attachment 222646 [details]
svn diff

Whoops. The last file was the module tgz.
Comment 17 Zane C. Bowers-Hadley 2021-02-20 14:27:28 UTC
Created attachment 222676 [details]
svn diff

Update the required version of Net::Connection::Match to 0.5.0.
Comment 18 commit-hook freebsd_committer freebsd_triage 2021-02-27 00:06:52 UTC
A commit references this bug:

Author: swills
Date: Sat Feb 27 00:06:37 UTC 2021
New revision: 566648
URL: https://svnweb.freebsd.org/changeset/ports/566648

Log:
  net/p5-Net-Connection-ncnetstat: create port

  Provides a enhances colorized netstat like tool that is
  capable of doing searches.

  The search criteria can be any of the following.

   * CIDR
   * port
   * host
   * PTR
   * pctcpu
   * pctmem
   * Regex PTR
   * state
   * UID
   * username
   * wait channel

  Among other unique features it can also display the full
  command, PctMem, and PctCPU of the process with the connection.

  WWW: https://metacpan.org/release/Net-Connection-ncnetstat

  PR:		253410
  Submitted by:	Zane C. Bowers-Hadley <vvelox@vvelox.net>

Changes:
  head/net/p5-Net-Connection-ncnetstat/
  head/net/p5-Net-Connection-ncnetstat/Makefile
  head/net/p5-Net-Connection-ncnetstat/distinfo
  head/net/p5-Net-Connection-ncnetstat/pkg-descr
  head/net/p5-Net-Connection-ncnetstat/pkg-plist
Comment 19 Steve Wills freebsd_committer freebsd_triage 2021-02-27 00:10:32 UTC
Committed, thanks!