[--ssl] [nrpe options] * * EXAMPLE * * icingacli monitoring nrpe 127.0.0.1 CheckMEM --ssl --MaxWarn=80% \ * --MaxCrit=90% --type=physical */ public function checkAction() { $host = $this->params->shift(); if (! $host) { echo $this->showUsage(); exit(3); } $command = $this->params->shift(null, '_NRPE_CHECK'); $port = $this->params->shift('port', 5666); try { $nrpe = new Connection($host, $port); if ($this->params->shift('ssl')) { $nrpe->useSsl(); } $args = array(); foreach ($this->params->getParams() as $k => $v) { $args[] = $k . '=' . $v; } echo $nrpe->sendCommand($command, $args) . "\n"; exit($nrpe->getLastReturnCode()); } catch (Exception $e) { echo $e->getMessage() . "\n"; exit(3); } } }