]> granicus.if.org Git - icinga2/commitdiff
Make agent error output more verbose
authorJean Flach <jean-marcel.flach@netways.de>
Tue, 15 Mar 2016 15:16:40 +0000 (16:16 +0100)
committerJean Flach <jean-marcel.flach@netways.de>
Tue, 15 Mar 2016 15:59:49 +0000 (16:59 +0100)
Adds the ran command to the agents error output

fixes #11388

agent/windows-setup-agent/SetupWizard.cs

index 1b56a3b369e49e09f27f94b76f4cbfda3ba27b3b..3dcc6c84f37378d9b310a1bd231e0c1158168395 100644 (file)
@@ -145,14 +145,14 @@ namespace Icinga
                        SetRetrievalStatus(25);
 
                        string pathPrefix = Program.Icinga2InstallDir + "\\etc\\icinga2\\pki\\" + txtInstanceName.Text;
-
+                       string processArguments = "pki new-cert --cn \"" + txtInstanceName.Text + "\" --key \"" + pathPrefix + ".key\" --cert \"" + pathPrefix + ".crt\"";
                        string output;
 
                        if (!File.Exists(pathPrefix + ".crt")) {
                                if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe",
-                                       "pki new-cert --cn \"" + txtInstanceName.Text + "\" --key \"" + pathPrefix + ".key\" --cert \"" + pathPrefix + ".crt\"",
+                                       processArguments,
                                        out output)) {
-                                       ShowErrorText(output);
+                                       ShowErrorText("Running command 'icinga2.exe " + processArguments + "' produced the following output:\n" + output);
                                        return;
                                }
                        }
@@ -161,10 +161,11 @@ namespace Icinga
 
                        _TrustedFile = Path.GetTempFileName();
 
+                       processArguments = "pki save-cert --host \"" + host + "\" --port \"" + port + "\" --key \"" + pathPrefix + ".key\" --cert \"" + pathPrefix + ".crt\" --trustedcert \"" + _TrustedFile + "\"";
                        if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe",
-                               "pki save-cert --host \"" + host + "\" --port \"" + port + "\" --key \"" + pathPrefix + ".key\" --cert \"" + pathPrefix + ".crt\" --trustedcert \"" + _TrustedFile + "\"",
+                               processArguments,
                                out output)) {
-                               ShowErrorText(output);
+                               ShowErrorText("Running command 'icinga2.exe " + processArguments + "' produced the following output:\n" + output);
                                return;
                        }
 
@@ -216,7 +217,7 @@ namespace Icinga
                        if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe",
                                "node setup" + args,
                                out output)) {
-                               ShowErrorText(output);
+                               ShowErrorText("Running command 'icinga2.exe " + "node setup" + args + "' produced the following output:\n" + output);
                                return;
                        }
 
@@ -238,14 +239,14 @@ namespace Icinga
                        if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe",
                                "daemon --validate",
                                out output)) {
-                               ShowErrorText(output);
+                               ShowErrorText("Running command 'icinga2.exe daemon --validate' produced the following output:\n" + output);
                                return;
                        }
 
                        if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe",
                                "--scm-install daemon",
                                out output)) {
-                               ShowErrorText(output);
+                               ShowErrorText("Running command 'icinga2.exe daemon --scm-install daemon' produced the following output:\n" + output);
                                return;
                        }