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});