Topic
4 replies Latest Post - ‏2013-02-19T14:53:23Z by dmcclure
SystemAdmin
SystemAdmin
172 Posts
ACCEPTED ANSWER

Pinned topic Adding Smileys in TBSM for Service Status

‏2013-02-14T09:55:43Z |
Hi Team,

I want to configure smileys for service Status column.

Could someone help me in doing that. I have TBSM 6.1 installed.

Regards,
Avi
Updated on 2013-02-19T14:53:23Z at 2013-02-19T14:53:23Z by dmcclure
  • dmcclure
    dmcclure
    54 Posts
    ACCEPTED ANSWER

    Re: Adding Smileys in TBSM for Service Status

    ‏2013-02-14T17:46:12Z  in response to SystemAdmin
    This is pretty straight forward to do using the tree template policy part of the service tree. I'm positive there are references to customizing the tree template in our manuals. You can see below the technique for substituting an image for a given value appearing in a specific column.

    Doug

    Here's an example tree template policy.

    Input variables:
    value: the value of the rule being updated (for State,Time,Events columns it's an image tag)
    columnName: the name of the column which is having a value updated
    columnAttribute: the name of the rule being updated
    id: the id of the instance being updated
    ServiceInstance: the service instance object

    Variable to set:
    VALUE (can be a number or an html string to get shown in the tree)

    To set VALUE to be one of the standard status icons, you can
    use one of the following html expressions
    VALUE = ""
    VALUE = ""
    VALUE = ""
    VALUE = ""
    VALUE = ""
    VALUE = ""

    Example: Show red, bold text if column name is ResponseTime and value
    of the rule is greater than 10:

    if (columnName = 'ResponseTime' && value > 10) {
    VALUE = ' ' + value + '';
    }
    */

    VALUE = value;

    if (columnName="Trend") {

    if (value < 0) {
    VALUE = "<font color='red'>" + value + "</font>";
    }
    }

    if (columnName = "Health") {
    if (value = 0) {
    icon = "/ibm/sla/images/clear_status.png";
    }
    if (value = 1) {
    icon = "/ibm/sla/images/minor_status.png";
    }
    if (value = 2) {
    icon = "/ibm/sla/images/critical_status.png";
    }
    VALUE = "";
    }

    if (columnName = "Cost") {
    VALUE = "$"+int(value);
    }

    if (columnName = "Transactions")
    {
    if ( value > 1000000 ) {
    VALUE = float((int(value / 1000))/1000)+"M";
    }
    else {
    if ( value > 1000 ) {
    VALUE = float((int(value / 100))/10)+"K";
    }
    }
    }
    • SystemAdmin
      SystemAdmin
      172 Posts
      ACCEPTED ANSWER

      Re: Adding Smileys in TBSM for Service Status

      ‏2013-02-14T18:19:39Z  in response to dmcclure
      depending on the image URL you end up using per Doug's suggestion, you will also need to copy the smiley images to the TBSM dashboard server.

      for example, if you specified "/ibm/sla/images/smiley-1.png" then you would need to copy smiley-1.png to the images directory under sla.war

      steve
    • SystemAdmin
      SystemAdmin
      172 Posts
      ACCEPTED ANSWER

      Re: Adding Smileys in TBSM for Service Status

      ‏2013-02-18T07:21:11Z  in response to dmcclure
      Hi Doug,

      As suggested, I followed the same procedure in tree template policy.

      However for value = 0, image in state column is showing as Null. And when in policy I am specifying condition as value > 0, image is showing up.
      In this way I am not sure what value it has been configured for critical, warning and clear.

      Could you please suggest on this.

      Regards,
      Avi
      • dmcclure
        dmcclure
        54 Posts
        ACCEPTED ANSWER

        Re: Adding Smileys in TBSM for Service Status

        ‏2013-02-19T14:53:23Z  in response to SystemAdmin
        I generally see that when your source is returning NULL due to nothing matching your query. Make sure you're returning a "0" and not NULL.

        Doug