Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » WMI » perl sample

MSiSCSI perl sample code

The foundations for Manageability in Windows is Windows Management Instrumentation (WMI; formerly WBEM) and WMI extensions for Windows Driver Model (WDM).

ActiveXperts Network Monitor provides the ability to build monitor check routines based on WMI. ActiveXperts has collected more than a hundred WMI samples. You can use these samples as a base for new check routines you can write yourself. The MSiSCSI WMI class can be used in ActiveXperts Network Monitor to monitor your servers.


Sample Code

use Win32::OLE('in');

my $computer = ".";

my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\WMI") or die "WMI connection failed.\n";
my $colItems = $objWMIService->ExecQuery("SELECT * FROM MSiSCSI_HBAInformation", "WQL");

foreach my $objItem (in $colItems) {
	print "Active: $objItem->{Active}\n";
	print "AsicVersion: $objItem->{AsicVersion}\n";
	print "BiDiScsiCommands: $objItem->{BiDiScsiCommands}\n";
	print "CacheValid: $objItem->{CacheValid}\n";
	print "DriverName: $objItem->{DriverName}\n";
	print "FirmwareVersion: $objItem->{FirmwareVersion}\n";
	print "FunctionalitySupported: $objItem->{FunctionalitySupported}\n";
	print "GenerationalGuid: $objItem->{GenerationalGuid}\n";
	print "InstanceName: $objItem->{InstanceName}\n";
	print "IntegratedTCPIP: $objItem->{IntegratedTCPIP}\n";
	print "MaxCDBLength: $objItem->{MaxCDBLength}\n";
	print "MultifunctionDevice: $objItem->{MultifunctionDevice}\n";
	print "NumberOfPorts: $objItem->{NumberOfPorts}\n";
	print "OptionRomVersion: $objItem->{OptionRomVersion}\n";
	print "RequiresBinaryIpAddresses: $objItem->{RequiresBinaryIpAddresses}\n";
	print "SerialNumber: $objItem->{SerialNumber}\n";
	print "Status: $objItem->{Status}\n";
	print "UniqueAdapterId: $objItem->{UniqueAdapterId}\n";
	print "VendorID: $objItem->{VendorID}\n";
	print "VendorModel: $objItem->{VendorModel}\n";
	print "VendorVersion: $objItem->{VendorVersion}\n";
	print "VersionMax: $objItem->{VersionMax}\n";
	print "VersionMin: $objItem->{VersionMin}\n";
	print "\n";
	print "########\n";
	print "\n";
}