White Papers

18 Implementation of the DMTF Redfish API on Dell EMC PowerEdge Servers
systemData = system.json()
storageData = storage.json()
print "Model: {}".format(systemData[u'Model'])
print "Manufacturer: {}".format(systemData[u'Manufacturer'])
print "Service tag {}".format(systemData[u'SKU'])
print "Serial number: {}".format(systemData[u'SerialNumber'])
print "Hostname: {}".format(systemData[u'HostName'])
print "Power state: {}".format(systemData[u'PowerState'])
print "Asset tag: {}".format(systemData[u'AssetTag'])
print "Memory size: {}".format(systemData[u'MemorySummary']
[u'TotalSystemMemoryGiB'])
print "CPU type: {}".format(systemData[u'ProcessorSummary'][u'Model'])
print "Number of CPUs: {}".format(systemData[u'ProcessorSummary'][u'Count'])
print "System status: {}".format(systemData[u'Status'][u'Health'])
print "RAID health: {}".format(storageData[u'Status'][u'Health'])
Output:
Model: PowerEdge R740
Manufacturer: Dell Inc.
Service tag BN7----
Serial number: CN7-----------
Hostname: WIN-GHLELBK2V2M
Power state: On
Asset tag:
Memory size: 64.0
CPU type: Intel(R) Xeon(R) CPU E5-2640 v3 @ 2.60GHz
Number of CPUs: 2
System status: OK
RAID health: OK
3.3.2 View system health across multiple servers
This example displays the service tag and overall system status for multiple systems; the source servers are
identified by a file consisting of iDRAC IP addresses and FQDNs as input.
import requests
import json
with open("serverList.txt", "r") as serverList:
for server in serverList.readlines():
req = requests.get("https://" + server.rstrip() +
"/redfish/v1/Systems/System.Embedded.1",verify=False,auth=('root','calvin'))
reqJson = req.json()