Example use case 1: Device classification

<< Click to Display Table of Contents >>

Raynet One > 1.1 > User Guide > Technical overview > Regular expressions 

Example use case 1: Device classification

In modern corporate environments, a lot of devices are used across departments and employees. It can be hard to keep track of them all. A good structure is necessary to understand each device's purpose. This can be achieved by assigning device names according to a common format. Device names can be matched by regular expressions to allow job execution on a multitude of devices, scheduled by days, months, or events. We want to take a look at an example company structure for clarification.

 

In the event of new device addition following a good structure, automated jobs will pick them up, resulting in seamless integration of the new device into corporate device management strategies.

 

A different device name format can be used for devices in maintenance state (dev-maintain-1) or other special needs (undisrupted use in corporate events, migration of data from one device to another). Device names can be changed by adjusting their hostname. To allow for such smart strategies, the device administration has to follow the regular expression format closely.

Company structure

There are the following departments: development (dev), sales (sale), consulting (consu) and management (mgmt). Each department has up to four rooms (1, 2, 3, 4). Every device assigned to a room is given a natural number (1, 2, 3, ... ).

Example device listing

dev-R1-1, dev-R1-2, dev-R2-1, dev-R3-3, sale-R1-1, sale-R1-3, sale-R1-4, sale-R2-2, sale-R2-3, sale-R3-4,
sale-R4-1, mgmt-R1-1, mgmt-R1-2, consu-R1-1, consu-R2-1, consu-R3-1

Regular expression format

The structure of the company device names is the following.

 

[department]-R[department room number]-[room device number]

 

The following C# regular expression matches the format.

 

(dev|sale|consu|mgmt)-R\d+-\d+

Making use of the structure

1.To select the devices from just the sales department, use
 
sale-R\d+-\d+
 
Result: sale-R1-1, sale-R1-3, sale-R1-4, sale-R2-2, sale-R2-3, sale-R3-4, sale-R4-1
 

2.To select devices from the first two rooms of each department, use
 
(sale|dev|consu|mgmt)-R(1|2)-\d+
 
Result: dev-R1-1, dev-R1-2, dev-R2-1, sale-R1-1, sale-R1-3, sale-R1-4, sale-R2-2, sale-R2-3, mgmt-R1-1, mgmt-R1-2, consu-R1-1, consu-R2-1

Expansion ideas

Unless the strategy is perfect, there is always room for improvement or change in it. Here are some suggestions about how the above strategy could be fit closer to your needs.

 

Decouple the room from the department, allowing you to select specific rooms really simply.

Add location tags to the device name format, used in multi-location or international companies.