Introduction
This document describes how to install and configure Energywise on CentOS 6.9
Contributed by Israel Moreno, Cisco TAC Engineer.
Background
Cisco Energywise Management (CEM) controllers are responsible for direct device communication within the network, device and asset import, power measurement and policy control. Each management deployment requires a minimum of one Controller connected to the CEM Server. Larger deployments typically have multiple Controllers deployed across different sites or locations, or even multiple controllers in the same location for large networks. Controllers can be installed on both Windows and Linux boxes.
Prerequisites
Requirements
- Root access or user with administrator rights on CentOS 6.9 box.
- CEM Server installed. Credentials and key pair file created during its installation will be needed.
- Wget and netcat utility packages installed on the CentOS system. You can install them using the following command: yum install wget nc
- Oracle Java SE Runtime Environment 8. The RPM can be found here.
Components Used
- CEM Server 5.2.0 installed on a Windows Server 2008 R2 Virtual Machine.
- CentOS 6.9 minimal installation Virtual Machine.
Installing Oracle Java SE Runtime Environment 8
- Copy the JRE RPM to the CentOS VM; skip this step if the RPM was downloaded directly on it.
- Install JRE with the following command:
yum install /<path> jre-8u<x>-linux-x<64/86>.rpm
The RPM can also be installed using:
rpm –ivh /<path> jre-8u<x>-linux-x<64/86>.rpm
Downloading and Installing the CEM Controller
- Download Cisco Energy Management Controller 5.2.0 for CentOS 6 from CEM Download page
There are 32-bit and 64-bit versions available:

- Log in to the CentOS system.
- Navigate to the folder that contains the downloaded file. For example, if the controller installation file is in your Downloads folder and the folder structure is /home/admin/Downloads, enter the following command:
cd /home/admin/Downloads
- Enter one of the following commands to install the controller:
yum install EnergyWise-Controller-<version>.rpm
rpm –ivh EnergyWise-Controller-<version>.rpm
The controller package is extracted and installed in the /var/lib/ewcontroller folder. This folder contains two different templates, one for CEM Server Cloud and one for CEM Server On Premise.
The next steps depend on which type of CEM Server is being used.
Steps for CEM Server Cloud.
- Copy the init.sample template entering the following command:
cp /var/lib/ewcontroller/ewcontroller.init.sample /var/lib/ewcontroller/ewcontroller.init
- Using the preferred text editor edit the init file, which contains the following lines:
ctrllogdir=""
clouddomain=""
cloudpassword=""
javapath=""
An explanation for each line is shown below:
- ctrllogdir=“<Local path of the log directory>” This line can be left empty, in which case, the default path /var/log/ewcontroller will be applied.
- clouddomain=" " This line holds the authentication domain associated to the CEM Server Cloud account. Cannot be empty.
- cloudpassword=" " This line holds the corresponding password for the domain used on the previous configuration line.
- javapath=" " Local path where Java is installed
This is how the ewcontroller.init file looks like for this example:
ctrllogdir=""
clouddomain="taclab.com"
cloudpassword="TaCLabPassW0rd"
javapath="/usr/java/jre1.8.0_131/bin/"
Adjust the lines as needed.
Steps for CEM Server On Premise.
- Copy the onpremise.init.sample template entering the following command:
cp /var/lib/ewcontroller/ewcontroller.onpremise.init.sample /var/lib/ewcontroller/ewcontroller.init
- Open your preferred text editor and edit the init file, which contains the following lines:
ctrllogdir=""
mqip=""
mqusername=""
mqpassword=""
mqport=""
javapath=""
An explanation for each line is shown below:
- ctrllogdir="<Local path of the log directory>" This line can be left empty, in which case, the default path /var/log/ewcontroller will be applied.
- mqip="<IP of the Message Queue>" CEM Server IP or FQDN.
- mqport="<Port number of the Message Queue>" CEM Server port. Default port is 5672.
- mqusername="<Username of the Message Queue>" Username configured during CEM Server installation.
- mqpassword="<Password of the Message Queue>" Password associated to the username entered on the previous line. Also configured during CEM Server installation.
- javapath="" Local path where java is installed.
This is how the ewcontroller.init file looks like for this example:
ctrllogdir=""
mqip="192.168.10.10"
mqusername="admin"
mqpassword="AdminPassword"
mqport="5672"
javapath="/usr/java/jre1.8.0_131/bin/"
From here, the steps are the same for both CEM Server Cloud and CEM Server On Premise.
Installing the certificate “cem_keypair.key”
The file cem_keypair.key is generated during CEM Server Installation. Also, it should be provided if CEM Server Cloud is being used. The file content looks similar to this:
-----BEGIN RSA PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDqvQg2LXJcJ+uhK3U+jnUJioC+
Sf7FU0qurJ9+FNSWOIsfN6Ebk8IbZsO3ysCPTcnpdXak4HSUAA5CCyQCVslomYka4vYrsw/uGycS
4ooIaTHBcah7whFTxQSkxCeBbglDhbpwWT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VRIvdopu8EKg5bjy2L9XoAEQkwdwYn+ehMCgYB3ET9t3iB9HWQo
CoSlsuvsuD5hI1iBU0A6QH86Oh8akHUFXYm9HrQP5N8kWbCJLBnbnxnGqbg4JUy6Epz0n94lmFsL
5zBvsF5FQ/hJf6gwfF5MxWeAzRrapa9+7NkLRLSGOmfkbGIOH1jZfwAXl/9pfA2CQMXSznn09ggk
EakeAQKBgHUWxiupruFehGnMri+Fv/Dy4CQMU2sPjcnqMamVEpB6fDdIeew7VcgAPSH1CyvspXiB
G/oh3wLBfhCu+h2ewbG+o6ZvcgUDg4QUjzCu5o2C1kDcPwyn8rHRjs5MSKj1ZlTphQpPilFGjqpT
ugqVTG3dVz33V/2aqXFd8vkBDG4O
-----END RSA PRIVATE KEY-----
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6r0INi1yXCfroSt1Po51CYqAvkn+xVNK
rqyffhTUljiLHzehG5PCG2bDt8rAj03J6XV2pOB0lAAOQgskAlbJaJmJGuL2K7MP7hsnEuKKCGkx
wXGoe8IRU8UEpMQngW4JQ4W6cFkxoDHDsMAshIUR3Tsi6j/+WjHwaxm5UTdr7fpmDCkTFzIOH6jh
rZ4QLLE6y1r0vS/DIPlHXi9Srpg21y1AZaZ8S7pT+B9eCtrUK+96Aae3CiPihzL9uyXCW4LSo/D9
y4GbzmJU1pstpN+rJmf2zHagyBe79OK4VurikFux83AUtrF3hv3i9kkL1NEpGAWwsPNUfYaOZ647
LWCwqwIDAQAB
-----END PUBLIC KEY-----
There are two valid options for installing the certificate file. The first one is putting the actual cem_keypair.key file to /var/lib/ewcontroller/cem_keypair.key. The command would look similar to this:
mv /<path>/<filename> /var/lib/ewcontroller/cem_keypair.key
The second one is to use a text editor to create the /var/lib/ewcontroller/cem_keypair.key file, paste the content and save it.
Starting the Controller Service
To start the controller service run the following command:
/etc/init.d/ewcontroller start
Note: This ewcontroller script looks for .firstboot file in the directory /var/lib/ewcontroller/. If this file exists, it imports the configuration from ewcontroller.init into the setting.json file. After this process is done, both ewcontroller.init and .firstboot files will be removed. If the wrong SSL certificate or wrong type of controller is configured (i.e. On Premise vs Cloud), then settings.json must be deleted and .firstboot must be created again within the same directory. Once the configuration is corrected, rerun /etc/init.d/ewcontroller start.
After the service restarts, the controller registers the service with the central server. If the controller fails to start with an unknown host exception error, edit the host file located in /etc/hosts/ and include the following line: 127.0.0.1 hostname hostname.domain where hostname is the name of the system on which the controller is installed.
Optional step. Opening firewall port
If the CentOS box is running a local firewall which blocks unauthorized outgoing connections (it is very likely there is not), it is necessary to allow outgoing TCP traffic on port 5672. To do so run the following command:
iptables –A OUTPUT –p tcp –dport 5672 –m comment -–comment ‘ALLOWING_CEM-SERVER_CONNECTION’ –j ACCEPT
Troubleshoot
After following the previous steps, the controller should show itself on CEM Server web interface. If any problem comes out, there are three files to look at. Those files are:
- /var/lib/ewcontroller/controller.stderr
- /var/lib/ewcontroller/controller.stdout
- /var/log/ewcontroller/controller.log