diff --git a/AUTHORS.md b/AUTHORS.md index 28d60480df..fec1d61546 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -97,6 +97,7 @@ LibreNMS contributors: - Karsten Nerdinger (piratonym) - Michael Nguyen (mnguyen1289) - Casey Schoonover (cschoonover91) +- Chris A. Evans (thecityofguanyu) [1]: http://observium.org/ "Observium web site" Observium was written by: diff --git a/doc/Extensions/Agent-Setup.md b/doc/Extensions/Agent-Setup.md index 652d9a7922..767e179bf2 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/html/includes/modal/new_service.inc.php b/html/includes/modal/new_service.inc.php index e1b973c74f..9891c2441e 100644 --- a/html/includes/modal/new_service.inc.php +++ b/html/includes/modal/new_service.inc.php @@ -11,17 +11,20 @@ * the source code distribution for details. */ -if(is_admin() !== false) { +if (is_admin() !== false) { // Build the types list. - if ($handle = opendir($config['nagios_plugins'])) { - while (false !== ($file = readdir($handle))) { - if ($file != '.' && $file != '..' && !strstr($file, '.') && strstr($file, 'check_')) { - list(,$check_name) = explode('_',$file,2); + $dir = $config['nagios_plugins']; + if (file_exists($dir) && is_dir($dir)) { + $files = scandir($dir); + $dir .= DIRECTORY_SEPARATOR; + d_print_r($files); + foreach ($files as $file) { + if (is_executable($dir.$file) && is_file($dir.$file) && strstr($file, 'check_')) { + list(,$check_name) = explode('_', $file, 2); $stype .= ""; } } - closedir($handle); } ?> @@ -142,4 +145,4 @@ $('#service-submit').click('', function(e) { $device['device_id'], 'pid' => $pid, 'user' => $user, 'vsz' => $vsz, 'rss' => $rss, 'cputime' => $cputime, 'command' => $command); diff --git a/scripts/distro b/scripts/distro index 96cbbe75f7..8a2ebd02ef 100755 --- a/scripts/distro +++ b/scripts/distro @@ -86,6 +86,9 @@ elif [ "${OS}" = "Darwin" ] ; then if [ -f /usr/bin/sw_vers ] ; then OSSTR=`/usr/bin/sw_vers|grep -v Build|sed 's/^.*:.//'| tr "\n" ' '` fi + +elif [ "${OS}" = "FreeBSD" ] ; then + OSSTR=`/usr/bin/uname -mior` fi echo ${OSSTR}