diff --git a/json-path/src/main/java/com/jayway/jsonpath/Criteria.java b/json-path/src/main/java/com/jayway/jsonpath/Criteria.java index 67a95f164..27a422aa2 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/Criteria.java +++ b/json-path/src/main/java/com/jayway/jsonpath/Criteria.java @@ -16,7 +16,7 @@ import com.jayway.jsonpath.internal.Path; import com.jayway.jsonpath.internal.PathCompiler; -import com.jayway.jsonpath.internal.token.PredicateContextImpl; +import com.jayway.jsonpath.internal.token.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,7 +35,7 @@ * */ @SuppressWarnings("unchecked") -public class Criteria implements Predicate { +public class Criteria implements StreamingPredicate { private static final Logger logger = LoggerFactory.getLogger(Criteria.class); @@ -64,6 +64,52 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { return res; } + @Override + public boolean check(TokenStackElement left, + TokenStackElement right) { + + if (left.getType() == right.getType()) { + switch (left.getType()) { + case ARRAY_TOKEN: + { + ArrayToken leftT = (ArrayToken)left; + ArrayToken rightT = (ArrayToken)right; + return check(leftT.getValue(), right.getValue()); + //break; + } + case OBJECT_TOKEN: + { + ObjectToken leftT = (ObjectToken)left; + ObjectToken rightT = (ObjectToken)right; + return check(leftT.getValue(), right.getValue()); + //break; + } + case STRING_TOKEN: + { + StringToken leftT = (StringToken)left; + StringToken rightT = (StringToken)right; + if (leftT.value != null && rightT.value != null) { + return leftT.value.equals(rightT.value); + } + return leftT == rightT; + } + case FLOAT_TOKEN: + { + FloatToken leftT = (FloatToken)left; + FloatToken rightT = (FloatToken)right; + return leftT.value == rightT.value; + } + case INTEGER_TOKEN: + { + IntToken leftT = (IntToken)left; + IntToken rightT = (IntToken)right; + return leftT.value == rightT.value; + } + } + } + return false; + } + @Override public String toString() { return "=="; @@ -77,6 +123,11 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { return res; } + @Override + public boolean check(TokenStackElement left, TokenStackElement right) { + return !EQ.check(left, right); + } + @Override public String toString() { return "!="; @@ -93,6 +144,51 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { return res; } + @Override + public boolean check(TokenStackElement left, TokenStackElement right) { + + if (left.getType() == right.getType()) { + switch (left.getType()) { + case ARRAY_TOKEN: + { + ArrayToken leftT = (ArrayToken)left; + ArrayToken rightT = (ArrayToken)right; + return check(leftT.getValue(), right.getValue()); + //break; + } + case OBJECT_TOKEN: + { + ObjectToken leftT = (ObjectToken)left; + ObjectToken rightT = (ObjectToken)right; + return check(leftT.getValue(), right.getValue()); + //break; + } + case STRING_TOKEN: + { + StringToken leftT = (StringToken)left; + StringToken rightT = (StringToken)right; + if (leftT.value != null && rightT.value != null) { + return leftT.value.compareTo(rightT.value) > 0; + } + break; + } + case FLOAT_TOKEN: + { + FloatToken leftT = (FloatToken)left; + FloatToken rightT = (FloatToken)right; + return leftT.value > rightT.value; + } + case INTEGER_TOKEN: + { + IntToken leftT = (IntToken)left; + IntToken rightT = (IntToken)right; + return leftT.value > rightT.value; + } + } + } + return false; + } + @Override public String toString() { return ">"; @@ -109,6 +205,51 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { return res; } + @Override + public boolean check(TokenStackElement left, + TokenStackElement right) { + if (left.getType() == right.getType()) { + switch (left.getType()) { + case ARRAY_TOKEN: + { + ArrayToken leftT = (ArrayToken)left; + ArrayToken rightT = (ArrayToken)right; + return check(leftT.getValue(), right.getValue()); + //break; + } + case OBJECT_TOKEN: + { + ObjectToken leftT = (ObjectToken)left; + ObjectToken rightT = (ObjectToken)right; + return check(leftT.getValue(), right.getValue()); + //break; + } + case STRING_TOKEN: + { + StringToken leftT = (StringToken)left; + StringToken rightT = (StringToken)right; + if (leftT.value != null && rightT.value != null) { + return leftT.value.compareTo(rightT.value) >= 0; + } + break; + } + case FLOAT_TOKEN: + { + FloatToken leftT = (FloatToken)left; + FloatToken rightT = (FloatToken)right; + return leftT.value >= rightT.value; + } + case INTEGER_TOKEN: + { + IntToken leftT = (IntToken)left; + IntToken rightT = (IntToken)right; + return leftT.value >= rightT.value; + } + } + } + return false; + } + @Override public String toString() { return ">="; @@ -125,6 +266,52 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { return res; } + @Override + public boolean check(TokenStackElement left, + TokenStackElement right) { + + if (left.getType() == right.getType()) { + switch (left.getType()) { + case ARRAY_TOKEN: + { + ArrayToken leftT = (ArrayToken)left; + ArrayToken rightT = (ArrayToken)right; + return check(leftT.getValue(), right.getValue()); + //break; + } + case OBJECT_TOKEN: + { + ObjectToken leftT = (ObjectToken)left; + ObjectToken rightT = (ObjectToken)right; + return check(leftT.getValue(), right.getValue()); + //break; + } + case STRING_TOKEN: + { + StringToken leftT = (StringToken)left; + StringToken rightT = (StringToken)right; + if (leftT.value != null && rightT.value != null) { + return leftT.value.compareTo(rightT.value) < 0; + } + break; + } + case FLOAT_TOKEN: + { + FloatToken leftT = (FloatToken)left; + FloatToken rightT = (FloatToken)right; + return leftT.value < rightT.value; + } + case INTEGER_TOKEN: + { + IntToken leftT = (IntToken)left; + IntToken rightT = (IntToken)right; + return leftT.value < rightT.value; + } + } + } + return false; + } + @Override public String toString() { return "<"; @@ -141,6 +328,52 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { return res; } + @Override + public boolean check(TokenStackElement left, + TokenStackElement right) { + + if (left.getType() == right.getType()) { + switch (left.getType()) { + case ARRAY_TOKEN: + { + ArrayToken leftT = (ArrayToken)left; + ArrayToken rightT = (ArrayToken)right; + return check(leftT.getValue(), right.getValue()); + //break; + } + case OBJECT_TOKEN: + { + ObjectToken leftT = (ObjectToken)left; + ObjectToken rightT = (ObjectToken)right; + return check(leftT.getValue(), right.getValue()); + //break; + } + case STRING_TOKEN: + { + StringToken leftT = (StringToken)left; + StringToken rightT = (StringToken)right; + if (leftT.value != null && rightT.value != null) { + return leftT.value.compareTo(rightT.value) <= 0; + } + break; + } + case FLOAT_TOKEN: + { + FloatToken leftT = (FloatToken)left; + FloatToken rightT = (FloatToken)right; + return leftT.value <= rightT.value; + } + case INTEGER_TOKEN: + { + IntToken leftT = (IntToken)left; + IntToken rightT = (IntToken)right; + return leftT.value <= rightT.value; + } + } + } + return false; + } + @Override public String toString() { return "<="; @@ -160,6 +393,28 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { if (logger.isDebugEnabled()) logger.debug("[{}] {} [{}] => {}", model, name(), join(", ", exps), res); return res; } + + @Override + public boolean check(TokenStackElement left, + TokenStackElement right) { + + throw new UnsupportedOperationException(); + /* + switch (left.getType()) { + case ARRAY_TOKEN: + { + ArrayToken leftT = (ArrayToken)left; + return (EQ.check(leftT.getValue(), right)); + } + case OBJECT_TOKEN: + case STRING_TOKEN: + case FLOAT_TOKEN: + case INTEGER_TOKEN: + break; + } + return false; + */ + } }, NIN { @Override @@ -169,6 +424,27 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { if (logger.isDebugEnabled()) logger.debug("[{}] {} [{}] => {}", model, name(), join(", ", nexps), res); return res; } + + @Override + public boolean check(TokenStackElement left, + TokenStackElement right) { + throw new UnsupportedOperationException(); + /* + switch (left.getType()) { + case ARRAY_TOKEN: + { + ArrayToken leftT = (ArrayToken)left; + return (NE.check(leftT.getValue(), right)); + } + case OBJECT_TOKEN: + case STRING_TOKEN: + case FLOAT_TOKEN: + case INTEGER_TOKEN: + break; + } + return false; + */ + } }, CONTAINS { @Override @@ -191,6 +467,51 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { if (logger.isDebugEnabled()) logger.debug("[{}] {} [{}] => {}", model, name(), expected, res); return res; } + + @Override + public boolean check(TokenStackElement left, + TokenStackElement right) { + + //throw new UnsupportedOperationException(); + switch (right.getType()) { + case ARRAY_TOKEN: + { + ArrayToken token = (ArrayToken)right; + return (EQ.check(token.getValue(), left)); + } + case OBJECT_TOKEN: + { + ObjectToken token = (ObjectToken)right; + return (EQ.check(token.getValue(), left)); + } + case STRING_TOKEN: + { + if (left.getType() == TokenType.STRING_TOKEN) { + StringToken tokenL = (StringToken)right; + StringToken tokenR = (StringToken)left; + if (tokenL.value != null && tokenR.value != null) { + return tokenL.value.equals(tokenR.value); + } + } + break; + } + case FLOAT_TOKEN: + if (left.getType() == TokenType.FLOAT_TOKEN) { + FloatToken tokenL = (FloatToken)right; + FloatToken tokenR = (FloatToken)left; + return tokenL.value == tokenR.value; + } + break; + case INTEGER_TOKEN: + if (left.getType() == TokenType.INTEGER_TOKEN) { + IntToken tokenL = (IntToken)right; + IntToken tokenR = (IntToken)left; + return tokenL.value == tokenR.value; + } + break; + } + return false; + } }, ALL { @Override @@ -219,6 +540,28 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { } return res; } + + @Override + public boolean check(TokenStackElement left, + TokenStackElement right) { + + throw new UnsupportedOperationException(); + /* + switch (left.getType()) { + case ARRAY_TOKEN: + { + ArrayToken leftT = (ArrayToken)left; + return (EQ.check(leftT.getValue(), right)); + } + case OBJECT_TOKEN: + case STRING_TOKEN: + case FLOAT_TOKEN: + case INTEGER_TOKEN: + break; + } + return false; + */ + } }, SIZE { @Override @@ -240,6 +583,34 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { } return res; } + + @Override + public boolean check(TokenStackElement left, + TokenStackElement right) { + throw new UnsupportedOperationException(); + /* + if (left.getType() == TokenType.INTEGER_TOKEN) { + int size = ((IntToken)left).value; + switch (right.getType()) { + case ARRAY_TOKEN: + { + ArrayToken token = (ArrayToken)right; + return (token.getIndex() + 1) == size; + } + case STRING_TOKEN: + { + StringToken token = (StringToken)right; + return token.value.length() == size; + } + case OBJECT_TOKEN: + case FLOAT_TOKEN: + case INTEGER_TOKEN: + break; + } + } + return false; + */ + } }, EXISTS { @Override @@ -247,6 +618,12 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { //This must be handled outside throw new UnsupportedOperationException(); } + + @Override + public boolean check(TokenStackElement left, + TokenStackElement right) { + throw new UnsupportedOperationException(); + } }, TYPE { @Override @@ -256,6 +633,11 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { return actType != null && expType.isAssignableFrom(actType); } + + @Override + public boolean check(TokenStackElement left, TokenStackElement right) { + return (left.getType() == right.getType()); + } }, REGEX { @Override @@ -280,6 +662,20 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { return res; } + @Override + public boolean check(TokenStackElement left, TokenStackElement right) { + if (right.getType() == TokenType.STRING_TOKEN + && left.getType() == right.getType()) + { + StringToken rightT = (StringToken)right; + if (null == rightT.pattern) { + rightT.pattern = Pattern.compile(rightT.value); + } + return rightT.pattern.matcher(((StringToken)left).value).matches(); + } + return false; + } + @Override public String toString() { return "=~"; @@ -292,6 +688,14 @@ boolean eval(Object expected, final Object model, final PredicateContext ctx) { Predicate exp = (Predicate) expected; return exp.apply(new PredicateContextImpl(model, ctx.root(), ctx.configuration(), pci.documentPathCache())); } + + @Override + public boolean check(TokenStackElement left, TokenStackElement right) { + //PredicateContextImpl pci = (PredicateContextImpl) ctx; + //StreamingPredicate exp = (StreamingPredicate) left; + //return exp.check(); + throw new UnsupportedOperationException(); + } }, NOT_EMPTY { @Override @@ -310,9 +714,34 @@ boolean eval(Object expected, Object model, PredicateContext ctx) { } return res; } + + @Override + public boolean check(TokenStackElement left, + TokenStackElement right) { + switch (right.getType()) { + case ARRAY_TOKEN: + { + ArrayToken token = (ArrayToken)right; + return token.getValue() != null; + } + case STRING_TOKEN: + { + StringToken token = (StringToken)right; + return token.value.length() > 0; + } + case OBJECT_TOKEN: + case FLOAT_TOKEN: + case INTEGER_TOKEN: + break; + } + return false; + } }; - abstract boolean eval(Object expected, Object model, PredicateContext ctx); + abstract boolean eval(Object expected, Object model, + PredicateContext ctx); + + abstract boolean check(TokenStackElement left, TokenStackElement right); public static CriteriaType parse(String str) { if ("==".equals(str)) { @@ -414,6 +843,43 @@ private boolean eval(PredicateContext ctx) { } } + @Override + public boolean check(TokenStack stack, int idx) { + for (Criteria criteria : criteriaChain) { + if (!criteria.check2(stack, idx)) { + return false; + } + } + return true; + } + + private boolean check2(TokenStack stack, int idx) { + if (CriteriaType.EXISTS == criteriaType) { + boolean exists = ((Boolean) right); + try { + //Configuration c = Configuration.builder().jsonProvider(ctx.configuration().jsonProvider()).options(Option.REQUIRE_PROPERTIES).build(); + //Object value = ((Path) left).evaluate(ctx.item(), ctx.root(), c).getValue(); + Object value = null; + + if (exists) { + return (value != null); + } else { + return (value == null); + } + } catch (PathNotFoundException e) { + return !exists; + } + } + try { + //Object leftVal = evaluateIfPath(left, ctx); + //Object rightVal = evaluateIfPath(right, ctx); + + //return criteriaType.check(rightVal, leftVal); + } catch (ValueCompareException e) { + } catch (PathNotFoundException e) { + } + return false; + } /** * Static factory method to create a Criteria using the provided key diff --git a/json-path/src/main/java/com/jayway/jsonpath/EvaluationCallback.java b/json-path/src/main/java/com/jayway/jsonpath/EvaluationCallback.java new file mode 100644 index 000000000..f5fe2a76a --- /dev/null +++ b/json-path/src/main/java/com/jayway/jsonpath/EvaluationCallback.java @@ -0,0 +1,37 @@ +/* + * Copyright 2011 the original author or authors. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.jayway.jsonpath; + +import com.jayway.jsonpath.internal.Path; + +/** + * A listener that can be registered on a {@link com.jayway.jsonpath.internal.token.TokenStack} that is notified when a + * result is found for a specific registered path + */ +public interface EvaluationCallback { + + /** + * Callback invoked when result is found + * @param path -- the specific path that was triggered + */ + public void resultFound(Path path) throws Exception; + + /** + * Callback invoked when the parser leaves the region in which the match + * was found + * @param path -- the specific path that was untriggered + */ + public void resultFoundExit(Path path) throws Exception; +} diff --git a/json-path/src/main/java/com/jayway/jsonpath/Filter.java b/json-path/src/main/java/com/jayway/jsonpath/Filter.java index 26c7ed1e9..59b210bf8 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/Filter.java +++ b/json-path/src/main/java/com/jayway/jsonpath/Filter.java @@ -15,6 +15,7 @@ package com.jayway.jsonpath; import com.jayway.jsonpath.internal.Utils; +import com.jayway.jsonpath.internal.token.TokenStack; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,7 +29,7 @@ /** * */ -public abstract class Filter implements Predicate { +public abstract class Filter implements StreamingPredicate { private static final Logger logger = LoggerFactory.getLogger(Filter.class); private static final Pattern OPERATOR_SPLIT = Pattern.compile("((?<=&&|\\|\\|)|(?=&&|\\|\\|))"); @@ -56,6 +57,8 @@ public static Filter filter(Collection predicates) { @Override public abstract boolean apply(PredicateContext ctx); + @Override + public abstract boolean check(TokenStack stack, int idx); public Filter or(final Predicate other){ return new OrFilter(this, other); @@ -80,6 +83,11 @@ public boolean apply(PredicateContext ctx) { return predicate.apply(ctx); } + @Override + public boolean check(TokenStack stack, int idx) { + return ((StreamingPredicate)predicate).check(stack, idx); + } + @Override public String toString() { return predicate.toString(); @@ -114,6 +122,16 @@ public boolean apply(PredicateContext ctx) { return true; } + @Override + public boolean check(TokenStack stack, int idx) { + for (Predicate predicate : predicates) { + if(!((StreamingPredicate)predicate).check(stack, idx)){ + return false; + } + } + return true; + } + @Override public String toString() { return "(" + Utils.join(" && ", predicates) + ")"; @@ -124,7 +142,7 @@ private static final class OrFilter extends Filter { private final Predicate left; private final Predicate right; - + private OrFilter(Predicate left, Predicate right) { this.left = left; this.right = right; @@ -140,6 +158,12 @@ public boolean apply(PredicateContext ctx) { return a || right.apply(ctx); } + @Override + public boolean check(TokenStack stack, int idx) { + boolean a = ((StreamingPredicate)left).check(stack, idx); + return a || ((StreamingPredicate)right).check(stack, idx); + } + @Override public String toString() { return "(" + left.toString() + " || " + right.toString() + ")"; diff --git a/json-path/src/main/java/com/jayway/jsonpath/StreamingPredicate.java b/json-path/src/main/java/com/jayway/jsonpath/StreamingPredicate.java new file mode 100644 index 000000000..85508da1e --- /dev/null +++ b/json-path/src/main/java/com/jayway/jsonpath/StreamingPredicate.java @@ -0,0 +1,25 @@ +/* + * Copyright 2011 the original author or authors. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.jayway.jsonpath; + +import com.jayway.jsonpath.internal.token.TokenStack; + +/** + * + */ +public interface StreamingPredicate extends Predicate { + + boolean check(TokenStack stack, int idx); +} diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/CompiledPath.java b/json-path/src/main/java/com/jayway/jsonpath/internal/CompiledPath.java index eed16fede..dc176772e 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/CompiledPath.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/CompiledPath.java @@ -17,6 +17,7 @@ import com.jayway.jsonpath.Configuration; import com.jayway.jsonpath.internal.token.EvaluationContextImpl; import com.jayway.jsonpath.internal.token.PathToken; +import com.jayway.jsonpath.internal.token.TokenStack; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -61,6 +62,11 @@ public EvaluationContext evaluate(Object document, Object rootDocument, Configur return evaluate(document, rootDocument, configuration, false); } + @Override + public boolean checkForMatch(TokenStack stack) { + return root.checkForMatch(stack, 0); + } + @Override public boolean isDefinite() { return root.isPathDefinite(); diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/Path.java b/json-path/src/main/java/com/jayway/jsonpath/internal/Path.java index b87b7b55d..b468f276c 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/Path.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/Path.java @@ -15,6 +15,7 @@ package com.jayway.jsonpath.internal; import com.jayway.jsonpath.Configuration; +import com.jayway.jsonpath.internal.token.TokenStack; /** * @@ -43,6 +44,12 @@ public interface Path { */ EvaluationContext evaluate(Object document, Object rootDocument, Configuration configuration, boolean forUpdate); + /** + * checks the parser state represented by stack and determines if this + * path matches it + */ + boolean checkForMatch(TokenStack stack); + /** * * @return true id this path is definite diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/ArrayPathToken.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/ArrayPathToken.java index 1928d91d3..2cfeefaec 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/token/ArrayPathToken.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/ArrayPathToken.java @@ -178,6 +178,85 @@ public String getPathFragment() { return sb.toString(); } + @Override + public boolean checkForMatch(TokenStack stack, int idx) + { + if (stack.getStack().size() <= idx) return false; + TokenStackElement curr = stack.getStack().get(idx); + + if (curr.getType() == TokenType.ARRAY_TOKEN) { + ArrayToken token = (ArrayToken)curr; + int tokenIdx = token.getIndex(); + switch (operation) { + case CONTEXT_SIZE: + { + if (isLeaf()) { + return stack.getStack().size() - 1 == idx; + } + return next().checkForMatch(stack, idx + 1); + } + case SLICE_TO: + { + int to = criteria.get(0).intValue(); + if (tokenIdx < to) { + if (isLeaf()) { + return stack.getStack().size() - 1 == idx; + } + return next().checkForMatch(stack, idx + 1); + } + break; + } + case SLICE_FROM: + { + int from = criteria.get(0).intValue(); + if (from <= tokenIdx) { + if (isLeaf()) { + return stack.getStack().size() - 1 == idx; + } + return next().checkForMatch(stack, idx + 1); + } + break; + } + case SLICE_BETWEEN: + { + int from = criteria.get(0).intValue(); + int to = criteria.get(1).intValue(); + if (from <= tokenIdx && tokenIdx < to) { + if (isLeaf()) { + return stack.getStack().size() - 1 == idx; + } + return next().checkForMatch(stack, idx + 1); + } + break; + } + case INDEX_SEQUENCE: + { + for (Integer i : criteria) { + if (i.intValue() == tokenIdx) { + if (isLeaf()) { + return stack.getStack().size() - 1 == idx; + } + return next().checkForMatch(stack, idx + 1); + } + } + break; + } + case SINGLE_INDEX: + { + if (criteria.get(0).intValue() == tokenIdx) { + if (isLeaf()) { + return stack.getStack().size() - 1 == idx; + } + return next().checkForMatch(stack, idx + 1); + } + break; + } + } + } + + return false; + } + @Override boolean isTokenDefinite() { return isDefinite; diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/ArrayToken.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/ArrayToken.java new file mode 100644 index 000000000..3981147ae --- /dev/null +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/ArrayToken.java @@ -0,0 +1,48 @@ + +package com.jayway.jsonpath.internal.token; + +/** + * + * @author Hunter Payne + **/ +public class ArrayToken implements TokenStackElement +{ + int currentIndex; + TokenStackElement value; // can be an object, array, or property + + public ArrayToken() + { + currentIndex = 0; + value = null; + } + + public TokenType getType() + { + return TokenType.ARRAY_TOKEN; + } + + public int getIndex() + { + return currentIndex; + } + + public TokenStackElement getValue() + { + return value; + } + + public void setValue(TokenStackElement elem) + { + if (value != null) { + ++currentIndex; + } + value = elem; + } + + public String toString() + { + return "Array[idx=" + currentIndex + "]"; + } +} + +// End ArrayToken.java diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/FloatToken.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/FloatToken.java new file mode 100644 index 000000000..561eb6137 --- /dev/null +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/FloatToken.java @@ -0,0 +1,33 @@ + +package com.jayway.jsonpath.internal.token; + +/** + * + * @author Hunter Payne + **/ +public class FloatToken implements TokenStackElement +{ + public float value; + + public FloatToken(float f) + { + value = f; + } + + public TokenType getType() + { + return TokenType.FLOAT_TOKEN; + } + + public TokenStackElement getValue() + { + return null; + } + + public void setValue(TokenStackElement elem) + { + throw new RuntimeException(); + } +} + +// End FloatToken.java diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/IntToken.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/IntToken.java new file mode 100644 index 000000000..df3dc314a --- /dev/null +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/IntToken.java @@ -0,0 +1,33 @@ + +package com.jayway.jsonpath.internal.token; + +/** + * + * @author Hunter Payne + **/ +public class IntToken implements TokenStackElement +{ + public int value; + + public IntToken(int f) + { + value = f; + } + + public TokenType getType() + { + return TokenType.INTEGER_TOKEN; + } + + public TokenStackElement getValue() + { + return null; + } + + public void setValue(TokenStackElement elem) + { + throw new RuntimeException(); + } +} + +// End IntToken.java diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/ObjectToken.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/ObjectToken.java new file mode 100644 index 000000000..408580fdf --- /dev/null +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/ObjectToken.java @@ -0,0 +1,45 @@ + +package com.jayway.jsonpath.internal.token; + +/** + * + * @author Hunter Payne + **/ +public class ObjectToken implements TokenStackElement +{ + String key; + TokenStackElement value; // can be an array, object, or property + + public ObjectToken() + { + key = null; + value = null; + } + + public TokenType getType() + { + return TokenType.OBJECT_TOKEN; + } + + public String getKey() + { + return key; + } + + public TokenStackElement getValue() + { + return value; + } + + public void setValue(TokenStackElement elem) + { + value = elem; + } + + public String toString() + { + return "Object[key=" + key + "]"; + } +} + +// End ObjectToken.java diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/PathToken.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/PathToken.java index 3d1897bcf..b94a6f8a0 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/token/PathToken.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/PathToken.java @@ -204,6 +204,9 @@ public boolean equals(Object obj) { public abstract void evaluate(String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx); + /** streaming API */ + public abstract boolean checkForMatch(TokenStack stack, int idx); + abstract boolean isTokenDefinite(); abstract String getPathFragment(); diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/PredicateContextImpl.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/PredicateContextImpl.java index 3abc68d5f..f18bf60cc 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/token/PredicateContextImpl.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/PredicateContextImpl.java @@ -66,7 +66,7 @@ public Object item() { @Override public T item(Class clazz) throws MappingException { - return configuration().mappingProvider().map(contextDocument, clazz, configuration); + return configuration().mappingProvider().map(contextDocument, clazz, configuration); } @Override diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/PredicatePathToken.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/PredicatePathToken.java index bd6c5100f..93b871b73 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/token/PredicatePathToken.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/PredicatePathToken.java @@ -77,13 +77,42 @@ public boolean accept(final Object obj, final Object root, final Configuration c Predicate.PredicateContext ctx = new PredicateContextImpl(obj, root, configuration, evaluationContext.documentEvalCache()); for (Predicate predicate : predicates) { - if (!predicate.apply (ctx)) { + if (!predicate.apply(ctx)) { return false; } } return true; } + private StackElementWrapper wrapper = null; + + @Override + public boolean checkForMatch(TokenStack stack, int idx) + { + assert(stack.getStack().size() > idx); + TokenStackElement curr = stack.getStack().get(idx); + + if (curr.getType() == TokenType.ARRAY_TOKEN || curr.getType() == TokenType.OBJECT_TOKEN) { + if (null == wrapper) { + wrapper = new StackElementWrapper(stack, idx); + } else { + wrapper.reset(idx); + } + + for (Predicate predicate : predicates) { + if (!predicate.apply(wrapper)) { + //if (!predicate.check(stack, idx)) { + return false; + } + } + if (isLeaf()) { + return stack.getStack().size() - 1 == idx; + } + return next().checkForMatch(stack, idx + 1); + } + return false; + } + @Override public String getPathFragment() { return FRAGMENTS[predicates.size() - 1]; diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/PropertyPathToken.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/PropertyPathToken.java index f7824036d..5b4048718 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/token/PropertyPathToken.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/PropertyPathToken.java @@ -14,12 +14,13 @@ */ package com.jayway.jsonpath.internal.token; +import java.util.List; +import java.util.logging.Logger; + import com.jayway.jsonpath.PathNotFoundException; import com.jayway.jsonpath.internal.PathRef; import com.jayway.jsonpath.internal.Utils; -import java.util.List; - /** * */ @@ -44,6 +45,29 @@ public void evaluate(String currentPath, PathRef parent, Object model, Evaluatio handleObjectProperty(currentPath, model, ctx, properties); } + @Override + public boolean checkForMatch(TokenStack stack, int idx) + { + if (stack.getStack().size() <= idx) return false; + TokenStackElement curr = stack.getStack().get(idx); + + if (curr.getType() == TokenType.OBJECT_TOKEN) { + ObjectToken token = (ObjectToken)curr; + if (token.getKey() != null) { + for (String checkKey : properties) { + if (token.getKey().equals(checkKey)) { + if (isLeaf()) { + return stack.getStack().size() - 1 == idx; + } + return next().checkForMatch(stack, idx + 1); + } + } + } + } + + return false; + } + @Override boolean isTokenDefinite() { return true; diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/RootPathToken.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/RootPathToken.java index 21f63787a..85117d272 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/token/RootPathToken.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/RootPathToken.java @@ -54,6 +54,16 @@ public void evaluate(String currentPath, PathRef pathRef, Object model, Evaluati } } + @Override + public boolean checkForMatch(TokenStack stack, int idx) + { + assert(0 == idx); + if (0 == stack.getStack().size()) { + return isLeaf(); + } + return !isLeaf() && next().checkForMatch(stack, 0); + } + @Override public String getPathFragment() { return "$"; diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/ScanPathToken.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/ScanPathToken.java index 5bb0d0e51..e2bef8793 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/token/ScanPathToken.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/ScanPathToken.java @@ -96,6 +96,28 @@ private static Predicate createScanPredicate(final PathToken target, final Evalu } } + @Override + public boolean checkForMatch(TokenStack stack, int idx) + { + if (stack.getStack().size() <= idx) return false; + TokenStackElement curr = stack.getStack().get(idx); + + if (curr.getType() == TokenType.ARRAY_TOKEN + || curr.getType() == TokenType.OBJECT_TOKEN) + { + //if ((idx - 1) == stack.getStack().size() && isLeaf()) + if (isLeaf()) { + return true; + } + for (int i = idx; i < stack.getStack().size(); ++i) { + if (next().checkForMatch(stack, i)) { + return true; + } + } + } + + return false; + } @Override boolean isTokenDefinite() { diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/StackElementWrapper.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/StackElementWrapper.java new file mode 100644 index 000000000..036338c57 --- /dev/null +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/StackElementWrapper.java @@ -0,0 +1,148 @@ + +package com.jayway.jsonpath.internal.token; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; + +import com.jayway.jsonpath.Configuration; +import com.jayway.jsonpath.Predicate; +import com.jayway.jsonpath.spi.mapper.MappingException; + +/** + * + */ +public class StackElementWrapper implements Predicate.PredicateContext +{ + private Map cache; + + private TokenStack stack; + private int idx; + private TokenStackElement elem; + + public StackElementWrapper(TokenStack s, int i) + { + stack = s; + idx = i; + elem = stack.getStack().get(i); + } + + public void reset(int i) + { + if (idx < i) { + // we are moving down the stack, so no cache removals are necessary + idx = i; + elem = stack.getStack().get(i); + } else if (idx > i) { + // we just popped up the stack, so we need to remove some things + // from the cache + TokenStackElement elem = null; + for (int j = i; j < idx; ++j) { + elem = stack.getStack().get(j); + popCache(this.elem); + //cache.remove(this.elem); + } + this.elem = elem; + idx = i; + } else { + TokenStackElement elem = stack.getStack().get(i); + if (this.elem != elem) { + popCache(this.elem); // just remove the previous thing + this.elem = elem; + } + } + } + + protected Object unwrap(TokenStackElement elem) + { + Object o = cache.get(elem); + + switch (elem.getType()) { + case ARRAY_TOKEN: + { + ArrayToken token = (ArrayToken)elem; + List l = (List)o; + if (null == l) { + + l = new ArrayList(token.getIndex() + 1); + cache.put(elem, l); + } + ((ArrayList)l).ensureCapacity(token.getIndex() + 1); + //for (int i = 0; i < token.getIndex(); ++i) { + // l.add(null); + //} + l.set(token.getIndex(), unwrap(token.getValue())); + return l; + } + case OBJECT_TOKEN: + { + ObjectToken token = (ObjectToken)elem; + Map m = (Map)o; + if (null == m) { + + m = new HashMap(); + cache.put(elem, m); + } + m.put(token.getKey(), unwrap(token.getValue())); + return m; + } + case STRING_TOKEN: + { + if (o != null) return o; + o = ((StringToken)elem).value; + //cache.put(elem, o); + return o; + } + case FLOAT_TOKEN: + { + if (o != null) return o; + o = new Float(((FloatToken)elem).value); + //cache.put(elem, o); + return o; + } + case INTEGER_TOKEN: + { + if (o != null) return o; + o = new Integer(((IntToken)elem).value); + //cache.put(elem, o); + return o; + } + default: + { + assert(false); + } + } + + return null; + } + + public void popCache(TokenStackElement elem) + { + cache.remove(elem); + } + + public Object item() + { + return unwrap(elem); + } + + public T item(Class clazz) throws MappingException + { + return configuration().mappingProvider().map( + item(), clazz, configuration()); + } + + public Object root() + { + return this; // ???? maybe unwrap the root element instead, + // but that's very very very expensive + // return unwrap(stack.getStack().get(0)); + } + + public Configuration configuration() + { + return stack.configuration(); + } +} + diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/StringToken.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/StringToken.java new file mode 100644 index 000000000..cbc5d3347 --- /dev/null +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/StringToken.java @@ -0,0 +1,37 @@ + +package com.jayway.jsonpath.internal.token; + +import java.util.regex.Pattern; + +/** + * + * @author Hunter Payne + **/ +public class StringToken implements TokenStackElement +{ + public String value; + public Pattern pattern; + + public StringToken(String s) + { + value = s; + pattern = null; + } + + public TokenType getType() + { + return TokenType.STRING_TOKEN; + } + + public TokenStackElement getValue() + { + return null; + } + + public void setValue(TokenStackElement elem) + { + throw new RuntimeException(); + } +} + +// End StringToken.java diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/TokenStack.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/TokenStack.java new file mode 100644 index 000000000..ab55f7d2d --- /dev/null +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/TokenStack.java @@ -0,0 +1,248 @@ + +package com.jayway.jsonpath.internal.token; + +import java.util.*; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.jayway.jsonpath.Configuration; +import com.jayway.jsonpath.EvaluationCallback; +import com.jayway.jsonpath.internal.Path; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; + +/** + * + * @author Hunter Payne + **/ +public class TokenStack +{ + protected static Logger log = Logger.getLogger("com.jayway.jsonpath"); + + protected Configuration conf; + protected Stack elements; + protected List paths; + protected Map matchedPaths; + + private TokenStackElement curr; + private Path rootMatch; + + public TokenStack(Configuration conf) + { + this.conf = conf; + paths = new ArrayList(); + matchedPaths = new HashMap(); + elements = new Stack(); + rootMatch = null; + } + + public Stack getStack() + { + return elements; + } + + /** + * registers a path for which to fire results + */ + public void registerPath(Path path) + { + paths.add(path); + } + + /** + * reads from stream and notifies the callback of matched registered paths + */ + public void read(JsonParser parser, EvaluationCallback callback) + throws Exception + { + assert(callback != null); + + boolean needsPathCheck = false; + /* + if (null == curr && elements.empty()) { + // check for $ patterns + for (Path path : paths) { + if (path.checkForMatch(this)) { + matchedPaths.put(curr, path); + callback.resultFound(path); + rootMatch = path; + } + } + } + */ + while (parser.nextToken() != null) { + boolean saveMatch = false; + switch (parser.getCurrentToken()) { + case START_ARRAY: + { + if (curr != null) { + TokenStackElement newElem = new ArrayToken(); + curr.setValue(newElem); + curr = newElem; + } else { + curr = new ArrayToken(); + } + saveMatch = true; + needsPathCheck = true; + elements.push(curr); + break; + } + case END_ARRAY: + { + Path match = matchedPaths.remove(curr); + if (match != null) { + callback.resultFoundExit(match); + } + elements.pop(); + if (elements.empty()) curr = null; + else curr = elements.peek(); + break; + } + case VALUE_EMBEDDED_OBJECT: + case START_OBJECT: + { + if (curr != null && curr.getType() == TokenType.ARRAY_TOKEN) { + if (((ArrayToken)curr).getValue() != null && + matchedPaths.containsKey(curr)) + { + Path match = matchedPaths.remove(curr); + callback.resultFoundExit(match); + + if (match.checkForMatch(this)) { + + matchedPaths.put(curr, match); + callback.resultFound(match); + } + } + } else if (null == curr && elements.empty()) { + // check for $ patterns + for (Path path : paths) { + if (path.checkForMatch(this)) { + matchedPaths.put(curr, path); + callback.resultFound(path); + rootMatch = path; + } + } + } + + if (curr != null) { + TokenStackElement newElem = new ObjectToken(); + curr.setValue(newElem); + curr = newElem; + } else { + curr = new ObjectToken(); + } + saveMatch = true; + needsPathCheck = true; + elements.push(curr); + break; + } + case END_OBJECT: + { + if (!"$".equals(curr)) { + Path match = matchedPaths.remove(curr); + if (match != null) { + callback.resultFoundExit(match); + } + } else { + Path match = matchedPaths.get("$"); + if (match != null) { + callback.resultFoundExit(match); + } + } + elements.pop(); + if (elements.empty()) curr = null; + else curr = elements.peek(); + break; + } + case FIELD_NAME: + { + assert(curr instanceof ObjectToken); + ((ObjectToken)curr).key = parser.getText(); + break; + } + case VALUE_FALSE: + { + StringToken newToken = new StringToken("FALSE"); + curr.setValue(newToken); + needsPathCheck = true; + break; + } + case VALUE_TRUE: + { + StringToken newToken = new StringToken("TRUE"); + curr.setValue(newToken); + needsPathCheck = true; + break; + } + case VALUE_NUMBER_FLOAT: + { + FloatToken newToken = + new FloatToken((float)parser.getValueAsDouble()); + curr.setValue(newToken); + needsPathCheck = true; + break; + } + case VALUE_NUMBER_INT: + { + IntToken newToken = new IntToken(parser.getValueAsInt()); + curr.setValue(newToken); + needsPathCheck = true; + break; + } + case VALUE_STRING: + { + StringToken newToken = new StringToken(parser.getText()); + curr.setValue(newToken); + needsPathCheck = true; + break; + } + case VALUE_NULL: + { + curr.setValue(null); + needsPathCheck = true; + break; + } + default: + assert false; + } + // now check the paths for matches + if (needsPathCheck) { + for (Path path : paths) { + if (path.checkForMatch(this)) { + if (saveMatch) matchedPaths.put(curr, path); + callback.resultFound(path); + } + } + needsPathCheck = false; + } + + if (rootMatch != null && elements.empty()) { + callback.resultFoundExit(rootMatch); + rootMatch = null; + } + } + } + + public String toString() + { + StringBuilder sb = new StringBuilder(); + sb.append("Token Stack depth="); + sb.append(elements.size()); + for (TokenStackElement elem : elements) { + sb.append(" "); + sb.append(elem.toString()); + } + sb.append(" "); + if (!elements.empty()) sb.append(elements.peek().getValue()); + return sb.toString(); + } + + public Configuration configuration() + { + return conf; + } +} + +// End TokenStack.java + diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/TokenStackElement.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/TokenStackElement.java new file mode 100644 index 000000000..ea1027d14 --- /dev/null +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/TokenStackElement.java @@ -0,0 +1,17 @@ + +package com.jayway.jsonpath.internal.token; + +/** + * + * @author Hunter Payne + **/ +public interface TokenStackElement +{ + public TokenType getType(); // otherwise its an object + + public TokenStackElement getValue(); + + public void setValue(TokenStackElement elem); +} + +// End TokenStackElement.java diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/TokenType.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/TokenType.java new file mode 100644 index 000000000..d8af2b521 --- /dev/null +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/TokenType.java @@ -0,0 +1,17 @@ + +package com.jayway.jsonpath.internal.token; + +/** + * + * @author Hunter Payne + **/ +public enum TokenType +{ + ARRAY_TOKEN, + OBJECT_TOKEN, + STRING_TOKEN, + FLOAT_TOKEN, + INTEGER_TOKEN +} + +// End TokenType.java diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/token/WildcardPathToken.java b/json-path/src/main/java/com/jayway/jsonpath/internal/token/WildcardPathToken.java index 243c00c76..2e7bcc440 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/token/WildcardPathToken.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/token/WildcardPathToken.java @@ -44,6 +44,14 @@ public void evaluate(String currentPath, PathRef parent, Object model, Evaluatio } } + @Override + public boolean checkForMatch(TokenStack stack, int idx) + { + if (idx + 1 < stack.getStack().size()) { + return !isLeaf() && next().checkForMatch(stack, idx + 1); + } + return isLeaf(); + } @Override boolean isTokenDefinite() { diff --git a/json-path/src/test/java/com/jayway/jsonpath/CallbackRecorder.java b/json-path/src/test/java/com/jayway/jsonpath/CallbackRecorder.java new file mode 100644 index 000000000..1c8d49fc0 --- /dev/null +++ b/json-path/src/test/java/com/jayway/jsonpath/CallbackRecorder.java @@ -0,0 +1,60 @@ +package com.jayway.jsonpath; + +import java.util.List; +import java.util.ArrayList; + +import com.jayway.jsonpath.EvaluationCallback; +import com.jayway.jsonpath.internal.Path; + +public class CallbackRecorder implements EvaluationCallback { + + public static class CallbackEvent { + private Path path; + private boolean exit; + public CallbackEvent(Path path, boolean exit) { + this.path = path; + this.exit = exit; + } + + public Path getPath() { + return path; + } + + public boolean isExit() { + return exit; + } + + public boolean equals(Object o) { + if (o instanceof CallbackEvent) { + CallbackEvent other = (CallbackEvent)o; + return other.getPath() == path && other.isExit() == exit; + } + return false; + } + + public String toString() { + return path + " isexit=" + exit; + } + } + + private List results; + + public CallbackRecorder() { + + results = new ArrayList(); + } + + public void resultFound(Path path) { + System.err.println("found result " + path); + results.add(new CallbackEvent(path, false)); + } + + public void resultFoundExit(Path path) { + System.err.println("exiting result " + path); + results.add(new CallbackEvent(path, true)); + } + + public List getResults() { + return results; + } +} diff --git a/json-path/src/test/java/com/jayway/jsonpath/FilterTest.java b/json-path/src/test/java/com/jayway/jsonpath/FilterTest.java index 45956b527..b4cd6f40b 100644 --- a/json-path/src/test/java/com/jayway/jsonpath/FilterTest.java +++ b/json-path/src/test/java/com/jayway/jsonpath/FilterTest.java @@ -8,6 +8,7 @@ import java.util.Map; import java.util.regex.Pattern; +import com.jayway.jsonpath.internal.token.TokenStack; import static com.jayway.jsonpath.Criteria.where; import static com.jayway.jsonpath.Filter.filter; import static org.assertj.core.api.Assertions.assertThat; @@ -384,6 +385,11 @@ public boolean apply(PredicateContext ctx) { return i == 1; } + + //@Override + public boolean check(TokenStack stack, int idx) { + return false; + } }; assertThat(filter(where("string-key").eq("string").and("$").matches(p)).apply(createPredicateContext(json))).isEqualTo(true); } diff --git a/json-path/src/test/java/com/jayway/jsonpath/JacksonTest.java b/json-path/src/test/java/com/jayway/jsonpath/JacksonTest.java index 7799c9d7a..ea1641956 100644 --- a/json-path/src/test/java/com/jayway/jsonpath/JacksonTest.java +++ b/json-path/src/test/java/com/jayway/jsonpath/JacksonTest.java @@ -3,11 +3,20 @@ import org.junit.Test; import java.util.Date; +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.nio.charset.Charset; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonFactory; +import com.jayway.jsonpath.EvaluationCallback; +import com.jayway.jsonpath.internal.Path; +import com.jayway.jsonpath.internal.PathCompiler; +import com.jayway.jsonpath.internal.token.*; import static java.util.Collections.singletonMap; import static org.assertj.core.api.Assertions.assertThat; -public class JacksonTest extends BaseTest { +public class JacksonTest extends BaseTest implements EvaluationCallback { @Test public void an_object_can_be_mapped_to_pojo() { @@ -45,4 +54,1036 @@ public void jackson_converts_dates() { assertThat(date).isEqualTo(now); } + protected TokenStack stack = null; + protected CallbackRecorder recorder = null; + protected Path idPath = null; + protected int match = 0; + protected Path floatPath = null; + protected int floatMatch = 0; + protected Path intPath = null; + protected int intMatch = 0; + protected Path rootPath = null; + + @Test + public void streamingTest() throws Exception { + + Path path = + PathCompiler.compile("$..completed_tasks[0:]"); + idPath = + PathCompiler.compile("$..completed_tasks[0:].id"); + floatPath = + PathCompiler.compile("$..completed_tasks[0:].resources.cpus"); + intPath = + PathCompiler.compile("$..completed_tasks[0:].resources.mem"); + rootPath = PathCompiler.compile("$"); + stack = new TokenStack(JACKSON_CONFIGURATION); + + recorder = new CallbackRecorder(); + String res = "issue_76.json"; + InputStream stream = + getClass().getClassLoader().getResourceAsStream(res); + assert(stream != null); + + int count = 0; + JsonFactory factory = new JsonFactory(); + stack.registerPath(path); + stack.registerPath(idPath); + stack.registerPath(floatPath); + stack.registerPath(intPath); + stack.registerPath(rootPath); + stack.read(factory.createJsonParser(stream), this); + Thread.sleep(1000); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(rootPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(idPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(floatPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(intPath, false))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(path, true))); + assert(recorder.getResults().get(count++). + equals(new CallbackRecorder.CallbackEvent(rootPath, true))); + } + + public void resultFound(Path path) { + if (path == idPath) { + switch (match++) { + case 0: + checkResult(stack, "mesos-jenkins-172c6f74-12bc-44fe-849a-ad902ddc2b64"); + break; + case 1: + checkResult(stack, "mesos-jenkins-cd18b433-e2ee-4a4e-875b-6ea82d90a53a"); + break; + case 2: + checkResult(stack, "mesos-jenkins-66fca7c0-88f7-4a1a-9796-a6de2e337b0a"); + break; + case 3: + checkResult(stack, "mesos-jenkins-258ad47c-85bf-4fe0-b7c4-4f0cc70f2998"); + break; + case 4: + checkResult(stack, "mesos-jenkins-f30e5e34-2ef6-4993-9260-73ee3520c0a5"); + break; + case 5: + checkResult(stack, "mesos-jenkins-1fc0bbd8-f0ff-48cd-a7f7-24a9436ba6bc"); + break; + case 6: + checkResult(stack, "mesos-jenkins-62b44026-843d-4813-a6a8-e95215250bb1"); + break; + case 7: + checkResult(stack, "mesos-jenkins-807b9b8a-3283-4e78-94e1-9dc17df4df77"); + break; + case 8: + checkResult(stack, "test_dv_helloworld.95f49d05-c9bf-11e4-a1fc-56847afe9799"); + break; + case 9: + checkResult(stack, "test_dv_helloworld.a40abda6-ca02-11e4-a1fc-56847afe9799"); + break; + case 10: + checkResult(stack, "test_dv_helloworld.3946a287-ca67-11e4-a1fc-56847afe9799"); + break; + case 11: + checkResult(stack, "test_dv_helloworld.fec0c74c-ce11-11e4-a1fc-56847afe9799"); + break; + case 12: + checkResult(stack, "test_jenkins-master.33d4007e-cf37-11e4-a1fc-56847afe9799"); + break; + case 13: + checkResult(stack, "test_jenkins-master.359deb0f-cf37-11e4-a1fc-56847afe9799"); + break; + case 14: + checkResult(stack, "test_jenkins-master.50773d6a-cf37-11e4-a1fc-56847afe9799"); + break; + case 15: + checkResult(stack, "test_jenkins-master.638fd9ce-cf37-11e4-a1fc-56847afe9799"); + break; + case 16: + checkResult(stack, "test_jenkins-master.81fd2852-cf37-11e4-a1fc-56847afe9799"); + break; + case 17: + checkResult(stack, "test_jenkins-master.afedb77b-cf37-11e4-a1fc-56847afe9799"); + break; + case 18: + checkResult(stack, "test_jenkins-master.0243c011-cf38-11e4-a1fc-56847afe9799"); + break; + case 19: + checkResult(stack, "test_dv_helloworld.4bdb1099-d1de-11e4-a1fc-56847afe9799"); + break; + case 20: + checkResult(stack, "sdp_shared_jenkins-master.eb8f2863-c9a2-11e4-a1fc-56847afe9799"); + break; + case 21: + checkResult(stack, "test_dv_helloworld.c7865efb-cd05-11e4-a1fc-56847afe9799"); + break; + case 22: + checkResult(stack, "test_jenkins-master.37684ad0-cf37-11e4-a1fc-56847afe9799"); + break; + case 23: + checkResult(stack, "test_jenkins-master.3c2e3752-cf37-11e4-a1fc-56847afe9799"); + break; + case 24: + checkResult(stack, "test_jenkins-master.405b3f34-cf37-11e4-a1fc-56847afe9799"); + break; + case 25: + checkResult(stack, "test_jenkins-master.44886e26-cf37-11e4-a1fc-56847afe9799"); + break; + case 26: + checkResult(stack, "test_jenkins-master.54a4936b-cf37-11e4-a1fc-56847afe9799"); + break; + case 27: + checkResult(stack, "test_jenkins-master.58d1e96c-cf37-11e4-a1fc-56847afe9799"); + break; + case 28: + checkResult(stack, "test_jenkins-master.5d97fcfd-cf37-11e4-a1fc-56847afe9799"); + break; + case 29: + checkResult(stack, "test_jenkins-master.6986f34f-cf37-11e4-a1fc-56847afe9799"); + break; + case 30: + checkResult(stack, "test_jenkins-master.790a33f1-cf37-11e4-a1fc-56847afe9799"); + break; + case 31: + checkResult(stack, "test_jenkins-master.8c2149b3-cf37-11e4-a1fc-56847afe9799"); + break; + case 32: + checkResult(stack, "test_jenkins-master.9c3d47e4-cf37-11e4-a1fc-56847afe9799"); + break; + case 33: + checkResult(stack, "test_jenkins-master.a06a01a6-cf37-11e4-a1fc-56847afe9799"); + break; + case 34: + checkResult(stack, "test_jenkins-master.fa821fbd-cf37-11e4-a1fc-56847afe9799"); + break; + case 35: + checkResult(stack, "test_jenkins-master.fbb39ade-cf37-11e4-a1fc-56847afe9799"); + break; + case 36: + checkResult(stack, "test_jenkins-master.ffe0f0e0-cf37-11e4-a1fc-56847afe9799"); + break; + case 37: + checkResult(stack, "test_jenkins-master.04a68f42-cf38-11e4-a1fc-56847afe9799"); + break; + case 38: + checkResult(stack, "test_jenkins-master.4ce2cc09-cf37-11e4-a1fc-56847afe9799"); + break; + case 39: + checkResult(stack, "test_jenkins-master.a792e469-cf37-11e4-a1fc-56847afe9799"); + break; + case 40: + checkResult(stack, "test_jenkins-master.fe166a0f-cf37-11e4-a1fc-56847afe9799"); + break; + case 41: + checkResult(stack, "test_jenkins-master.0670c7f3-cf38-11e4-a1fc-56847afe9799"); + break; + case 42: + checkResult(stack, "test_dev_frontend.3950b432-d234-11e4-bc5e-56847afe9799"); + break; + case 43: + checkResult(stack, "test_dv_helloworld.c3a7d253-d241-11e4-bc5e-56847afe9799"); + break; + case 44: + checkResult(stack, "test_dv_helloworld.d7c6b3c4-d244-11e4-bc5e-56847afe9799"); + break; + case 45: + checkResult(stack, "test_dev_frontend.a0f3f185-d2e6-11e4-bc5e-56847afe9799"); + break; + } + } else if (path == floatPath) { + + switch (floatMatch++) { + case 0: + checkResult(stack, new Float(0.2)); + break; + case 1: + checkResult(stack, new Float(0.2)); + break; + case 2: + checkResult(stack, new Float(0.2)); + break; + case 3: + checkResult(stack, new Float(0.2)); + break; + case 4: + checkResult(stack, new Float(0.2)); + break; + case 5: + checkResult(stack, new Float(0.2)); + break; + case 6: + checkResult(stack, new Float(0.2)); + break; + case 7: + checkResult(stack, new Float(0.2)); + break; + case 8: + checkResult(stack, new Float(0.1)); + break; + case 9: + checkResult(stack, new Float(0.1)); + break; + case 10: + checkResult(stack, new Float(0.1)); + break; + case 11: + checkResult(stack, new Float(0.1)); + break; + case 12: + checkResult(stack, new Float(0.3)); + break; + case 13: + checkResult(stack, new Float(0.3)); + break; + case 14: + checkResult(stack, new Float(0.3)); + break; + case 15: + checkResult(stack, new Float(0.3)); + break; + case 16: + checkResult(stack, new Float(0.3)); + break; + case 17: + checkResult(stack, new Float(0.3)); + break; + case 18: + checkResult(stack, new Float(0.3)); + break; + case 19: + checkResult(stack, new Float(0.1)); + break; + case 20: + checkResult(stack, new Float(0.3)); + break; + case 21: + checkResult(stack, new Float(0.1)); + break; + case 22: + checkResult(stack, new Float(0.3)); + break; + case 23: + checkResult(stack, new Float(0.3)); + break; + case 24: + checkResult(stack, new Float(0.3)); + break; + case 25: + checkResult(stack, new Float(0.3)); + break; + case 26: + checkResult(stack, new Float(0.3)); + break; + case 27: + checkResult(stack, new Float(0.3)); + break; + case 28: + checkResult(stack, new Float(0.3)); + break; + case 29: + checkResult(stack, new Float(0.3)); + break; + case 30: + checkResult(stack, new Float(0.3)); + break; + case 31: + checkResult(stack, new Float(0.3)); + break; + case 32: + checkResult(stack, new Float(0.3)); + break; + case 33: + checkResult(stack, new Float(0.3)); + break; + case 34: + checkResult(stack, new Float(0.3)); + break; + case 35: + checkResult(stack, new Float(0.3)); + break; + case 36: + checkResult(stack, new Float(0.3)); + break; + case 37: + checkResult(stack, new Float(0.3)); + break; + case 38: + checkResult(stack, new Float(0.3)); + break; + case 39: + checkResult(stack, new Float(0.3)); + break; + case 40: + checkResult(stack, new Float(0.3)); + break; + case 41: + checkResult(stack, new Float(0.3)); + break; + case 42: + checkResult(stack, new Float(0.2)); + break; + case 43: + checkResult(stack, new Float(0.1)); + break; + case 44: + checkResult(stack, new Float(0.1)); + break; + case 45: + checkResult(stack, new Float(0.2)); + break; + default: + assert(false); + break; + } + } else if (path == intPath) { + + switch (intMatch++) { + case 0: + checkResult(stack, new Integer(704)); + break; + case 1: + checkResult(stack, new Integer(704)); + break; + case 2: + checkResult(stack, new Integer(704)); + break; + case 3: + checkResult(stack, new Integer(704)); + break; + case 4: + checkResult(stack, new Integer(704)); + break; + case 5: + checkResult(stack, new Integer(704)); + break; + case 6: + checkResult(stack, new Integer(704)); + break; + case 7: + checkResult(stack, new Integer(704)); + break; + case 8: + checkResult(stack, new Integer(32)); + break; + case 9: + checkResult(stack, new Integer(32)); + break; + case 10: + checkResult(stack, new Integer(32)); + break; + case 11: + checkResult(stack, new Integer(32)); + break; + case 12: + checkResult(stack, new Integer(768)); + break; + case 13: + checkResult(stack, new Integer(768)); + break; + case 14: + checkResult(stack, new Integer(768)); + break; + case 15: + checkResult(stack, new Integer(768)); + break; + case 16: + checkResult(stack, new Integer(768)); + break; + case 17: + checkResult(stack, new Integer(768)); + break; + case 18: + checkResult(stack, new Integer(768)); + break; + case 19: + checkResult(stack, new Integer(32)); + break; + case 20: + checkResult(stack, new Integer(768)); + break; + case 21: + checkResult(stack, new Integer(32)); + break; + case 22: + checkResult(stack, new Integer(768)); + break; + case 23: + checkResult(stack, new Integer(768)); + break; + case 24: + checkResult(stack, new Integer(768)); + break; + case 25: + checkResult(stack, new Integer(768)); + break; + case 26: + checkResult(stack, new Integer(768)); + break; + case 27: + checkResult(stack, new Integer(768)); + break; + case 28: + checkResult(stack, new Integer(768)); + break; + case 29: + checkResult(stack, new Integer(768)); + break; + case 30: + checkResult(stack, new Integer(768)); + break; + case 31: + checkResult(stack, new Integer(768)); + break; + case 32: + checkResult(stack, new Integer(768)); + break; + case 33: + checkResult(stack, new Integer(768)); + break; + case 34: + checkResult(stack, new Integer(768)); + break; + case 35: + checkResult(stack, new Integer(768)); + break; + case 36: + checkResult(stack, new Integer(768)); + break; + case 37: + checkResult(stack, new Integer(768)); + break; + case 38: + checkResult(stack, new Integer(768)); + break; + case 39: + checkResult(stack, new Integer(768)); + break; + case 40: + checkResult(stack, new Integer(768)); + break; + case 41: + checkResult(stack, new Integer(768)); + break; + case 42: + checkResult(stack, new Integer(1024)); + break; + case 43: + checkResult(stack, new Integer(32)); + break; + case 44: + checkResult(stack, new Integer(32)); + break; + case 45: + checkResult(stack, new Integer(1024)); + break; + default: + assert(false); + break; + } + } + recorder.resultFound(path); + } + + public void resultFoundExit(Path path) { + assert(path != idPath); + assert(path != floatPath); + assert(path != intPath); + recorder.resultFoundExit(path); + } + + protected void checkResult(TokenStack stack, Object expected) { + checkResult(stack.getStack().peek(), expected); + } + + protected void checkResult(TokenStackElement elem, Object expected) { + switch (elem.getType()) { + case STRING_TOKEN: + { + StringToken token = (StringToken)elem; + assert(token.value.equals(expected)); + break; + } + case FLOAT_TOKEN: + { + FloatToken token = (FloatToken)elem; + assert(expected instanceof Float); + assert(token.value == ((Float)expected).floatValue()); + break; + } + case INTEGER_TOKEN: + { + IntToken token = (IntToken)elem; + assert(expected instanceof Integer); + assert(token.value == ((Integer)expected).intValue()); + break; + } + case ARRAY_TOKEN: + case OBJECT_TOKEN: + { + checkResult(elem.getValue(), expected); + break; + } + default: + { + assert(false); + } + } + } } diff --git a/json-path/src/test/java/com/jayway/jsonpath/JacksonTest_Split.java b/json-path/src/test/java/com/jayway/jsonpath/JacksonTest_Split.java new file mode 100644 index 000000000..0ca786213 --- /dev/null +++ b/json-path/src/test/java/com/jayway/jsonpath/JacksonTest_Split.java @@ -0,0 +1,61 @@ +package com.jayway.jsonpath; + +import static org.junit.Assert.*; +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.core.JsonParseException; +import com.jayway.jsonpath.internal.Path; +import com.jayway.jsonpath.internal.PathCompiler; +import com.jayway.jsonpath.internal.token.TokenStack; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.junit.Test; + +public class JacksonTest_Split extends BaseTest implements EvaluationCallback { + + private static final Logger log = LoggerFactory.getLogger(JacksonTest_Split.class); + private List results = new ArrayList(); + + @Test + public void json_Test() throws Exception { + jsonSplit_Test(JACKSON_CONFIGURATION); + results.clear(); + jsonSplit_Test(JSON_SMART_CONFIGURATION); + results.clear(); + } + + private void jsonSplit_Test(Configuration jsonProviderCfg) + throws JsonParseException, IOException, Exception { + + try { + String res = "json_opsview1.json"; + InputStream stream = getClass().getClassLoader().getResourceAsStream(res); + Path path = PathCompiler.compile("$.list[*]"); + + TokenStack stack = new TokenStack(jsonProviderCfg); + + JsonFactory factory = new JsonFactory(); + stack.registerPath(path); + stack.read(factory.createParser(stream), this); + } finally { + log.debug("results: " + results.size()); + //assertTrue(results.size() == 96); + } + } + + @Override + public void resultFound(Path path) throws Exception { + //log.debug(source + ":" + String.valueOf(obj)); + //results.add(obj); + } + + @Override + public void resultFoundExit(Path path) throws Exception { + //log.debug(source + ":" + String.valueOf(obj)); + } +} diff --git a/json-path/src/test/java/com/jayway/jsonpath/PredicateTest.java b/json-path/src/test/java/com/jayway/jsonpath/PredicateTest.java index 62939070e..1855122a9 100644 --- a/json-path/src/test/java/com/jayway/jsonpath/PredicateTest.java +++ b/json-path/src/test/java/com/jayway/jsonpath/PredicateTest.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Map; +import com.jayway.jsonpath.internal.token.TokenStack; import static com.jayway.jsonpath.JsonPath.using; import static org.assertj.core.api.Assertions.assertThat; @@ -19,6 +20,11 @@ public void predicates_filters_can_be_applied() { public boolean apply(PredicateContext ctx) { return ctx.item(Map.class).containsKey("isbn"); } + + //@Override + public boolean check(TokenStack stack, int idx) { + return false; + } }; assertThat(reader.read("$.store.book[?].isbn", List.class, booksWithISBN)).containsOnly("0-395-19395-8", "0-553-21311-3"); diff --git a/json-path/src/test/java/com/jayway/jsonpath/old/FilterTest.java b/json-path/src/test/java/com/jayway/jsonpath/old/FilterTest.java index 07d386467..4636ccb2e 100644 --- a/json-path/src/test/java/com/jayway/jsonpath/old/FilterTest.java +++ b/json-path/src/test/java/com/jayway/jsonpath/old/FilterTest.java @@ -8,6 +8,7 @@ import com.jayway.jsonpath.JsonPath; import com.jayway.jsonpath.Predicate; import com.jayway.jsonpath.spi.json.JsonProvider; +import com.jayway.jsonpath.internal.token.TokenStack; import org.assertj.core.api.Assertions; import org.junit.Test; @@ -346,6 +347,10 @@ public boolean apply(PredicateContext ctx) { } return false; } + //@Override + public boolean check(TokenStack stack, int idx) { + return false; + } }; Filter rootChildFilter = filter(where("name").regex(Pattern.compile("rootChild_[A|B]"))); @@ -366,6 +371,10 @@ public void arrays_of_objects_can_be_filtered() throws Exception { public boolean apply(PredicateContext ctx) { return 1 == (Integer)ctx.item(); } + //@Override + public boolean check(TokenStack stack, int idx) { + return false; + } }; List res = JsonPath.read(doc, "$.items[?]", customFilter); diff --git a/json-path/src/test/resources/json_opsview1.json b/json-path/src/test/resources/json_opsview1.json new file mode 100644 index 000000000..17b03554f --- /dev/null +++ b/json-path/src/test/resources/json_opsview1.json @@ -0,0 +1,4572 @@ +{ + "summary":{ + "handled":"231", + "unhandled":"8", + "total":"239", + "service":{ + "critical":"3", + "ok":"135", + "handled":"135", + "unknown":"3", + "unhandled":"8", + "warning":"2", + "total":"143" + }, + "host":{ + "handled":"96", + "unhandled":"0", + "up":"96", + "total":"96" + } + }, + "list":[ + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.137: rta 0.226ms, lost 0%", + "state":"ok", + "service_object_id":"269", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415650", + "perfdata_available":"1" + } + ], + "name":"10.0.0.137", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.200: rta 0.256ms, lost 0%", + "state":"ok", + "service_object_id":"270", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415734", + "perfdata_available":"1" + } + ], + "name":"10.0.0.200", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.201: rta 0.203ms, lost 0%", + "state":"ok", + "service_object_id":"271", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415651", + "perfdata_available":"1" + } + ], + "name":"10.0.0.201", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.231: rta 0.504ms, lost 0%", + "state":"ok", + "service_object_id":"272", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415515", + "perfdata_available":"1" + } + ], + "name":"10.0.0.231", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.232: rta 0.418ms, lost 0%", + "state":"ok", + "service_object_id":"273", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415653", + "perfdata_available":"1" + } + ], + "name":"10.0.0.232", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"2", + "handled":"2", + "computed_state":"unknown", + "unknown":"3", + "unhandled":"3", + "total":"5" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.31: rta 0.879ms, lost 0%", + "state":"ok", + "service_object_id":"274", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415553", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128714", + "state_type":"hard", + "name":"Interface Status", + "current_check_attempt":"3", + "output":"Dependency failure: SNMP Agent is UNKNOWN", + "state":"unknown", + "service_object_id":"275", + "unhandled":"1", + "downtime":"0", + "last_check":"1442415533", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128654", + "state_type":"hard", + "name":"SNMP Agent", + "current_check_attempt":"3", + "output":"check_snmp_sysinfo UNKNOWN - SNMP parameter validation failed. Missing rocommunity!", + "state":"unknown", + "service_object_id":"276", + "unhandled":"1", + "downtime":"0", + "last_check":"1442415534", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128712", + "state_type":"hard", + "name":"Uptime", + "current_check_attempt":"3", + "output":"Dependency failure: SNMP Agent is UNKNOWN", + "state":"unknown", + "service_object_id":"277", + "unhandled":"1", + "downtime":"0", + "last_check":"1442415536", + "perfdata_available":"0" + }, + { + "max_check_attempts":"1", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Uptime Restart", + "current_check_attempt":"1", + "output":"Service assumed OK - no results received", + "state":"ok", + "service_object_id":"278", + "unhandled":"0", + "downtime":"0", + "last_check":"1441286896", + "perfdata_available":"0" + } + ], + "name":"10.0.0.31", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.31: rta 0.927ms, lost 0%", + "num_services":"5", + "downtime":"0", + "last_check":"1442415533", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.46: rta 0.491ms, lost 0%", + "state":"ok", + "service_object_id":"279", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415605", + "perfdata_available":"1" + } + ], + "name":"10.0.0.46", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"debian", + "state":"up", + "summary":{ + "critical":"1", + "handled":"0", + "computed_state":"critical", + "unhandled":"1", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"877719", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1050858", + "state_type":"hard", + "name":"SSH processes", + "current_check_attempt":"3", + "output":"Connection refused by host", + "state":"critical", + "service_object_id":"372", + "unhandled":"1", + "downtime":"0", + "last_check":"1442415632", + "perfdata_available":"0" + } + ], + "name":"10.0.0.67", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.67: rta 0.285ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1442415632", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.70: rta 0.256ms, lost 0%", + "state":"ok", + "service_object_id":"280", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415667", + "perfdata_available":"1" + } + ], + "name":"10.0.0.70", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"447594", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"447594", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.86: rta 0.459ms, lost 0%", + "state":"ok", + "service_object_id":"281", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415475", + "perfdata_available":"1" + } + ], + "name":"10.0.0.86", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.86: rta 0.112ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1441968173", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.93: rta 0.421ms, lost 0%", + "state":"ok", + "service_object_id":"282", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415521", + "perfdata_available":"1" + } + ], + "name":"10.0.0.93", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.6.1: rta 1.994ms, lost 0%", + "state":"ok", + "service_object_id":"283", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415730", + "perfdata_available":"1" + } + ], + "name":"10.0.6.1", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.6.176: rta 0.503ms, lost 0%", + "state":"ok", + "service_object_id":"286", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415521", + "perfdata_available":"1" + } + ], + "name":"aixdev2.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.150: rta 0.404ms, lost 0%", + "state":"ok", + "service_object_id":"287", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415509", + "perfdata_available":"1" + } + ], + "name":"bestraining5.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"93338", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"93338", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.75: rta 0.385ms, lost 0%", + "state":"ok", + "service_object_id":"288", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415730", + "perfdata_available":"1" + } + ], + "name":"bigip1.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.75: rta 0.192ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1442322429", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.77: rta 1.116ms, lost 0%", + "state":"ok", + "service_object_id":"289", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415560", + "perfdata_available":"1" + } + ], + "name":"build-linux64.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.76: rta 0.309ms, lost 0%", + "state":"ok", + "service_object_id":"290", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415670", + "perfdata_available":"1" + } + ], + "name":"buildserver01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.97: rta 0.193ms, lost 0%", + "state":"ok", + "service_object_id":"291", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415723", + "perfdata_available":"1" + } + ], + "name":"demoserver01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.25: rta 0.160ms, lost 0%", + "state":"ok", + "service_object_id":"292", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415674", + "perfdata_available":"1" + } + ], + "name":"demoserver02.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.51: rta 0.254ms, lost 0%", + "state":"ok", + "service_object_id":"293", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415736", + "perfdata_available":"1" + } + ], + "name":"devbes.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.89: rta 0.431ms, lost 0%", + "state":"ok", + "service_object_id":"294", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415674", + "perfdata_available":"1" + } + ], + "name":"devmodeller.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.6.162: rta 0.290ms, lost 0%", + "state":"ok", + "service_object_id":"295", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415501", + "perfdata_available":"1" + } + ], + "name":"devtest2.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"175471", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.3: rta 1.124ms, lost 0%", + "state":"ok", + "service_object_id":"296", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415496", + "perfdata_available":"1" + } + ], + "name":"dvr", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.3: rta 368.532ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1442239997", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.6.185: rta 0.233ms, lost 0%", + "state":"ok", + "service_object_id":"297", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415539", + "perfdata_available":"1" + } + ], + "name":"england.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.194: rta 0.288ms, lost 0%", + "state":"ok", + "service_object_id":"298", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415681", + "perfdata_available":"1" + } + ], + "name":"esxi5v1.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"101692", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"101692", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.49: rta 0.411ms, lost 0%", + "state":"ok", + "service_object_id":"284", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415475", + "perfdata_available":"1" + } + ], + "name":"HPCOMPAQ-JM-VIS.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.49: rta 0.274ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1442314075", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.68: rta 0.235ms, lost 0%", + "state":"ok", + "service_object_id":"299", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415472", + "perfdata_available":"1" + } + ], + "name":"interlinkdc01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.118: rta 0.312ms, lost 0%", + "state":"ok", + "service_object_id":"300", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415683", + "perfdata_available":"1" + } + ], + "name":"interlinkdc02.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.151: rta 0.350ms, lost 0%", + "state":"ok", + "service_object_id":"301", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415615", + "perfdata_available":"1" + } + ], + "name":"interlinkserv.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.6.188: rta 0.221ms, lost 0%", + "state":"ok", + "service_object_id":"302", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415682", + "perfdata_available":"1" + } + ], + "name":"ireland.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.63: rta 0.264ms, lost 0%", + "state":"ok", + "service_object_id":"285", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415470", + "perfdata_available":"1" + } + ], + "name":"ISS-HPOVOW.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.61: rta 0.453ms, lost 0%", + "state":"ok", + "service_object_id":"303", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415488", + "perfdata_available":"1" + } + ], + "name":"iss-hpovow2.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.24: rta 0.700ms, lost 0%", + "state":"ok", + "service_object_id":"304", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415685", + "perfdata_available":"1" + } + ], + "name":"moasi01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.126: rta 0.548ms, lost 0%", + "state":"ok", + "service_object_id":"305", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415545", + "perfdata_available":"1" + } + ], + "name":"mobes01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.114: rta 0.403ms, lost 0%", + "state":"ok", + "service_object_id":"306", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415688", + "perfdata_available":"1" + } + ], + "name":"mobes02.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.10: rta 0.189ms, lost 0%", + "state":"ok", + "service_object_id":"307", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415697", + "perfdata_available":"1" + } + ], + "name":"nasdev.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.7: rta 1.002ms, lost 0%", + "state":"ok", + "service_object_id":"308", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415693", + "perfdata_available":"1" + } + ], + "name":"netmonitor", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.40: rta 1.119ms, lost 0%", + "state":"ok", + "service_object_id":"309", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415613", + "perfdata_available":"1" + } + ], + "name":"nexus.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.208: rta 0.290ms, lost 0%", + "state":"ok", + "service_object_id":"310", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415692", + "perfdata_available":"1" + } + ], + "name":"nndev1.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.196: rta 0.250ms, lost 0%", + "state":"ok", + "service_object_id":"311", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415525", + "perfdata_available":"1" + } + ], + "name":"nndev2.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.52: rta 0.483ms, lost 0%", + "state":"ok", + "service_object_id":"312", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415695", + "perfdata_available":"1" + } + ], + "name":"nndev3.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.62: rta 0.284ms, lost 0%", + "state":"ok", + "service_object_id":"313", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415537", + "perfdata_available":"1" + } + ], + "name":"nndev4b.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.222: rta 0.414ms, lost 0%", + "state":"ok", + "service_object_id":"314", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415697", + "perfdata_available":"1" + } + ], + "name":"opbridgeasi01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.122: rta 0.457ms, lost 0%", + "state":"ok", + "service_object_id":"315", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415655", + "perfdata_available":"1" + } + ], + "name":"opbridgebes01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.132: rta 0.459ms, lost 0%", + "state":"ok", + "service_object_id":"316", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415703", + "perfdata_available":"1" + } + ], + "name":"opbridgebes02.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.127: rta 0.373ms, lost 0%", + "state":"ok", + "service_object_id":"317", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415552", + "perfdata_available":"1" + } + ], + "name":"opbridgedb01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.120: rta 0.573ms, lost 0%", + "state":"ok", + "service_object_id":"318", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415702", + "perfdata_available":"1" + } + ], + "name":"opbridgescm01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.153: rta 0.461ms, lost 0%", + "state":"ok", + "service_object_id":"319", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415692", + "perfdata_available":"1" + } + ], + "name":"openaudit.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"opsview", + "state":"up", + "summary":{ + "critical":"2", + "ok":"36", + "handled":"36", + "computed_state":"critical", + "unhandled":"4", + "warning":"2", + "total":"40" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1481991", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - localhost: rta 0.022ms, lost 0%", + "state":"ok", + "service_object_id":"135", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415506", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"CPU statistics", + "current_check_attempt":"1", + "output":"OK: utilization:1.4%,guest:0.0%,iowait:0.1%,irq:0.0%,nice:0.0%,softirq:0.0%,steal:0.0%,system:0.4%,user:0.9%", + "state":"ok", + "service_object_id":"134", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415488", + "perfdata_available":"1" + }, + { + "max_check_attempts":"2", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Defunct ndo2db Processes", + "current_check_attempt":"1", + "output":"PROCS OK: 0 processes with UID = 498 (nagios), STATE = Z, command name 'ndo2d'", + "state":"ok", + "service_object_id":"136", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415503", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Disk: /", + "current_check_attempt":"1", + "output":"DISK OK - free space: / 22697 MB (88% inode=95%):", + "state":"ok", + "service_object_id":"137", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415507", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Disk: /opt/opsview/work/", + "current_check_attempt":"1", + "output":"DISK OK - free space: / 22697 MB (88% inode=95%):", + "state":"ok", + "service_object_id":"138", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415516", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Disk: /tmp", + "current_check_attempt":"1", + "output":"DISK OK - free space: / 22697 MB (88% inode=95%):", + "state":"ok", + "service_object_id":"139", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415524", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Disk: /usr/local/nagios/var", + "current_check_attempt":"1", + "output":"DISK OK - free space: / 22697 MB (88% inode=95%):", + "state":"ok", + "service_object_id":"140", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415533", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Disk: /usr/local/nagios/var/backups", + "current_check_attempt":"1", + "output":"DISK OK - free space: / 22697 MB (88% inode=95%):", + "state":"ok", + "service_object_id":"141", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415542", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Disk: /var/log/opsview/", + "current_check_attempt":"1", + "output":"DISK OK - free space: / 22697 MB (88% inode=95%):", + "state":"ok", + "service_object_id":"142", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415567", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Disk: /var/opt/opsview", + "current_check_attempt":"1", + "output":"DISK OK - free space: / 22697 MB (88% inode=95%):", + "state":"ok", + "service_object_id":"143", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415575", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Nagios Core Processes", + "current_check_attempt":"1", + "output":"PROCS OK: 6 processes with command name 'nagios'", + "state":"ok", + "service_object_id":"144", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415562", + "perfdata_available":"1" + }, + { + "max_check_attempts":"1", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Nagios Core Startup", + "current_check_attempt":"1", + "output":"Nagios started up in 0 seconds", + "state":"ok", + "service_object_id":"145", + "unhandled":"0", + "downtime":"0", + "last_check":"1442413466", + "perfdata_available":"1" + }, + { + "max_check_attempts":"1", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Nagios Core Stats", + "current_check_attempt":"1", + "output":"NAGIOSTATS OK", + "state":"ok", + "service_object_id":"146", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415275", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Opsview Agent", + "current_check_attempt":"1", + "output":"NRPE v2.14 (OpsviewAgent 4.6.3.0: osname=Linux: osvers=2.6.32-573.3.1.el6.x86_64: desc=CentOS release 6.7 (Final))", + "state":"ok", + "service_object_id":"147", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415581", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Opsview Application Processes", + "current_check_attempt":"1", + "output":"PROCS OK: 1 process with args 'opsview_web_server'", + "state":"ok", + "service_object_id":"148", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415594", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Opsview Application Server", + "current_check_attempt":"1", + "output":"TCP OK - 0.001 second response time on localhost port 3000", + "state":"ok", + "service_object_id":"149", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415602", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"533862", + "state_type":"hard", + "name":"Opsview Application Status", + "current_check_attempt":"3", + "output":"opsview CRITICAL (critical=1)\nopsview (errors=1):\n CRITICAL opsview::Opsview Login", + "state":"critical", + "service_object_id":"150", + "unhandled":"1", + "downtime":"0", + "last_check":"1442415726", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Opsview Daemon", + "current_check_attempt":"1", + "output":"TCP OK - 0.001 second response time on socket /usr/local/nagios/var/rw/opsviewd.cmd", + "state":"ok", + "service_object_id":"154", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415643", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Opsview Data Warehouse Status", + "current_check_attempt":"1", + "output":"ODW_STATUS OK - Last updated: 2015-09-16T15:00:00", + "state":"ok", + "service_object_id":"155", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415342", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481796", + "state_type":"hard", + "name":"Opsview DB Connections", + "current_check_attempt":"1", + "output":"MYSQL_PERFORMANCE OK - All parameters OK", + "state":"ok", + "service_object_id":"151", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415673", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481789", + "state_type":"hard", + "name":"Opsview DB Performance", + "current_check_attempt":"1", + "output":"MYSQL_PERFORMANCE OK - All parameters OK", + "state":"ok", + "service_object_id":"152", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415683", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Opsview DB Status", + "current_check_attempt":"1", + "output":"Uptime: 1656668 Threads: 15 Questions: 6752975 Slow queries: 0 Opens: 29112 Flush tables: 1 Open tables: 64 Queries per second avg: 4.76", + "state":"ok", + "service_object_id":"153", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415631", + "perfdata_available":"1" + }, + { + "max_check_attempts":"2", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Opsview Graphing Import", + "current_check_attempt":"1", + "output":"LOGS OK - Oldest log file is 0 seconds old, 0 files backlogged", + "state":"ok", + "service_object_id":"156", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415350", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"358364", + "state_type":"hard", + "name":"Opsview Housekeeping Cronjob Monitor", + "current_check_attempt":"1", + "output":"CRONJOBS OK - Housekeeping cronjob last successfully ran 9 hours ago", + "state":"ok", + "service_object_id":"158", + "unhandled":"0", + "downtime":"0", + "last_check":"1442403003", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"358356", + "state_type":"hard", + "name":"Opsview Housekeeping Monitor", + "current_check_attempt":"1", + "output":"HOUSEKEEP OK - Housekeeping script last successfully ran 9 hours ago", + "state":"ok", + "service_object_id":"159", + "unhandled":"0", + "downtime":"0", + "last_check":"1442403011", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"534019", + "state_type":"hard", + "name":"Opsview HTTP", + "current_check_attempt":"3", + "output":"HTTP WARNING: HTTP/1.1 403 Forbidden - 5159 bytes in 0.002 second response time", + "state":"warning", + "service_object_id":"157", + "unhandled":"1", + "downtime":"0", + "last_check":"1442415568", + "perfdata_available":"1" + }, + { + "max_check_attempts":"2", + "markdown":"0", + "state_duration":"704189", + "state_type":"hard", + "name":"Opsview License Checks", + "current_check_attempt":"2", + "output":"LICENSE_EXPIRY WARNING - Opsview 30 Day Trial is valid until 2015-09-26 23:59:59", + "state":"warning", + "service_object_id":"160", + "unhandled":"1", + "downtime":"0", + "last_check":"1442402838", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"534078", + "state_type":"hard", + "name":"Opsview Login", + "current_check_attempt":"3", + "output":"HTTP CRITICAL: HTTP/1.1 404 Not Found - string 'login_username' not found on 'http://localhost:80/login' - 458 bytes in 0.008 second response time", + "state":"critical", + "service_object_id":"161", + "unhandled":"1", + "downtime":"0", + "last_check":"1442415509", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Opsview NDO", + "current_check_attempt":"1", + "output":"NDO OK - 0 ndo files backlogged", + "state":"ok", + "service_object_id":"162", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415693", + "perfdata_available":"1" + }, + { + "max_check_attempts":"2", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Opsview Updates", + "current_check_attempt":"1", + "output":"UPDATES OK - Survey information sent", + "state":"ok", + "service_object_id":"163", + "unhandled":"0", + "downtime":"0", + "last_check":"1442402801", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Read-only Partitions: /", + "current_check_attempt":"1", + "output":"RO_MOUNTS OK: No ro mounts found", + "state":"ok", + "service_object_id":"164", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415716", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Read-only Partitions: /opt/opsview/work/", + "current_check_attempt":"1", + "output":"RO_MOUNTS OK: No ro mounts found", + "state":"ok", + "service_object_id":"165", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415717", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Read-only Partitions: /tmp", + "current_check_attempt":"1", + "output":"RO_MOUNTS OK: No ro mounts found", + "state":"ok", + "service_object_id":"166", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415727", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Read-only Partitions: /usr/local/nagios/var", + "current_check_attempt":"1", + "output":"RO_MOUNTS OK: No ro mounts found", + "state":"ok", + "service_object_id":"167", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415735", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Read-only Partitions: /usr/local/nagios/var/backups", + "current_check_attempt":"1", + "output":"RO_MOUNTS OK: No ro mounts found", + "state":"ok", + "service_object_id":"168", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415743", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Read-only Partitions: /var/log/opsview/", + "current_check_attempt":"1", + "output":"RO_MOUNTS OK: No ro mounts found", + "state":"ok", + "service_object_id":"169", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415747", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Read-only Partitions: /var/opt/opsview", + "current_check_attempt":"1", + "output":"RO_MOUNTS OK: No ro mounts found", + "state":"ok", + "service_object_id":"170", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415757", + "perfdata_available":"0" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Unix Load Average", + "current_check_attempt":"1", + "output":"OK - load average: 0.00, 0.00, 0.00", + "state":"ok", + "service_object_id":"171", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415468", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Unix Memory", + "current_check_attempt":"1", + "output":"Usage: real 51% (962/1869 MB), buffer: 148 MB, cache: 540 MB, swap: 1% (32/3072 MB)", + "state":"ok", + "service_object_id":"172", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415471", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1481991", + "state_type":"hard", + "name":"Unix Swap", + "current_check_attempt":"1", + "output":"SWAP OK - 99% free (3040 MB out of 3071 MB)", + "state":"ok", + "service_object_id":"173", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415482", + "perfdata_available":"1" + } + ], + "name":"opsview", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - localhost: rta 0.026ms, lost 0%", + "num_services":"40", + "downtime":"0", + "last_check":"1442415726", + "alias":"Opsview Master Server" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.6.135: rta 0.246ms, lost 0%", + "state":"ok", + "service_object_id":"320", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415703", + "perfdata_available":"1" + } + ], + "name":"penne.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.165: rta 0.423ms, lost 0%", + "state":"ok", + "service_object_id":"321", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415584", + "perfdata_available":"1" + } + ], + "name":"publicrepo.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.143: rta 0.298ms, lost 0%", + "state":"ok", + "service_object_id":"322", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415704", + "perfdata_available":"1" + } + ], + "name":"reposerver01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.125: rta 0.416ms, lost 0%", + "state":"ok", + "service_object_id":"323", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415671", + "perfdata_available":"1" + } + ], + "name":"rhel6-rsbes1.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"589802", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"589802", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.254: rta 0.604ms, lost 0%", + "state":"ok", + "service_object_id":"324", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415465", + "perfdata_available":"1" + } + ], + "name":"router.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.254: rta 0.519ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1441825965", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.9: rta 0.316ms, lost 0%", + "state":"ok", + "service_object_id":"325", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415522", + "perfdata_available":"1" + } + ], + "name":"routerguest.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.141: rta 0.381ms, lost 0%", + "state":"ok", + "service_object_id":"326", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415707", + "perfdata_available":"1" + } + ], + "name":"scm-14-dev-lj.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.182: rta 0.237ms, lost 0%", + "state":"ok", + "service_object_id":"327", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415543", + "perfdata_available":"1" + } + ], + "name":"sfui.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.35: rta 0.224ms, lost 0%", + "state":"ok", + "service_object_id":"328", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415712", + "perfdata_available":"1" + } + ], + "name":"sharepoint01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.1: rta 1.940ms, lost 0%", + "state":"ok", + "service_object_id":"329", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415492", + "perfdata_available":"1" + } + ], + "name":"switch48gig.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"122095", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.170: rta 0.301ms, lost 0%", + "state":"ok", + "service_object_id":"330", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415472", + "perfdata_available":"1" + } + ], + "name":"testingserver02.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.170: rta 0.255ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1442293618", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.149: rta 0.502ms, lost 0%", + "state":"ok", + "service_object_id":"331", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415533", + "perfdata_available":"1" + } + ], + "name":"testlink.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.57: rta 0.430ms, lost 0%", + "state":"ok", + "service_object_id":"332", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415714", + "perfdata_available":"1" + } + ], + "name":"ubu-nagios.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"607069", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"607069", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.19: rta 0.442ms, lost 0%", + "state":"ok", + "service_object_id":"333", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415599", + "perfdata_available":"1" + } + ], + "name":"ubustwdata.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.19: rta 0.304ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1441808698", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"424372", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"239811", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.190: rta 0.302ms, lost 0%", + "state":"ok", + "service_object_id":"334", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415656", + "perfdata_available":"1" + } + ], + "name":"vm-2k3-mq701.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.190: rta 0.236ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1442175902", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"93274", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"93274", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.81: rta 0.461ms, lost 0%", + "state":"ok", + "service_object_id":"335", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415493", + "perfdata_available":"1" + } + ], + "name":"vm-2k8nnmi910.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.81: rta 0.220ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1442322493", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.17: rta 0.459ms, lost 0%", + "state":"ok", + "service_object_id":"336", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415719", + "perfdata_available":"1" + } + ], + "name":"vm-backup.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"206462", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"132902", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.14: rta 0.369ms, lost 0%", + "state":"ok", + "service_object_id":"337", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415465", + "perfdata_available":"1" + } + ], + "name":"vm-dhhsbctest2.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.14: rta 0.320ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1442282812", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.18: rta 0.131ms, lost 0%", + "state":"ok", + "service_object_id":"338", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415720", + "perfdata_available":"1" + } + ], + "name":"vm-intbes36.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.28: rta 0.159ms, lost 0%", + "state":"ok", + "service_object_id":"339", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415707", + "perfdata_available":"1" + } + ], + "name":"vm-intbes37.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"179923", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"179923", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.71: rta 0.186ms, lost 0%", + "state":"ok", + "service_object_id":"340", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415544", + "perfdata_available":"1" + } + ], + "name":"vm-linbppm96.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.71: rta 0.168ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1442235844", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"833351", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"644591", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.27: rta 0.249ms, lost 0%", + "state":"ok", + "service_object_id":"341", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415576", + "perfdata_available":"1" + } + ], + "name":"vm-linfc3.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.27: rta 0.241ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1441771119", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.23: rta 0.396ms, lost 0%", + "state":"ok", + "service_object_id":"342", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415727", + "perfdata_available":"1" + } + ], + "name":"vm-linux-bes36.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.96: rta 0.122ms, lost 0%", + "state":"ok", + "service_object_id":"343", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415503", + "perfdata_available":"1" + } + ], + "name":"vm-mingw.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.54: rta 0.147ms, lost 0%", + "state":"ok", + "service_object_id":"344", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415727", + "perfdata_available":"1" + } + ], + "name":"vm-mvnint01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"5", + "handled":"5", + "computed_state":"ok", + "unhandled":"0", + "total":"5" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.100: rta 0.022ms, lost 0%", + "state":"ok", + "service_object_id":"346", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415731", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"CPU statistics", + "current_check_attempt":"1", + "output":"OK: utilization:1.2%,guest:0.0%,iowait:0.1%,irq:0.0%,nice:0.0%,softirq:0.0%,steal:0.0%,system:0.4%,user:0.7%", + "state":"ok", + "service_object_id":"345", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415637", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Unix Load Average", + "current_check_attempt":"1", + "output":"OK - load average: 0.00, 0.00, 0.00", + "state":"ok", + "service_object_id":"347", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415727", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Unix Memory", + "current_check_attempt":"1", + "output":"Usage: real 51% (962/1869 MB), buffer: 148 MB, cache: 540 MB, swap: 1% (32/3072 MB)", + "state":"ok", + "service_object_id":"348", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415732", + "perfdata_available":"1" + }, + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Unix Swap", + "current_check_attempt":"1", + "output":"SWAP OK - 99% free (3040 MB out of 3071 MB)", + "state":"ok", + "service_object_id":"349", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415515", + "perfdata_available":"1" + } + ], + "name":"vm-opsview4.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"5", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.228: rta 0.432ms, lost 0%", + "state":"ok", + "service_object_id":"350", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415737", + "perfdata_available":"1" + } + ], + "name":"vm-oracle-asi.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"424392", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"424392", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.37: rta 0.246ms, lost 0%", + "state":"ok", + "service_object_id":"351", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415576", + "perfdata_available":"1" + } + ], + "name":"vm-rhel54int.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.37: rta 0.160ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1441991375", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.69: rta 0.252ms, lost 0%", + "state":"ok", + "service_object_id":"352", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415736", + "perfdata_available":"1" + } + ], + "name":"vm-rhel6.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"576896", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.224: rta 0.306ms, lost 0%", + "state":"ok", + "service_object_id":"353", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415473", + "perfdata_available":"1" + } + ], + "name":"vm-xpprox86-scm32", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.224: rta 0.258ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1441838814", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"206249", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"206249", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.102: rta 0.470ms, lost 0%", + "state":"ok", + "service_object_id":"354", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415619", + "perfdata_available":"1" + } + ], + "name":"vmasitest02.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.102: rta 0.241ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1442209518", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"206414", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"206414", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.88: rta 0.361ms, lost 0%", + "state":"ok", + "service_object_id":"355", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415753", + "perfdata_available":"1" + } + ], + "name":"vmscmtest01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"OK - 10.0.0.88: rta 0.213ms, lost 0%", + "num_services":"1", + "downtime":"0", + "last_check":"1442209353", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.103: rta 0.305ms, lost 0%", + "state":"ok", + "service_object_id":"356", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415742", + "perfdata_available":"1" + } + ], + "name":"vmwareserv01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.91: rta 0.307ms, lost 0%", + "state":"ok", + "service_object_id":"357", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415697", + "perfdata_available":"1" + } + ], + "name":"vostro400-vm.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.8: rta 0.367ms, lost 0%", + "state":"ok", + "service_object_id":"358", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415741", + "perfdata_available":"1" + } + ], + "name":"vpnserv.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.6.10: rta 0.214ms, lost 0%", + "state":"ok", + "service_object_id":"359", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415693", + "perfdata_available":"1" + } + ], + "name":"wales.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.229: rta 0.461ms, lost 0%", + "state":"ok", + "service_object_id":"360", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415743", + "perfdata_available":"1" + } + ], + "name":"win-4gf3ii79ngf.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.20: rta 0.374ms, lost 0%", + "state":"ok", + "service_object_id":"361", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415724", + "perfdata_available":"1" + } + ], + "name":"win-ibm-tep.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.6.167: rta 0.340ms, lost 0%", + "state":"ok", + "service_object_id":"362", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415747", + "perfdata_available":"1" + } + ], + "name":"wshpdev.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.16: rta 0.246ms, lost 0%", + "state":"ok", + "service_object_id":"363", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415513", + "perfdata_available":"1" + } + ], + "name":"xenbackup01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.83: rta 0.229ms, lost 0%", + "state":"ok", + "service_object_id":"364", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415752", + "perfdata_available":"1" + } + ], + "name":"xenbuild01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.107: rta 3.002ms, lost 0%", + "state":"ok", + "service_object_id":"365", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415681", + "perfdata_available":"1" + } + ], + "name":"xendev02.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.106: rta 0.221ms, lost 0%", + "state":"ok", + "service_object_id":"366", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415752", + "perfdata_available":"1" + } + ], + "name":"xendev03.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.15: rta 0.138ms, lost 0%", + "state":"ok", + "service_object_id":"367", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415471", + "perfdata_available":"1" + } + ], + "name":"xenint01", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.110: rta 0.274ms, lost 0%", + "state":"ok", + "service_object_id":"368", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415752", + "perfdata_available":"1" + } + ], + "name":"xenopdesk01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.113: rta 2.371ms, lost 0%", + "state":"ok", + "service_object_id":"369", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415711", + "perfdata_available":"1" + } + ], + "name":"xenserver00.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + }, + { + "icon":"server", + "state":"up", + "summary":{ + "ok":"1", + "handled":"1", + "computed_state":"ok", + "unhandled":"0", + "total":"1" + }, + "unhandled":"0", + "max_check_attempts":"2", + "num_interfaces":"0", + "state_duration":"1128871", + "services":[ + { + "max_check_attempts":"3", + "markdown":"0", + "state_duration":"1128871", + "state_type":"hard", + "name":"Connectivity - LAN", + "current_check_attempt":"1", + "output":"OK - 10.0.0.34: rta 1.142ms, lost 0%", + "state":"ok", + "service_object_id":"370", + "unhandled":"0", + "downtime":"0", + "last_check":"1442415755", + "perfdata_available":"1" + } + ], + "name":"xenserver01.int-link.com", + "state_type":"hard", + "current_check_attempt":"1", + "output":"Host assumed UP - no results received", + "num_services":"1", + "downtime":"0", + "last_check":"1441286896", + "alias":"" + } + ] +} \ No newline at end of file