Fujitsu ETERNUS TPP Disk Discovery

Fujitsu.Storage.ETERNUS.TPPDiskDiscovery (Discovery)

Element properties:

TargetFujitsu.Storage.ETERNUS.TPPRG
EnabledTrue
Frequency20400
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:

Member Modules:

ID Module Type TypeId RunAs 
DiscoveryOfTPPDisk DataSource Microsoft.Windows.TimedPowerShell.DiscoveryProvider Default

Source Code:

<Discovery ID="Fujitsu.Storage.ETERNUS.TPPDiskDiscovery" Enabled="true" Target="Fujitsu.Storage.ETERNUS.TPPRG" ConfirmDelivery="true" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Fujitsu.Storage.ETERNUS.TPPDisk">
<Property TypeID="Fujitsu.Storage.ETERNUS.TPPDisk" PropertyID="ObjectName"/>
<Property TypeID="Fujitsu.Storage.ETERNUS.TPPDisk" PropertyID="DiskSize"/>
<Property TypeID="Fujitsu.Storage.ETERNUS.TPPDisk" PropertyID="Speed"/>
<Property TypeID="Fujitsu.Storage.ETERNUS.TPPDisk" PropertyID="Type"/>
<Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
</DiscoveryClass>
</DiscoveryTypes>
<DataSource ID="DiscoveryOfTPPDisk" TypeID="Windows!Microsoft.Windows.TimedPowerShell.DiscoveryProvider">
<IntervalSeconds>20400</IntervalSeconds>
<SyncTime/>
<ScriptName>DiscoveryOfTPPDisk.ps1</ScriptName>
<ScriptBody><Script>
param($sourceId,$managedEntityId,$computerName,$StorageName,$TPPRGs,$TPPRGName,$PoolName)
$api = new-object -comObject 'MOM.ScriptAPI'
$discoveryData = $api.CreateDiscoveryData(0, $SourceId, $ManagedEntityId)

write-eventLog -LogName ETERNUS -Message "Discovery TPP Disk" -Source Cs -id 116

Add-PSSnapIn Get-TPPDiskList
$disk = Get-TPPDiskList
$diskCount = $disk.length
for($i = 0; $i -lt $diskCount;$i++)
{
if($disk[$i].TPPRGName.Equals($TPPRGName))
{
$instance = $discoveryData.CreateClassInstance("$MPElement[Name='Fujitsu.Storage.ETERNUS.TPPDisk']$")
$instance.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", $computerName)
$instance.AddProperty("$MPElement[Name='Fujitsu.Storage.ETERNUS.ManagerService']/PrincipalName$", $computerName )
$instance.AddProperty("$MPElement[Name='Fujitsu.Storage.ETERNUS.Storage']/StorageName$",$StorageName)
$instance.AddProperty("$MPElement[Name='Fujitsu.Storage.ETERNUS.TPP']/ObjectName$",$PoolName)
$instance.AddProperty("$MPElement[Name='Fujitsu.Storage.ETERNUS.TPPRGs']/ObjectName$",$TPPRGs)
$instance.AddProperty("$MPElement[Name='Fujitsu.Storage.ETERNUS.TPPRG']/ObjectName$",$TPPRGName)
$instance.AddProperty("$MPElement[Name='Fujitsu.Storage.ETERNUS.TPPDisk']/ObjectName$",$disk[$i].ObjectName)
$instance.AddProperty("$MPElement[Name='Fujitsu.Storage.ETERNUS.TPPDisk']/DiskSize$",$disk[$i].DiskSize)
$instance.AddProperty("$MPElement[Name='Fujitsu.Storage.ETERNUS.TPPDisk']/Speed$",$disk[$i].Speed)
$instance.AddProperty("$MPElement[Name='Fujitsu.Storage.ETERNUS.TPPDisk']/Type$",$disk[$i].Type)
$instance.AddProperty("$MPElement[Name="System!System.Entity"]/DisplayName$", $disk[$i].ObjectName)
$discoveryData.AddInstance($instance)
}
}
$discoveryData
</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>sourceID</Name>
<Value>$MPElement$</Value>
</Parameter>
<Parameter>
<Name>managedEntityID</Name>
<Value>$Target/Id$</Value>
</Parameter>
<Parameter>
<Name>computerName</Name>
<Value>$Target/Host/Host/Host/Host/Property[Type="Fujitsu.Storage.ETERNUS.ManagerService"]/PrincipalName$</Value>
</Parameter>
<Parameter>
<Name>StorageName</Name>
<Value>$Target/Host/Host/Host/Property[Type="Fujitsu.Storage.ETERNUS.Storage"]/StorageName$</Value>
</Parameter>
<Parameter>
<Name>PoolName</Name>
<Value>$Target/Host/Host/Property[Type="Fujitsu.Storage.ETERNUS.TPP"]/ObjectName$</Value>
</Parameter>
<Parameter>
<Name>TPPRGs</Name>
<Value>$Target/Host/Property[Type="Fujitsu.Storage.ETERNUS.TPPRGs"]/ObjectName$</Value>
</Parameter>
<Parameter>
<Name>TPPRGName</Name>
<Value>$Target/Property[Type="Fujitsu.Storage.ETERNUS.TPPRG"]/ObjectName$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>600</TimeoutSeconds>
</DataSource>
</Discovery>