PHP code example of serverzone / supermicro-ipmi

1. Go to this page and download the library: Download serverzone/supermicro-ipmi library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

serverzone / supermicro-ipmi example snippets




ance = new ServerZone\SupermicroIpmi\Client('my-ipmi.local', 'ADMIN', 'ADMIN');
$instance = new ServerZone\SupermicroIpmi\Client('192.168.0.1', 'ADMIN', 'ADMIN');
$instance = new ServerZone\SupermicroIpmi\Client('[2001:db8::1]', 'ADMIN', 'ADMIN');

var_dump($instance->getPowerStatus());

var_dump($instance->getPowerConsumption());

$instance->powerOn();

$instance->powerOff();

$instance->powerReset();

foreach($i->getSensors() as $row) {
    printf("%20s %8s %10s %10s\n", $row->getName(), $row->getValue(), $row->getUnits(), $row->getStatus(), $row->getLimit('UNC'));
}