diff --git a/public_html/appmonitor/index.php b/public_html/appmonitor/index.php index 93f84d1e75166aacd3d84d5a5894f48c4c43f713..bf51c1341acb1b1408e0cd9bb2d63bf78227f120 100644 --- a/public_html/appmonitor/index.php +++ b/public_html/appmonitor/index.php @@ -193,10 +193,12 @@ if(count($aConfig['mirrorPackages'])){ ( [type] => rsync [runas] => - [target] => copy-deployment@puppet.one.iml.unibe.ch:/var/shared/imldeployment + [target] => copy-deployment@puppet:/var/shared/imldeployment ) */ - $sCmd='ssh '.$aData['target']. ' ls -1'; + $sTargetHost = preg_replace('/\:.*/', '', $aData['target']); + $sCmd='ssh '.$sTargetHost. ' ls -1'; + exec($sCmd, $sOut, $iRc); $oMonitor->addCheck( array( @@ -206,7 +208,7 @@ if(count($aConfig['mirrorPackages'])){ "function" => "Simple", "params" => array( "result" => $iRc ? RESULT_ERROR : RESULT_OK, - "value" => "$sCmd returns $sOut", + "value" => "Command [$sCmd] returns with exitcode $iRc; output: ".implode(" ", $sOut), ), ), )