# Sensu Go Migration

***Legacy***

Currently Sensu is installed, but will migrate us to `Sensu Go`

1. Move packages to Repo server via `wget` be sure to check `sha512`
```
cd /var/www/html/redhat/msoc/Packages
wget https://packagecloud.io/sensu/stable/packages/el/7/sensu-go-cli-5.15.0-7782.x86_64.rpm/download.rpm
mv download.rpm  sensu-go-cli-5.15.0-el7.x86_64.rpm

wget https://packagecloud.io/sensu/stable/packages/el/7/sensu-go-agent-5.15.0-7782.x86_64.rpm/download.rpm
mv download.rpm sensu-go-agent-5.15.0-7782.x86_64.rpm

wget https://packagecloud.io/sensu/stable/packages/el/7/sensu-go-backend-5.15.0-7782.x86_64.rpm/download.rpm
mv download.rpm sensu-go-backend-5.15.0-7782.x86_64.rpm
```

2. Download the Sensu Go software packages; ie Backend, CLI, & Agent - [Sensu Downloads](https://sensu.io/downloads)

```
wget -O sensu-go-backend-5.16.1-8521.x86_64.rpm  https://packagecloud.io/sensu/stable/packages/el/7/sensu-go-backend-5.16.1-8521.x86_64.rpm/download.rpm
wget -O sensu-go-agent-5.16.1-8521.x86_64.rpm https://packagecloud.io/sensu/stable/packages/el/7/sensu-go-agent-5.16.1-8521.x86_64.rpm/download.rpm
wget -O sensu-go-cli-5.16.1-8521.x86_64.rpm https://packagecloud.io/sensu/stable/packages/el/7/sensu-go-cli-5.16.1-8521.x86_64.rpm/download.rpm

chown apache: sensu-go-*
chmod 640 sensu-go-*
```

[prod]root@reposerver:/var/www/html/redhat/msoc/Packages:# sha512sum sensu-go-*
da69e33d8b9bb493cf261bd7fae261aabc19346a2c9942ada8a6005774ed9042fe129321f45425c300680036a2c9b14217db701c9b4e58843e486df24cc1e7d1  sensu-go-agent-5.15.0-7782.x86_64.rpm
510839b01ca37a1733d1656b9c6672b4a3be08fdd4b12f910beb232ac2d2a60a3a75d0fc011920f2c489be6f8a2290aac133d8f9627cc8fdeb9bc285fd449036  sensu-go-backend-5.15.0-7782.x86_64.rpm
196641d17d774e1c82c8b3842736821736a739d25a8f0b214de26a1c2ec80a06cb0caa7713fb8026209a5d2454d458c502f3c887e48fa221646520c8f75423d6  sensu-go-cli-5.15.0-el7.x86_64.rpm

[dev]root@reposerver:/var/www/html/redhat/msoc/Packages:# sha512sum sensu-go-*
da69e33d8b9bb493cf261bd7fae261aabc19346a2c9942ada8a6005774ed9042fe129321f45425c300680036a2c9b14217db701c9b4e58843e486df24cc1e7d1  sensu-go-agent-5.15.0-7782.x86_64.rpm
36ee9bf1afd2c837e0d1d4b9151cf9f9e1a1ac09546832d2ad840ffa48694cdb509373e8e7ca9152475d8e2fba9f3e62e0e206a543018b8667e883acedbe2e18  sensu-go-agent-5.16.1-8521.x86_64.rpm
510839b01ca37a1733d1656b9c6672b4a3be08fdd4b12f910beb232ac2d2a60a3a75d0fc011920f2c489be6f8a2290aac133d8f9627cc8fdeb9bc285fd449036  sensu-go-backend-5.15.0-7782.x86_64.rpm
b449d093c219bc6262ad82cf281ed12f83d0e42f1a83c6eeca53527278cfed61f97054b51a971ed4e9a1c0cfd3bdd5f17955f166093c44f3435515c8307cf953  sensu-go-backend-5.16.1-8521.x86_64.rpm
196641d17d774e1c82c8b3842736821736a739d25a8f0b214de26a1c2ec80a06cb0caa7713fb8026209a5d2454d458c502f3c887e48fa221646520c8f75423d6  sensu-go-cli-5.15.0-el7.x86_64.rpm
f8b107e90bbd9a3b2348592d39ca69ed0e7e0cb02e0fc65caaedc31296f926077387c059d274554b099159169259355f4c5288855d6c6cadc62c70fdcbf6408c  sensu-go-cli-5.16.1-8521.x86_64.rpm

FOLLOW INSTRUCTIONS IN [Reposerver Notes](Reposerver%20Notes.md) to finish setting up packages

```
#remove old software
yum remove uchiwa sensu jemalloc redis erlang rabbitmq-server
```

prep vault
create policy
add secret
adjust salt_master configuration in vault config

  policies:
    - saltstack/minions
    - saltstack/minion/{minion}

ext_pillar:
  - vault: path=salt/pillar_data
  - vault: path=salt/minions/{minion}/pass

adjust security groups through terraform

```
#run salt state
salt sensu.msoc.defpoint.local saltutil.refresh_pillar
salt sensu.msoc.defpoint.local state.sls sensu_master
```

Client to Agent migration
```
#uninstall client
pkg.remove sensu
cmd.run 'rm -rf /etc/sensu/*'
saltutil.refresh_pillar
state.sls sensu_agent
```

Sensu Prod
41 clients
7 silenced
clu-keepalive/jenkins/nginx, atlantis - none, dps-idm- keepalive, phantom-splunk_indexer_ports


