...
|
...
|
@@ -10,7 +10,7 @@ const Server = models.Server; |
|
|
const ws = require('../../lib/ws');
|
|
|
|
|
|
const monit = {
|
|
|
node: function (projectId, hosts) {
|
|
|
node: function (project, hosts) {
|
|
|
hosts.forEach((host) => {
|
|
|
var obj = {
|
|
|
'total': 0,
|
...
|
...
|
@@ -41,14 +41,14 @@ const monit = { |
|
|
}).catch(function (err) {
|
|
|
obj.errmsg = '获取监控状态失败'
|
|
|
}).finally(function () {
|
|
|
ws.broadcast(`/monit/${projectId}`, {
|
|
|
ws.broadcast(`/monit/${project._id}`, {
|
|
|
host: host,
|
|
|
monitdata: obj
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
php: function(projectId, hosts) {
|
|
|
php: function(project, hosts) {
|
|
|
if (!_.isArray(hosts)) {
|
|
|
return;
|
|
|
}
|
...
|
...
|
@@ -67,7 +67,7 @@ const monit = { |
|
|
console.log(err);
|
|
|
} else {
|
|
|
stream.on('close', () => {
|
|
|
ws.broadcast(`/monit/${projectId}`, {
|
|
|
ws.broadcast(`/monit/${project._id}`, {
|
|
|
host: host,
|
|
|
monitdata: obj
|
|
|
});
|
...
|
...
|
|