Skip to content
Snippets Groups Projects
Commit 6b59f380 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch 'update-appmonitor' into 'master'

Update appmonitor

See merge request !91
parents a87013bf 32c903e1
No related branches found
No related tags found
No related merge requests found
...@@ -86,8 +86,14 @@ $iProjectCount=count($oPrj->getProjects()); ...@@ -86,8 +86,14 @@ $iProjectCount=count($oPrj->getProjects());
$iInProgress=0; $iInProgress=0;
$iInQueue=0; $iInQueue=0;
foreach ($oPrj->getProjects() as $sPrj) { foreach ($oPrj->getProjects() as $sPrj) {
$oPrj->getPhases(); $oPrj2=new project($sPrj);
$aProgress=$oPrj2->getProgress();
/*
* so ist irgendwas anders ... er initialisiert das Projekt nicht
*
$oPrj->setProjectById($sPrj);
$aProgress=$oPrj->getProgress(); $aProgress=$oPrj->getProgress();
*/
$iInProgress+=$aProgress['inprogress'] ? 1 : 0; $iInProgress+=$aProgress['inprogress'] ? 1 : 0;
$iInQueue+=$aProgress['hasQueue'] ? 1 : 0; $iInQueue+=$aProgress['hasQueue'] ? 1 : 0;
} }
...@@ -187,10 +193,12 @@ if(count($aConfig['mirrorPackages'])){ ...@@ -187,10 +193,12 @@ if(count($aConfig['mirrorPackages'])){
( (
[type] => rsync [type] => rsync
[runas] => [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); exec($sCmd, $sOut, $iRc);
$oMonitor->addCheck( $oMonitor->addCheck(
array( array(
...@@ -200,7 +208,7 @@ if(count($aConfig['mirrorPackages'])){ ...@@ -200,7 +208,7 @@ if(count($aConfig['mirrorPackages'])){
"function" => "Simple", "function" => "Simple",
"params" => array( "params" => array(
"result" => $iRc ? RESULT_ERROR : RESULT_OK, "result" => $iRc ? RESULT_ERROR : RESULT_OK,
"value" => "$sCmd returns $sOut", "value" => "Command [$sCmd] returns with exitcode $iRc; output: ".implode(" ", $sOut),
), ),
), ),
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment