diff --git a/public_html/appmonitor/index.php b/public_html/appmonitor/index.php index 422c047b54f93e304b1a7d104fe718326e08edc4..5d23ccf3978487543e5f6a842f7c942705fa2dc2 100644 --- a/public_html/appmonitor/index.php +++ b/public_html/appmonitor/index.php @@ -230,30 +230,33 @@ if(isset($aConfig['foreman']['api'])){ } // #6421 - add check for AWX +// #7709 - update for instances per rollout plugin if(isset($aConfig['plugins']['rollout']['awx'])){ $aOpts=[]; - $aOpts['url'] = $aConfig['plugins']['rollout']['awx']['url'].'/'; - if(isset($aConfig['plugins']['rollout']['awx']['user'])){ - $aOpts['userpwd'] = $aConfig['plugins']['rollout']['awx']['user'] - . (isset($aConfig['plugins']['rollout']['awx']['password']) - ? ':'.$aConfig['plugins']['rollout']['awx']['password'] + foreach ($aConfig['plugins']['rollout'] as $sId => $aRolloutConfig) { + if ($aRolloutConfig['plugin'] == "awx") { + $aOpts['url'] = $aRolloutConfig['url'].'/'; + $aOpts['userpwd'] = $aRolloutConfig['user'] + . (isset($aRolloutConfig['password']) + ? ':'.$aRolloutConfig['password'] : '' ) ; - } - $oMonitor->addCheck( - [ - "name" => "AWX API", - "description" => "check if AWX api is available", - "group" => "network", - "parent" => "read config file", - "check" => [ - "function" => "HttpContent", - "params" => $aOpts, - ], - ] - ); + $oMonitor->addCheck( + [ + "name" => "AWX API - ".$sId, + "description" => "check if AWX api is available", + "group" => "network", + "parent" => "read config file", + "check" => [ + "function" => "HttpContent", + "params" => $aOpts, + ], + ] + ); + } + } } // ----------------------------------------------------------------------