R3.1 build 17: Alarms: Throw error or prune white space in operand/variables in alarm configuration

Bug #1610713 reported by Ankit Jain
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.1
Fix Committed
High
VishnuVardhan V
Trunk
Fix Committed
High
VishnuVardhan V

Bug Description

Configured the following rule:

Name OrRule
Enabled true
Description OrRule
Severity Minor
UVE Keys analytics-node
Rules NodeStatus.process_info.process_state != "PROCESS_STATE_RUNNING", variables NodeStatus.process_info.process_name
OR
NodeStatus.process_info.process_name == "contrail-topology", variables NodeStatus.process_info.process_name

== Contrail Analytics ==
supervisor-analytics: active
contrail-alarm-gen active
contrail-analytics-api active
contrail-analytics-nodemgr active
contrail-collector active
contrail-query-engine active
contrail-snmp-collector inactive
contrail-topology active

json_operand1_value and json_variables are shown as null in the below alarm please check

Below alarm raised:
{
severity: 2,
alarm_rules: {
or_list: [
{
and_list: [
{
condition: {
operation: "!=",
operand1: "NodeStatus.process_info.process_state",
variables: [
"NodeStatus.process_info.process_name"
],
operand2: {
json_value: ""PROCESS_STATE_RUNNING""
}
},
match: [
{
json_operand1_value: "null",
json_variables: {
NodeStatus.process_info.process_name: "null"
}
},
{
json_operand1_value: "null",
json_variables: {
NodeStatus.process_info.process_name: "null"
}
},
{
json_operand1_value: "null",
json_variables: {
NodeStatus.process_info.process_name: "null"
}
},
{
json_operand1_value: "null",
json_variables: {
NodeStatus.process_info.process_name: "null"
}
},
{
json_operand1_value: "null",
json_variables: {
NodeStatus.process_info.process_name: "null"
}
},
{
json_operand1_value: "null",
json_variables: {
NodeStatus.process_info.process_name: "null"
}
},
{
json_operand1_value: "null",
json_variables: {
NodeStatus.process_info.process_name: "null"
}
}
]
}
]
},
{
and_list: [
{
condition: {
operation: "==",
operand1: "NodeStatus.process_info.process_name",
variables: [
"NodeStatus.process_info.process_name"
],
operand2: {
json_value: ""contrail-topology""
}
},
match: [
{
json_operand1_value: ""contrail-topology"",
json_variables: {
NodeStatus.process_info.process_name: "null"
}
}
]
}
]
}
]
},
timestamp: 1470588400370252,
ack: false,
token: "eyJ0aW1lc3RhbXAiOiAxNDcwNTg4NDAwMzcwMjUyLCAiaHR0cF9wb3J0IjogNTk5NSwgImhvc3RfaXAiOiAiMTAuMjA0LjIxNy41MyJ9",
type: "OrRule",
description: "OrRule"
}
]
}
}

Alarm Configuration:

{
alarm: {
display_name: "OrRule",
uuid: "a3c72fb7-4f46-4abc-8966-ff38c928f13d",
alarm_rules: {
or_list: [
{
and_list: [
{
operation: "!=",
operand1: "NodeStatus.process_info.process_state ",
variables: [
"NodeStatus.process_info.process_name "
],
operand2: {
json_value: ""PROCESS_STATE_RUNNING""
}
}
]
},
{
and_list: [
{
operation: "==",
operand1: "NodeStatus.process_info.process_name",
variables: [
"NodeStatus.process_info.process_name "
],
operand2: {
json_value: ""contrail-topology""
}
}
]
}
]
},
parent_uuid: "45613b94-dac9-48b3-8e4e-cae225d8a8c3",
parent_href: "http://nodeg13:8082/global-system-config/45613b94-dac9-48b3-8e4e-cae225d8a8c3",
parent_type: "global-system-config",
alarm_severity: 2,
perms2: {
owner: "cloud-admin",
owner_access: 7,
global_access: 0,
share: [ ]
},
href: "http://nodeg13:8082/alarm/a3c72fb7-4f46-4abc-8966-ff38c928f13d",
id_perms: {
enable: true,
uuid: {
uuid_mslong: 11801453812903200000,
uuid_lslong: 9900881450178769000
},
created: "2016-08-07T16:42:33.641386",
description: "OrRule",
creator: null,
user_visible: true,
last_modified: "2016-08-07T16:46:40.048745",
permissions: {
owner: "cloud-admin",
owner_access: 7,
other_access: 7,
group: "cloud-admin-group",
group_access: 7
}
},
fq_name: [
"default-global-system-config",
"OrRule"
],
uve_keys: {
uve_key: [
"analytics-node"
]
},
name: "OrRule"
}
}

Tags: analytics
Revision history for this message
Sundaresan Rajangam (srajanga) wrote :

The issue is due to trailing space in the operand and variables. Hence marking the bug as invalid.

and_list: [
{
operation: "!=",
operand1: "NodeStatus.process_info.process_state ", <<<<<<
variables: [
"NodeStatus.process_info.process_name " <<<<<<
],
operand2: {
json_value: ""PROCESS_STATE_RUNNING""
}

Changed in juniperopenstack:
status: New → Invalid
Revision history for this message
Ankit Jain (ankitja) wrote :

Seems UI issue, Assigning it to Rahul. This alarm was configured through the UI.trailing spaces are not getting removed automatically while configuring alarms through the UI.

Changed in juniperopenstack:
status: Invalid → New
assignee: Sundaresan Rajangam (srajanga) → Rahul (rahuls)
Revision history for this message
Ankit Jain (ankitja) wrote :

Sundar,

I think analytics should also be doing auto removal of trailing spaces.

Rahul (rahuls)
Changed in juniperopenstack:
assignee: Rahul (rahuls) → VishnuVardhan V (vishnuvv)
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.1

Review in progress for https://review.opencontrail.org/23094
Submitter: VishnuVardhan V (<email address hidden>)

summary: - R3.1 build 17: Alarms: Match list shown in the raised alarm is not
- proper when alarm rule with multiple OR conditions is configured
+ R3.1 build 17: Alarms: Throw error or prune white space in
+ operand/variables in alarm configuration
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/23094
Committed: http://github.org/Juniper/contrail-web-controller/commit/a33839da894b9ea7296284f4453b3b74255e5fd9
Submitter: Zuul
Branch: R3.1

commit a33839da894b9ea7296284f4453b3b74255e5fd9
Author: Vishnu Vardhan V <email address hidden>
Date: Tue Aug 9 14:28:10 2016 +0530

Closes-Bug:#1610713
Triming the operand1, operand2, variables in config alarms & pattern in userdefind counters.

Change-Id: I5863e70168d0814260619c6182c6e3597237dd0c

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/23141
Submitter: VishnuVardhan V (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/23141
Committed: http://github.org/Juniper/contrail-web-controller/commit/9b60aad3cd447d81d8aa440f64e00b6536abf23d
Submitter: Zuul
Branch: master

commit 9b60aad3cd447d81d8aa440f64e00b6536abf23d
Author: Vishnu Vardhan V <email address hidden>
Date: Tue Aug 9 14:28:10 2016 +0530

Closes-Bug:#1610713
Triming the operand1, operand2, variables in config alarms & pattern in userdefind counters.

Change-Id: I5863e70168d0814260619c6182c6e3597237dd0c

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.