Forum Discussion

jewettdn423's avatar
3 months ago

Reports grouped by (user added) Host attribute?

Hello,     New user to IT Analytics.  I had a question, if anyone has added custom host attributes and figured out how to reference them in the SQL query commands.  A few days ago Ernie gracio...
  • ZenOfAnalytics's avatar
    3 months ago

    Take a look at APT_V_SERVER_ATTRIBUTE.  That view shows a row for each host (aka client) in the system, followed by a column for each attribute name.  In some cases (e.g. LOCATION => LOCATION_1)  the column for the attribute will have an "_1" appended.

    To add attributes, you will join APT_V_SERVER_ATTRIBUTE to other views.  For example, to add the ENVIRONMENT attribute to a client report based on APT_V_JOB, the code snippet would be:

    SELECT DISTINCT j.client_name,
    sa.environment
    FROM apt_v_job j,
    apt_v_server_attribute sa
    WHERE j.client_id = sa.host_id