Skip to content
/ showme Public

Rapid diagnostic system status tool (performance monitoring, network scanning, mysql performance monitoring, kubectl status)

License

Notifications You must be signed in to change notification settings

lflxp/showme

Repository files navigation

Introduction

Rapid diagnostic system status tool (performance monitoring, network scanning, mysql performance monitoring, kubectl status)

快速诊断系统状态工具(性能监控、网络扫描、mysql性能监控)

Install

go get -u github.com/lflxp/showme
make install
showme -h

Example

Module

smart.png

特点

  • 支持 kubectl | go | git | kill 等命令的自动补全
  • 无其它任何依赖,一个文件smkubectl搞定所有事情
  • 无复杂繁琐的fzf配置,无需安装fzf命令
  • 自动生成zsh-completion配置,只需简单配置即可,无需复杂zsh|zsh-completion配置
  • 开箱即用,效率提升,简单易用

安装及使用

go install github.com/lflxp/showme@latest

autoload -U compinit && compinit -u
source <(showme completion zsh)

快捷键

~

操作

  • k ~

  • k g ~

  • k get ~

  • k get po ~ (没有空格)

  • k get po ~ (有空格)

  • k edit po -n

  • k get po -n namespace pod -c ~

  • k logs -f ~

  • 【Doing】k8s 【Kubenetes Dashboard】

k8s.png

  • 【Doing】轻量音乐播放器 【本地网易云音乐】

music.png

monitor.png

s1.png

安装

make gopacket

NMAP

基于优秀的nmap工具进行封装,采用gin api restful remote的方式进行远程调用。

PLAYBOOK

基于Ansible-playbook开发的Go原型工具,功能特点有:

showme playbook

  • RPC远程操作
  • Yaml Template
  • Go Template
  • Plugin Register
  • Mini CMDB Required

Gomartix

黑客帝国字母雨

SEARCH

全局模糊搜索

__test() {
  local cmd="${FZF_TEST_COMMAND:-"list"}"
  setopt localoptions pipefail no_aliases 2> /dev/null
  eval "$cmd"
  local ret=$?
  echo
  return $ret
}

# test
fzf-test() {
  LBUFFER="${LBUFFER}$(__test)"
  local ret=$?
  zle reset-prompt
  return $ret
}
zle     -N   fzf-test
bindkey '^[e' fzf-test

PROXY

基于GOLANG的各种代理工具,处于测试阶段。

Usage

➜  showme git:(master) ✗ showme proxy -h  
* http正向代理
* http 反向代理
* mysql tcp代理(负载均衡、读写分离、分布式调度)
* socket5 代理
* ss fq代理

Usage:
  showme proxy [command]

Available Commands:
  http        http正向代理
  httpreverse http反向代理
  mysql       mysql proxy
  socket5     socket5 http代理服务器
  ss          shadowsocks

Technology Stack

  1. go-prompt
  2. gocui/tcell/tview/ncurses/goncurses
  3. 提示选项分为两种: 一、命令参数 dashboard status 二、配置参数 dashboard --status
  4. github.com/jroimartin/gocui
  5. github.com/gdamore/tcell
  6. vue 【Element-UI】
  7. websocket
  8. gin web api
  9. yaml

新增操作

  1. suggests/commands.go 添加首字符命令添加提示
  2. completers/options.go 添加含【-】的参数
  3. completers/common.go -> FirstCommandFunc 添加命令提示 添加基于首字符的二级字符命令提示
  4. executors 添加目录实现命令gocui展示
  5. executors/executors.go 添加command对应的执行命令

多线程改造

https://blog.csdn.net/lengyuezuixue/article/details/79664409

TODO

  • 结合GuiLite进行美化
  • tty 添加install自动部署systemctl服务的功能
  • 对接Mini CMDB

贡献

若要基于本项目进行开发,需要先建立cobra cli命令选项cobra add ${YOUR_CLI} -p rootCmd

k8s resource list

alertmanagers.monitoring.coreos.com                           endpoints                                                     nodes.metrics.k8s.io                                          replicasets.extensions
apiservices.apiregistration.k8s.io                            etcdclusters.etcd.database.coreos.com                         persistentvolumeclaims                                        replicationcontrollers
certificatesigningrequests.certificates.k8s.io                events                                                        persistentvolumes                                             resourcequotas
clusterrolebindings.rbac.authorization.k8s.io                 events.events.k8s.io                                          poddisruptionbudgets.policy                                   rolebindings.rbac.authorization.k8s.io
clusterroles.rbac.authorization.k8s.io                        horizontalpodautoscalers.autoscaling                          pods                                                          roles.rbac.authorization.k8s.io
componentstatuses                                             ingresses.extensions                                          pods.metrics.k8s.io                                           secrets
configmaps                                                    jobs.batch                                                    podsecuritypolicies.extensions                                serviceaccounts
controllerrevisions.apps                                      leases.coordination.k8s.io                                    podsecuritypolicies.policy                                    servicemonitors.monitoring.coreos.com
cronjobs.batch                                                limitranges                                                   podtemplates                                                  services
customresourcedefinitions.apiextensions.k8s.io                mutatingwebhookconfigurations.admissionregistration.k8s.io    priorityclasses.scheduling.k8s.io                             statefulsets.apps
daemonsets.apps                                               namespaces                                                    prometheuses.monitoring.coreos.com                            storageclasses.storage.k8s.io
daemonsets.extensions                                         networkpolicies.extensions                                    prometheusrules.monitoring.coreos.com                         validatingwebhookconfigurations.admissionregistration.k8s.io
deployments.apps                                              networkpolicies.networking.k8s.io                             redisfailovers.storage.spotahome.com                          volumeattachments.storage.k8s.io
deployments.extensions                                        nodes                                                         replicasets.apps                                              

go 1.18 hotfix

go get -u golang.org/x/sys
go get -u github.com/go-eden/routine