mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-26 16:08:43 +02:00
Merge remote-tracking branch 'refs/remotes/librenms/master' into min_graph_height
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
||||
|
||||
@@ -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 .= "<option value='$check_name'>$check_name</option>";
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -142,4 +145,4 @@ $('#service-submit').click('', function(e) {
|
||||
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
echo(" EXTREME-BASE-MIB ");
|
||||
|
||||
if ($device['os'] == 'xos') {
|
||||
echo(" EXTREME-BASE-MIB ");
|
||||
// Power Usage
|
||||
$descr = "Power Usage";
|
||||
$oid = "1.3.6.1.4.1.1916.1.1.1.40.1.0"; // extremeSystemPowerUsage
|
||||
|
||||
@@ -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);
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#! /usr/bin/env python
|
||||
#! /usr/bin/env python2
|
||||
"""
|
||||
poller-service A service to wrap SNMP polling. It will poll up to $threads devices at a time, and will not re-poll
|
||||
devices that have been polled within the last $poll_frequency seconds. It will prioritize devices based
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#! /usr/bin/env python
|
||||
#! /usr/bin/env python2
|
||||
"""
|
||||
poller-wrapper A small tool which wraps around the poller and tries to
|
||||
guide the polling process with a more modern approach with a
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python2
|
||||
import urllib2
|
||||
import re
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python2
|
||||
import warnings
|
||||
import re
|
||||
warnings.filterwarnings(action="ignore", message='the sets module is deprecated')
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python2
|
||||
import urllib2
|
||||
import re
|
||||
|
||||
|
||||
Reference in New Issue
Block a user