diff --git a/modules/monitoring/library/Monitoring/Command/Transport/RemoteCommandFile.php b/modules/monitoring/library/Monitoring/Command/Transport/RemoteCommandFile.php index ab0e78ce82..5426bb90a6 100644 --- a/modules/monitoring/library/Monitoring/Command/Transport/RemoteCommandFile.php +++ b/modules/monitoring/library/Monitoring/Command/Transport/RemoteCommandFile.php @@ -341,24 +341,6 @@ protected function sendCommandString($commandString) 'Failed to write the whole command to the remote command pipe' ); } - fclose($this->sshPipes[0]); - $readBuffer = $read = array($this->sshPipes[2]); - $write = null; - $except = null; - $stderr = ''; - while ( - false !== (stream_select($readBuffer, $write, $exceptBuffer, 0, 20000)) - && $this->getSshProcessStatus('running') - ) { - if (! empty($readBuffer)) { - $stderr .= stream_get_contents($readBuffer[0]); - } - // Reset buffer - $readBuffer = $read; - } - if (! empty($stderr)) { - throw new CommandTransportException('Can\'t send external Icinga command: %s', trim($stderr)); - } } else { $this->throwSshFailure(); } @@ -436,7 +418,7 @@ protected function forkSsh() if (! is_resource($this->sshProcess)) { throw new CommandTransportException( - 'Can\'t send external Icinga command, failed to fork SSH' + 'Can\'t send external Icinga command: Failed to fork SSH' ); } } @@ -473,9 +455,7 @@ protected function throwSshFailure($msg = 'Can\'t send external Icinga command') public function __destruct() { if (is_resource($this->sshProcess)) { - if (is_resource($this->sshPipes[0])) { - fclose($this->sshPipes[0]); - } + fclose($this->sshPipes[0]); fclose($this->sshPipes[1]); fclose($this->sshPipes[2]);