简体   繁体   中英

Unable to create the rabbitmq.json for sensu client

I am using https://github.com/portertech/chef-monitor cookbook to setup the sensu client as the node is bootstrapped to the chef server. The default recipe should install sensu components, ssl, json configurations and also the sensu client service.

However the rabbitmq.json is not getting created, the chef client run fails as it tries to start the chef client service at the end.

There is a databag created for SSL. node["monitor"]["master_address"] has been set

values for rabbitMQ has been provided in the nodes as override

{
    "sensu": {
    "rabbitmq": 
        {
            "host": "myhost.com",
            "port":5671,
            "vhost":"/sensu",
            "user":"sensu",
            "password":"secret",
            "ssl": {
                "cert_chain_file":"/etc/sensu/ssl/cert.pem",
                "private_key_file":"/etc/sensu/ssl/key.pem"
                }
            }
        }
    }
}

but the rabbitmq.json is not getting created, hence the start service is not working and the log says unable to connect to rabbit mq

"level":"fatal","message":"transport connection error","error":"failed to connect to rabbitmq"

Read the sensu cookbook readme file again. It does not require a rabbitMQ.json on client side. The config.json /etc/sensu/config.json should have the entry for rabbitmq for the client to connect to. It would also have the entries for redis and api.

Make sure you are passing the node.monitor.master_address : The sensu server ip Or if you are not, it should look for the node monitor::master recipe and pick its ip.

The problem was with SSL grrrr... seems the ssl in the databag was bad, regenerated the ssl and propagated for all, worked fine after that.

cd examples/ssl
./ssl_certs.sh generate
knife data bag create sensu
Use the plain-text data bag item:

knife data bag from file sensu ssl.json
Or, encrypted it with your data bag secret. See Encrypt a Data Bag for more information.

knife data bag --secret-file /path/to/your/secret from file sensu ssl.json
./ssl_certs.sh clean

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM