Skip to content

Commit

Permalink
Merge pull request #2 from johann8384/master
Browse files Browse the repository at this point in the history
Improved Data Set, Added mock Sensu Functionality
  • Loading branch information
johann8384 committed Mar 12, 2014
2 parents 1a7b7b0 + 326ff40 commit 88778c3
Show file tree
Hide file tree
Showing 6 changed files with 276 additions and 238 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lib-cov
*.out
*.pid
*.gz

.idea
pids
logs
results
Expand Down
28 changes: 22 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,22 @@ module.exports = function(params)
};

var getDeviceHostnames = function(callback) {
var devices = db.devices.devices;
var deviceList = [];
_.each(devices, function(device) {
deviceList.push({hostname: device.hostname, deviceID: device.deviceID});
db.devices.getAllFull(function (err, devices) {
var deviceList = {};
_.each(devices, function(device) {
deviceList[device.name + mgmtDomain] = {
'dev_desc': device.name + mgmtDomain,
'dev': device.deviceID,
'full_name': '',
'email': '',
'company': device.company,
'clientid': device.clientID,
'location': device.location,
'runbook': ''
};
});
callback(null, deviceList);
});
callback(null, deviceList);
};

var getContactsbyClientID = function(clientID, callback) {
Expand Down Expand Up @@ -178,8 +188,14 @@ module.exports = function(params)
}, callback);
};

module.getSensuEvents = getSensuEvents;
var getSensuDevices = function(callback) {
cache_memory.wrap('getSensuDevices', function(cacheCallback) {
db.devices.getSensuDevices(cacheCallback);
}, callback);
};

module.getSensuDevices = getSensuDevices;
module.getSensuEvents = getSensuEvents;
initialize(function(err, reply) {
mgmtDomain = params['mgmtDomain'];
db.devices.setMgmtDomain(mgmtDomain);
Expand Down
36 changes: 18 additions & 18 deletions lib/db/clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ var clients = [
"company": "Luettgen-Boyle"
},
{
"domain": "o'conner.info",
"domain": "oconner.info",
"address1": "28081 Molly Way Apt. 921",
"address2": "Suite 401",
"clientID": 1072,
Expand All @@ -1064,7 +1064,7 @@ var clients = [
"city": "West Maurine",
"zip": "75720",
"state": "Alabama",
"shortname": "'cnnr",
"shortname": "ocnnr",
"catch_phrase": "Polarised context-sensitive instructionset",
"company": "O'Conner, Effertz and Bogisich"
},
Expand Down Expand Up @@ -2749,7 +2749,7 @@ var clients = [
"company": "Labadie Ltd"
},
{
"domain": "o'reilly-mills.info",
"domain": "oreilly-mills.info",
"address1": "34304 Hayes Plain Apt. 053",
"address2": "Suite 250",
"clientID": 1193,
Expand All @@ -2758,7 +2758,7 @@ var clients = [
"city": "Port Arnulfo",
"zip": "18947-5250",
"state": "Michigan",
"shortname": "'rllymlls",
"shortname": "orllymlls",
"catch_phrase": "Optimized explicit GraphicalUserInterface",
"company": "O'Reilly-Mills"
},
Expand Down Expand Up @@ -3183,7 +3183,7 @@ var clients = [
"company": "Hegmann Group"
},
{
"domain": "o'connell.com",
"domain": "oconnell.com",
"address1": "39232 Eichmann Path Suite 432",
"address2": "Apt. 042",
"clientID": 1224,
Expand All @@ -3192,7 +3192,7 @@ var clients = [
"city": "Zoeychester",
"zip": "03926-8820",
"state": "Minnesota",
"shortname": "'cnnll",
"shortname": "ocnnll",
"catch_phrase": "Distributed explicit opensystem",
"company": "O'Connell, Zboncak and Durgan"
},
Expand Down Expand Up @@ -3393,7 +3393,7 @@ var clients = [
"company": "Rosenbaum-McGlynn"
},
{
"domain": "o'kon.info",
"domain": "okon.info",
"address1": "9933 Dortha Inlet",
"address2": "Suite 183",
"clientID": 1239,
Expand All @@ -3402,7 +3402,7 @@ var clients = [
"city": "Brakusville",
"zip": "58769-8145",
"state": "Kentucky",
"shortname": "'kn",
"shortname": "okn",
"catch_phrase": "Operative value-added throughput",
"company": "O'Kon Inc"
},
Expand Down Expand Up @@ -3729,7 +3729,7 @@ var clients = [
"company": "Weimann-Ernser"
},
{
"domain": "o'kon-shields.com",
"domain": "okon-shields.com",
"address1": "9122 Thomas Meadow Suite 064",
"address2": "Suite 857",
"clientID": 1263,
Expand All @@ -3738,7 +3738,7 @@ var clients = [
"city": "Klingstad",
"zip": "90610",
"state": "NewYork",
"shortname": "'knshlds",
"shortname": "oknshlds",
"catch_phrase": "Diverse systematic adapter",
"company": "O'Kon-Shields"
},
Expand Down Expand Up @@ -4961,7 +4961,7 @@ var clients = [
"company": "Bergstrom Ltd"
},
{
"domain": "o'reilly-morissette.com",
"domain": "oreilly-morissette.com",
"address1": "82595 Hettinger Light",
"address2": "Apt. 854",
"clientID": 1351,
Expand All @@ -4970,7 +4970,7 @@ var clients = [
"city": "McLaughlinmouth",
"zip": "08717",
"state": "Oregon",
"shortname": "'rllymrsstt",
"shortname": "orllymrsstt",
"catch_phrase": "Diverse even-keeled monitoring",
"company": "O'Reilly-Morissette"
},
Expand Down Expand Up @@ -6991,7 +6991,7 @@ var clients = [
"company": "Wiegand-Volkman"
},
{
"domain": "o'kon.com",
"domain": "okon.com",
"address1": "993 Deven Estate",
"address2": "Suite 724",
"clientID": 1496,
Expand All @@ -7000,7 +7000,7 @@ var clients = [
"city": "Lake Carol",
"zip": "93054",
"state": "Kentucky",
"shortname": "'kn",
"shortname": "okn",
"catch_phrase": "Balanced motivating hierarchy",
"company": "O'Kon and Sons"
},
Expand Down Expand Up @@ -7607,7 +7607,7 @@ var clients = [
"company": "Jenkins Ltd"
},
{
"domain": "o'hara.com",
"domain": "ohara.com",
"address1": "7972 Krystina Mountain",
"address2": "Apt. 846",
"clientID": 1540,
Expand All @@ -7616,7 +7616,7 @@ var clients = [
"city": "Marquesberg",
"zip": "43650",
"state": "Virginia",
"shortname": "'hr",
"shortname": "ohr",
"catch_phrase": "Pre-emptive secondary migration",
"company": "O'Hara and Sons"
},
Expand Down Expand Up @@ -7663,7 +7663,7 @@ var clients = [
"company": "Emard Ltd"
},
{
"domain": "o'conner.net",
"domain": "oconner.net",
"address1": "04754 Justen Forges",
"address2": "Apt. 458",
"clientID": 1544,
Expand All @@ -7672,7 +7672,7 @@ var clients = [
"city": "East Aracely",
"zip": "33153-9694",
"state": "Hawaii",
"shortname": "'cnnr",
"shortname": "ocnnr",
"catch_phrase": "User-friendly incremental methodology",
"company": "O'Conner Group"
},
Expand Down
Loading

0 comments on commit 88778c3

Please sign in to comment.