4 Replies Latest reply: May 25, 2012 7:38 AM by Oleg Protokolov RSS

Query Patrol Agent ID

InfoJester

Hi all,

 

Given a host name and port for a Patrol Agent I'd very much like to be able to ask it its ID.  I thought this would be very easy, that it would be stored in the config somewhere.  But I see that the Patrol Agent know's lot's of things about its self, it's port, host name, version etc but it doesn't seem to store its ID in the config.

 

Does anyone use a method to get an agent to tell them its name, something CLI based?

 

Many thanks.

  • 1. Query Patrol Agent ID
    JayM

    Try the following in your SOW / its a variable on the agent object itself.

     

    %PSL v="/agentPid"; g=get(v); print("\n PatrolAgent PID[".g."]");

  • 2. Query Patrol Agent ID
    InfoJester

    Thanks JayM, that's a useful command I was not aware of and gives the Process ID.

     

    I apologies I was ambiguous, I'm looking for the ID of the Patrol Agents its self, ie the ID it's using in the RT cloud and I see when I connect to it from the cServer.  The default is [server name]_[port number] but I have some none standard agent IDs in my cloud.

     

    My ultimate goal is to add agents to cServer profiles dynamically using 'admincli'.  This works very well but I need exact Patrol Agent IDs to do it.  Asking the Patrol Agent for its ID seems logical, I'm supprised it's not very easy.

  • 3. Re: Query Patrol Agent ID
    JayM

    Initially I would advise try to drive your agent provisioning process from a CMDB type resource rather than interrogating your current environment and applying delta's.

     

    Saying that I'd suggest following options to interrogate a P7 environments.

     

    fyi

    - One can't use PSL to talk directly to P7.

    - For your reference, [server name]_[port number] is known as the advertised "service name" in the RTCLOUD.

     

    ###########################
    OPTION1 : Use BMC's INFRASTRUCTURE KM which has a useful binary phmColl.exe for monitoring P7 components ie PCS, RTSERVERs, RTCLOUDs, AGENTS. 

     

    You can use the same CLI interface the KM is using.

     

    EXAMPLE1

    # list of agents connected to my RTCLOUD / example filter - choose your own

    C:\>%PATROL_HOME%\bin\phmColl -s tcp:CMRTCLOUD3A:2059  -c getReport | grep Connected | tail -5

            trapp28_3181 Connected

            trdbp26_3181 Connected

            gs-mlappsvr2_3181 Connected

            trdbp33_3181 Connected

            gsp-clsdb2_3181 Connected

     

     

    ###########################

    OPTION2 : you could use PSL in conjunction with the agent (thats loaded the INFRASTRUCTURE KM) as it has instantiated useful information.

     

    #EXAMPLE2

    %PSL v="/PHM_AGENT/instances"; al=get(v); print("\n AGENT LIST[\n".al."\n]");

     

    AGENT LIST[

    RTC03_-_tcp_FMG-S3-1837_2059_fmw-s3-1836_3181

    RTC03_-_tcp_FMG-S3-1837_2059_fmg-s3-1837_3181

    RTC03_-_tcp_FMG-S3-1837_2059_gsp-nbmedap1_3181

    RTC03_-_tcp_FMG-S3-1837_2059_cyv-glzsvr1_3181

    ...

     

    ###########################

    OPTION3 : Use the ADMINCLI.EXE using following options

     

    # get your encrypted password from patrol.conf if you want admincli to be completely autonomous to login and list while still being secure-ish

     

    C:\>admincli -c %COMPUTERNAME% -table hg -op ls
    .

    .
    Host Groups table:
    1: Name:PRODUCTION_UNIX, Label:PRODUCTION_UNIX, Description:
    2: Name:CONN_RTC01, Label:RTC01, Description:Auto Generated Host Group for Connection RTC01
    3: Name:PRODUCTION_WIN, Label:PRODUCTION_WIN, Description:
    4: Name:CONN_RTC03, Label:RTC03, Description:Auto Generated Host Group for Connection RTC03


    C:\>admincli -c %COMPUTERNAME% -table hg -op ls_mem -name PRODUCTION_WIN
    .

    .

    Managed systems for PRODUCTION_WIN:
    1: FMG-S3-1836_3181
    2: FMG-S3-1837_3181
    3: FMG-S3-1847_3181
    4: FMG-S3-1853_3181
    5: FMG-S3-1863_3181
    6: FMG-V3-1832_3181
    7: FMW-S3-1836_3181
    8: FMW-S3-1847_3181
    9: FMW-S3-1861_3181
    10: FMW-S3-1898_3181
    11: FMW-V3-1839_3181

    C:\>

    ###########################

     

    Enjoy !

    Jay

  • 4. Re: Query Patrol Agent ID
    Oleg Protokolov

    Hi,

     

    Here is...

     

    %PSL printf( "PATROL Agent's Service Name (ID) inside RT-Cloud: '%s'\n", get( "/cosAgentBranch" ) );

     

    --

    Regards?

    Oleg