[icinga-checkins] icinga.org: icingaweb2-module-director/master: Icinga2Agent.psm1: a few upstream improvements

git at icinga.org git at icinga.org
Wed Nov 2 13:53:39 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: cff76236d853bdcbf20c24e957057922f5c772da
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=cff76236d853bdcbf20c24e957057922f5c772da

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Nov  2 13:51:41 2016 +0100

Icinga2Agent.psm1: a few upstream improvements

---

 contrib/windows-agent-installer/Icinga2Agent.psm1 |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/contrib/windows-agent-installer/Icinga2Agent.psm1 b/contrib/windows-agent-installer/Icinga2Agent.psm1
index 33278e9..931e305 100644
--- a/contrib/windows-agent-installer/Icinga2Agent.psm1
+++ b/contrib/windows-agent-installer/Icinga2Agent.psm1
@@ -281,7 +281,7 @@ function Icinga2AgentModule {
         $this.info('Downloading Icinga 2 Agent Binary from ' + $url + '  ...');
         $execptionMsg = '';
         Try {
-            $WebStatusCode = Invoke-WebRequest -Method Head -Uri "$url"
+            $WebStatusCode = Invoke-WebRequest -UseBasicParsing -Method Head -Uri "$url"
 
             if ($WebStatusCode.StatusCode -eq 200) {
                 Invoke-WebRequest "$url" -OutFile $this.getInstallerPath();
@@ -495,6 +495,7 @@ function Icinga2AgentModule {
             $this.info('Flushing content of ' + $this.getApiDirectory());
             $folder = New-Object -ComObject Scripting.FileSystemObject;
             $folder.DeleteFolder($this.getApiDirectory());
+            $this.setProperty('require_restart', 'true');
         }
     }
 
@@ -862,10 +863,11 @@ object ApiListener "api" {
             $this.generateIcingaConfiguration();
             $this.applyPossibleConfigChanges();
 
+            if ($this.shouldFlushIcingaApiDirectory()) {
+                $this.flushIcingaApiDirectory();
+            }
+
             if ($this.madeChanges()) {
-                if ($this.shouldFlushIcingaApiDirectory()) {
-                    $this.flushIcingaApiDirectory();
-                }
                 $this.restartAgent();
             } else {
                 $this.info('No changes detected.');



More information about the icinga-checkins mailing list