Start a Conversation

Unsolved

This post is more than 5 years old

4120

September 24th, 2009 04:00

Adding discovery filter via dmctl/perl API

I'm trying to add AD filter entries via the Perl API. I got the following info for the add_filter function:

     add_filter(
      filter ,
      port ,
      snmpVersion ,
      accessMode ,
      communities
     )

but when I try to run it, I get this error message:

     [6] Reference to 2-element array expected for argument to InCharge primitive 'invokeOperation', stopped at ./set_ad_filters.pl line 42

I can't figure out the format for the filter argument. Does someone know what I should pass to this?

Thanks,

-Dmitri

September 28th, 2009 12:00

Hi Dmitry,

the issue with ANYVALARRAY structure is being able to figure out what is the meaning of each value ... sometimes it's obvious / easy to find out, sometimes it's not. I'm not using the feature you are looking at, so  I don't know the structure, but here is a similar example which should give you the idea :

                        @result = $session->invokeOperation( "ACT_SNMP::SNMPGet", "get",
                                [
                                        [ "ANYVALARRAY",
                                                [
                                                        [ "STRING", $deviceIP ],
                                                        [ "INT", $SNMPPort ],
                                                        [ "STRING", $_SNMPVersion ],
                                                        [ "STRING", $SNMPString ],
                                                        [ "STRING", "" ],
                                                        [ "STRING", "" ],
                                                        [ "STRING", "" ],
                                                        [ "STRING", "" ],
                                                        [ "STRING", "" ],
                                                        [ "STRING", "" ]
                                                ]
                                        ],
                                        [ "STRING", $SNMPSysNameOID ]
                                ] );

where the signature of the call is :

target (mandatory)
oid (mandatory)
timeout (option)
retries (option)
policy (option)
format (option)

(and you can see how to build the ANYVALARRAY structure)

HTH,

--Fred

== Monitor your Smarts environment using APG ReportPack for Smarts health  ==
Frederic Meunier
Solutions Watch4Net Inc
APG & Smarts InCharge integration

September 28th, 2009 18:00

Thanks, that's really helpful. I realized I was actually trying to use the wrong method - applyFilters of ICF_TopologyManager does what I need.

BTW how do you get the additional info for what should be in the ANYVALARRAY? dmctl getO only shows the following info for the "get" method:

    get target oid timeout retries policy format

Thanks,

-Dmitri

September 29th, 2009 05:00

Hi Dmitri,

this is the secret part ;-) ... sometimes, searching for the method in existing ASL scripts (rules directory) will give you the answer, sometimes looking at the other methods and attributes available in the class may help, sometimes "brute forcing" the call can help (error message giving the number or parameters needed, types, ...) ... This is really sad all these methods are not fully documented. You may try using the EMC support too.

--Fred

== Monitor your Smarts environment using APG ReportPack for Smarts health  ==
Frederic Meunier
Solutions Watch4Net Inc
APG & Smarts InCharge integration
No Events found!

Top