mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
more memcached
git-svn-id: http://www.observium.org/svn/observer/trunk@3114 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+14
-14
@@ -341,6 +341,20 @@ $config['allow_unauth_graphs'] = 0; # Allow graphs to be viewed by an
|
||||
$config['allow_unauth_graphs_cidr'] = array(); # Allow graphs to be viewed without authorisation from certain IP ranges
|
||||
$config['auth_mechanism'] = "mysql"; # Available mechanisms: mysql (default), ldap, http-auth
|
||||
|
||||
### LDAP Authentication
|
||||
|
||||
$config['auth_ldap_version'] = 3; # v2 or v3
|
||||
$config['auth_ldap_server'] = "ldap.yourserver.com";
|
||||
$config['auth_ldap_port'] = 389;
|
||||
$config['auth_ldap_prefix'] = "uid=";
|
||||
$config['auth_ldap_suffix'] = ",ou=People,dc=example,dc=com";
|
||||
$config['auth_ldap_group'] = "cn=observium,ou=groups,dc=example,dc=com";
|
||||
|
||||
$config['auth_ldap_groupbase'] = "ou=group,dc=example,dc=com";
|
||||
$config['auth_ldap_groups']['admin']['level'] = 10;
|
||||
$config['auth_ldap_groups']['pfy']['level'] = 7;
|
||||
$config['auth_ldap_groups']['support']['level'] = 1;
|
||||
|
||||
### Sensors
|
||||
|
||||
$config['allow_entity_sensor']['amperes'] = 1;
|
||||
@@ -393,20 +407,6 @@ $config['syslog_filter'][] = "diskio.c"; ## Ignore some crappy stuff from SNMP
|
||||
$config['enable_libvirt'] = 0; # Enable Libvirt VM support
|
||||
$config['libvirt_protocols'] = array("qemu+ssh","xen+ssh"); # Mechanisms used, add or remove if not using this on any of your machines.
|
||||
|
||||
### LDAP Authentication
|
||||
|
||||
$config['auth_ldap_version'] = 3; # v2 or v3
|
||||
$config['auth_ldap_server'] = "ldap.yourserver.com";
|
||||
$config['auth_ldap_port'] = 389;
|
||||
$config['auth_ldap_prefix'] = "uid=";
|
||||
$config['auth_ldap_suffix'] = ",ou=People,dc=example,dc=com";
|
||||
$config['auth_ldap_group'] = "cn=observium,ou=groups,dc=example,dc=com";
|
||||
|
||||
$config['auth_ldap_groupbase'] = "ou=group,dc=example,dc=com";
|
||||
$config['auth_ldap_groups']['admin']['level'] = 10;
|
||||
$config['auth_ldap_groups']['pfy']['level'] = 7;
|
||||
$config['auth_ldap_groups']['support']['level'] = 1;
|
||||
|
||||
### Hardcoded ASN descriptions
|
||||
$config['astext'][65332] = "Cymru FullBogon Feed";
|
||||
$config['astext'][65333] = "Cymru Bogon Feed";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
function poll_sensor($device, $class, $unit)
|
||||
{
|
||||
global $config;
|
||||
global $config; global $memcache;
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `device_id` = ? AND `poller_type` = 'snmp'", array($class, $device['device_id'])) as $sensor)
|
||||
{
|
||||
@@ -72,7 +72,12 @@ function poll_sensor($device, $class, $unit)
|
||||
log_event(ucfirst($class) . ' ' . $sensor['sensor_descr'] . " above threshold: " . $sensor_value . " $unit (> " . $sensor['sensor_limit'] . " $unit)", $device, $class, $sensor['sensor_id']);
|
||||
}
|
||||
|
||||
dbUpdate(array('sensor_current' => $sensor_value), 'sensors', '`sensor_class` = ? AND `sensor_id` = ?', array($class, $sensor['sensor_id']));
|
||||
if ($config['memcached']['enable'])
|
||||
{
|
||||
$memcache->set('sensor-'.$sensor['sensor_id'].'-value', $sensor_value);
|
||||
} else {
|
||||
dbUpdate(array('sensor_current' => $sensor_value), 'sensors', '`sensor_class` = ? AND `sensor_id` = ?', array($class, $sensor['sensor_id']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,16 @@ foreach (dbFetchRows("SELECT * FROM storage WHERE device_id = ?", array($device[
|
||||
|
||||
rrdtool_update($storage_rrd,"N:".$storage['used'].":".$storage['free']);
|
||||
|
||||
$update = dbUpdate(array('storage_used' => $storage['used'], 'storage_free' => $storage['free'], 'storage_size' => $storage['size'], 'storage_units' => $storage['units'], 'storage_perc' => $percent),
|
||||
'storage', '`storage_id` = ?', array($storage['storage_id']));
|
||||
if ($config['memcached']['enable'])
|
||||
{
|
||||
$memcache->set('storage-'.$storage['storage_id'].'-used', $storage['used']);
|
||||
$memcache->set('storage-'.$storage['storage_id'].'-free', $storage['free']);
|
||||
$memcache->set('storage-'.$storage['storage_id'].'-size', $storage['size']);
|
||||
$memcache->set('storage-'.$storage['storage_id'].'-units', $storage['units']);
|
||||
$memcache->set('storage-'.$storage['storage_id'].'-used', $percent);
|
||||
} else {
|
||||
$update = dbUpdate(array('storage_used' => $storage['used'], 'storage_free' => $storage['free'], 'storage_size' => $storage['size'], 'storage_units' => $storage['units'], 'storage_perc' => $percent), 'storage', '`storage_id` = ?', array($storage['storage_id']));
|
||||
}
|
||||
|
||||
echo("\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user