oms文档
  • 什么是OMS?
  • Guides
    • 资产管理
    • 批量操作
    • SSH
    • 文件浏览器
    • 任务管理
    • 隧道管理
    • 简要主机监控
  • Extras
    • 剧本
    • 编写自定义剧本插件
    • SSHD指标
Powered by GitBook
On this page
  1. Extras

编写自定义剧本插件

Previous剧本NextSSHD指标

Last updated 2 years ago

自定义的剧本需要实现以下方法:

type Step interface {
	ID() string
	SetID(id string)
	Exec(session *transport.Session, sudo bool) ([]byte, error)
	GetSchema() (interface{}, error)
	Create(conf []byte) (Step, error)
	Name() string
	Desc() string
	Config() interface{}
}

同时需要定义一个manifest.yaml

name: vnc_install
import: vnc_install

其中name表示唯一的插件名,import表示导入的路径,可以参考go path的导入规则。

详情可见example:

编写后放到data/plugin

添加识别成功后可以在剧本添加时找到

https://github.com/ssbeatty/vnc_install