NOTE: This is an excerpt from an upcoming rewrite of the Sensu installation guide, so some references may be made to documentation contents that don't currently exist, but they are coming soonicorn.com.
Although Sensu’s architecture is one of its most compelling features, and the installation guide can help you get Sensu installed in a variety of configurations in any operating environment, you might not actually care about any of that until you can get Sensu up and running in a testing and/or development environment and try it out. This installation guide is intended to help you install Sensu in 5 minutes or less, or we'll give you your money back, guaranteed.
Install Sensu in 5 minutes or less, or we'll give you your money back, guaranteed.
After completing the steps in this guide, you will have a fully functional Sensu Core installation in a standalone configuration.
What will you need to complete the 5-minute Sensu install?
- A virtual machine, or physical computer running 64-bit Ubuntu 14.04 with a minimum of 2GB of memory (4GB recommended)
- Familiarity with a modern command-line interface
- 5 minutes (the amount of time it should take to complete this installation guide)
Ready? Let's get started!
The following installation steps will help you get Sensu Core installed in a standalone on a system running Ubuntu 14.04, only. For installation on other platforms, and/or alternative installation configurations, please consult the installation guide.
-
Install Redis (>= 1.3.14) from the distribution repository:
sudo apt-get update sudo apt-get -y install redis-server curl jq
-
Install the Redis init scripts using the
update-rc.d
utility, and start Redis:sudo update-rc.d redis-server defaults sudo /etc/init.d/redis-server start
-
Download and install Sensu using
wget
anddpkg
:wget https://core.sensuapp.com/apt/pool/sensu/main/s/sensu/sensu_0.22.1-1_amd64.deb sudo dpkg -i sensu_0.22.1-1_amd64.deb
Verify that Sensu is installed by running the following command:
/opt/sensu/bin/sensu-server --version
-
Configure Sensu by copying the following example configuration file contents to
/etc/sensu/config.json
:{ "redis": { "host": "localhost" }, "transport": { "name": "redis" }, "api": { "host": "localhost", "port": 4567 } }
-
Configure the Sensu client copying the following example configuration file contents to
/etc/sensu/conf.d/client.json
:{ "client": { "name": "test", "address": "localhost", "subscriptions": [ "test" ] } }
-
Make sure that the
sensu
user owns all of the Sensu configuration files:sudo chown -R sensu:sensu /etc/sensu
-
Start the Sensu services
sudo /etc/init.d/sensu-server start sudo /etc/init.d/sensu-api start sudo /etc/init.d/sensu-client start
-
Verify that your installation is ready to use by querying the Sensu API using the
curl
utility (and piping the result tojq
):curl http://localhost:4567/clients | jq .
If the Sensu API returns a JSON array of Sensu clients similar to this:
$ curl http://localhost:4567/clients | jq . % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 106 100 106 0 0 14026 0 --:--:-- --:--:-- --:--:-- 15142 [ { "timestamp": 1458593707, "version": "0.22.1", "subscriptions": [ "test" ], "address": "localhost", "name": "test" } ]
...you have successfully installed and configured Sensu!
Coming soon...
Hi,
I have setup sensu on ubuntu 16.04 but i am not able to start following services. KINDLY HELP
sensu-server
sensu-client
sensu-api
it gives error when i run service sensu-server start
Job for sensu-server.service failed because the control process exited with error code. See "systemctl status sensu-server.service" and "journalctl -xe" for details.
root@ip-172-31-25-171:
# service sensu-server start# service sensu-server statusJob for sensu-server.service failed because the control process exited with error code. See "systemctl status sensu-server.service" and "journalctl -xe" for details.
root@ip-172-31-25-171:
● sensu-server.service - LSB: Sensu monitoring framework server
Loaded: loaded (/etc/init.d/sensu-server; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2017-07-23 06:13:04 UTC; 47s ago
Docs: man:systemd-sysv-generator(8)
Process: 2771 ExecStart=/etc/init.d/sensu-server start (code=exited, status=1/FAILURE)
Jul 23 06:13:02 ip-172-31-25-171 systemd[1]: Starting LSB: Sensu monitoring framework server...
Jul 23 06:13:02 ip-172-31-25-171 sensu-server[2771]: * Starting sensu-server
Jul 23 06:13:04 ip-172-31-25-171 sensu-server[2771]: ...fail!
Jul 23 06:13:04 ip-172-31-25-171 systemd[1]: sensu-server.service: Control process exited, code=exited status=1
Jul 23 06:13:04 ip-172-31-25-171 systemd[1]: Failed to start LSB: Sensu monitoring framework server.
Jul 23 06:13:04 ip-172-31-25-171 systemd[1]: sensu-server.service: Unit entered failed state.
Jul 23 06:13:04 ip-172-31-25-171 systemd[1]: sensu-server.service: Failed with result 'exit-code'.
root@ip-172-31-25-171:~# tail -f /var/log/sensu/sensu-server.log
{"timestamp":"2017-07-22T18:16:51.732061+0000","level":"warn","message":"loading config file","file":"/etc/sensu/conf.d/transport.json"}
{"timestamp":"2017-07-22T18:16:51.732098+0000","level":"warn","message":"config file applied changes","file":"/etc/sensu/conf.d/transport.json","changes":{}}
{"timestamp":"2017-07-22T18:16:51.732185+0000","level":"warn","message":"loading config file","file":"/etc/sensu/conf.d/client.json"}
{"timestamp":"2017-07-22T18:16:51.732239+0000","level":"warn","message":"config file applied changes","file":"/etc/sensu/conf.d/client.json","changes":{"client":{"name":[null,"server"],"address":[null,"localhost"],"subscriptions":[null,["ALL"]]}}}
{"timestamp":"2017-07-22T18:16:51.732276+0000","level":"warn","message":"loading config file","file":"/etc/sensu/conf.d/uchiwa.json"}
{"timestamp":"2017-07-22T18:16:51.732333+0000","level":"warn","message":"config file applied changes","file":"/etc/sensu/conf.d/uchiwa.json","changes":{"sensu":[{"spawn":{"limit":12}},[{"name":"Sensu","host":"localhost","ssl":false,"port":4567,"path":"","timeout":5000}]],"uchiwa":[null,{"port":3000,"stats":10,"refresh":10000}]}}
{"timestamp":"2017-07-22T18:16:51.732384+0000","level":"warn","message":"loading config file","file":"/etc/sensu/conf.d/redis.json"}
{"timestamp":"2017-07-22T18:16:51.732432+0000","level":"warn","message":"config file applied changes","file":"/etc/sensu/conf.d/redis.json","changes":{"redis":[null,{"host":"localhost","port":6379}]}}
{"timestamp":"2017-07-22T18:16:51.732482+0000","level":"fatal","message":"sensu must be a hash","object":[{"name":"Sensu","host":"localhost","ssl":false,"port":4567,"path":"","timeout":5000}]}
{"timestamp":"2017-07-22T18:16:51.732513+0000","level":"fatal","message":"SENSU NOT RUNNING!"}