Network Devices
Query IPMI with cnspec
Query IPMI interfaces with cnspec
Query and inventory your servers using cnspec and the Intelligent Platform Management Interface (IPMI). IPMI provides management and monitoring capabilities independently of the host system's CPU, firmware (BIOS or UEFI), and operating system.
Prerequisites
To query IPMI interfaces with cnspec, you must have:
- cnspec installed on your workstation
- Network access to the IPMI interface (typically on a dedicated management port)
- IPMI credentials (username and password)
Connect to an IPMI interface
To query an IPMI interface, provide the username and host address:
cnspec shell ipmi USER@HOST| For... | Substitute... |
|---|---|
| USER | Your IPMI username |
| HOST | The IPMI interface IP or hostname |
For example:
cnspec shell ipmi admin@192.168.1.100 --ask-pass
Enter password:You can also provide the password directly:
cnspec shell ipmi admin@192.168.1.100 --password YOUR_PASSWORDExample queries
Once connected, you can query IPMI resources.
Retrieve the device ID information
cnspec> ipmi.deviceID
ipmi.deviceID: {
deviceAvailable: true
deviceRevision: 1
firmwareRevision: "2.45"
...
}Retrieve the chassis status
cnspec> ipmi.chassis
ipmi.chassis: {
systemPower: "on"
...
}Retrieve the management controller GUID
cnspec> ipmi.guid
ipmi.guid: "12345678-1234-1234-1234-123456789abc"Learn more
-
To learn more about how the MQL query language works, read Write Effective MQL.
-
For a list of all the IPMI resources and fields you can query, read the IPMI Resource Pack Reference.