# 什么是OMS?

OMS是一个简单易用的运维管理平台，基于Go开发，集成了GO全平台、易于部署和高并发的特性。目前实现了资产管理、文件浏览器、批量命令、批量上传文件、VNC连接和基于自建脚本并行执行的能力。

## 快速开始

#### 下载

在release界面选择需要的发行版本以及对应机器的架构执行文件下载：

{% embed url="<https://github.com/ssbeatty/oms/releases>" %}

#### 运行

* Windows

创建一个新的文件夹，并移动可执行文件到文件夹中，双击执行即可

* Linux

```shell
cd /you/path/omsd && ./oms --config=/you/path/config.yaml
```

{% hint style="info" %}
**配置文件:**  当没有参数执行oms时，会在当前目录生成一个config.yaml配置文件，默认使用sqlite作为持久化存储的数据库，但是并不推荐使用它。在正常使用过程中，推荐使用mysql或者postgres。
{% endhint %}

* docker

> docker-compose.yaml

```yaml
version: '2.3'

services:
  oms:
    image: ghcr.io/ssbeatty/oms/oms:v0.7.5
    restart: always
    ports:
      - "9090:9090"
    volumes:
      - ./data:/opt/oms/data
      - ./config:/etc/oms
```

* 配置文件

以下是对配置文件的示例：

```yaml
app:
  name: oms
  addr: 127.0.0.1
  port: 9090
  mode: dev
  data_path: data  # 运行文件目录
  run_start: false # 是否在运行时打开浏览器 windows
  temp_date: 336h  # 执行日志的保存时间 默认14天

db:
  driver: postgres
  user: root
  password: 123456
  dsn: 127.0.0.1:3306
  db_name: oms
```

* 目录结构

<pre><code>oms
<strong>├─omsd          # 可执行程序
</strong>└─data
   ├─plugin     # 插件存放目录
   ├─tasks      # 任务日志
   ├─tmp        # 缓存目录
   ├─oms.db     # 数据库文件
   └─upload     # 临时上传文件夹
</code></pre>

#### 注册为服务

<pre class="language-bash"><code class="lang-bash"><strong># 使用用户root将omsd注册为服务
</strong><strong>omsd --action install --user root --config /path/your/config.yaml
</strong># 取消注册
omsd --action uninstall
</code></pre>

#### 自行编译

```shell
# clone
git clone --recurse-submodules https://github.com/ssbeatty/oms.git

# build frontend (node version > 14.0)
cd web/omsUI
yarn && yarn build

# 打包 oms
# linux
packr build -o oms cmd/omsd/main.go
# win
packr build -o oms.exe cmd/omsd/main.go
```

### 指南:&#x20;

{% content-ref url="/pages/wcmwrNhg3DtXcDyjP5Us" %}
[资产管理](/ssbeattyoms-wen-dang/guides/zi-chan-guan-li.md)
{% endcontent-ref %}

{% content-ref url="/pages/IQeOxLo74f0DHErkAQgS" %}
[批量操作](/ssbeattyoms-wen-dang/guides/pi-liang-cao-zuo.md)
{% endcontent-ref %}

{% content-ref url="/pages/Hwymg0Qckc11fVSoyqJW" %}
[SSH](/ssbeattyoms-wen-dang/guides/ssh.md)
{% endcontent-ref %}

{% content-ref url="/pages/DBpteALvOxwHMgZXSZkd" %}
[文件浏览器](/ssbeattyoms-wen-dang/guides/wen-jian-liu-lan-qi.md)
{% endcontent-ref %}

{% content-ref url="/pages/d984HVgDTfgtMG0QErKt" %}
[任务管理](/ssbeattyoms-wen-dang/guides/ren-wu-guan-li.md)
{% endcontent-ref %}

{% content-ref url="/pages/VCtjSUz7QCJBrDH8kzmy" %}
[隧道管理](/ssbeattyoms-wen-dang/guides/sui-dao-guan-li.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wang918562230.gitbook.io/ssbeattyoms-wen-dang/shen-me-shi-oms.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
