Important

   

This space contains documentation for TrueSight Server Automation 8.9.03 and the later service packs for 8.9. For earlier releases, see BMC Server Automation 8.9.

Walkthrough: Setting a property value on a server using a component template

This topic walks you through the process of creating server smart groups based on the values set from a Compliance Job. You can accomplish this by using a TrueSight Server Automation component template to set a property value on a server. This topic walks you through the process.

The topic includes the following sections:

Introduction

The problem we have w/ server properties is beyond the default/intrinsic ones it’s really painful to set them.  right not it involves running nsh scripts, then blcli to set them, which is slow and can hoze your env (parallel type 1 nsh + blcli = bad).  so this seems a bit of a back-door way to accomplish the same in a less taxing way.

How to correctly use in a compliance job and via the persist operator – I want to ultimately use server smart groups based on the values set from compliance jobs.  Does this set a server property?  I need some help with property classes / instances.

persisting the value into a server property that can be used later for server smart group membership

run a compliance job that does some kind of check like “is this thing there”, and as part of the check, setting a property value if it’s there or not.  then to create a server smart group based on the value of that property.

When we run compliance against server/component persist will create an instance of those custom property. If we had created a smart group using this property than servers are populated accordingly.

When we run against target it will create instance of that property class and set that property accordingly, later used in remediation.

You could have multiple commands/persists.  The persist bit should handle the creation of a property instance for the server and setting it as the value for the property in the server class (i think, we’ll see).

the server class links to the custom class (eg remediation properties) and the value on the server is set to the instance we are modifying in the persist then it should all work 

What do I need to do before I get started?

For this walkthrough, you log on as BLAdmin, the default superuser for TrueSight Server Automation. Note that in live deployments, BMC recommends that you grant access based on roles with a narrower set of permissions.

Using the TrueSight Server Automation console, set up a component template with some compliance rules, according to the instructions in Walkthrough: Creating a compliance template.

How to set a property value on a server

 ProcedureExample screen
1

Using the TrueSight Server Automation console, set up a custom class with the property values you want.

  1. Select Configuration > Property Dictionary View. The Property Dictionary opens.
  2. Select Custom Property Classes.
  3. Right-click and select New Class or New sub-class from the pop-up menu.
  4. On the General panel of the Create New Property Class wizard, for Name, enter the name of a custom property class. For Description, you can optionally provide descriptive text. Then click Next.
  5. On the Properties panel, specify the properties that should be associated with this property class, and then click Next. The panel automatically includes all built-in properties that are associated by default with a property class. For more information, see Adding or modifying properties.
  6. On the Permissions panel, define permissions for this property class. The Permissions panel is an access control list granting roles access to this property class. TrueSight Server Automation uses ACLs to control access to all objects. For more information about defining ACLs, see Defining permissions for a system object.
  7. To save the new custom property class, click Finish.
  8. To close the Property Dictionary, click Close.

3

Next, set a property in the server class.

  1. Start the TrueSight Server Automation Console.
  2. Choose Configuration > Property Dictionary View.
  3. Expand Built-in Property Classes.

 
  1. Scroll down to the Server property class and then click the Server property class.
  2. Click Add new property .
 Fill in the Add Property window as follows. Be sure to call the new property MY_PROPERTY and accept all defaults.
 

Link the server property to the custom class.


 
4

Modify the compliance rules you set up so that the rules use the ‘persist’ operator to run some command on the server and set the value of a property in the custom class to the output of the command.

- the rule should pass no matter what happens i think.  something like:

Persist Command.xyz = ??PROPERTY??

TARGET.OS = XXX

 
5

To use that in a smart group you’d make a condition in the smart group like SERVER_CLASS_PROPERTY.YOURPROPERTY equals XXX or whatever.

  1. In the Servers folder, browse to the server group in which you want to create your smart server group.
  2. Right-click the server group and select New > Smart Server Group.
  3. Enter a name and description for the new smart group.
  4. Create the rules for binding servers to this smart group.
    In the following example, you want to bind all servers with the External Web Server property set to True.
  5. Click Next.
  6. If you want to change the ACL for this server group, modify them here.
  7. Click Finish.
  8. Select the newly created Smart Server Group.
    All servers with the External Web Server property set to True are added to this group automatically.
 

Wrapping it up

In this walkthrough, you created a component template that runs a command, gets the output and sets a property value on the server.  You can then use that value as a condition in a server smart group.

Was this page helpful? Yes No Submitting... Thank you

Comments