Skip to content

Commit

Permalink
Fix error in parser
Browse files Browse the repository at this point in the history
  • Loading branch information
pratid committed Jun 2, 2015
1 parent cfad0be commit ce7f15f
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 14 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -19,6 +19,11 @@ For more information, please refer to the description of Monitoring GE in

## Releases

[FIWARE 3.5.2 (R7)][release_3_5_2_ref]

* ngsi_event_broker version 1.3.2
* ngsi_adapter version 1.1.6

[FIWARE 3.5.2 (R6)][release_3_5_2_ref]

* ngsi_event_broker version 1.3.2
Expand Down
4 changes: 4 additions & 0 deletions ngsi_adapter/README.md
Expand Up @@ -69,6 +69,10 @@ two components: probe data and optional performance data.

## Changelog

Version 1.1.6

* Fix bug in quantum-openvswitch-agent parser

Version 1.1.5

* Neutron supported in quantum-related parsers
Expand Down
6 changes: 6 additions & 0 deletions ngsi_adapter/script/build/files/debian/changelog
@@ -1,3 +1,9 @@
fiware-monitoring-ngsi-adapter (1.1.6) precise; urgency=low

* Fixed bug in quantum-openvswitch-agent parser

-- Telefónica I+D <opensource@tid.es> Tue, 02 Jun 2015 15:00:00 +0200

fiware-monitoring-ngsi-adapter (1.1.5) precise; urgency=low

* Neutron supported in quantum-related parsers
Expand Down
Expand Up @@ -189,6 +189,9 @@ if [ $1 -eq 0 ]; then
fi

%changelog
* Tue Jun 02 2015 Telefónica I+D <opensource@tid.es> 1.1.6-1
- Fix bug in quantum-openvswitch-agent parser

* Thu May 14 2015 Telefónica I+D <opensource@tid.es> 1.1.5-1
- Neutron supported in quantum-related parsers

Expand Down
25 changes: 12 additions & 13 deletions ngsi_adapter/src/lib/parsers/check_quantum_openvswitch_agent.js
Expand Up @@ -11,21 +11,20 @@ var nagios = require('./common/nagios');
var parser = Object.create(nagios.parser);
parser.getContextAttrs = function(probeEntityData) {
var data = probeEntityData.data.split('\n')[0];
var attrs = { quantum_openvswitch_agent: 0};
var attrs = { quantum_openvswitch_agent: 0 };
var items = data.split(':');
if ((items.length)>0 ) {
if (items[1].indexOf("quantum-openvswitch-agent") != -1){
if(items[0].indexOf("PROCS OK") !=-1){
attrs.quantum_openvswitch_agent=1
}
else{
attrs.quantum_openvswitch_agent=0
}
}
}
else{
throw new Error('No valid quantum-opendwitch-agent data found..');
if (items.length > 0) {
if (items[1].match(/(quantum|neutron)-openvswitch-agent/)) {
if (items[0].indexOf("PROCS OK") != -1) {
attrs.quantum_openvswitch_agent = 1;
} else {
attrs.quantum_openvswitch_agent = 0;
}
}
} else {
throw new Error('No valid quantum-openvswitch-agent data found');
}
return attrs;
};

exports.parser = parser;
2 changes: 1 addition & 1 deletion ngsi_adapter/src/package.json
@@ -1,5 +1,5 @@
{
"version": "1.1.5",
"version": "1.1.6",
"name": "ngsi_adapter",
"main": "lib/adapter.js",
"description": "Generic NGSI Probe Adapter",
Expand Down

0 comments on commit ce7f15f

Please sign in to comment.