{"action":"opened","issue":{"url":"https://api.github.com/repos/prometheus/nagios_plugins/issues/6","labels_url":"https://api.github.com/repos/prometheus/nagios_plugins/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/nagios_plugins/issues/6/comments","events_url":"https://api.github.com/repos/prometheus/nagios_plugins/issues/6/events","html_url":"https://github.com/prometheus/nagios_plugins/issues/6","id":125423342,"number":6,"title":"Getting parse error","user":{"login":"nickvth","id":7606465,"avatar_url":"https://avatars.githubusercontent.com/u/7606465?v=3","gravatar_id":"","url":"https://api.github.com/users/nickvth","html_url":"https://github.com/nickvth","followers_url":"https://api.github.com/users/nickvth/followers","following_url":"https://api.github.com/users/nickvth/following{/other_user}","gists_url":"https://api.github.com/users/nickvth/gists{/gist_id}","starred_url":"https://api.github.com/users/nickvth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickvth/subscriptions","organizations_url":"https://api.github.com/users/nickvth/orgs","repos_url":"https://api.github.com/users/nickvth/repos","events_url":"https://api.github.com/users/nickvth/events{/privacy}","received_events_url":"https://api.github.com/users/nickvth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-07T16:06:22Z","updated_at":"2016-01-07T16:06:22Z","closed_at":null,"body":"[root@apps1 nagios_plugins]# ./check_prometheus_metric.sh -H 'http://localhost' -q 'count(consul_health_service_status{service=\"test\"}) - sum(consul_health_service_status{service=\"test\"})' -c 2 -w 1 -n test\r\nUNKNOWN - unable to parse prometheus response\r\ntest is {};0;1452182545.297\r\n\r\n\r\nwhen sh -x \r\n++ get_prometheus_result\r\n++ local _PROMETHEUS_CMD\r\n++ local _RESULT\r\n++ printf -v _PROMETHEUS_CMD '%s -server=%s -timeout=%s query' '/bin/docker run --rm -ti prom/prometheus-cli' http://localhost 30s\r\n+++ /bin/docker run --rm -ti prom/prometheus-cli -server=http://localhost -timeout=30s query 'count(consul_health_service_status{service=\"test\"}) - sum(consul_health_service_status{service=\"test\"})'\r\n'+ _RESULT='{};0;1452182314.599\r\n =~ ^-?[0-9]+\\.?[0-9]*$ ]]\r\n++ case \"$_RESULT\" in\r\n'+ printf %s '{};0;1452182314.599\r\n' PROMETHEUS_RESULT='{};0;1452182314.599\r\n =~ ^-?[0-9]+$ ]]314.599\r\n+ [[ false = \\t\\r\\u\\e ]]\r\n+ NAGIOS_SHORT_TEXT='unable to parse prometheus response'\r\n' NAGIOS_LONG_TEXT='test is {};0;1452182314.599\r\n+ exit\r\n+ on_exit\r\n+ [[ -z '' ]]\r\n+ NAGIOS_STATUS=UNKNOWN\r\n+ [[ -z unable to parse prometheus response ]]\r\n+ printf '%s - %s\\n' UNKNOWN 'unable to parse prometheus response'\r\nUNKNOWN - unable to parse prometheus response\r\n ]][ -n test is {};0;1452182314.599\r\n' printf '%s\\n' 'test is {};0;1452182314.599\r\ntest is {};0;1452182314.599\r\n+ exit 3"}}