monitoring: Don't translate exception messages in the remote command file

This commit is contained in:
Eric Lippmann 2014-10-29 10:00:59 +01:00
parent 1cc1521607
commit e7ef1826b7

View File

@ -17,6 +17,11 @@ use Icinga\Module\Monitoring\Command\Renderer\IcingaCommandFileCommandRenderer;
*/ */
class RemoteCommandFile implements CommandTransportInterface class RemoteCommandFile implements CommandTransportInterface
{ {
/**
* Transport identifier
*/
const TRANSPORT = 'remote';
/** /**
* Remote host * Remote host
* *
@ -175,13 +180,11 @@ class RemoteCommandFile implements CommandTransportInterface
} }
$commandString = $this->renderer->render($command, $now); $commandString = $this->renderer->render($command, $now);
Logger::debug( Logger::debug(
sprintf( 'Sending external Icinga command "%s" to the remote command file "%s:%u%s"',
mt('monitoring', 'Sending external Icinga command "%s" to the remote command file "%s:%u%s"'), $commandString,
$commandString, $this->host,
$this->host, $this->port,
$this->port, $this->path
$this->path
)
); );
$ssh = sprintf('ssh -o BatchMode=yes -p %u', $this->port); $ssh = sprintf('ssh -o BatchMode=yes -p %u', $this->port);
// -o BatchMode=yes for disabling interactive authentication methods // -o BatchMode=yes for disabling interactive authentication methods
@ -197,10 +200,7 @@ class RemoteCommandFile implements CommandTransportInterface
exec($ssh, $output, $status); exec($ssh, $output, $status);
if ($status !== 0) { if ($status !== 0) {
throw new TransportException( throw new TransportException(
mt( 'Can\'t send external Icinga command "%s": %s',
'monitoring',
'Can\'t send external Icinga command "%s": %s'
),
$ssh, $ssh,
implode(' ', $output) implode(' ', $output)
); );