Ce poste combiné avec Installer Sensu avec YUM a été utilisé afin d'installer, de configurer et de démarrer Sensu et les services associés :
sudo yum install -y erlang && \
sudo rpm -Uvh http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.0/rabbitmq-server-3.5.0-1.noarch.rpm && \
sudo yum install -y redis && \
echo '[sensu]
name=sensu
baseurl=http://sensu.global.ssl.fastly.net/yum/$basearch/
gpgcheck=0
enabled=1' | sudo tee /etc/yum.repos.d/sensu.repo && \
sudo yum install -y sensu && \
sudo yum install -y uchiwa && \
for s in rabbitmq-server redis.service sensu-server sensu-api uchiwa; do sudo systemctl restart $s; done && \
sudo rabbitmqctl add_vhost /sensu && \
sudo rabbitmqctl add_user sensu secret && \
sudo rabbitmqctl set_permissions -p /sensu sensu ".*" ".*" ".*"
Analyse
- Naviguer vers :3000 montre le tableau de bord uchiwa et indique
Connection error. Is the Sensu API running?
- /var/log/sensu/sensu-api.log indique
{"timestamp":"2016-07-03T22:58:58.532905+0000","level":"warn","message":"config file does not exist or is not readable","file":"/etc/sensu/config.json"}
{"timestamp":"2016-07-03T22:58:58.533069+0000","level":"warn","message":"ignoring config file","file":"/etc/sensu/config.json"}
{"timestamp":"2016-07-03T22:58:58.533137+0000","level":"warn","message":"loading config files from directory","directory":"/etc/sensu/conf.d"}
{"timestamp":"2016-07-03T22:58:58.712175+0000","level":"info","message":"api listening","protocol":"http","bind":"0.0.0.0","port":4567}
- Le fichier config.json ne semble pas exister (
/etc/sensu/config.json: No such file or directory
) - Téléchargement de l'exemple config.json et le redémarrage de sensu-api n'a pas résolu le problème
{
"rabbitmq": {
"host": "localhost",
"vhost": "/sensu",
"user": "sensu",
"password": "secret"
},
"redis": {
"host": "localhost",
"port": 6379,
"password": "secret"
}
}
- le port redis est en écoute :
LISTEN 0 128 127.0.0.1:6379 *:*
- le port rabbitmq aussi :
LISTEN 0 100 *:4567 *:*
- Uchiwa ne peut pas se connecter aux centres de données.
{
"sensu": [
{
"name": "Site 1",
"host": "localhost",
"port": 4567,
"timeout": 10
},
{
"name": "Site 2",
"host": "localhost",
"port": 4567,
"ssl": false,
"path": "",
"user": "",
"pass": "",
"timeout": 10
}
],
"uchiwa": {
"host": "0.0.0.0",
"port": 3000,
"refresh": 10
}
}
{"timestamp":"2016-07-03T23:34:32.990067621Z","level":"warn","message":"GET http://localhost:4567/stashes returned: 500 Internal Server Error"}
{"timestamp":"2016-07-03T23:34:32.990102095Z","level":"warn","message":"Connection failed to the datacenter Site 1"}
{"timestamp":"2016-07-03T23:34:32.990115588Z","level":"info","message":"Updating the datacenter Site 2"}
{"timestamp":"2016-07-03T23:34:32.991462585Z","level":"warn","message":"GET http://localhost:4567/stashes returned: 500 Internal Server Error"}
{"timestamp":"2016-07-03T23:34:32.991492978Z","level":"warn","message":"Connection failed to the datacenter Site 2"}
- naviguer vers
<IPADDRESS>:4567
résulte en :
{"error":"redis and transport connections not initialized"}
- réponses de redis
sudo redis-cli ping
PONG
- le mot de passe redis a été défini, mais le problème persiste
sudo redis-cli
127.0.0.1:6379> auth secret
OK