]> granicus.if.org Git - icinga2/commitdiff
Add headers to debug output
authorMichael Friedrich <michael.friedrich@icinga.com>
Tue, 19 Jun 2018 07:03:04 +0000 (09:03 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 21 Jun 2018 13:08:36 +0000 (15:08 +0200)
plugins/check_nscp_api.cpp

index 333b217ab7531ad6745f58e00e9fd57af4bf1689..b0871713ded5085dd424bb8fdcc2b7b97d217da3 100644 (file)
@@ -93,8 +93,10 @@ static Dictionary::Ptr QueryEndpoint(const String& host, const String& port, con
                req->RequestUrl->SetArrayFormatUseBrackets(false);
 
                req->AddHeader("password", password);
-               if (l_Debug)
-                       std::cout << "Sending request to 'https://" << host << ":" << port << req->RequestUrl->Format(false, false) << "'\n";
+               if (l_Debug) {
+                       std::cout << "Sending request to 'https://" << host << ":" << port << req->RequestUrl->Format(false, false) << "'\n"
+                               << "Headers: " << JsonEncode(req->Headers) << "\n";
+               }
 
                // Submits the request. The 'ResultHttpCompletionCallback' is called once the HttpRequest receives an answer,
                // which then sets 'ready' to true
@@ -223,7 +225,7 @@ static int FormatOutput(const Dictionary::Ptr& result)
                state == "UNKNOWN" ? 3 : 4;
 
        if (creturn == 4) {
-               std::cout << "check_nscp UNKNOWN Answer format error: 'result' was not a known state.\n";
+               std::cout << "check_nscp_api UNKNOWN Answer format error: 'result' was not a known state.\n";
                return 3;
        }