mirror of https://github.com/garabik/grc.git
Merge pull request #163 from grassharper/devel
add support for FreeBSD's sockstat command
This commit is contained in:
commit
7704a1824e
|
@ -0,0 +1,93 @@
|
||||||
|
=======
|
||||||
|
# CAPS LINE
|
||||||
|
regexp=^[A-Z\s%]*([A-Z]{3})[A-Z\s%]*$
|
||||||
|
colours=underline
|
||||||
|
=======
|
||||||
|
# root
|
||||||
|
regexp=^root(?=\s|$)
|
||||||
|
colours=bold red
|
||||||
|
=======
|
||||||
|
# non-root users
|
||||||
|
regexp=^(?:(?!root|USER))([^\s]+)
|
||||||
|
colours=bold yellow,unchanged
|
||||||
|
=======
|
||||||
|
# CMD
|
||||||
|
regexp=^[a-zA-Z]+\w+\s+(\w+)\s+\d+
|
||||||
|
colours=unchanged,bold cyan
|
||||||
|
=======
|
||||||
|
# FD
|
||||||
|
regexp=^[a-zA-Z]+\w+\s+\w+\s+\d+\s+(\d+)
|
||||||
|
colours=unchanged,yellow
|
||||||
|
=======
|
||||||
|
# PID
|
||||||
|
regexp=^[a-zA-Z]+\w+\s+[a-zA-Z]+\w+\s+(\d+)
|
||||||
|
colours=unchanged,bold magenta
|
||||||
|
=======
|
||||||
|
# PROTOCOLS
|
||||||
|
regexp=(tcp4|udp4|tcp6|udp6|stream|dgram)
|
||||||
|
colours=bold blue
|
||||||
|
=======
|
||||||
|
# hostname:service
|
||||||
|
regexp=([\w\.\-]+):([\w\-]+)\b
|
||||||
|
colours=yellow, bold green, bold yellow
|
||||||
|
=======
|
||||||
|
# hostname:port
|
||||||
|
regexp=([\w\.\-]+):(\d+)\b
|
||||||
|
colours=yellow, bold green, bold red
|
||||||
|
=======
|
||||||
|
# *:service
|
||||||
|
regexp=(\*):([\w\-]+)\b
|
||||||
|
colours=yellow, yellow, bold red
|
||||||
|
=======
|
||||||
|
# PATH
|
||||||
|
regexp=\s\/.*\/(\S+)($| \(.*\))
|
||||||
|
colours=green,bright_green,red
|
||||||
|
=======
|
||||||
|
# status
|
||||||
|
regexp=FIN_WAIT.*
|
||||||
|
colours=red
|
||||||
|
=======
|
||||||
|
# status
|
||||||
|
regexp=SYN.*?
|
||||||
|
colours=bold red
|
||||||
|
=======
|
||||||
|
# status
|
||||||
|
regexp=LISTEN(ING)?
|
||||||
|
colours=bold blue
|
||||||
|
=======
|
||||||
|
# status
|
||||||
|
regexp=TIME_WAIT
|
||||||
|
colours=bold red
|
||||||
|
=======
|
||||||
|
# status
|
||||||
|
regexp=CLOS(E(_WAIT)?|ING)
|
||||||
|
colours=red
|
||||||
|
skip=yes
|
||||||
|
=======
|
||||||
|
# status
|
||||||
|
regexp=LAST_ACK
|
||||||
|
colours=red
|
||||||
|
=======
|
||||||
|
# status
|
||||||
|
regexp=ESTAB.*?\b|CONNECTED
|
||||||
|
colours=bold yellow
|
||||||
|
=======
|
||||||
|
# status
|
||||||
|
regexp=FREE
|
||||||
|
colours=bold green
|
||||||
|
=======
|
||||||
|
# status
|
||||||
|
regexp=DISCONNECTING
|
||||||
|
colours=red
|
||||||
|
=======
|
||||||
|
# status
|
||||||
|
regexp=CONNECTING
|
||||||
|
colours=green
|
||||||
|
=======
|
||||||
|
# status
|
||||||
|
regexp=CONNECTING
|
||||||
|
colours=green
|
||||||
|
=======
|
||||||
|
# status
|
||||||
|
regexp=UNKNOWN
|
||||||
|
colours=blink bold red
|
|
@ -42,5 +42,6 @@ if [ "$TERM" != dumb ] && [ -n "$GRC" ]; then
|
||||||
alias semanage='colourify semanage'
|
alias semanage='colourify semanage'
|
||||||
alias getsebool='colourify getsebool'
|
alias getsebool='colourify getsebool'
|
||||||
alias ifconfig='colourify ifconfig'
|
alias ifconfig='colourify ifconfig'
|
||||||
|
alias sockstat='colourify sockstat'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
3
grc.conf
3
grc.conf
|
@ -294,3 +294,6 @@ conf.whois
|
||||||
(^|[/\w\.]+/)go test\s?
|
(^|[/\w\.]+/)go test\s?
|
||||||
conf.go-test
|
conf.go-test
|
||||||
|
|
||||||
|
# sockstat command
|
||||||
|
(^|[/\w\.]+/)sockstat\s?
|
||||||
|
conf.sockstat
|
||||||
|
|
2
grc.fish
2
grc.fish
|
@ -11,7 +11,7 @@ set -U grc_plugin_execs cat cvs df diff dig gcc g++ ls ifconfig \
|
||||||
wdiff blkid du dnf docker docker-compose docker-machine env id ip iostat journalctl kubectl \
|
wdiff blkid du dnf docker docker-compose docker-machine env id ip iostat journalctl kubectl \
|
||||||
last lsattr lsblk lspci lsmod lsof getfacl getsebool ulimit uptime nmap \
|
last lsattr lsblk lspci lsmod lsof getfacl getsebool ulimit uptime nmap \
|
||||||
fdisk findmnt free semanage sar ss sysctl systemctl stat showmount \
|
fdisk findmnt free semanage sar ss sysctl systemctl stat showmount \
|
||||||
tcpdump tune2fs vmstat w who
|
tcpdump tune2fs vmstat w who sockstat
|
||||||
|
|
||||||
for executable in $grc_plugin_execs
|
for executable in $grc_plugin_execs
|
||||||
if type -q $executable
|
if type -q $executable
|
||||||
|
|
Loading…
Reference in New Issue