]> granicus.if.org Git - icinga2/blobdiff - doc/15-troubleshooting.md
ITL by_ssh add -E parameter
[icinga2] / doc / 15-troubleshooting.md
index 9058e8745e742a2b1b50b65762cbfcd4ad13c172..c0fad94f612b93eb4c28b4bd67d348ce36f348cd 100644 (file)
@@ -296,7 +296,7 @@ on the name:
 
 ```
 $ curl -k -s -u root:icinga -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST 'https://localhost:5665/v1/objects/services' \
--d '{ "filter": "regex(pattern, service.name)", "filter_vars": { "pattern": "^http" }, "attrs": [ "__name", "last_check_result" ] }' | python -m json.tool
+-d '{ "filter": "regex(pattern, service.name)", "filter_vars": { "pattern": "^http" }, "attrs": [ "__name", "last_check_result" ], "pretty": true }'
 {
     "results": [
         {
@@ -369,7 +369,7 @@ The feature 'checker' is already enabled.
 Fetch all check result events matching the `event.service` name `random`:
 
 ```
-$ curl -k -s -u root:icinga -X POST 'https://localhost:5665/v1/events?queue=debugchecks&types=CheckResult&filter=match%28%22random*%22,event.service%29'
+$ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/events?queue=debugchecks&types=CheckResult&filter=match%28%22random*%22,event.service%29'
 ```
 
 
@@ -388,7 +388,7 @@ Example for retrieving the check source from all `disk` services using a
 
 ```
 $ curl -k -s -u root:icinga -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST 'https://localhost:5665/v1/objects/services' \
--d '{ "filter": "regex(pattern, service.name)", "filter_vars": { "pattern": "^disk" }, "attrs": [ "__name", "last_check_result" ] }' | python -m json.tool
+-d '{ "filter": "regex(pattern, service.name)", "filter_vars": { "pattern": "^disk" }, "attrs": [ "__name", "last_check_result" ], "pretty": true }'
 {
     "results": [
         {
@@ -547,7 +547,7 @@ The REST API provides the [status](12-icinga2-api.md#icinga2-api-status) URL end
 on Icinga and its features.
 
 ```
-# curl -k -s -u root:icinga 'https://localhost:5665/v1/status' | python -m json.tool | less
+# curl -k -s -u root:icinga 'https://localhost:5665/v1/status?pretty=1' | less
 ```
 
 You can also calculate late check results via the REST API:
@@ -672,7 +672,7 @@ The feature 'notification' is already enabled.
 You can use the Icinga 2 API [event streams](12-icinga2-api.md#icinga2-api-event-streams) to receive live notification streams:
 
 ```
-$ curl -k -s -u root:icinga -X POST 'https://localhost:5665/v1/events?queue=debugnotifications&types=Notification'
+$ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/events?queue=debugnotifications&types=Notification'
 ```
 
 ## Feature Troubleshooting <a id="troubleshooting-features"></a>
@@ -934,7 +934,7 @@ the following (e.g. by invoking a forced check from the web interface):
 Fetch all check result events matching the `event.service` name `remote-client`:
 
 ```
-$ curl -k -s -u root:icinga -X POST 'https://localhost:5665/v1/events?queue=debugcommandendpoint&types=CheckResult&filter=match%28%22remote-client*%22,event.service%29'
+$ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/events?queue=debugcommandendpoint&types=CheckResult&filter=match%28%22remote-client*%22,event.service%29'
 ```