This document describes how to configure a Sensu server and other actions on CloudCenter to add or remove worker Virtual Machines (VMs) from the server.
Cisco recommends that you have knowledge of these topics:
This document is not restricted to specific software and hardware versions.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
Sensu is a program designed to monitor various aspects of a machine. It can be incorporated into CloudCenter to provide increased monitoring ability to any deployed VM's. This walkthrough is designed to be an example that shows how you can integrate Sensu with CloudCenter with the use of actions.
This is designed to run on a CentOS 7 VM that has direct access to the internet. If you need to connect to a proxy, perform that configuration before you proceed.
Open these ports for incoming and outgoing: 3000, 3030, 4567, 5671, 5672, 6379. Ensure that the Sensu server has a static IP address.
Note: All that is inside the Code Blocks is designed to be copied and pasted into the terminal.
Install Epel Repository
sudo yum -y install epel-release
sudo yum -y install erlang
Install Redis, RabbitMQ, and Configure RabbitMQ
sudo rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo rpm -Uvh http://www.rabbitmq.com/releases/rabbitmq-server/v3.4.1/rabbitmq-server-3.4.1-1.noarch.rpm
sudo rabbitmq-plugins enable rabbitmq_management
sudo yum -y install redis
sudo chkconfig redis on
sudo service redis start
sudo chkconfig rabbitmq-server on
sudo /etc/init.d/rabbitmq-server start
sudo rabbitmqctl add_vhost /sensu
sudo rabbitmqctl add_user sensu secret
sudo rabbitmqctl set_permissions -p /sensu sensu ".*" ".*" ".*"
Register Sensu Repository
enabled=1' |sudo tee /etc/yum.repos.d/sensu.repo
sudo service sensu-client restart && sudo service sensu-server restart && sudo service sensu-api restart
After a minute, you should have three checks listed.
If you click on the Sensu-server client, you see detailed information from the three checks for that device.
Update Action Scripts
Change the line host to"SensuServerIP" to have the IP address of the Sensu Server.
5. Edit sensuuninstall.sh. 6. Change the line curl -s -i -X DELETE http://SensuServerIP:4567/clients/$cliqrNodeHostname to have the IP address of the Sensu Server.
7. Zip the modified files back into Sensu.zip. 8. Upload to a repository that the CloudCenter Manager (CCM) has configured.
Create Sensu Actions
Navigate to Actions Library and select New Action.
Type: Command or Script Action Name: Register Sensu Description: Installs Sensu client and registers it with the server Execute Action: On Virtual Machine OS Object Mapping: Resource Type: CloudCenter Deployed VMs Application Profile: All Cloud Region: All Cloud Account: All Service All Resource Type: Imported VMs (with Agent Installed) Cloud Region: All Cloud Account: All OS Types: All Action Definition: Execute From Bundle: Yes Location: The repo you uploaded it to, and the path to the Sensu.zip file Script From Bundle: sensuinstall.sh
Save action and create another new action
Type: Command or Script Action Name: Unregister Sensu Description: Stops Sensu client and unregisters it with the server Execute Action: On Virtual Machine OS Object Mapping: Resource Type: CloudCenter Deployed VMs Application Profile: All Cloud Region: All Cloud Account: All Service All Resource Type: Imported VMs (with Agent Installed) Cloud Region: All Cloud Account: All OS Types: All Action Definition: Execute From Bundle: Yes Location: The repo you uploaded it to, and the path to the Sensu.zip file Script From Bundle: sensuuninstall.sh Save Action
You can now use these actions on any deployed VM to register it to your Sensu server and unregister. Note that unregister does not uninstall the Sensu client, it just stops the service and removes it from the server's database (DB).