mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
push more state to memcached fix sensors poller to not retry all temperature sensors where return >9000 5 times (lmsensors returns milliC, so 30000 for 30C)
git-svn-id: http://www.observium.org/svn/observer/trunk@3244 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -13,6 +13,14 @@ foreach (dbFetchRows("SELECT * FROM `mempools` WHERE device_id = ?", array($devi
|
||||
{
|
||||
if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
if ($config['memcached']['enable'])
|
||||
{
|
||||
$state = $memcache->get('mempool-'.$mempool['mempool_id'].'-state');
|
||||
if($debug) { print_r($state); }
|
||||
if(is_array($state)) { $mempool = array_merge($mempool, $state); }
|
||||
unset($state);
|
||||
}
|
||||
|
||||
$text_descr = rewrite_entity_descr($mempool['mempool_descr']);
|
||||
|
||||
$mempool_url = "device/".$device['device_id']."/health/mempool/";
|
||||
|
@@ -14,6 +14,15 @@ if (count($mempools))
|
||||
|
||||
foreach ($mempools as $mempool)
|
||||
{
|
||||
|
||||
if ($config['memcached']['enable'])
|
||||
{
|
||||
$state = $memcache->get('mempool-'.$mempool['mempool_id'].'-state');
|
||||
if($debug) { print_r($state); }
|
||||
if(is_array($state)) { $mempool = array_merge($mempool, $state); }
|
||||
unset($state);
|
||||
}
|
||||
|
||||
$percent= round($mempool['mempool_perc'],0);
|
||||
$text_descr = rewrite_entity_descr($mempool['mempool_descr']);
|
||||
$total = formatStorage($mempool['mempool_total']);
|
||||
|
@@ -6,12 +6,10 @@ $port = dbFetchRow("SELECT * FROM `ports` WHERE `port_id` = ?", array($vars['por
|
||||
|
||||
if ($config['memcached']['enable'])
|
||||
{
|
||||
$oids = array('ifInOctets', 'ifOutOctets', 'ifInUcastPkts', 'ifOutUcastPkts', 'ifInErrors', 'ifOutErrors');
|
||||
foreach ($oids as $oid)
|
||||
{
|
||||
$port[$oid.'_rate'] = $memcache->get('port-'.$port['port_id'].'-'.$oid.'_rate');
|
||||
if ($debug) { echo("MC[".$oid."->".$port[$oid.'_rate']."]"); }
|
||||
}
|
||||
$state = $memcache->get('port-'.$port['port_id'].'-state');
|
||||
if($debug) { print_r($state); }
|
||||
if(is_array($state)) { $port = array_merge($port, $state); }
|
||||
unset($state);
|
||||
}
|
||||
|
||||
$port_details = 1;
|
||||
|
@@ -108,12 +108,10 @@ if ($vars['view'] == 'minigraphs')
|
||||
{
|
||||
if ($config['memcached']['enable'])
|
||||
{
|
||||
$oids = array('ifInOctets', 'ifOutOctets', 'ifInUcastPkts', 'ifOutUcastPkts', 'ifInErrors', 'ifOutErrors');
|
||||
foreach ($oids as $oid)
|
||||
{
|
||||
$port[$oid.'_rate'] = $memcache->get('port-'.$port['port_id'].'-'.$oid.'_rate');
|
||||
if ($debug) { echo("MC[".$oid."->".$port[$oid.'_rate']."]"); }
|
||||
}
|
||||
$state = $memcache->get('port-'.$port['port_id'].'-state');
|
||||
if($debug) { print_r($state); }
|
||||
if(is_array($state)) { $port = array_merge($port, $state); }
|
||||
unset($state);
|
||||
}
|
||||
|
||||
include("includes/print-interface.inc.php");
|
||||
|
@@ -19,6 +19,15 @@ foreach (dbFetchRows("SELECT * FROM `mempools` AS M, `devices` as D WHERE D.devi
|
||||
{
|
||||
$text_descr = $mempool['mempool_descr'];
|
||||
|
||||
if ($config['memcached']['enable'])
|
||||
{
|
||||
$state = $memcache->get('mempool-'.$mempool['mempool_id'].'-state');
|
||||
if($debug) { print_r($state); }
|
||||
if(is_array($state)) { $port = array_merge($mempool, $state); }
|
||||
unset($state);
|
||||
}
|
||||
|
||||
|
||||
$mempool_url = "device/device=".$mempool['device_id']."/tab=health/metric=mempool/";
|
||||
$mini_url = "graph.php?id=".$mempool['mempool_id']."&type=".$graph_type."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=80&height=20&bg=f4f4f4";
|
||||
|
||||
|
@@ -308,15 +308,15 @@ $ports = dbFetchRows($query, $param);
|
||||
|
||||
// FIXME - only populate what we need to search at this point, because we shouldn't show *all* ports, as it's silly.
|
||||
|
||||
foreach ($ports as $p)
|
||||
foreach ($ports as $port)
|
||||
{
|
||||
if ($config['memcached']['enable'])
|
||||
{
|
||||
$oids = array('ifInOctets', 'ifOutOctets', 'ifInUcastPkts', 'ifOutUcastPkts', 'ifInErrors', 'ifOutErrors');
|
||||
foreach ($oids as $oid)
|
||||
if ($config['memcached']['enable'])
|
||||
{
|
||||
$ports[$port['port_id']][$oid.'_rate'] = $memcache->get('port-'.$port['port_id'].'-'.$oid.'_rate');
|
||||
if ($debug) { echo("MC[".$oid."->".$port[$oid.'_rate']."]"); }
|
||||
$state = $memcache->get('port-'.$port['port_id'].'-state');
|
||||
if(is_array($state)) { $ports[$port['port_id']] = array_merge($port, $state); }
|
||||
unset($state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user