From 04ef3f1244a65c72fa99142a3d2b4757d43c817c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 31 Aug 2015 12:18:25 +0200 Subject: [PATCH] LocalCommandFile: Accept option `instance' refs #9651 --- .../Command/Transport/LocalCommandFile.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Command/Transport/LocalCommandFile.php b/modules/monitoring/library/Monitoring/Command/Transport/LocalCommandFile.php index 00756da9d..b2f21a05e 100644 --- a/modules/monitoring/library/Monitoring/Command/Transport/LocalCommandFile.php +++ b/modules/monitoring/library/Monitoring/Command/Transport/LocalCommandFile.php @@ -22,6 +22,13 @@ class LocalCommandFile implements CommandTransportInterface */ const TRANSPORT = 'local'; + /** + * The name of the Icinga instance this transport will transfer commands to + * + * @var string + */ + protected $instanceName; + /** * Path to the icinga command file * @@ -51,6 +58,29 @@ class LocalCommandFile implements CommandTransportInterface $this->renderer = new IcingaCommandFileCommandRenderer(); } + /** + * Set the name of the Icinga instance this transport will transfer commands to + * + * @param string $name + * + * @return $this + */ + public function setInstance($name) + { + $this->instanceName = $name; + return $this; + } + + /** + * Return the name of the Icinga instance this transport will transfer commands to + * + * @return string + */ + public function getInstance() + { + return $this->instanceName; + } + /** * Set the path to the local Icinga command file *