Provision Based on OUI / Device Vendor

Hello,

In Default Provision can i edit it so it declare values (update values) based on the device OUI / Vendor ?
Is the below provision is right ?

// set 5 minutes refresh parameter
const min = Date.now(30000)
const now = Date.now()
const OUI = declare(“DeviceID.OUI”, {path:min, value:min});

if (OUI.value == “000271” || “40f21c”){
declare(“InternetGatewayDevice”, {path:min, value:min});
}
else if (OUI.value == “00259E”){
declare(“InternetGatewayDevice.DeviceInfo”, {path:min, value:min});
}
else
{
declare(“Device”, {path:min, value:min});
}

Why are you trying to refresh the entire object model for all of your devices? This is wildly inefficient and will slow down the provisioning process.

1 Like

This is as an example, i dont want to refresh the full model, i want to refresh specific parameters.
But is that right provision script ? since it does not work .

You can put it in any provision script. What I typically do is have multiple provision scripts. I have one just for refreshing DSL stats. Another that is kicked off by 8 DIAGNOSTICS COMPLETE, another for WAN and LAN data.

Here is one for refreshing DSL information every two days:

/* global declare:false */
//log('Refresh_ATM_Stats');
const oneDay = 60 * 60 * 24 * 1000; // 60 secs / minute, 60 mins / hour, 24 hrs / day
const dslRefreshInterval = Date.now() - (oneDay * 1.5);
const statsRefreshInterval = Date.now() - (oneDay * 0.25);
const twoDaysAgo = Date.now() - (oneDay * 2);

const paramNames = [
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.ModulationType',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.UpstreamCurrRate',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.DownstreamCurrRate',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.UpstreamMaxRate',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.DownstreamMaxRate',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.UpstreamNoiseMargin',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.DownstreamNoiseMargin',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.UpstreamAttenuation',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.DownstreamAttenuation',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.UpstreamPower',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.DownstreamPower',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.LinkEncapsulationUsed',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.LineNumber',
    'InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.X_BROADCOM_COM_BondingLineNumber',
    'Device.DSL.Channel.*.UpstreamCurrRate',
    'Device.DSL.Channel.*.DownstreamCurrRate',
    'Device.DSL.Channel.*.LinkEncapsulationUsed',
    'Device.DSL.Channel.*.Stats.*.*',
    'Device.DSL.Line.*.UpstreamMaxBitRate',
    'Device.DSL.Line.*.DownstreamMaxBitRate',
    'Device.DSL.Line.*.UpstreamNoiseMargin',
    'Device.DSL.Line.*.DownstreamNoiseMargin',
    'Device.DSL.Line.*.UpstreamAttenuation',
    'Device.DSL.Line.*.DownstreamAttenuation',
    'Device.DSL.Line.*.UpstreamPower',
    'Device.DSL.Line.*.DownstreamPower',
    'Device.DSL.Line.*.LineNumber',
    'Device.DSL.Line.*.X_ZYXEL_BondingLineNumber'
];

for(let key of paramNames) {
    //log('Refreshing ATM key', {key: key});
    declare(key, {path: twoDaysAgo, value: dslRefreshInterval});
}

// Refresh stats every 4 hours
declare('InternetGatewayDevice.WANDevice.*.WANDSLInterfaceConfig.Stats.*.*', {path: twoDaysAgo, value: statsRefreshInterval});
declare('Device.DSL.Line.*.Stats.*.*', {path: twoDaysAgo, value: statsRefreshInterval});
declare('Device.DSL.Channel.*.Stats.*.*', {path: twoDaysAgo, value: statsRefreshInterval});

Thank You for Help, Will check and get back to you if there are any issue.