Bosun Install scollector on CentOS 7


Example

As a privileged user (root or sudo):

Create scollector directory:

mkdir /opt/scollector

In the /opt/scollector directory, download the latest binary build from the bosun/scollector site, [http://bosun.org/scollector/][1]

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

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

Create a symbolic link in /usr/local/bin:

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

Create the configuration directory;

mkdir /etc/scollector

Using this guide create your scollector configuration file, scollector.toml

The path for the configuration file is then /etc/scollector/scollector.conf

ex:

 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 = ""

Create the Service file, /etc/systemd/system/scollector.service

ex:

[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

Tell Systemd that you have created a new service:

systemctl enable scollector.service

Start scollector:

systemctl start scollector

You can see if scollector has started by running:

systemctl status scollector

Alternatively, you can view the system message log, you're looking for something like:

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