diff --git a/doc/Extensions/Agent-Setup.md b/doc/Extensions/Agent-Setup.md index 652d9a792..767e179bf 100644 --- a/doc/Extensions/Agent-Setup.md +++ b/doc/Extensions/Agent-Setup.md @@ -15,7 +15,15 @@ On each of the hosts you would like to use the agent on then you need to do the cd /opt/ git clone https://github.com/librenms/librenms-agent.git cd librenms-agent -cp check_mk_agent /usr/bin/check_mk_agent +``` + +Now copy the relevant check_mk_agent: + +| linux | freebsd | +| --- | --- | +| `cp check_mk_agent /usr/bin/check_mk_agent` | `cp check_mk_agent_freebsd /usr/bin/check_mk_agent` | + +```shell chmod +x /usr/bin/check_mk_agent ``` diff --git a/includes/polling/unix-agent.inc.php b/includes/polling/unix-agent.inc.php index 8f9f8582f..43a4f499a 100644 --- a/includes/polling/unix-agent.inc.php +++ b/includes/polling/unix-agent.inc.php @@ -97,7 +97,7 @@ if ($device['os_group'] == 'unix') { dbDelete('processes', 'device_id = ?', array($device['device_id'])); $data=array(); foreach (explode("\n", $agent_data['ps']) as $process) { - $process = preg_replace('/\((.*),([0-9]*),([0-9]*),([0-9\:]*),([0-9]*)\)\ (.*)/', '\\1|\\2|\\3|\\4|\\5|\\6', $process); + $process = preg_replace('/\((.*),([0-9]*),([0-9]*),([0-9\:\.]*),([0-9]*)\)\ (.*)/', '\\1|\\2|\\3|\\4|\\5|\\6', $process); list($user, $vsz, $rss, $cputime, $pid, $command) = explode('|', $process, 6); if (!empty($command)) { $data[]=array('device_id' => $device['device_id'], 'pid' => $pid, 'user' => $user, 'vsz' => $vsz, 'rss' => $rss, 'cputime' => $cputime, 'command' => $command);