Intersight is a tool to monitor and configure data center solutions such as UCS servers. Intersight collects metrics from servers and makes them available for viewing in the GUI or for use through the API.
Energy consumption in data centers is often a significant cost that is overlooked. This consumption may also be a factor for environmental impact. The administrator needs to determine the energy consumption of their environment | IT administrator has noticed issues with a workload. The administrator must identify if this is a UCS networking problem. The administrator needs to verify the single/multiple links between the server and Fabric Interconnect, as well as between the Fabric Interconnect and upstream network | With growing workloads there is also a demand for new infrastructure. To adapt to this demand, you may have to increase your UCS environment with a few more chassis. This will lead to increase traffic on the Fabric Interconnect uplinks. The administrator needs to determine if the current uplink capacity will be enough to handle the new infrastructure |
During this workshop you'll use Intersight and automation to get metrics from UCS servers:
Please use the image hint below each step if you're stuck.
-
Go to Intersight, click on Sign-in with Cisco ID
-
When asked, provide the following credentials:
Reveal Mail
DEVWKS2486+[YourTableNumber]@gmail.com
Reveal Password
You'll be redirected to the main Intersight interface.
-
In the left panel, click on 'Operate', then select 'Servers'.
-
Click on the server CSS-DCC1-1-1, look for the Metrics tab and select it.
-
Take a look at the metrics fetched by Intersight.
-
Look for the panel on the left side of the screen and click on Analyse, then Explorer.
On the Metrics Explorer you'll be able to explore all the metrics gathered by Intersight from all devices and filter out of your preferences.
-
In the Metrics panel, select the metric to fetch: Host Power and Status > Host Power > Average.
-
A chart will appear according to the option selected on the Metric Panel.
-
Scroll down to see the Raw Data fetched from the Time-Series in the Intersight OpenTelemetry API.
-
Look for the Query Code tab. This is the JSON code send to the API to get the metrics.
-
Copy the code from the curly bracket in line 2 until the penultimate line with a closing curly bracket.
Click here to get JSON code instead
{ "queryType": "groupBy", "dataSource": "PhysicalEntities", "granularity": { "type": "period", "period": "PT10M", "timeZone": "Europe/Paris", "origin": "2025-02-02T11:01:00.000Z" }, "intervals": [ "2025-02-02T11:01:00.000Z/2025-02-03T11:01:00.000Z" ], "dimensions": [], "filter": { "type": "and", "fields": [ { "type": "selector", "dimension": "instrument.name", "value": "hw.host" } ] }, "aggregations": [ { "type": "longSum", "name": "count", "fieldName": "hw.host.power_count" }, { "type": "doubleSum", "name": "hw.host.power-Sum", "fieldName": "hw.host.power" }, { "type": "thetaSketch", "name": "endpoint_count", "fieldName": "host.id" } ], "postAggregations": [ { "type": "expression", "name": "hw-host-power-Avg", "expression": "(\"hw.host.power-Sum\" / \"count\")" } ] }
-
Now visit the REST Client natively integrated into Intersight with this URL. This portal allows you to view the Intersight API documentation and interact with it directly.
-
With this client, you can interact with the Time Series by sending a POST request from the right panel.
-
Paste the copied JSON from earlier on the POST panel and click on Send. You may be asked to log in again
-
You can recognise the same information as the Raw Data from the GUI within the hw-host-power-Avg variable.
Now, let's take it a step further and extract the data to use it in an observability tool such as Grafana. To do this we will use a tool installed in your computer Intersight-Metrics-Bridge. It will poll power metrics from Intersight, store them in InfluxDB, and display them in Grafana easily with containers. Your computer already has the necessary tools to make it work. Now launch a terminal in your computer.
- Go to the right directory:
cd ./Desktop/DEVWKS-2486/intersight-metrics-bridge
- The API Key is not embedded in your session, we need to extract the API Key and inventory file from internet. It's available from this remote repo, clone it with:
git clone https://github.com/mabuelgh/DEVWKS-2486-alt.git
- Replace the placeholder API Key and inventory file with the one copied in last step. The API Key is read-only access to the Intersight account from earlier. The inventory file contains a list of Serial Numbers to monitor. Use this command to use the files:
rm -f -r config && cp -f -r ./DEVWKS-2486-alt/config ./
- To make the Metrics-Brigde work, we need to set environment variables with the following python script (this project is using a Python virtual environment.)
../bin/python initial_setup.py
- Now that everything is ready, build the docker containers with the docker-compose command:
sudo docker-compose build --no-cache
- Wait a few minutes to have access to the terminal again and then start the containers.
sudo docker-compose up
- Don't close this terminal and open a new terminal tab to make sure you have 3 containers up and running with this command:
sudo docker ps
-
Look for STATUS: Up for the three containers.
-
Access the Grafana container created at 127.0.0.1:3000.
-
The credentials are admin / password
-
On the left panel, click on Dashboards and then select Cisco UCS Servers Power Usage Dashboard
-
Watch the metrics get collected every minute.
-
When everything done, please stop (Ctrl+C on the main terminal tab, multiple times) and delete the containers for the next workshops 😊
sudo docker rm -f intersight-metrics-bridge-influxdb intersight-metrics-bridge-grafana intersight-metrics-bridge-intersight-poller
- This GitHub page will be up for one week.
- The webex space for this session will be up for at least 2 weeks.
- The project Intersight-Metrics-Bridge is already available to use on GitHub.
- You can contact me on: