Skip to content

Commit 8cad783

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.1' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.1
2 parents 404c729 + 17d5361 commit 8cad783

File tree

8 files changed

+42
-33
lines changed

8 files changed

+42
-33
lines changed

interface/web/admin/templates/server_config_rescue_edit.htm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ <h1><tmpl_var name="list_head_txt"></h1>
1717
{tmpl_var name='do_not_try_rescue_httpd'}
1818
</div>
1919
</div>
20+
<!--
2021
<div class="form-group">
2122
<label class="col-sm-3 control-label">{tmpl_var name='do_not_try_rescue_mongodb_txt'}</label>
2223
<div class="col-sm-9">
2324
{tmpl_var name='do_not_try_rescue_mongodb'}
2425
</div>
2526
</div>
27+
-->
2628
<div class="form-group">
2729
<label class="col-sm-3 control-label">{tmpl_var name='do_not_try_rescue_mysql_txt'}</label>
2830
<div class="col-sm-9">

interface/web/monitor/lib/module.conf.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,12 @@
196196
'link' => 'monitor/show_data.php?type=fail2ban',
197197
'html_id' => 'fai2ban');
198198

199+
/*
199200
$items[] = array( 'title' => "Show MongoDB-Log",
200201
'target' => 'content',
201202
'link' => 'monitor/show_data.php?type=mongodb',
202203
'html_id' => 'mongodb');
203-
204+
*/
204205
$items[] = array( 'title' => "Show IPTables",
205206
'target' => 'content',
206207
'link' => 'monitor/show_data.php?type=iptables',

interface/web/monitor/show_data.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,15 @@
138138
$description = '';
139139
$add_padding = true;
140140
break;
141+
/*
141142
case 'mongodb':
142143
$template = 'templates/show_data.htm';
143144
$output .= $app->tools_monitor->showMongoDB();
144145
$time = $app->tools_monitor->getDataTime('log_mongodb');
145146
$title = $app->lng("monitor_title_mongodb_txt") . ' (' . $monTransSrv . ' : ' . $_SESSION['monitor']['server_name'] . ')';
146147
$description = '';
147148
break;
149+
*/
148150
case 'iptables':
149151
$template = 'templates/show_data.htm';
150152
$output .= $app->tools_monitor->showIPTables();

interface/web/sites/database_user_edit.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,11 @@ function onBeforeUpdate() {
169169
/* prepare password for MongoDB */
170170
// TODO: this still doens't work as when only the username changes we have no database_password.
171171
// taking the one from oldData doesn't work as it's encrypted...shit!
172+
/*
172173
$this->dataRecord['database_password_mongo'] = $this->dataRecord['database_user'].":mongo:".$this->dataRecord['database_password'];
173174
174175
$this->dataRecord['server_id'] = 0; // we need this on all servers
175-
176+
*/
176177
parent::onBeforeUpdate();
177178
}
178179

@@ -206,7 +207,7 @@ function onBeforeInsert() {
206207
$this->dataRecord['server_id'] = 0; // we need this on all servers
207208

208209
/* prepare password for MongoDB */
209-
$this->dataRecord['database_password_mongo'] = $this->dataRecord['database_user'].":mongo:".$this->dataRecord['database_password'];
210+
// $this->dataRecord['database_password_mongo'] = $this->dataRecord['database_user'].":mongo:".$this->dataRecord['database_password'];
210211

211212
parent::onBeforeInsert();
212213
}

server/lib/classes/cron.d/100-monitor_mongodb.inc.php renamed to server/lib/classes/cron.d/100-monitor_mongodb.inc.php~

File renamed without changes.

server/lib/classes/monitor_tools.inc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,16 @@ public function monitorServices() {
370370
$state = 'error'; // because service is down
371371
}
372372
}
373+
/*
373374
$data['mongodbserver'] = -1;
374375
if ($this->_checkTcp('localhost', 27017)) {
375376
$data['mongodbserver'] = 1;
376377
} else {
377378
$data['mongodbserver'] = 0;
379+
*/
378380
//$state = 'error'; // because service is down
379381
/* TODO!!! check if this is a mongodbserver at all, otherwise it will always throw an error state!!! */
380-
}
382+
// }
381383

382384
/*
383385
* Return the Result

server/mods-available/rescue_core_module.inc.php

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private function _doRescue() {
9797
/*
9898
* rescue MongoDB if needed
9999
*/
100-
$this->_rescueMongoDB();
100+
// $this->_rescueMongoDB();
101101

102102
/*
103103
* rescue mysql if needed (maybe httpd depends on mysql, so try this first!)
@@ -311,71 +311,72 @@ private function _rescueHttpd(){
311311
$this->_rescueDaemon($daemon);
312312
}
313313

314+
314315
/**
315316
* restarts MongoDB, if needed
316317
*/
317-
private function _rescueMongoDB(){
318-
global $app, $conf;
318+
// private function _rescueMongoDB(){
319+
// global $app, $conf;
319320

320321
/*
321322
* do nothing, if it is not allowed to rescue mysql
322323
*/
323-
if ((isset($conf['serverconfig']['rescue']['do_not_try_rescue_mongodb']) && ($conf['serverconfig']['rescue']['do_not_try_rescue_mongodb']) == 'y')){
324-
return;
325-
}
324+
// if ((isset($conf['serverconfig']['rescue']['do_not_try_rescue_mongodb']) && ($conf['serverconfig']['rescue']['do_not_try_rescue_mongodb']) == 'y')){
325+
// return;
326+
// }
326327

327328
/*
328329
* if the service is up and running, or the service is not installed there is nothing to do...
329330
*/
330-
if ($this->_monitoringData[0][0]['data']['mongodbserver'] != 0){
331-
/* Clear the try counter, because we do not have to try to rescue the service */
332-
$this->_rescueData['mongodbserver']['try_counter'] = 0;
333-
return;
334-
}
331+
// if ($this->_monitoringData[0][0]['data']['mongodbserver'] != 0){
332+
// /* Clear the try counter, because we do not have to try to rescue the service */
333+
// $this->_rescueData['mongodbserver']['try_counter'] = 0;
334+
// return;
335+
// }
335336

336337
/*
337338
* OK, the service is installed and down.
338339
* Maybe this is because of a restart of the service by the admin.
339340
* This means, we check the data 1 minute ago
340341
*/
341-
if ((!isset($this->_monitoringData[1][0]['data']['mongodbserver'])) ||
342-
((isset($this->_monitoringData[1][0]['data']['mongodbserver'])) && ($this->_monitoringData[1][0]['data']['mongodbserver'] != 0))){
342+
// if ((!isset($this->_monitoringData[1][0]['data']['mongodbserver'])) ||
343+
// ((isset($this->_monitoringData[1][0]['data']['mongodbserver'])) && ($this->_monitoringData[1][0]['data']['mongodbserver'] != 0))){
343344
/*
344345
* We do NOT have this data or we have this data, but the webserver was not down 1 minute ago.
345346
* This means, it could be, that the admin is restarting the server.
346347
* We wait one more minute...
347348
*/
348-
return;
349-
}
349+
// return;
350+
// }
350351

351352
/*#####
352353
* The service is down and it was down 1 minute ago.
353354
* We try to rescue it
354355
*#####*/
355356

356357
/* Get the try counter */
357-
$tryCount = (!isset($this->_rescueData['mongodbserver']['try_counter']))? 1 : $this->_rescueData['mongodbserver']['try_counter'] + 1;
358+
// $tryCount = (!isset($this->_rescueData['mongodbserver']['try_counter']))? 1 : $this->_rescueData['mongodbserver']['try_counter'] + 1;
358359

359360
/* Set the new try counter */
360-
$this->_rescueData['mongodbserver']['try_counter'] = $tryCount;
361+
// $this->_rescueData['mongodbserver']['try_counter'] = $tryCount;
361362

362363
/* if 5 times will not work, we have to give up... */
363-
if ($tryCount > 5){
364-
$app->log('MongoDB is down! Rescue will not help!', LOGLEVEL_ERROR);
365-
return;
366-
}
364+
// if ($tryCount > 5){
365+
// $app->log('MongoDB is down! Rescue will not help!', LOGLEVEL_ERROR);
366+
// return;
367+
// }
367368

368369

369-
$app->log('MongoDB is down! Try rescue MongoDB (try:' . $tryCount . ')...', LOGLEVEL_WARN);
370+
// $app->log('MongoDB is down! Try rescue MongoDB (try:' . $tryCount . ')...', LOGLEVEL_WARN);
370371

371-
if(is_file($conf['init_scripts'] . '/' . 'mongodb')) {
372-
$daemon = 'mongodb';
373-
} else {
374-
$daemon = 'mongodb';
375-
}
372+
// if(is_file($conf['init_scripts'] . '/' . 'mongodb')) {
373+
// $daemon = 'mongodb';
374+
// } else {
375+
// $daemon = 'mongodb';
376+
// }
376377

377-
$this->_rescueDaemon($daemon);
378-
}
378+
// $this->_rescueDaemon($daemon);
379+
// }
379380

380381
/**
381382
* restarts mysql, if needed

server/plugins-available/mongo_clientdb_plugin.inc.php renamed to server/plugins-available/mongo_clientdb_plugin.inc.php~

File renamed without changes.

0 commit comments

Comments
 (0)