0 Replies Latest reply on Feb 3, 2017 5:00 PM by alanwevans

    Query ePO Agent custom properties on Linux?

    alanwevans

      So I can set the custom properties w/ maconfig...

       

      usage: maconfig -custom

      -prop1          value of first custom property

      -prop2          value of second custom property

      -prop3          value of third custom property

      -prop4          value of forth custom property

      e.g.

             maconfig -custom -prop1 "value string"

             maconfig -custom -prop2 "value string"

             maconfig -custom -prop3 "value string"

             maconfig -custom -prop4 "value string"

       

      But can I query the properties?

       

      I tried just leaving off the value thinking that `-custom -prop1` might display prop1 instead.  But it doesn't.

       

      I did manage to figure out that they are stored in the SQLite3 database /var/McAfee/agent/db/ma.db, but I would like to avoid doing something like the following to see if a value has already been set to the value I want it set to.  Installing sqlite3 on all of my systems only to find a custom property.

       

      sqlite3 /var/McAfee/agent/db/ma.db "SELECT COUNT(*) FROM AGENT_CHILD WHERE NAME = 'UserProperty1' AND VALUE='Foo';"

       

      I can grep for it, but that seems gross also because I would have to make sure my custom properties are unique as to not collide with other strings in the file.

       

      grep MySuperUniqueValueThatIsNotVeryIntuitive /var/McAfee/agent/db/ma.db

      Binary file /var/McAfee/agent/db/ma.db matches

       

      It looks like the name and value columns follow immediately after one another in the SQLite DB but that may not be very reliable and they appear twice for some reason.

       

      grep -ao UserProperty1Foo /var/McAfee/agent/db/ma.db

      UserProperty1Foo

      UserProperty1Foo

       

      This is for puppet btw.  I am trying to manage the user property.

       

      exec {'set_user_property':

        command => '/opt/McAfee/agent/bin/maconfig -custom -prop1 Foo',

        unless => 'grep -q UserProperty1Foo /var/McAfee/agent/db/ma.db',

      }

      Thoughts?

       

      -Alan