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

In reply to Win32 OLE communicating with MsCluster.Cluster object by mvitor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.