⬆️ ⬇️

Manage HP ProLiant servers through open REST APIs or “iLO on steroids”

Introduction from HP: This publication was written by one of our customers who, on duty, wished to remain anonymous. All matches of names and aypishnikov considered random. You can try to do the same at any time in our demo center in Moscow - if you wish, please write in the comments.



Greetings. My name is Edward, and I am a system administrator in a small company that outsources IT infrastructure administration. Ahem ... Already looks like an anonymous club with someone with problems? Well, okay, we did have one interesting problem, and today we will tell you how we ran into it and how we accidentally solved it.





For a start, a little background. Still remember how fun it was to adminit remote iron earlier, 5-8 years ago? We write the application to the engineers at the DC, wait for them to connect the KVM, set up the BIOS / CMOS, set the network boot, set up the system (this is good if someone good has already written the generator of the preseed / kickstart files, and the DC has DHCP / PXE server). And then we got ipmi on all servers (well, over time). Oh, how happy we were at first!



ipmitool -U user -P password power up -H XXX ipmitool -U user -P password password bootdev pxe -H XXX ipmitool -U user -P password power reset -H XXX 


And the server already seems to be running the OS. It remains only to watch this in the console, if you are bored. The only problem was that the BIOS still had to be updated manually and set up (well, enable HT / VT-d, at least). As a result, all the servers were configured differently, depending on which quarter they were installed. Well, you understand that the servers are always set by the youngest admin.

')

When we found something critical, we walked and manually switched the settings. Bardak, and only. But in general, all this was fine with us before the story happened to us, which I will talk about today.



It is worth mentioning that we place a part of our clients directly on our hardware (more precisely, on virtual machines on this hardware, which is driven through <crossed out with large NDA letters). Well, to make it easier for you to imagine, our system is very similar to OpenStack. And then, one day, the customer came to us and asked " on his hardware to make a system for managing virtual machines in a private cloud ." We were delighted, we began to show him his decision (after signing the contract and the TZ), he liked everything. I liked everything, the managers are already opening champagne (and I must say that the contract by our standards was very good). And then the client shows his finger at the point of TK and asks - “ what about it? ". Admins are sitting and looking at this point in perplexity - “ new servers should be automatically added to the cloud after inventory, rack installation and network-power connections ”. We started to show - look, we write the server here (1c), add its mac-address here (samopisnaya web-muzzle to manage the dhcp-server and pxe), run the script, the server boots over the network, the system is installed (we are relieved breathed out, realizing that at least the system is being installed by itself), then we catch the server when rebooting, press the Del key hard ... In general, the client’s representative looked at it, scratched his head, walked around the conversation, collected his thoughts and said: “ Well, where here automatically? So let's throw out everything except 1C, anyway, accountants will enter the server there, not me, and the place where you wrote the mac-address ”. Well, soon after that he left, adding that he hoped that we would still solve the problem.



Then we, as usual, decided to read the TK. We found there all sorts of interesting points that we (well, those who did the task, and not those who signed the TK and retold it to us) saw it for the first time. For example, monitoring temperature bypassing the OS, monitoring electricity consumption, auto-tuning the BIOS ... We started thinking. At first they were inclined to think that ipmitool could do all this. Then they presented what it would look like. We thought about how to update the settings, about monitoring the sensors ... In general, we parted for the weekend with the task "to study all Google for ipmi alternatives that they can."



We come on Monday, all are sad, angry. And one admin sits and smiles. It was logical to pester him with questions about why he reads ithappens when we have such trouble. As it turned out, he was happy about the fact that he was reading not ithappens, but Redfish server management spec v 1.0 ( read here ). They all read aloud together, they stopped being angry. Redfish turned out to be exactly what we need. They took the manager, made him ring up all the server manufacturers to find the piece of hardware in which Redfish was implemented. They come in an hour and laughs, point the finger at the box at the entrance and say " everything, I found ." Actually, the box was a box from HP Proliant Gen9. We found the server, returned it to the laboratory (and who ever guessed the new, unexplored server to take to the DC at once ...) and began to get acquainted with the HP REST API (which is the implementation of Redfish in HP servers).



Since we are admins (this was later given to us by a pitonist, and he wrote everything to us and made a nice web-interface), the first thing we did was write sh-nicknames who would do what we needed. Of course, we wouldn’t recommend going to the Rest API with the console curl and generating JSON via echo (or at least later don’t show it to anyone), but we’ll be happy to share examples of interaction with the HP ProLiant REST API (especially since HP asked us about this).



The possibilities are actually there, in the documentation there are 2 hundred pages of the list of objects and a brief description of them. The first thing we tried to do our basic tasks, like a proof-of-concept. Of course, some of them can be done through IPMI, but we decided to use one tool, namely the API.



First of all (well, well, secondly, after connecting the server in the rack and after HP iLO gets the IP address), we register all the BIOS settings:



 # echo '{"AcpiRootBridgePxm":"Enabled","AcpiRtcSupport":"Disabled","AcpiSlit":"Enabled","AdjSecPrefetch":"Enabled","AdminEmail":"","AdminName":"","AdminOtherInfo":"","AdminPassword":"","AdminPhone":"","AdvancedMemProtection":"AdvancedEcc","AsrStatus":"Enabled","AsrTimeoutMinutes":"10","AssetTagProtection":"Unlocked","AttributeRegistry":"HpBiosAttributeRegistryP86.1.1.0","AutoPowerOn":"RestoreLastState","BootMode":"LegacyBios","BootOrderPolicy":"RetryIndefinitely","ChannelInterleaving":"Enabled","CollabPowerControl":"Enabled","ConsistentDevNaming":"LomsOnly","CustomPostMessage":"","DcuIpPrefetcher":"Enabled","DcuStreamPrefetcher":"Enabled","Description":"This is the Platform/BIOS Configuration (RBSU) Current Settings","Dhcpv4":"Enabled","DynamicPowerCapping":"Auto","DynamicPowerResponse":"Fast","EmbNicEnable":"Enabled","EmbSata1Enable":"Enabled","EmbSata2Enable":"Enabled","EmbVideoConnection":"Auto","EmbeddedDiagnostics":"Enabled","EmbeddedDiagsMode":"Auto","EmbeddedSata":"Raid","EmbeddedUefiShell":"Enabled","EmsConsole":"Disabled","EnergyPerfBias":"BalancedPerf","EraseUserDefaults":"No","ExtendedAmbientTemp":"Disabled","ExtendedMemTest":"Disabled","F11BootMenu":"Enabled","FanFailPolicy":"Shutdown","FanInstallReq":"EnableMessaging","HwPrefetcher":"Enabled","IntelDmiLinkFreq":"Auto","IntelPerfMonitoring":"Disabled","IntelProcVtd":"Enabled","IntelQpiFreq":"Auto","IntelQpiPowerManagement":"Enabled","IntelTxt":"Disabled","IntelligentProvisioning":"Enabled","Ipv4Address":"0.0.0.0","Ipv4Gateway":"0.0.0.0","Ipv4PrimaryDNS":"0.0.0.0","Ipv4SecondaryDNS":"0.0.0.0","Ipv4SubnetMask":"0.0.0.0","MaxMemBusFreqMHz":"Auto","MaxPcieSpeed":"MaxSupported","MemFastTraining":"Enabled","MinProcIdlePkgState":"C6Retention","MinProcIdlePower":"C6","MixedPowerSupplyReportngi":"Enabled","Modified":"2015-02-12T20:16:59+00:00","Name":"BIOS Current Settings","NetworkBootRetry":"Enabled","NicBoot1":"NetworkBoot","NicBoot2":"Disabled","NmiDebugButton":"Enabled","NodeInterleaving":"Disabled","OldAdminPassword":"","OldPowerOnPassword":"","PciBusPadding":"Enabled","PostF1Prompt":"Delayed20Sec","PowerButton":"Enabled","PowerOnDelay":"None","PowerOnLogo":"Enabled","PowerOnPassword":"","PowerProfile":"BalancedPowerPerf","PowerRegulator":"DynamicPowerSavings","PreBootNetwork":"EmbNic","ProcCoreDisable":0,"ProcHyperthreading":"Enabled","ProcNoExecute":"Enabled","ProcTurbo":"Enabled","ProcVirtualization":"Disabled","ProcX2Apic":"Enabled","ProductId":"777424-AA1","QpiBandwidthOpt":"Balanced","QpiSnoopConfig":"Standard","RedundantPowerSupply":"BalancedMode","RemovableFlashBootSeq":"ExternalKeysFirst","RestoreDefaults":"No","RestoreManufacturingDefaults":"No","RomSelection":"CurrentRom","SataSecureErase":"Disabled","SaveUserDefaults":"No","SecureBoot":"Disabled","SerialConsoleBaudRate":"115200","SerialConsoleEmulation":"Vt100Plus","SerialConsolePort":"Auto","SerialNumber":"8CW4340081","ServerAssetTag":"","ServerName":"","ServerOtherInfo":"","ServerPrimaryOs":"","ServiceEmail":"","ServiceName":"","ServiceOtherInfo":"","ServicePhone":"","SettingsResult":{"ETag":"","Messages":[{"MessageArgs":[],"MessageID":"Base.1.0:Success"}],"Time":""},"Sriov":"Enabled","ThermalConfig":"OptimalCooling","ThermalShutdown":"Enabled","TimeZone":"Utc0","TpmBinding":"Disabled","TpmOperation":"Disable","TpmState":"NotPresent","TpmType":"NoTpm","TpmVisibility":"Visible","Type":"HpBios.1.0.0","UefiOptimizedBoot":"Enabled","UefiPxeBoot":"Auto","UefiShellBootOrder":"Disabled","UefiShellStartup":"Disabled","UefiShellStartupLocation":"AttachedMedia","UefiShellStartupUri":"","UrlBootFile":"","Usb3Mode":"Auto","UsbBoot":"Enabled","UsbControl":"UsbEnabled","UtilityLang":"English","VideoOptions":"BothVideoEnabled","VirtualInstallDisk":"Disabled","VirtualSerialPort":"Com2Irq3","WakeOnLan":"Enabled","links":{"BaseConfigs":{"href":"/rest/v1/systems/1/bios/BaseConfigs"},"Boot":{"href":"/rest/v1/systems/1/bios/Boot"},"Mappings":{"href":"/rest/v1/systems/1/bios/Mappings"},"Settings":{"href":"/rest/v1/systems/1/bios/Settings"}}}' | curl -v -k -X PATCH https://Administrator:Password@192.168.2.250/rest/v1/systems/1/Bios/Settings -H "Content-Type: application/json" --data-binary @- ; echo 




Learn to manage nutrition. Rebut "by the button":



 # echo '{"Action":"Reset","ResetType":"ForceRestart"}' | curl -v -k -X POST https://Administrator:Password@192.168.2.250/rest/v1/systems/1 -H "Content-Type: application/json" --data-binary @- ; echo 


"Pull the cable out of the socket":



 # echo '{"Action":"Reset","ResetType":"ForceOff"}' | curl -v -k -X POST https://Administrator:Password@192.168.2.250/rest/v1/systems/1 -H "Content-Type: application/json" --data-binary @- ; echo 


We turn on the server:



 # echo '{"Action":"Reset","ResetType":"On"}' | curl -v -k -X POST https://Administrator:Password@192.168.2.250/rest/v1/systems/1 -H "Content-Type: application/json" --data-binary @- ; echo 


We send the engineer "to press the power button":



 # echo '{"Action":"Reset","ResetType":"PushPowerButton"}' | curl -v -k -X POST https://Administrator:D3BFF4AE@192.168.2.250/rest/v1/systems/1 -H "Content-Type: application/json" --data-binary @- ; echo 


Ask the server who he is:



 # curl -v -k -X GET https://Administrator:Password@192.168.2.250/rest/v1 -H "Content-Type: application/json" {"Name":"HP RESTful Root Service","Oem":{"Hp":{"Manager":[{"DefaultLanguage":"en","FQDN":"ILO8CW4340081.","HostName":"ILO8CW4340081","Languages":[{"Language":"en","TranslationName":"English","Version":"2.02"}],"ManagerFirmwareVersion":"2.02","ManagerType":"iLO 4"}],"Sessions":{"CertCommonName":"ILO8CW4340081","KerberosEnabled":false,"LDAPAuthLicenced":false,"LDAPEnabled":false,"LocalLoginEnabled":true,"LoginFailureDelay":0,"LoginHint":{"Hint":"POST to /Sessions to login using the following JSON object:","HintPOSTData":{"Password":"password","UserName":"username"}},"SecurityOverride":true,"ServerName":""},"Type":"HpiLOServiceExt.0.9.5","links":{"Providers":{"href":"/rest/v1/Providers"}}}},"ServiceVersion":"0.9.5","Time":"2015-05-06T18:01:55Z","Type":"ServiceRoot.0.9.5","links":{"AccountService":{"href":"/rest/v1/AccountService"},"Chassis":{"href":"/rest/v1/Chassis"},"Managers":{"href":"/rest/v1/Managers"},"Registries":{"href":"/rest/v1/Registries"},"Schemas":{"href":"/rest/v1/Schemas"},"Sessions":{"href":"/rest/v1/Sessions"},"Systems":{"href":"/rest/v1/Systems"},"self":{"href":"/rest/v1/root"}}} 


With a PATCH request in the same handle, you can change the server information inside the iLo.



We will ask the MAC addresses of the server (yes, as a result we went further and the DHCP server itself conducted an inventory of new servers, if we found an unfamiliar iLO in a separate VLAN-e - for iLO we issued dynamic addresses, and then we got records about static addresses for server network cards and iLo interface):



 # curl -v -k -X GET https://Administrator:Password@192.168.2.250/rest/v1/systems/1 -H "Content-Type: application/json" {"AvailableActions":[{"Action":"Reset","Capabilities":[{"AllowableValues":["On","ForceOff","ForceRestart","Nmi","PushPowerButton"],"PropertyName":"ResetType"}]}],"Bios":{"Current":{"VersionString":"P86 v1.30 (09/04/2014)"}},"Boot":{"BootSourceOverrideEnabled":"Disabled","BootSourceOverrideSupported":["None","Floppy","Cd","Hdd","Usb","Utilities","Diags","BiosSetup","Pxe","UefiShell","UefiTarget"],"BootSourceOverrideTarget":"None","UefiTargetBootSourceOverride":"None","UefiTargetBootSourceOverrideSupported":["NIC.LOM.1.1.IPv4","NIC.LOM.1.1.IPv6"]},"Description":"Computer System View","HostCorrelation":{"HostMACAddress":["14:58:d0:d3:20:8e","14:58:d0:d3:20:8f"],"HostName":"","IPAddress":[""]},"IndicatorLED":"Off","Manufacturer":"HP","Memory":{"TotalSystemMemoryGB":32},"Model":"ProLiant DL120 Gen9","Name":"Computer System","Oem":{"Hp":{"AvailableActions":[{"Action":"PowerButton","Capabilities":[{"AllowableValues":["Press","PressAndHold"],"PropertyName":"PushType"},{"AllowableValues":["/Oem/Hp"],"PropertyName":"Target"}]}],"Bios":{"Backup":{"Date":"v1.30 (09/04/2014)","Family":"P86","VersionString":"P86 v1.30 (09/04/2014)"},"Bootblock":{"Date":"","Family":"P86","VersionString":"P86 "},"Current":{"Date":"09/04/2014","Family":"P86","VersionString":"P86 v1.30 (09/04/2014)"},"UefiClass":2},"PowerAllocationLimit":900,"PowerAutoOn":"Restore","PowerOnDelay":"Minimum","PowerRegulatorMode":"Dynamic","PowerRegulatorModesSupported":["OSControl","Dynamic","Max","Min"],"Type":"HpComputerSystemExt.0.10.0","VirtualUUID":null,"links":{"BIOS":{"href":"/rest/v1/systems/1/bios"},"PCIDevices":{"href":"/rest/v1/Systems/1/PCIDevices"},"PCISlots":{"href":"/rest/v1/Systems/1/PCISlots"},"SecureBoot":{"href":"/rest/v1/Systems/1/SecureBoot"}}}},"Power":"Off","Processors":{"Count":1,"ProcessorFamily":"Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz"},"SKU":"777424-AA1","SerialNumber":"8CW4340081","Status":{"Health":"OK","State":"Disabled"},"SystemType":"Physical","Type":"ComputerSystem.0.9.5","UUID":"34373737-3432-4338-5734-333430303831","links":{"Chassis":[{"href":"/rest/v1/Chassis/1"}],"Manager":[{"href":"/rest/v1/Managers/1"}],"self":{"href":"/rest/v1/Systems/1"}}} 


From the previous JSON, we also pulled out the amount of memory with the CPU model, then the developers made integration with 1C, the server sent data about themselves and there. Here we also determined the BIOS version in order to swear about the outdated (or simply different in the cluster) versions.



You can also take readings of power metrics through the REST API (unfortunately, not in all the “levels” of the iLO license):



 # curl -v -k -X GET https://Administrator:Password@192.168.2.250/rest/v1/chassis/1/PowerMetrics -H "Content-Type: application/json" 


We also found some kind of creepy handle that describes the state of the server - fan speed, temperature, the state of different hardware inside the server.



 # curl -v -k -X GET https://Administrator:Password@192.168.1.235/rest/v1/Chassis/1/ThermalMetrics -H "Content-Type: application/json" {"Fans":[{"CurrentReading":33,"FanName":"Fan 1","Oem":{"Hp":{"Location":"System","Type":"HpServerFan.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Percent"},{"CurrentReading":33,"FanName":"Fan 2","Oem":{"Hp":{"Location":"System","Type":"HpServerFan.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Percent"},{"CurrentReading":33,"FanName":"Fan 3","Oem":{"Hp":{"Location":"System","Type":"HpServerFan.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Percent"},{"CurrentReading":33,"FanName":"Fan 4","Oem":{"Hp":{"Location":"System","Type":"HpServerFan.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Percent"},{"CurrentReading":33,"FanName":"Fan 5","Oem":{"Hp":{"Location":"System","Type":"HpServerFan.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Percent"},{"CurrentReading":33,"FanName":"Fan 6","Oem":{"Hp":{"Location":"System","Type":"HpServerFan.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Percent"}],"Name":"ThermalMetrics","Temperatures":[{"Context":"Ambient","CurrentReading":21,"LowerThresholdCritical":46,"LowerThresholdNonCritical":42,"Name":"01-Inlet Ambient","Oem":{"Hp":{"LocationXmm":11,"LocationYmm":0,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"CPU","CurrentReading":40,"LowerThresholdCritical":0,"LowerThresholdNonCritical":70,"Name":"02-CPU 1","Oem":{"Hp":{"LocationXmm":7,"LocationYmm":9,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"CPU","CurrentReading":40,"LowerThresholdCritical":0,"LowerThresholdNonCritical":70,"Name":"03-CPU 2","Oem":{"Hp":{"LocationXmm":12,"LocationYmm":9,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"GPU","CurrentReading":27,"LowerThresholdCritical":0,"LowerThresholdNonCritical":87,"Name":"04-P1 DIMM 1-2","Oem":{"Hp":{"LocationXmm":10,"LocationYmm":10,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"GPU","CurrentReading":0,"LowerThresholdCritical":0,"LowerThresholdNonCritical":87,"Name":"05-P1 DIMM 3-4","Oem":{"Hp":{"LocationXmm":5,"LocationYmm":10,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"State":"Absent"},"Units":"Celsius"},{"Context":"GPU","CurrentReading":28,"LowerThresholdCritical":0,"LowerThresholdNonCritical":87,"Name":"06-P2 DIMM 1-2","Oem":{"Hp":{"LocationXmm":14,"LocationYmm":10,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"GPU","CurrentReading":0,"LowerThresholdCritical":0,"LowerThresholdNonCritical":87,"Name":"07-P2 DIMM 3-4","Oem":{"Hp":{"LocationXmm":11,"LocationYmm":10,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"State":"Absent"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":0,"LowerThresholdCritical":0,"LowerThresholdNonCritical":60,"Name":"08-HD Max","Oem":{"Hp":{"LocationXmm":4,"LocationYmm":2,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"State":"Absent"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":41,"LowerThresholdCritical":0,"LowerThresholdNonCritical":105,"Name":"09-Chipset","Oem":{"Hp":{"LocationXmm":7,"LocationYmm":13,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":40,"LowerThresholdCritical":0,"LowerThresholdNonCritical":0,"Name":"10-P/S 1","Oem":{"Hp":{"LocationXmm":1,"LocationYmm":14,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":0,"LowerThresholdCritical":0,"LowerThresholdNonCritical":0,"Name":"11-P/S 2","Oem":{"Hp":{"LocationXmm":2,"LocationYmm":14,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"State":"Absent"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":30,"LowerThresholdCritical":120,"LowerThresholdNonCritical":115,"Name":"12-VR P1","Oem":{"Hp":{"LocationXmm":7,"LocationYmm":8,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":30,"LowerThresholdCritical":120,"LowerThresholdNonCritical":115,"Name":"13-VR P2","Oem":{"Hp":{"LocationXmm":12,"LocationYmm":8,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":26,"LowerThresholdCritical":120,"LowerThresholdNonCritical":115,"Name":"14-VR P1 Zone","Oem":{"Hp":{"LocationXmm":7,"LocationYmm":7,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":25,"LowerThresholdCritical":120,"LowerThresholdNonCritical":115,"Name":"15-VR P2 Zone","Oem":{"Hp":{"LocationXmm":12,"LocationYmm":7,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":26,"LowerThresholdCritical":120,"LowerThresholdNonCritical":115,"Name":"16-VR P1 Mem","Oem":{"Hp":{"LocationXmm":8,"LocationYmm":7,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":26,"LowerThresholdCritical":120,"LowerThresholdNonCritical":115,"Name":"17-VR P2 Mem","Oem":{"Hp":{"LocationXmm":13,"LocationYmm":7,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":0,"LowerThresholdCritical":0,"LowerThresholdNonCritical":60,"Name":"18-Storage Batt","Oem":{"Hp":{"LocationXmm":0,"LocationYmm":7,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"State":"Absent"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":30,"LowerThresholdCritical":85,"LowerThresholdNonCritical":80,"Name":"19-iLO Zone","Oem":{"Hp":{"LocationXmm":12,"LocationYmm":13,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":30,"LowerThresholdCritical":105,"LowerThresholdNonCritical":100,"Name":"20-System Board","Oem":{"Hp":{"LocationXmm":7,"LocationYmm":14,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":28,"LowerThresholdCritical":105,"LowerThresholdNonCritical":100,"Name":"21-System Board","Oem":{"Hp":{"LocationXmm":11,"LocationYmm":13,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":24,"LowerThresholdCritical":127,"LowerThresholdNonCritical":126,"Name":"22-P/S Zone","Oem":{"Hp":{"LocationXmm":4,"LocationYmm":9,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":28,"LowerThresholdCritical":0,"LowerThresholdNonCritical":126,"Name":"23-System Board","Oem":{"Hp":{"LocationXmm":4,"LocationYmm":15,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":29,"LowerThresholdCritical":0,"LowerThresholdNonCritical":126,"Name":"24-System Board","Oem":{"Hp":{"LocationXmm":9,"LocationYmm":15,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":29,"LowerThresholdCritical":0,"LowerThresholdNonCritical":126,"Name":"25-System Board","Oem":{"Hp":{"LocationXmm":10,"LocationYmm":15,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"Expansion Bay","CurrentReading":0,"LowerThresholdCritical":0,"LowerThresholdNonCritical":100,"Name":"26-PCI 1","Oem":{"Hp":{"LocationXmm":4,"LocationYmm":13,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"State":"Absent"},"Units":"Celsius"},{"Context":"Expansion Bay","CurrentReading":0,"LowerThresholdCritical":0,"LowerThresholdNonCritical":100,"Name":"27-PCI 2","Oem":{"Hp":{"LocationXmm":10,"LocationYmm":13,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"State":"Absent"},"Units":"Celsius"},{"Context":"Expansion Bay","CurrentReading":0,"LowerThresholdCritical":0,"LowerThresholdNonCritical":100,"Name":"28-PCI 3","Oem":{"Hp":{"LocationXmm":10,"LocationYmm":13,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"State":"Absent"},"Units":"Celsius"},{"Context":"Expansion Bay","CurrentReading":26,"LowerThresholdCritical":0,"LowerThresholdNonCritical":126,"Name":"29-PCI 1 Zone","Oem":{"Hp":{"LocationXmm":4,"LocationYmm":15,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"Expansion Bay","CurrentReading":24,"LowerThresholdCritical":0,"LowerThresholdNonCritical":126,"Name":"30-PCI 2 Zone","Oem":{"Hp":{"LocationXmm":10,"LocationYmm":15,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"Expansion Bay","CurrentReading":25,"LowerThresholdCritical":0,"LowerThresholdNonCritical":126,"Name":"31-PCI 3 Zone","Oem":{"Hp":{"LocationXmm":10,"LocationYmm":15,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"Health":"OK","State":"Enabled"},"Units":"Celsius"},{"Context":"Expansion Bay","CurrentReading":0,"LowerThresholdCritical":0,"LowerThresholdNonCritical":100,"Name":"32-LOM Card","Oem":{"Hp":{"LocationXmm":10,"LocationYmm":13,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"State":"Absent"},"Units":"Celsius"},{"Context":"Expansion Bay","CurrentReading":0,"LowerThresholdCritical":0,"LowerThresholdNonCritical":126,"Name":"33-I/O Board","Oem":{"Hp":{"LocationXmm":10,"LocationYmm":15,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"State":"Absent"},"Units":"Celsius"},{"Context":"System Board","CurrentReading":0,"LowerThresholdCritical":0,"LowerThresholdNonCritical":100,"Name":"34-LOM","Oem":{"Hp":{"LocationXmm":6,"LocationYmm":14,"Type":"HpSeaOfSensors.0.9.5"}},"Status":{"State":"Absent"},"Units":"Celsius"}],"Type":"ThermalMetrics.0.9.5","links":{"self":{"href":"/rest/v1/Chassis/1/ThermalMetrics"}}} 


We also found an object that talks about the state of the server as a whole (OK / fail) and what it is doing now (in our example it was loaded):



 # curl -v -k -X  GET https://Administrator:Password@192.168.1.235/rest/v1/Chassis/1 -H "Content-Type: application/json" ... "Status":{"Health":"OK","State":"Starting"} ... 


In general, we finally wrote sh-nickname and gave it to the developer. He laughed at us, we scolded him for it, threatened to take away the root ... But then he wrote a module in our little cloud that can add and manage servers through Redfish (and HP REST API, respectively). Well, we finally completed the order.



Probably, it is time to round out. We will tell about those who played the main roles in all this history.





Thanks for attention!

Source: https://habr.com/ru/post/268885/



All Articles