sortColumn = LIB_SORT_DEFAULT; $sortCriteria->ascending = true; $sortCriteria = new SortCriteria(1, "ASC","","*"); // Sort on GUIDs $PartList = get_logical_libraries($user, $sortCriteria); $numPartList = count($PartList); for ($libIndex = 0; $libIndex < $numPartList; $libIndex++) { $libraryNames[$libIndex] = $PartList[$libIndex]->name; $libraryIndex[$PartList[$libIndex]->name] = $libIndex; //error_log("Guid:".$PartList[$libIndex]->guid); $encryptData = get_partition_enryption($user, $PartList[$libIndex]->guid); $libraryEncryption[$PartList[$libIndex]->name] = $encryptData->method; //error_log('$libraryEncryption['.$PartList[$libIndex]->name.'] = '.$libraryEncryption[$PartList[$libIndex]->name]); } //debug /* $libraryNames[6] = "anyname1"; $libraryIndex["anyname1"] = 6; $libraryNames[7] = "anyname1"; $libraryIndex["anyname2"] = 7; $libraryNames[8] = "anyname1"; $libraryIndex["anyname3"] = 8; $numPartList = $numPartList +3; */ $PartList[PART_IE] = "IO STATION"; // !?! was MAILBOX $PartList[PART_CLN] = "CLEANING"; /*####################################################### # Slot addressing: # The model states that the Slot location Address is: # chassis, magazine, slot #######################################################*/ $sortCriteria->sortColumn = 3; // Location per Slot Attributes $sortCriteria->ascending = true; $sortCriteria->filterPattern = "*"; $SlotList = get_all_slots_and_mailbox($user, $sortCriteria); //$SlotList = get_all_slots($user, $sortCriteria); $physicalSlotList = get_physical_slots($user, $sortCriteria); // Put all the Slots in a HASH table foreach( $SlotList as $Slot ) { if($Slot->name == "" ) $Slot->name = "Unassigned"; //= "Physical Library"; $hSlots[ $Slot->location ] = $Slot; } foreach ($physicalSlotList as $pslot) { //error_log($pslot->location); $pslot->name = "Unassigned"; $hSlots[ $pslot->location ] = $pslot; } $sortCriteria = new SortCriteria(0, "ASC","","*"); // Sort on GUIDs $CleanList = get_cleaning_slots($user, $sortCriteria, 0); // Get ALL Cleaning SLOTs // Add the cleaning Slots to the HASH table foreach( $CleanList as $Slot ) { if($Slot->name == "" ) $Slot->name = "Unassigned"; //"Physical Library"; $hSlots[ $Slot->location ] = $Slot; } $ChassisList = get_chassis($user); // Put all the Chassis in a HASH table so We can sort the the way we want. foreach( $ChassisList as $Chass ) { $hChass[ $Chass->location ] = $Chass; } krsort( $hChass ); $sortCriteria->sortColumn = 1; // Location per Drive Attributes $sortCriteria->ascending = true; $sortCriteria->filterPattern = "*"; $DriveList = get_all_drives($user, $sortCriteria); // Put all the Drives in a HASH table so we can draw them as we get to there locations foreach( $DriveList as $Drv ) { if($Drv->name == "" ) $Drv->name = "Unassigned"; //"Physical Library"; $hDrives[ $Drv->location ] = $Drv; } // get inaccessible slots $libModel=0; $x_hidden=""; $bottomChassis = 0; foreach ($hChass as $chass) { if (!isset($firstChass)) $firstChass=$chass; if ($chass->model=="ControlModule5U") $libModel+=5; if ($chass->model=="ExpansionModule9U") $libModel+=9; $bottomChassis = $chass->location; } if ($libModel>=23) $x_hidden=$firstChass->location; $numChass=count($hChass); $numSlots=array(); for ($i=10; $i>-10;$i--) { if ($hChass[$i]) { if ($hChass[$i]->model=="ControlModule5U") { $n1=8; $n2=6; $drvs=2; } else if ($hChass[$i]->model=="ExpansionModule9U") { $n1=16; $n2=12; $drvs=4; } $numSlots[$i]=array(0,$n1,$n1,$n1,$n1,$n1,$n2); $numSlots[$i]["drives"]=$drvs; } } $libNames=array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"); // $blueShades=array("","#007df1","#009df1","#00b9f1","#00d5f1","#00f1f1","00f1cd","#00f1a5","#00f164","#91f100","#c1f100","#ddf100","#f1f100","#f1dd00","#f1c900","#f1b100"); $blueShades=array("","#7DA7D9","#7DA7D9","#7DA7D9","#7DA7D9","#7DA7D9","#7DA7D9","#7DA7D9","#7DA7D9","#7DA7D9","#7DA7D9","#7DA7D9","#7DA7D9","#7DA7D9","#7DA7D9","#7DA7D9"); $namesFound=array(); //print_r($hSlots); //print_r($hDrives); //print_r($hChass); function getSlotCss($address,$type) { global $hDrives; global $hSlots; global $libNames; global $namesFound; global $x_hidden; global $blueShades; global $libraryIndex; global $bottomChassis; global $libraryEncryption; $className="map_emptyslot"; $info=""; $libName=""; $colorIn=""; $colorOut=""; $onOver=""; $onOut=""; $onClick=""; $title=""; $estimatedHeight=50; if ($hSlots[$address]!=false ) $slot=$hSlots[$address]; if ($hDrives[$address]!=false ) $slot=$hDrives[$address]; //error_log('Here is slot info: '.print_r($slot, true)); //blue shades for slots if ($type=="slot") { $len=strlen($slot->name); $name=substr($slot->name,0);//$len-2); if ($libNames[$name]=="") { $name=substr($slot->name,0);//,$len-1); } if ($libNames[$name]!="" && $name!="") { $blue_shade=$name; } } // end if (($x_hidden!="" && $address==$x_hidden.",4,1" || $address==$x_hidden.",5,1")|| $address==$bottomChassis.",1,15" || $address==$bottomChassis.",1,16" || $address==$bottomChassis.",2,15" || $address==$bottomChassis.",2,16" || $address==$bottomChassis.",3,15" || $address==$bottomChassis.",3,16" || $address==$bottomChassis.",4,15" || $address==$bottomChassis.",4,16" || $address==$bottomChassis.",5,15" || $address==$bottomChassis.",5,16") { $title="Physically inaccessible slot "; $className="map_inaccessibleslot"; $onClick=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.="
Inaccessible Slot
Type: Storage
Location: ".$address."
Description: This slot is inaccessible in the current physical configuration.
"; $estimatedHeight=160; } else if ($slot!=false) { if ($hSlots[$address]!=false) //slot { if (($slot->slotType != "Drive") && ($slot->barcode == "") && (($slot->mediaType == 'LTO-1')||($slot->mediaType == 'LTO-2')||($slot->mediaType == 'LTO-3')||($slot->mediaType == 'LTO-4'))) { $mediaType = 'LTO'; } else { $mediaType = $slot->mediaType; } switch ($slot->slotType) { case "Storage" : if ($slot->name == "Unassigned") { if ($slot->barcode) { $title="Unlicensed/Unassigned library slot : ".$address; $onClick=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.="
Unlicensed/Unassigned Slot
"; $onClick.=""; $onClick.="
Location: ".$slot->location."
Barcode: ".$slot->barcode."
This slot (".$address.") is either currently unlicensed and requires a feature license to use or it is unassigned and must be assigned to a logical library before it can be utilized.
"; $setOnClick="setClickedCell('slot_".$address."','#ffffff','#A7A7A7')"; $estimatedHeight=50; } else { $title="Unlicensed/Unassigned library slot : ".$address; $onClick=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.="
Unlicensed/Unassigned Slot
This slot (".$address.") is either currently unlicensed and requires a feature license to use or it is unassigned and must be assigned to a logical library before it can be utilized.
"; $setOnClick="setClickedCell('slot_".$address."','#ffffff','#A7A7A7')"; $estimatedHeight=50; } break; } error_log('$libraryEncryption['.$slot->name.'] = '.$libraryEncryption[$slot->name]); // if the drive is encryption capable if (($slot->mediaType == 'LTO-4') || ($slot->mediaTypeCode > 2)) { error_log('Logical Libray NAME:::::::::::::::::::::::'.$slot->name); switch ($libraryEncryption[$slot->name]) { case 2: $method = "System Managed Encryption"; break; case 3: $method = "Application Managed Encryption"; break; case 4: $method = "Library Managed Encryption"; break; case 5: $method = "Custom"; break; default: $method = "None"; //if (!is_ibm_encryption_licensed($user)) { $addText = "Buy the encryption license!"; } break; } } else { $method = "N/A"; } case "Drive" : $className="map_slot"; $colorIn="#7DA7D9"; $blueShades[$blue_shade]; $onClick=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.="
Assigned Slot
Type: ".$slot->slotType."
Logical Library: ".$slot->name."
Location: ".$slot->location."
Barcode: ".$slot->barcode."
MediaType: ".$mediaType."
Element Address: ".$slot->logicalAddress."
Encryption Method: ".$method."
"; $estimatedHeight=160; break; case "IE Station" : case "IO Station" : $blue_shade=""; $className="map_ieslot"; $theslottype = "I/O"; $info="I/O"; $colorIn="#6381C6"; $colorOut="#6381C6"; if (($slot->name=="Physical Library") && ($slot->barcode!="")) { $onClick=""; $onClick.=""; $onClick.=""; //$onClick.="
I/O Station Slot: Cartridge Assigned to Physical Library
The cartridge at this location is assigned to physical library.
"; //$onClick.=""; //$onClick.=""; //$onClick.=""; //$onClick.=""; $onClick.=""; $onClick.="
Type: I/O Station
Location: ".$slot->location."
Barcode: ".$slot->barcode."
MediaType: ".$mediaType."
Element Address: ".$slot->logicalAddress."
"; } else if (($slot->name !="Physical Library") && ($slot->barcode!="")) { $onClick=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.="
I/O Station Slot: Assigned Cartridge
Type: I/O Station
Location: ".$slot->location."
Barcode: ".$slot->barcode."
Cartridge Assigned to: ".$slot->name."
MediaType: ".$mediaType."
Element Address: ".$slot->logicalAddress."
"; } else { $onClick=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.="
I/O Station Slot
Type: I/O Station
Location: ".$slot->location."
MediaType: ".$mediaType."
Element Address: ".$slot->logicalAddress."
"; } $estimatedHeight=160; break; case "Cleaning" : $blue_shade=""; $className="map_cleanslot"; $info="CLN"; $colorIn="#0054A6"; $colorOut="#0054A6"; $onClick=" "; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; // $onClick.=""; $onClick.=""; $onClick.="
Cleaning Slot
Type: ".$slot->slotType."
Logical Library: ".$slot->name."
Location: ".$slot->location."
Barcode: ".$slot->barcode."
MediaType: ".$mediaType."
Element Address: ".$slot->logicalAddress."
Cleaning Status: ".$slot->status."
"; $estimatedHeight=160; break; } $title="(".$slot->name.")"." Location : ".$slot->location." Barcode : ".$slot->barcode; } if ($hDrives[$address]!=false) { $mediaType = $slot->mediaType; if ($slot->barcode) { $className="map_drivefullslot"; $onOver="this.className='map_drivefullslotover'"; $onClick="this.className='map_drivefullslotover'"; $onOut="this.className='map_drivefullslot'"; } else { $className="map_driveslot"; $onOver="this.className='map_driveslotover'"; $onClick="this.className='map_driveslotover'"; $onOut="this.className='map_driveslot'"; } if ($slot->name != "Unassigned") //"Physical Library") { /* if ($slot->barcode) { $onOver="this.className='map_drivefullslotover'"; $onOut="this.className='map_drivefullslot'"; } else { $onOver="this.className='map_driveslotover'"; $onOut="this.className='map_driveslot'"; } */ $title="Drive | Location : ".$slot->location." | ".$slot->name." | Interface : ".$slot->interfaceType ; $onClick=" "; $onClick.=""; } else { $title="Unassigned drive"; $onClick="
Assigned Drive
"; $onClick.=""; } $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $estimatedHeight=260; if ($slot->interfaceType=="Fibre") { if ($slot->topology == 1) { $topology = "Auto (L Port)"; } else if ($slot->topology == 2) { $topology = "L Port"; } else if ($slot->topology == 3) { $topology = "N Port"; } else if ($slot->topology == 4) { $topology = "Auto (N Port)"; } else { $topology = $slot->topology; } if ($slot->topologyAct ==0) { $topologyAct = "Unknown"; } else if ($slot->topologyAct == 1) { $topologyAct = "Auto (L Port)"; } else if ($slot->topologyAct == 2) { $topologyAct = "L Port"; } else if ($slot->topologyAct == 3) { $topologyAct = "N Port"; } else if ($slot->topologyAct == 4) { $topologyAct = "Auto (N Port)"; } else { $topologyAct = $slot->topologyAct; } if ($slot->speed == 0) { $speed = 'Auto'; } else if ($slot->speed == 1) { $speed = '1 Gb/s'; } else if ($slot->speed == 2) { $speed = '2 Gb/s'; } else if ($slot->speed == 4) { $speed = '4 Gb/s'; } else { $speed = $slot->speed; } if ($slot->speedAct == 0) { $speedAct = 'Auto'; } else if ($slot->speedAct == 1) { $speedAct = '1 Gb/s'; } else if ($slot->speedAct == 2) { $speedAct = '2 Gb/s'; } else if ($slot->speedAct == 4) { $speedAct = '4 Gb/s'; } else { $speedAct = $slot->speedAct; } $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $estimatedHeight=390; } $onClick.=""; if ($slot->controlPath) { $slot->controlPath = "Yes"; } else { $slot->controlPath = "No"; } $onClick.=""; //error_log('$libraryEncryption['.$slot->name.'] = '.$libraryEncryption[$slot->name]); // if the drive is encryption capable if (($slot->mediaType == 'LTO-4') || ($slot->mediaTypeCode > 2)) { error_log('Logical Libray NAME:::::::::::::::::::::::'.$slot->name); switch ($libraryEncryption[$slot->name]) { case 2: $method = "System Managed Encryption"; break; case 3: $method = "Application Managed Encryption"; break; case 4: $method = "Library Managed Encryption"; break; case 5: $method = "Custom"; break; default: $method = "None"; //if (!is_ibm_encryption_licensed($user)) { $addText = "Buy the encryption license!"; } break; } } else { $method = "N/A"; } $onClick.=""; $onClick.=""; $onClick.="
Unassigned Drive
Interface: ".$slot->interfaceType."
Type: ".$mediaType."
Status: ".$slot->status."
Logical Library: ".$slot->name."
Location: ".$slot->location."
Barcode: ".$slot->barcode."
Element Address: ".$slot->logicalAddress."
Vendor: ".$slot->vendor."
Model: ".$slot->model."
Physical SN: ".$slot->serialNumber."
Logical SN: ".$slot->logicalSerialNumber."
WWNN: ".$slot->wwnn."
WWPN: ".$slot->wwpn."
Loop ID: ".$slot->loopId."
Topology Request: ".$topology."
Speed Request: ".$speed."
Topology Actual: ".$topologyAct."
Speed Actual: ".$speedAct."
Firmware Level: ".$slot->firmwareLevel."
Control Path: ".$slot->controlPath."
Encryption Method: ".$method."
"; $setOnClick="setClickedCell('slot_".$address."','','')"; } $len=strlen($slot->name); $name=substr($slot->name,$len-2); if ($libNames[$name]=="") { $name=substr($slot->name,$len-1); } if ($libNames[$name]!="") { $libName=$libNames[$name]; $namesFound[$name]=1; } if ($slot->barcode ) $drvHere="
"; } else if ($type=="drive") { $title="Empty drive slot : ".$address; $onClick=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.="
Unassigned drive
Empty drive slot (".$address.")
"; $setOnClick="setClickedCell('slot_".$address."','#ffffff','#A7A7A7')"; $estimatedHeight=50; } else { $drvHere="
"; /* $title="Unlicensed/Unassigned library slot : ".$address; $onClick=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.="
Unlicensed/Unassigned I/O Slot
This slot (".$address.") is either currently unlicensed and requires a feature license to use or it is unassigned and must be assigned to a logical library before it can be utilized.
"; */ $onClick=""; $onClick.=""; $onClick.=""; //$onClick.="
I/O Station Slot: Unassigned Cartridge
Unassigned cartridges in the I/O station may be assigned to a logical library or to the physical library using the Operator Panel.
"; //$onClick.=""; //$onClick.=""; //$onClick.=""; //$onClick.=""; $onClick.=""; $onClick.="
Type: I/O Station
Location: ".$slot->location."
Barcode: ".$slot->barcode."
MediaType: ".$mediaType."
Element Address: ".$slot->logicalAddress."
"; $setOnClick="setClickedCell('slot_".$address."','#ffffff','#A7A7A7')"; $estimatedHeight=50; } if ($type =="drive") { } else if ($colorIn!="") { $onOver="changeBgColor('slot_".$hSlots[$address]->location."','".$colorIn."')"; $onOut="changeBgColor('slot_".$hSlots[$address]->location."','".$colorOut."')"; $setOnClick="setClickedCell('slot_".$address."','#ffffff','".$colorOut."')"; } $classLibName="map_libname"; if ($libName=="") $classLibName=$className."_info"; if ($onClick!="") $onClick="showInfo('".$onClick."','slot_".$address."',".$estimatedHeight.");".$setOnClick; $ret=array(); $ret["className"]=$className; $ret["classNameInfo"]=$className."_info"; //blue shades for slots if ($type=="slot") { if ($blue_shade!="") { $ret["classNameInfo"].="_".$blue_shade; } } // end $ret["classLibName"]=$classLibName; $ret["info"]=$info; //DEBUG /*$len = strlen($slot->location); if (substr($slot->location,$len-1) == '1') { $slot->name = "anyname1"; } if (substr($slot->location,$len-1) == '2') { $slot->name = "anyname2"; } if (substr($slot->location,$len-1) == '3') { $slot->name = "anyname3"; } */ $ret["libName"]=$libNames[$libraryIndex[$slot->name]]; //$libName; $ret["drvHere"]=$drvHere; $ret["onOver"]=$onOver; $ret["onOut"]=$onOut; $ret["onClick"]=$onClick; $ret["title"]=$title; $ret["blue_shade"]=$blue_shade; return $ret; } function getChassCss($address) { global $hChass; $className="map_chassslot"; $onClick=""; $chass=$hChass[$address]; $title="(".$chass->location.")"." ".$chass->model." | SN: ".$chass->serial." | ".$chass->manufacturer; $onClick=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.=""; $onClick.="
Enclosure
Manufacturer: ".$chass->manufacturer."
Model: ".$chass->model."
Serial Number: ".$chass->serial."
"; if ($onClick!="") $onClick="showInfo('".$onClick."','slot_".$address."',100)"; $ret=array(); $ret["onClick"]=$onClick; $ret["className"]=$className; $ret["title"]=$title; return $ret; } $lengend=""; function makeLegend() { global $legend; global $namesFound; global $libraryNames; global $libNames; global $numPartList; $legend="
"; $legend.=""; $legend.=""; $legend.=""; $legend.="
CLN I/O Storage Unlicensed/Unassigned
"; $legend.="
"; $legend.=""; $legend.=""; $legend.="
Logical Library Key:
"; for ($i=0;$i<$numPartList;$i++) { // if ($namesFound[$i]==1) { if (($i%5) == 0) { $legend.=""; } error_log('$libNames = '.$libraryNames[$i]); $legend.=""; $legend.=""; } } if ($numPartList < 5) { $legend.=""; } $legend.="
".$libNames[$i]." - ".$libraryNames[$i]."
"; } ?> Drive logs
Library Map

Last refresh:


location][$x];$y++) { $address=$enc->location.",".$x.",".$y; $cssInfo=getSlotCss($address,"slot"); $slot_info=$address; if ($cssInfo["classNameInfo"]=="map_inaccessibleslot_info") $slot_info=""; ?>
" onMouseOver="" onMouseOut="" onClick="" title="" >
" style="width:26px" id="slot__info" name="slot__info" > " id="slot_" name="slot_" > " style="width:11px" id="slot__libname" name="slot__libname" > " style="width:15px" id="slot__info" name="slot__info" > " id="slot_" name="slot_" >
location]["drives"];$y++) { $address=$enc->location.",".$y; $cssInfo=getSlotCss($address,"drive"); ?> location); ?>
" onMouseOut="" onClick="" title="" name="slot_" id="slot_" >
">
 
" title="" name="slot_location?>" id="slot_location?>" >
Enclosure location?>
location][$x];$y++) { $address=$enc->location.",".$x.",".$y; $cssInfo=getSlotCss($address,"slot"); $slot_info=$address; if ($cssInfo["classNameInfo"]=="map_inaccessibleslot_info") $slot_info=""; ?>
" onMouseOver="" onMouseOut="" onClick="" title="" >
" style="width:11px" id="slot__libname" name="slot__libname" > " style="width:15px" id="slot__info" name="slot__info" > " id="slot_" name="slot_" >