diff --git a/app/components/config/config.json b/app/components/config/config.json index cf70ce4..3550238 100644 --- a/app/components/config/config.json +++ b/app/components/config/config.json @@ -18,7 +18,7 @@ { "type": "table", "config": { - "title": "Hosts", + "title": "Open Hosts problems", "cells": { "text": [ "Host", @@ -36,9 +36,16 @@ ] }, "apiName": "hosts", - "additionnalQueryFields": { - "acknowledged": 0, - "state": 1 + "filters": { + "is": { + "acknowledged": [ + false + ], + "state": [ + "DOWN", + "UNREACHABLE" + ] + } }, "isWrappable": false, "noRepeatCell": "" @@ -47,7 +54,7 @@ { "type": "table", "config": { - "title": "Service problems", + "title": "Open Service problems", "cells": { "text": [ "Host", @@ -66,16 +73,19 @@ "filters": { "isnot": { "state": [ - 0 + "OK" ], "host_state": [ - 2 + "DOWN", + "UNREACHABLE" + ] + }, + "is": { + "acknowledged": [ + false ] } }, - "additionnalQueryFields": { - "acknowledged": 0 - }, "isWrappable": true, "noRepeatCell": "host" } @@ -83,7 +93,7 @@ { "type": "table", "config": { - "title": "Hosts", + "title": "Hosts problems", "cells": { "text": [ "Host", @@ -104,7 +114,7 @@ "filters": { "isnot": { "state": [ - 0 + "UP" ] } }, @@ -115,7 +125,7 @@ { "type": "table", "config": { - "title": "Service problems", + "title": "Services problems", "cells": { "text": [ "Host", @@ -134,7 +144,7 @@ "filters": { "isnot": { "state": [ - 0 + "OK" ] } }, diff --git a/app/components/live/surveil.js b/app/components/live/surveil.js index da4c0b8..eafaf63 100644 --- a/app/components/live/surveil.js +++ b/app/components/live/surveil.js @@ -40,7 +40,7 @@ angular.module('bansho.live', []) } if (fields.length > 0) { - query.fields = JSON.stringify(fields); + query.fields = fields; } query.filters = JSON.stringify(filters); @@ -58,8 +58,13 @@ angular.module('bansho.live', []) var getService = function (hostName, description) { var fields = [], - filters = {}, - additionnalFields = {'host_name': hostName, 'description': description}; + filters = { + 'is': { + 'host_name': [hostName], + 'description': [description] + } + }, + additionnalFields = {}; return this.getObjects(fields, filters, 'services', additionnalFields) .error(function () { @@ -69,9 +74,14 @@ angular.module('bansho.live', []) var getHostOpenProblems = function () { var fields = ['state'], - filters = {}, + filters = { + 'is': { + 'state': ['DOWN', 'UNREACHABLE'], + 'acknowledged': [false] + } + }, apiName = 'hosts', - additionnalFields = {'acknowledged': 0, 'state': 1}; + additionnalFields = {}; return getObjects(fields, filters, apiName, additionnalFields) .error(function () { @@ -81,10 +91,17 @@ angular.module('bansho.live', []) var getServiceOpenProblems = function () { var serviceFields = ['host_name', 'state'], - serviceFilters = {'isnot': {'state': [0]}}, - serviceAdditionnalFields = {'acknowledged': 0}, + serviceFilters = { + 'isnot': { + 'state': ['OK'] + }, + 'is': { + 'acknowledged': [false] + } + }, + serviceAdditionnalFields = {}, hostFields = ['host_name', 'state'], - hostFilters = {'isnot': {'state': [2]}}, + hostFilters = {'isnot': {'state': ['DOWN', 'UNREACHABLE']}}, hostAdditionnalFields = {}, responsePromise = $q.defer(); @@ -115,7 +132,7 @@ angular.module('bansho.live', []) var getHostProblems = function () { var fields = ['state'], - filters = {'isnot': {'state': [0]}}, + filters = {'isnot': {'state': ['UP']}}, apiName = 'hosts', additionnalFields = {}; @@ -128,7 +145,7 @@ angular.module('bansho.live', []) // This service is used to count the number of service problems var getServiceProblems = function () { var fields = ['state'], - filters = {'isnot': {'state': [0]}}, + filters = {'isnot': {'state': ['OK']}}, apiName = 'services', additionnalFields = {}; diff --git a/app/components/service/service_main/service_main.html b/app/components/service/service_main/service_main.html index 2ce2426..91a9c4c 100644 --- a/app/components/service/service_main/service_main.html +++ b/app/components/service/service_main/service_main.html @@ -2,6 +2,7 @@