Start a Conversation

Unsolved

This post is more than 5 years old

5038

May 13th, 2009 15:00

dmctl Syntax Help

Hi,

I am trying to set the community strings in ICF_TopologyManager::ICF-TopologyManager::ReadCommunities,

visible as Read Community Strings in the Configure Polling and Thresholds GUI. The related operations are:

# dmctl -s US-LAB-AM-PM-1 getO ICF_TopologyManager | grep -i communit

    getCommunities
    setCommunities communities
    addCommunity community
    updateCommunity fileName

addCommunity works, but I cannot figure out how to remove community strings. Since there is no related

operation, I am trying to use the setCommunities operation, but I cannot get it to work.

___________________________________________________________________________

I try to use setCommunites through the commandline with dmctl:

# dmctl -s US-LAB-AM-PM-1 invoke ICF_TopologyManager::ICF-TopologyManager setCommunities "test"
CI-E-EGENERIC-At TopologyManager.c:11287  argument 1 should be of type set of
    MR_STRING: Number and types of arguments in call to operation don't match
    its signature
MR-WRONG_OPERATION_ARGS-Number and types of arguments in call to operation
    don't match its signature

The add function works, but there is no comparable removeCommunity function:

# dmctl -s US-LAB-AM-PM-1 invoke ICF_TopologyManager::ICF-TopologyManager addCommunity test

# dmctl -s US-LAB-AM-PM-1 invoke ICF_TopologyManager::ICF-TopologyManager getCommunities
{ "public" "test" }

___________________________________________________________________________

In Perl, I am running into the same problem:

my $community_strings = [
                            'public',
                            'test',
];

my $object = $smarts_session->object("ICF_TopologyManager::ICF-TopologyManager");

my $r = $object->invoke("setCommunities", $community_strings );

=>

# ./configure_polling_and_thresholds.pl
[15] CI-E-EGENERIC-At TopologyManager.c:11287  argument 1 should be of type set of
    MR_STRING: Number and types of arguments in call to operation don't match
    its signature
MR-WRONG_OPERATION_ARGS-Number and types of arguments in call to operation
    don't match its signature, stopped at ./configure_polling_and_thresholds.pl line 102

Does anyone know what type of syntax it is expecting?

Thanks,

Alicia

53 Posts

May 13th, 2009 15:00

Alicia,

Try

$object = $smarts_session->object("ICF_TopologyManager::ICF-TopologyManager");

my $r = $object->invoke("setCommunities", "public test");

7 Posts

May 13th, 2009 15:00

It still gives the same error message...

I'm using:


use lib '/opt/InCharge7/IP/smarts/perl/5.8.0/lib/';
use lib '/opt/InCharge7/IP/smarts/local/perl/5.8.0/lib/';

InCharge::session;


and

IP_NETWORK_SUITE: V7.0.3.12(87579), 27-Feb-2009 15:08:12 Copyright 1995-2009, EMC Corporation - Build 80
Foundation V7.0.2.1(87494), 24-Feb-2009 02:08:51 Copyright 1995-2009, EMC Corporation - Build 49

Is it possibly something in the code itself?

3 Posts

May 26th, 2009 12:00

Hi Alicia,

The issue is that setCommunities is expecting a list parameter (that is, a list of community strings).  Here is some ASL code which set's the community strings.  As far as I can tell, setting the list of community strings using setCommunities is the only way to delete a community string.

communityStrings = list("larry", "curly", "moe");

tpmgr = object("ICF_TopologyManager", "ICF-TopologyManager");

tpmgr->setCommunities(communityStrings);

Caveat: the number of community strings may not exceed 4.  This should work just as well in perl, though I have not tried it:

Cheers,

-dbf

No Events found!

Top