Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/check-tcport
Listen check tool via ipaddr, port and uid
https://github.com/matsumotory/check-tcport
Last synced: about 2 months ago
JSON representation
Listen check tool via ipaddr, port and uid
- Host: GitHub
- URL: https://github.com/matsumotory/check-tcport
- Owner: matsumotory
- Created: 2016-11-21T09:50:14.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-21T16:29:39.000Z (about 8 years ago)
- Last Synced: 2024-10-18T18:29:02.675Z (3 months ago)
- Language: C
- Size: 8.79 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# check-tcport
Check listening tcp port by uid, port and ipaddr on Linux
## build
```
make
```## example
- return value is 0 when listening with your parameters
- return value is 1 when not listening with your parameters```
./check-tcport ipaddr port uid
``````
$ ./check-tcport 0.0.0.0 8080 808000
state=TCP_LISTEN ipaddr=0.0.0.0 port=8080 inode=3760955 uid=808000$ netstat -lnte | grep '0.0.0.0:8080\|808000'
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 808000 3760955
```## time
```
$ time netstat -lnte | grep '0.0.0.0:8080\|808000'
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 808000 3760955real 0m0.010s
user 0m0.001s
sys 0m0.011s$ time ./check-tcport 0.0.0.0 8080 808000
state=TCP_LISTEN ipaddr=0.0.0.0 port=8080 inode=3760955 uid=808000real 0m0.005s
user 0m0.000s
sys 0m0.005s
```