part of IP as custom attribute

TD

Hi,

for our shops we have to set a shop-specific URL and since I don't like to do it for every single shop (90 shops) I was hoping it would be possible to retrieve a part of the ip-address of the device which can be used as part of the url.

The second part of the ip-address always stands for the shop number.

IP= 10.1.2.251   => SHOP 1

For example =>.  http://soti-XXX/login

the XXX should be the second part of the ip-address the android devices are receiving.

For example:   IP device: 10.1.1.1. => URL should be http://soti-001/login (always 3 figures, since shopnumbers go from 1 till 99)

Is there a simple solution to have this done, with custom attributes and scripting maybe ?

Edited 4 years ago
Android
ANSWERS
MD
Matt Dermody Diamond Contributor
4 years ago

Custom Data can be configured to read in a value from an INI file on the device. You could hypothetically write a small Android app that when launched either A) prompts the user for what store they're in and then saves that value to the file, potentially padding it with zeroes in the process, or B) pulls that info from the device IP and does the same padding before saving it to the file. It may be easier to just prompt it for the end users as extracting IP might be problematic given that Google is making accessing that kind of uniquely identifying information more difficult every year. 

Once the value is in the INI file the Custom Data rule can extract it to a Custom Data property which you can then utilize macros in order to feed it into a dynamic URL:

surf://http://soti-%MCCustomData:SHOP%/login

TD
Tim De Jonge
4 years ago

Hi Matt, 

thx for the quick answer !

Personally I would prefer to have the custom attribute from the device IP since when devices are changed from store, the IP automatically changes also.

Could you maybe explain a bit more on how to ?

Like how to get it in an ini file to set the custom data property through a custom data rule...

Sorry, I'm nog really familiair with these configurations....

RC
Raymond Chan Diamond Contributor
4 years ago

Hi Tim,

In response to your message to me requesting for some feedback, I can just add a little bit to what Matt said in his post.

While there is recently added support for using macro in URL for Soti Surf as described by Matt,  extracting of particular octet of %IP% together with formatting to leading-zero three digits in such URL definition is not possible.   Hence,  I beleive what Matt suggested using custom data is currently the simplest workaround to support what you need.

TD
Tim De Jonge
4 years ago

Hi,

would it maybe be possible to create virtual groups for every shop ? since then I can filter on the beginpart of the ip-address which will be like   10.1  for shop 1, 10.2 for shop 2....

Maybe in that way I could run a script that sets the custom attribute ??

RC
Raymond Chan Diamond Contributor
4 years ago (edited 4 years ago)

Wether or not your approach works depends on many deatils/assumptons of your use case which I don't have.  To put effort into that, my company has to charge our customer for a PoC to look into the details and propose a solution.  Hence, I cannot say definitely it's possible or not here.

However, even if you have the expertise to come up with the right scripts for use in your proposed approach, adding 90 virtual device groups and deploying 90 different scripts  look much more complicated to develop and maintain than using the custom data aprroach.

In fact, if you have considered using virtual groups, why not having 90 non-virtual device groups (one for each shop), and each such group has the right custom attribute value already set up? 

TD
Tim De Jonge
4 years ago

Hi Chan,

thx for your response...
We could create non-virtual groups also per shop, and then set custom attribute on each group to inheret to the devices... right ?

Then which URL shoud I create to use the customattribute within ??

RC
Raymond Chan Diamond Contributor
4 years ago (edited 4 years ago)

As a device can belong to multiple virtual groups at the same time, there is possibility of conflicts and difficulty to handle inheritance in virtual-group tree hierarchy.   Hence, there is no "custom attribute" setting options available in the web-console GUI  for you to configure for each virual device group.

TD
Tim De Jonge
4 years ago

If I create different groups for each shop, and the set the custom attribute of the group to the shop number, won't this custom attribute be inhereted by the devices under this group ?

RC
Raymond Chan Diamond Contributor
4 years ago

Hi Tim,

Whenever a device is manually or automatically (e.g. with device relocation or alert rule, etc.) relocated to a device group having a pre-set custom attribute value, it will inherit the value from that device-group by default.

TD
Tim De Jonge
4 years ago

Hi Chan,

that part I already got solved, so a group for every shop named the shopnumber.

next I would like to have the value of the custom attribute which I created called ShopNr filled in.

url: https://shoeshopXXX.youcanbookme.be

where XXX should be the shopnumber taken from the custom attribute ShopNr

url must then be:   https://shoeshop031.youcanbookme.be

if this would be possible, it would mean less work for us, and more flexibility afterwards...

thx in advance