UI Questions - Device Tab

Hey guys,

  1. My questions is about the “Device” tab:

A) When I enter in the “Device” tab, just show 10 devices …
Can I increase this number to show more devices at once?

B) And there’s a “More” button in the bottom of the page, but this will go on 10 by 10 devices only …
Can I expand to go 20, 50, 100, etc … ?

C) In the “Filter” search bar, how can I search for MAC Address ?
What I need to change in the “Admin --> Config --> Edit filters” ?

  • label: “‘Serial number’”
    parameter: DeviceID.SerialNumber
    type: “‘string’”
  • label: “‘Tag’”
    parameter: tag
    type: “‘string’”
  • label: “‘PPP’”
    parameter: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.ExternalIPAddress
    type: “‘string’”
  • label: “‘IP’”
    parameter: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress
    type: “‘string’”
  • label: “‘PPPoE’”
    parameter: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.Username
    type: “‘string’”
  • label: “‘MAC-PPP’”
    parameter: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.MACAddress
    type: “‘string’”

D) The “Tag” filter, in the “Filter” search bar, doesn’t work (in didn’t change since I’ve installed the Genie).
There’s any bug or script error?

For now, is just this questions.

Sorry for my English.

If you need any information from scripts or anything else, just ask, that I’ll post here.

Thanks

Create a config entry for ‘pageSize’ from admin → config.

The option above controls this too.

Add something like this:

- label: "'MAC'"
  parameter: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.MACAddress
  type: "'mac'"

The ‘mac’ type lets conveniently search for MAC with or without colons.

IIRC this was a bug that was fixed in master branch. If you installed from npm you can either reinstall from source or wait for the second beta very soon.

2 Likes

Just a small addendum: add ui.pageSize in admin → config, not just pageSize…
:slight_smile:

3 Likes

Hey guys …
I have new questions about the same page (Device Tab - Filters) and the Device Page itself
I’m running the Version 1.2.3+20201027064135

I’ve notice 2 things differents and I want to ask some questions:

  1. Let’s start from the bottom of the Device Page … In this link:
    (http://myGenieServer.intranet.com:3000/#!/devices/OUI-PRODUCTCLASS-SERIALNUMBER)
    In the bottom of the page … “All parameters” …

If I don’t put any filter, in the bottom shows:
“Displaying XXX out of YYYY parameters.”

Can I remove it ?
In the previously version this doesn’t show.
And this is very annoying …

  1. Now, let’s go back at the Device Tab (http://myGenieServer.intranet.com:3000/#!/devices/):

In the Filter field …

The Filter works like a SQL Query, right?
If I put the “%” I can “filter” some things to fast search some device …
Okay so far!
Now, if I want to do an “OR” filter rather than “AND” filter ?
Like this:
I want to search for Serial Number AABBCC112233 and AABBCC112244, to show in the list.
How can I do this?

I found a way using the URL, but this is very difficult and annoying too:
Filter inside the Filter, looks like this:
http://myGenieServer.intranet.com:3000/#!/devices?filter=Q(“Serial number”%2C “SERIALNUMBER-01”) AND Q(“Serial number”%2C “SERIALNUMBER-02”)

This Filter will find SERIALNUMBER-02 inside the filter SERIALNUMBER-01 …
I don’t want this …

I want to search both at the same time …
Just change the “AND” value in the URL and put “OR”, like this:
http://myGenieServer.intranet.com:3000/#!/devices?filter=Q(“Serial number”%2C “SERIALNUMBER-01”) OR Q(“Serial number”%2C “SERIALNUMBER-02”)

Can you guys please create a button to choose between AND and OR filter?
This will help A LOT !!

Thanks in advance!
Best Regards,

P.S1: You guys rocks!

Hey @zaidka

I know that you’ve already done the First thing in my previous post.
Many thanks!

But, can you take a look at the second one?
About the “Filter inside the Filter”.
The “AND” n “OR” thing in the URL filter like below:

http://YourGenieURL:3000/#!/devices?filter=Q(“Serial number”%2C “SERIALNUMBER-01”) AND Q(“Serial number”%2C “SERIALNUMBER-02”)

http://YourGenieURL:3000/#!/devices?filter=Q(“Serial number”%2C “SERIALNUMBER-01”) OR Q(“Serial number”%2C “SERIALNUMBER-02”)

It’s really a need !

Many thanks again. =P

Hi @zaidka ,

I would like to understand how to configure properly the “more” button as you can see in the picture.

I already configured the ui.pageSize but it show all the devices at once. I would like to configure the more button only to show all the devices I have. I do not know why but right now it stops to 200 devices. It is ok to add 10 device each time I click more but how can I list all the devices ?

Thank You !

What I do when I need more than 200 devices, I download the CSV file and import it into a database.
Then I use SQL the get the Data I need from DB.

Alternatively I use small Scripts with the CSV files. e.g. I had to reboot over 100 devices and then read a parameter from the device.

More than 200 Devices at the same the could create performance problems on the client machine.

@JonasGhost Don’t know if this will help you, but here is a PHP script I wrote years ago to reboot CPEs based upon a given filter. I haven’t needed this script in years so it might be slightly out of date.

<?php

$nbi = 'https://your_ip_or_host_name:7557';

$filter = [
    '_lastBoot'                  => ['$lt' => '2019-11-14 03:00:00 -0900'],
    'VirtualParameters.location' => 'SomeCity',
    '_lastInform'                => ['$gte' => '2019-11-14 07:16:18 -0900'],
    '_tags'                      => ['$ne' => 'Bridged'],
];

$devices = queryNbi($nbi, $filter);
$count = count($devices);

printf("Rebooting %d devices\r\n", $count);

foreach ($devices as $id) {
    $uri = sprintf('%s/devices/%s/tasks?timeout=2000&connection_request', $nbi, rawurlencode($id));

    if (!rebootDevice($uri)) {
        print("Error rebooting device ${id}\r\n");
    }
}

printf("Rebooted %d devices\r\n\r\n", $count);

function rebootDevice(string $uri): bool {
//    $exec = sprintf("curl -X POST '%s' --data '%s'", $uri, json_encode(['name' => 'reboot']));
//    print "${exec}\r\n";
//    return true;

    $ch = createCurl($uri);

    curl_setopt_array($ch, [
        CURLOPT_CUSTOMREQUEST => 'POST',
        CURLOPT_HTTPHEADER => [
            'Content-Type: application/json; charset=utf-8',
            'Accept:application/json, text/javascript, */*; q=0.01'
        ],
        CURLOPT_HEADER => true,
        CURLINFO_HEADER_OUT => true,
        CURLOPT_POSTFIELDS, http_build_query(['name' => 'reboot']),
        CURLOPT_RETURNTRANSFER => TRUE,
        CURLOPT_FOLLOWLOCATION => TRUE,
        CURLOPT_VERBOSE => TRUE,
        CURLOPT_STDERR => $verbose = fopen('php://temp', 'rw+'),
        CURLOPT_FILETIME => TRUE,
    ]);
    $result = curl_exec($ch);

    echo "Verbose information:\n", !rewind($verbose), stream_get_contents($verbose), "\n";
    fclose($verbose);
    echo $result;

    $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    $info = curl_getinfo($ch);

    return $statusCode === 200;
}

function queryNbi(string $nbi, array $filter) {
    $projection = '_id';

    $uri = sprintf('%s/devices/?query=%s&projection=%s', $nbi, rawurlencode(json_encode($filter)), $projection);

    $curl = createCurl($uri);

    $data = json_decode(curl_exec($curl), true);

    curl_close($curl);

    return array_map(fn ($row) => $row['_id'], $data);
}

function createCurl(string $url) {
    $curl = curl_init();

    curl_setopt($curl, CURLOPT_TIMEOUT_MS, 20000);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

    curl_setopt($curl, CURLOPT_URL, $url);

    return $curl;
}
1 Like

I asked about this before. You can’t. There is a hard limit of 200. You will need to use filters to reduce the size of the list to below 200.

Hi,

Is there any plan to increase the size from 200?

We have roughly 3500 routers in deployment currently.

Its work? or i made a mistake?

2 Likes

Looks right. If you’re on 1.2.7 then this is a known bug. Try downgrading to 1.2.5, or wait a couple of days for the next release that will address this issue.

Thanks. I’ll wait

I ran into a issue, which I currently try by automatically rebooting the devices once a week or so.
The script was very helpful :smiley:

The issue I have:
The new CPE type does not send informs after some time. When restarting the device it is working again. Unfortunately the device does not react on connection request, when that problem showed up.

We have the same issue. When we are doing our required performance testing (required for government grants) I reboot the CPEs every morning of the test cycle.

1 Like

Here is another approach that may be useful for you @JonasGhost. Every morning at 3 AM, I query the ACS for all CPEs that has informed more than 2 hours ago. I then have some code which attempts to log into the CPE via SSH and issues the reboot command. Using this approach, I’ve significantly reduced the number of “it doesn’t work” messages from coworkers.

2 Likes

Thanks! It´s great!!

Hi! Version v1.2.8+20211027200938 does not allow paging after modifying the ui.pageSizeto parameter to 10,20,30 or 200 per page; does not list all devices. It only does it if I set the parameter to more than the total for example: if I have 400 devices in ui.pageSize I set it to 1000 and it shows them all in a single “page”.

tag each device and use the filter. In my case I have each device tagged with the customer Id.

1 Like

Thanks, but I not understand your solution.
Can you explain “how make” about tag each device or send me an example ?
Thank you!