mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Remove legacy function calls (#12651)
* massive inlines * fix style and wtf * remove rrdtool.inc.php include * fix CommonFunctions namespace issues * looking for missing class space, fix undefined class issues * style fixes
This commit is contained in:
@@ -44,7 +44,7 @@ if (isset($options['h'])) {
|
||||
$params = $device_ids;
|
||||
} else {
|
||||
$where = 'AND `hostname` LIKE ?';
|
||||
$params = [str_replace('*', '%', mres($options['h']))];
|
||||
$params = [str_replace('*', '%', $options['h'])];
|
||||
}
|
||||
}
|
||||
$devices = dbFetchRows("SELECT * FROM `devices` WHERE status = 1 AND disabled = 0 $where ORDER BY `hostname` ASC", $params);
|
||||
|
@@ -128,25 +128,25 @@ function print_help()
|
||||
$options = getopt('b:s:h:i:f:np:t:q:');
|
||||
|
||||
if (! empty($options['s'])) {
|
||||
$host_glob = str_replace('*', '%', mres($options['s']));
|
||||
$host_glob = str_replace('*', '%', $options['s']);
|
||||
$nameType = 'sysName';
|
||||
}
|
||||
if (! empty($options['h'])) {
|
||||
$host_glob = str_replace('*', '%', mres($options['h']));
|
||||
$host_glob = str_replace('*', '%', $options['h']);
|
||||
$nameType = 'hostname';
|
||||
}
|
||||
if (array_key_exists('n', $options)) {
|
||||
$create_bill = true;
|
||||
}
|
||||
if (! empty($options['t'])) {
|
||||
$bill_type = mres($options['t']);
|
||||
$bill_type = $options['t'];
|
||||
}
|
||||
if (! empty($options['q'])) {
|
||||
$bill_cdr = mres($options['q']);
|
||||
$bill_cdr = $options['q'];
|
||||
}
|
||||
|
||||
$bill_name = str_replace('*', '%', mres($options['b']));
|
||||
$intf_glob = str_replace('*', '%', mres($options['i']));
|
||||
$bill_name = str_replace('*', '%', $options['b']);
|
||||
$intf_glob = str_replace('*', '%', $options['i']);
|
||||
|
||||
// Exit if no bill
|
||||
if (empty($bill_name)) {
|
||||
|
@@ -59,7 +59,7 @@ $tmp_path = Config::get('temp_dir', '/tmp');
|
||||
if ($hostname === 'all') {
|
||||
$hostname = '*';
|
||||
}
|
||||
$files = glob(get_rrd_dir($hostname) . '/*.rrd');
|
||||
$files = glob(Rrd::dirFromHost($hostname) . '/*.rrd');
|
||||
|
||||
$converted = 0;
|
||||
$skipped = 0;
|
||||
@@ -99,8 +99,8 @@ foreach ($files as $file) {
|
||||
}
|
||||
|
||||
echo "Converting $file: ";
|
||||
$command = "$rrdtool dump $file > $random &&
|
||||
sed -i 's/<step>\([0-9]*\)/<step>$step/' $random &&
|
||||
$command = "$rrdtool dump $file > $random &&
|
||||
sed -i 's/<step>\([0-9]*\)/<step>$step/' $random &&
|
||||
sed -i 's/<minimal_heartbeat>\([0-9]*\)/<minimal_heartbeat>$heartbeat/' $random &&
|
||||
$rrdtool restore -f $random $file &&
|
||||
rm -f $random";
|
||||
|
@@ -6,8 +6,8 @@ require realpath(__DIR__ . '/..') . '/includes/init.php';
|
||||
|
||||
$options = getopt('h:p:');
|
||||
|
||||
$hosts = str_replace('*', '%', mres($options['h']));
|
||||
$ports = str_replace('*', '%', mres($options['p']));
|
||||
$hosts = str_replace('*', '%', $options['h']);
|
||||
$ports = str_replace('*', '%', $options['p']);
|
||||
|
||||
if (empty($hosts) && empty($ports)) {
|
||||
echo "-h <device hostname wildcard> Device(s) to match (all is a valid arg)\n";
|
||||
|
Reference in New Issue
Block a user