mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Some more tweaks
This commit is contained in:
@ -48,6 +48,10 @@ function influx_update($device,$measurement,$tags=array(),$fields) {
|
||||
$tmp_fields = array();
|
||||
$tmp_tags['hostname'] = $device['hostname'];
|
||||
foreach ($tags as $k => $v) {
|
||||
$v = preg_replace(array('/ /','/,/','/=/'),array('\ ','\,','\='), $v);
|
||||
if (empty($v)) {
|
||||
$v = '_blank_';
|
||||
}
|
||||
$tmp_tags[$k] = $v;
|
||||
}
|
||||
foreach ($fields as $k => $v) {
|
||||
|
@ -486,7 +486,7 @@ foreach ($ports as $port) {
|
||||
$fields['ifInOctets_rate'] = $port['ifInOctets_rate'];
|
||||
$fields['ifOutOctets_rate'] = $port['ifOutOctets_rate'];
|
||||
|
||||
$tags = array('ifName' => '"'.$port['ifName'].'"', 'ifSpeed' => '"'.$port['ifSpeed'].'"', 'port_descr_type' => '"'.$port['port_descr_type'].'"');
|
||||
$tags = array('ifName' => $port['ifName'], 'port_descr_type' => $port['port_descr_type']);
|
||||
influx_update($device,'ports',$tags,$fields);
|
||||
|
||||
// End Update IF-MIB
|
||||
|
Reference in New Issue
Block a user