mvitor has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys.

I have a mission that has give more work than the necessary, I guess.

I have in hand a MC Cluster monitoring system that currently parses the return of the ‘cluster.exe res’ command.

My mission is to access that Resources information accessing the MS Cluster Object, so I thought about Win32::OLE and wrote this code:

use strict; use Win32::OLE; use warnings; Win32::OLE->Option(Warn => 2); my $cluster = Win32::OLE->new('MsCluster.Cluster'); print Dumper($cluster); $cluster->Open('') or die $^E;
Following the microsoft documentation, the Open method should open a connection with the local cluster and is exactly there where my program die without any message error. Also when I Dump the content of the $cluster reference, I see the those warnings messages:
Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "CommonProperties" at C:\ESC\ORACLE\PERL\LIB +/Data/Dump er.pm line 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "PrivateProperties" at C:\ESC\ORACLE\PERL\LI +B/Data/Dum per.pm line 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "CommonROProperties" at C:\ESC\ORACLE\PERL\L +IB/Data/Du mper.pm line 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "PrivateROProperties" at C:\ESC\ORACLE\PERL\ +LIB/Data/D umper.pm line 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "Name" at C:\ESC\ORACLE\PERL\LIB/Data/Dumper +.pm line 1 58 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "Version" at C:\ESC\ORACLE\PERL\LIB/Data/Dum +per.pm lin e 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "QuorumResource" at C:\ESC\ORACLE\PERL\LIB/D +ata/Dumper .pm line 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "QuorumLogSize" at C:\ESC\ORACLE\PERL\LIB/Da +ta/Dumper. pm line 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "QuorumPath" at C:\ESC\ORACLE\PERL\LIB/Data/ +Dumper.pm line 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "Nodes" at C:\ESC\ORACLE\PERL\LIB/Data/Dumpe +r.pm line 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "ResourceGroups" at C:\ESC\ORACLE\PERL\LIB/D +ata/Dumper .pm line 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "Resources" at C:\ESC\ORACLE\PERL\LIB/Data/D +umper.pm l ine 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "ResourceTypes" at C:\ESC\ORACLE\PERL\LIB/Da +ta/Dumper. pm line 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "Networks" at C:\ESC\ORACLE\PERL\LIB/Data/Du +mper.pm li ne 158 Win32::OLE(0.1502) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "NetInterfaces" at C:\ESC\ORACLE\PERL\LIB/Da +ta/Dumper. pm line 158 $VAR1 = bless( { 'CommonProperties' => undef, 'PrivateProperties' => undef, 'CommonROProperties' => undef, 'PrivateROProperties' => undef, 'Name' => undef, 'Version' => undef, 'QuorumResource' => undef, 'QuorumLogSize' => undef, 'QuorumPath' => undef, 'Nodes' => undef, 'ResourceGroups' => undef, 'Resources' => undef, 'ResourceTypes' => undef, 'Networks' => undef, 'NetInterfaces' => undef }, 'Win32::OLE' );
Died at test_cluster.pl line 12.

Does anyone can give me some light? I don’t have a big experience with Win servers and I couldn’t understand what is happening wrong with the $cluster data structure.

Thanks in Advance,

Marcio Vitor