diff --git a/example.sh b/example.sh index fd278da..0b44457 100755 --- a/example.sh +++ b/example.sh @@ -14,13 +14,13 @@ ARGS=$2 # Execute set -ex -CURL="/usr/bin/curl $2 -q -f" +CURL="/usr/bin/curl $2 -s -f" # GET Hosts # $CURL -X POST -d '{"method": "GET", "table": "hosts", "columns": ["name", "address"]}' $SERVER/v1/raw # Same Request but with table endpoint -$CURL "$SERVER/v1/table/hosts?columns=name,address" +$CURL "$SERVER/v1/table/hosts?columns=name,address&limit=1" # GET Hosts with limit # $CURL -X POST -d '{"method": "GET", "table": "hosts", "columns": ["name", "address", "groups"], "limit": 3}' $SERVER/v1/raw @@ -32,4 +32,10 @@ $CURL "$SERVER/v1/table/hosts?columns=name&column=address&column=groups&limit=3" # $CURL -X POST -d '{"method": "GET", "table": "hosts", "query": [["Stats", "state >= 0"], ["Stats", "state > 0"], ["Stats", "scheduled_downtime_depth = 0"], ["StatsAnd", "2"], ["Stats", "state > 0"], ["Stats", "scheduled_downtime_depth = 0"], ["Stats", "acknowledged = 0"], ["StatsAnd", "3"], ["Stats", "host_staleness >= 1.5"], ["Stats", "host_scheduled_downtime_depth = 0"], ["StatsAnd", "2"]]}' $SERVER/v1/raw # Tactical overview data :) -$CURL $SERVER/v1/stats/tactical_overview \ No newline at end of file +$CURL "$SERVER/v1/stats/tactical_overview" + +# Services +$CURL "$SERVER/v1/table/services?limit=1&filter=service_unhandled" + +# Services by hostname +$CURL "$SERVER/v1/table/services?filter=Filter%3A%20host_name%20%3D%20checkmk01.%2A" \ No newline at end of file diff --git a/lql/v1table.go b/lql/v1table.go index 2bb917e..013490a 100644 --- a/lql/v1table.go +++ b/lql/v1table.go @@ -24,6 +24,7 @@ func init() { "parents", } v1TableColumns["services"] = []string{ + "state", "host_name", "display_name", "description",