Commodore Commodore
Commodore
826 views

HI is in Critical state but value is N/A

Jump to solution

Hello,

Here is my problem today : with the BSM Connector, I send datas from third-party systems to BSM (9.24) and show it in a view, with HIs and KPIs set.
The data sent is very simple, it's actually an availability percent, with very basic objectives : a value of 0 means critical and 100 means OK.
Everything was running fine but yesterday I discovered that when I have one KPI in critical state (that is when the value is 0), the underlying HI is also critical but without value! The value is showed as "N/A", as you can see in the screenshot attached.
You can also see that the data retrieve by BSM is good, as the value field ("dValue") contains 0.
My question is: how is it possible to have the HI with critical state , with a good value but displaying "N/A"
Thanks!

Labels (1)
Tags (4)
0 Likes
1 Solution

Accepted Solutions
Commodore Commodore
Commodore

Well this SiteScope rule still needs to get values to calculate properly the status. In fact it calculates the average of values (confirmed by looking at the java code of the rule). It works well if we have at least one good measure during the past period, it's only when all measures are bad that I get the problem.

I know there are generic rules, but in the HP documentation it's recommended to look for other rules before trying those ones, because they requires more power, being not compiled but interpreted at runtime.

Anyway, I think I have found the explanation and a solution. I took a look at the java code of the SiteScope rule (com.mercury.am.rules.dashboard.blDashboardRules.SSMeasurementTimeRule) and I've discovered this in the calculateKPI function:

double valuesSum = 0;
int valuesCount = 0;
[...]
Double value = null; if (valuesSum != 0) { /* calculate the average value */ value = new Double(valuesSum / valuesCount); }

The variable "valuesSum" contains the sum of measures during the past period. So, since all the measures have the value 0, the sum is also 0 and the value is not calculated!

So one solution I can do is make a new rule based on this rule and changing the code with this:

Double value = null;
if (valuesCount > 0) {
  /* calculate the average value */
  value = new Double(valuesSum / valuesCount);
}

By using the count of measures instead of the value, this should calculate the average and do the trick!

Edit: yeah it's working (see screenshot hi_ok attached) !

View solution in original post

0 Likes
5 Replies
Commodore Commodore
Commodore

To add more details, here are 2 more screenshots.

The first one "edit_HI" shows the the current Health Indicator for the problematic CI.

The second "query" shows a query result made with the custom query builder, showing that there are datas incoming from the BSM connector, retrieve with the proper values set in the selector of the HI.

0 Likes
Micro Focus Expert
Micro Focus Expert

the HI's value and status are determined by the Business Rule. in your case its seems like the HI is using custom rule (Drilldowns time-based rule). please include the rule's script (I assume you created it using Groovy rule).

it is very possible that HI will have status and no value. if the HI is fed by more than 1 metric then it won't have value but only status, but we will know for sure only after looking at your rule.

0 Likes
Commodore Commodore
Commodore

Hi Asaf,

You're right I forgot to post the screenshot of the business rule, here it is.

But it's not a groovy rule, I simply duplicated a "SiteScope Measurement Time-Based Rule". All I have done is setting the rule parameters (default "duration" to 30 minutes) and set thresholds ( OK >= 100, Warning >= 60, Critical otherwise).

Oh wait, I just realized what is the description of this Sitescope rule : "Calculates the status based on metrics for a SiteScope measurement CI for time sampleType: ss_t, monitored by the SiteScope Monitor."

Could it be that the value is only calculated when the status is better than Critical?

0 Likes
Micro Focus Expert
Micro Focus Expert

this rule doesnt use the value...

if you want to average numeric values then use different rule (for example: Generic sample rule).

0 Likes
Commodore Commodore
Commodore

Well this SiteScope rule still needs to get values to calculate properly the status. In fact it calculates the average of values (confirmed by looking at the java code of the rule). It works well if we have at least one good measure during the past period, it's only when all measures are bad that I get the problem.

I know there are generic rules, but in the HP documentation it's recommended to look for other rules before trying those ones, because they requires more power, being not compiled but interpreted at runtime.

Anyway, I think I have found the explanation and a solution. I took a look at the java code of the SiteScope rule (com.mercury.am.rules.dashboard.blDashboardRules.SSMeasurementTimeRule) and I've discovered this in the calculateKPI function:

double valuesSum = 0;
int valuesCount = 0;
[...]
Double value = null; if (valuesSum != 0) { /* calculate the average value */ value = new Double(valuesSum / valuesCount); }

The variable "valuesSum" contains the sum of measures during the past period. So, since all the measures have the value 0, the sum is also 0 and the value is not calculated!

So one solution I can do is make a new rule based on this rule and changing the code with this:

Double value = null;
if (valuesCount > 0) {
  /* calculate the average value */
  value = new Double(valuesSum / valuesCount);
}

By using the count of measures instead of the value, this should calculate the average and do the trick!

Edit: yeah it's working (see screenshot hi_ok attached) !

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.