diff --git a/lib/agent/actions/alert/index.js b/lib/agent/actions/alert/index.js index aba65a5a1..b6af04421 100644 --- a/lib/agent/actions/alert/index.js +++ b/lib/agent/actions/alert/index.js @@ -48,6 +48,9 @@ exports.start = function(opts, cb) { emitter = null; } + // remove newlines so the message can be completely displayed + message = message.replace(/(\r\n|\n|\r)/gm," "); + args.push(message); system.spawn_as_logged_user(bin, args, function(err, alert) { if (err) return done(err); diff --git a/lib/agent/providers/network/linux.js b/lib/agent/providers/network/linux.js index 2f5c840bb..63aba58dc 100644 --- a/lib/agent/providers/network/linux.js +++ b/lib/agent/providers/network/linux.js @@ -104,7 +104,7 @@ exports.parse_access_points_list = function(output) { return; var obj = { - ssid: parsed['ESSID'].slice(1, -1).replace(/[^\w :'-]/, ''), // remove "" and weird chars, + ssid: parsed['ESSID'].slice(1, -1).replace(/[^\w :'-]/g, ''), // remove "" and weird chars, mac_address: parsed['Address'], security: parsed['Encryption key'] == 'on' } diff --git a/lib/agent/providers/network/mac.js b/lib/agent/providers/network/mac.js index 4b8db9b75..e7fa76ea7 100644 --- a/lib/agent/providers/network/mac.js +++ b/lib/agent/providers/network/mac.js @@ -64,7 +64,7 @@ exports.parse_access_points_list = function(stdout) { var sec = end[1] && end[1].trim(); var ap = { - ssid : start[0].trim().replace(/[^\w :'-]/, ''), // remove weird chars + ssid : start[0].trim().replace(/[^\w :'-]/g, ''), // remove weird chars mac_address : line.match(mac_address_regex)[0], signal_strength : parseInt(data[1]), // use positive integers channel : parseInt(data[2]), diff --git a/lib/agent/providers/network/windows.js b/lib/agent/providers/network/windows.js index 21d99cf48..a81c56c77 100644 --- a/lib/agent/providers/network/windows.js +++ b/lib/agent/providers/network/windows.js @@ -99,7 +99,7 @@ exports.parse_access_points_list_autowc = function(out) { return arr.map(function(o) { return { - ssid : o.ssid.replace(/[^\w :'-]/, ''), + ssid : o.ssid.replace(/[^\w :'-]/g, ''), // security : null, // don't have this data // quality : null, signal_strength : o.signal_strength,