Discover and register specific network switch, assign template

One way to identifier network devices is by querying this key:
.1.3.6.1.2.1.1.2.0
for "RB951G-2HnD" it will show:
.1.3.6.1.4.1.14988.1
for "WS-C3750G-24TS" it will show:
.1.3.6.1.4.1.9.1.516
in which part these records differ? The answer is:
.9.1.516
.14988.1
And that is why I need to create action to register: