Is there a query to get a list of disconnected Patrol Agents in the TSPS?

Version 6
    Share This:

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    PRODUCT:

    TrueSight Presentation Server


    APPLIES TO:

    TrueSight Presentation Server all versions



    QUESTION:

    Is there a query to get a list of disconnected Patrol Agents in the TSPS?


    ANSWER:

    The query to run against the TSPS DB is:
    select proxy.serverid, proxy.proxyhostname, patrol.patrolagentid, patrol.hostname , patrol.patrolagentport, patrol.mfdstatus from proxy_details proxy join patrolagent_details patrol on proxy.serverid = patrol.serverid and proxy.proxyid= patrol.proxyid where patrol.mfdstatus > 0 ;

    For example, here we see two disconnected Patrol Agents:

    User-added image


    On the TSPS, access the DB & run the query:

    C:\Users\Administrator>SET PGPASSWORD=bmcAdm1n

    C:\Users\Administrator>CD /D "%TRUESIGHTPSERVER_HOME%\truesightpserver\modules\pgsql\bin\"

    C:\Program Files\BMC Software\TrueSightPServer\truesightpserver\modules\pgsql\bin>psql -U dbadmin truesight

    Note: Your DB username will probably be different than dbadmin.  To get your
    DB username, check in %TRUESIGHTPSERVER_HOME%\TrueSightPServerInstalledConfiguration.xml for this entry:
    <property><name>TrueSight_database_username</name><value>admin</value></property>


    truesight=# select proxy.serverid, proxy.proxyhostname, patrol.patrolagentid, patrol.hostname , patrol.patrolagentport, patrol.mfdstatus from proxy_details proxy join patrolagent_details patrol on proxy.serverid = patrol.serverid and proxy.proxyid= patrol.proxyid where patrol.mfdstatus > 0 ;
     serverid |     proxyhostname      | patrolagentid |        hostname        | patrolagentport | mfdstatus
    ----------+------------------------+---------------+------------------------+-----------------+-----------
            1 | clm-aus-sty7ot.bmc.com |             5 | WIN-ASCHOLEB-52        |            3181 |         1
            1 | clm-aus-sty624.bmc.com |             4 | clm-aus-sty7vr.bmc.com |            3187 |         1
    (2 rows)


    Start one of the Patrol Agents:
    -bash-4.2# hostname
    clm-aus-sty7vr
    -bash-4.2# ./PatrolAgent -p 3187&
    [1] 14928

    User-added image

    Re-run the query on the TSPS DB:
    truesight=# select proxy.serverid, proxy.proxyhostname, patrol.patrolagentid, patrol.hostname , patrol.patrolagentport, patrol.mfdstatus from proxy_details proxy join patrolagent_details patrol on proxy.serverid = patrol.serverid and proxy.proxyid= patrol.proxyid where patrol.mfdstatus > 0 ;
    ----------+------------------------+---------------+-----------------+-----------------+-----------
            1 | clm-aus-sty7ot.bmc.com |             5 | WIN-ASCHOLEB-52 |            3181 |         1
    (1 row)

    Optionally:
    If you don't want to run the commands interactively, but would rather run them like a script, then here is the syntax:

    psql -U dbadmin -d truesight -c "select proxy.serverid, proxy.proxyhostname, patrol.patrolagentid, patrol.hostname , patrol.patrolagentport, patrol.mfdstatus from proxy_details proxy join patrolagent_details patrol on proxy.serverid = patrol.serverid and proxy.proxyid= patrol.proxyid where patrol.mfdstatus > 0 ;"


    Article Number:

    000155278


    Article Type:

    FAQ/Procedural



      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles