在 CentOS 7 上安裝 scollector

作為特權使用者(root 或 sudo):

建立 scollector 目錄:

mkdir /opt/scollector

在/ opt / scollector 目錄中,從 bosun / scollector 站點下載最新的二進位制版本,[ http://bosun.org/scollector/] [1 ]

wget https://github.com/bosun-monitor/bosun/releases/download/"version"/scollector-"OS"-"arch"

例如:
wget https://github.com/bosun-monitor/bosun/releases/download/0.5.0/scollector-linux-amd64

在/ usr / local / bin 中建立一個符號連結:

ln -s /opt/scollector/scollector-linux-amd64 /usr/local/bin/scollector

建立配置目錄;

mkdir /etc/scollector

使用本指南建立 scollector 配置檔案 scollector.toml

配置檔案的路徑是/etc/scollector/scollector.conf

例如:

 Host = "http://xxx.xxx.xxx.xxx:8070" #replace xxx with the IP of your Bosun server
    Hostname = "DevOps-Bosun-Prod"
    [[ICMP]]
      Host = "some.hostname.here"
    [[ICMP]]
      Host = "some.other.hostname.here"
    [tags]
      hostgroup = "system"
    #[[GoogleAnalytics]]
    #  ClientID = ""
    #  Secret = ""
    #  Token = ""

建立服務檔案/etc/systemd/system/scollector.service

例如:

[Unit]
Description=Scollector Service
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/scollector -conf=/etc/scollector/scollector.toml
Restart=on-abort

[Install]
WantedBy=multi-user.target

告訴 Systemd 你已建立新服務:

systemctl enable scollector.service

開始 scollector:

systemctl start scollector

你可以通過執行來檢視 scollector 是否已啟動:

systemctl status scollector

或者,你可以檢視系統訊息日誌,你正在尋找以下內容:

Jul 29 23:19:27 bosun-prod systemd: Started Scollector Service.
Jul 29 23:19:27 bosun-prod systemd: Starting Scollector Service...
Jul 29 23:19:27 bosun-prod scollector[4363]: info: main.go:213: OpenTSDB host: http://127.0.0.1:8070