Skip to content

Commit

Permalink
Version 1.1.3 adding attributes to region.js parser
Browse files Browse the repository at this point in the history
  • Loading branch information
pratid committed Apr 23, 2015
1 parent e4108be commit 69cee6a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
6 changes: 5 additions & 1 deletion ngsi_adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ two components: probe data and optional performance data.

## Changelog

Version 1.1.3

* Add attributes to region.js parser

Version 1.1.2

* Fix log rotation problems
Expand All @@ -94,4 +98,4 @@ Version 1.0.0

## License

(c) 2013-2014 Telefónica I+D, Apache License 2.0
(c) 2013-2015 Telefónica I+D, Apache License 2.0
6 changes: 6 additions & 0 deletions ngsi_adapter/script/build/files/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
fiware-monitoring-ngsi-adapter (1.1.3) precise; urgency=low

* Added attributes to region.js parser

-- Telefónica I+D <opensource@tid.es> Thu, 23 Apr 2015 15:00:00 +0200

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

* Fixed log rotation problems
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ if [ $1 -eq 0 ]; then
fi

%changelog
* Thu Apr 23 2015 Telefónica I+D <opensource@tid.es> 1.1.3-1
- Add attributes to region.js parser

* Fri Mar 13 2015 Telefónica I+D <opensource@tid.es> 1.1.2-1
- Fix log rotation problems
- Add .rpm package generation
Expand Down
8 changes: 7 additions & 1 deletion ngsi_adapter/src/lib/parsers/region.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var parser = Object.create(nagios.parser);
parser.getContextAttrs = function(probeEntityData) {
var data = probeEntityData.data.split('\n')[0]; // only consider first line of probe data, discard perfData

var attrs = { coreUsed: NaN, coreEnabled: NaN, coreTot: NaN , vmUsed: NaN, vmTot: NaN,hdUsed: NaN,hdTot: NaN,ramUsed: NaN,ramTot: NaN, location: NaN, latitude: NaN, longitude: NaN, vmImage:'', vmList:'', timeSample:NaN};
var attrs = { coreUsed: NaN, coreEnabled: NaN, coreTot: NaN , vmUsed: NaN, vmTot: NaN,hdUsed: NaN,hdTot: NaN,ramUsed: NaN,ramTot: NaN, location: NaN, latitude: NaN, longitude: NaN,ipUsed: NaN, ipAvailable: NaN, ipTot: NaN, vmImage:'', vmList:'', timeSample:NaN};
var items = data.split(',');
if ((items.length)>0 ) {
for (var i = 0; i < items.length; i++){
Expand Down Expand Up @@ -48,6 +48,12 @@ parser.getContextAttrs = function(probeEntityData) {
attrs.latitude=element.split('::')[1].replace(/['\s]/g, '')
if (element.split('::')[0].replace(/\s/g, '')=="longitude")
attrs.longitude=element.split('::')[1].replace(/['\s]/g, '')
if (element.split('::')[0].replace(/\s/g, '')=="ipUsed")
attrs.ipUsed=element.split('::')[1].replace(/['\s]/g, '')
if (element.split('::')[0].replace(/\s/g, '')=="ipAvailable")
attrs.ipAvailable=element.split('::')[1].replace(/['\s]/g, '')
if (element.split('::')[0].replace(/\s/g, '')=="ipTot")
attrs.ipTot=element.split('::')[1].replace(/['\s]/g, '')
if (element.split('::')[0].replace(/\s/g, '')=="vmImage")
if((element.split('::')[1]).replace(/#/g,','))
attrs.vmImage=(element.split('::')[1]).replace(/#/g,',')
Expand Down
2 changes: 1 addition & 1 deletion ngsi_adapter/src/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.2",
"version": "1.1.3",
"name": "ngsi_adapter",
"main": "lib/adapter.js",
"description": "Generic NGSI Probe Adapter",
Expand Down

0 comments on commit 69cee6a

Please sign in to comment.