mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Check that $fields has value
This commit is contained in:
@ -300,6 +300,7 @@ function rrdtool_escape($string, $maxlength=null){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function rrdtool_tune($type, $filename, $max) {
|
function rrdtool_tune($type, $filename, $max) {
|
||||||
|
$fields = array();
|
||||||
if ($type === 'port') {
|
if ($type === 'port') {
|
||||||
if ($max < 10000000) {
|
if ($max < 10000000) {
|
||||||
return false;
|
return false;
|
||||||
@ -309,6 +310,8 @@ function rrdtool_tune($type, $filename, $max) {
|
|||||||
'INOCTETS','OUTOCTETS','INERRORS','OUTERRORS','INUCASTPKTS','OUTUCASTPKTS','INNUCASTPKTS','OUTNUCASTPKTS','INDISCARDS','OUTDISCARDS','INUNKNOWNPROTOS','INBROADCASTPKTS','OUTBROADCASTPKTS','INMULTICASTPKTS','OUTMULTICASTPKTS'
|
'INOCTETS','OUTOCTETS','INERRORS','OUTERRORS','INUCASTPKTS','OUTUCASTPKTS','INNUCASTPKTS','OUTNUCASTPKTS','INDISCARDS','OUTDISCARDS','INUNKNOWNPROTOS','INBROADCASTPKTS','OUTBROADCASTPKTS','INMULTICASTPKTS','OUTMULTICASTPKTS'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$options = "--maximum " . implode(":$max --maximum ", $fields). ":$max";
|
if (count($fields) > 0) {
|
||||||
rrdtool('tune', $filename, $options);
|
$options = "--maximum " . implode(":$max --maximum ", $fields). ":$max";
|
||||||
|
rrdtool('tune', $filename, $options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user