script provision behaviour

Dan Morphis dan at milkcarton.com
Fri May 5 05:19:13 EDT 2017


Because genie is going to keep running the script (as long as the precondition is met) until there are no more changes.

This block is unnecessary, as those values are sent in every inform by the device:
> declare("InternetGatewayDevice.DeviceInfo.SerialNumber", {value: 1});
> declare("InternetGatewayDevice.DeviceInfo.ProductClass", {value: 1});
> declare("InternetGatewayDevice.DeviceInfo.ManufacturerOUI", {value: 1});
> declare("InternetGatewayDevice.DeviceInfo.Manufacturer", {value: 1});


In your case, declare("Device.*", {value: now}); refreshes the entire model (the change in this case). Take that part out and only refresh the few specific parameters you actually care about and the script should only execute once.

-dan

> On May 5, 2017, at 12:17 AM, Miguel Ángel Sánchez Moragues <sanchez.moragues at gmail.com> wrote:
> 
> Hi,
> 
> I have the following script which is execute every "2 PERIODIC" event:
> 
> let now = Date.now();
> let serialNumber = declare("DeviceID.SerialNumber", {value: 1});
> 
> log('start refresh2 script SN=' + serialNumber.value[0]);
> 
> declare("InternetGatewayDevice.DeviceInfo.SerialNumber", {value: 1});
> declare("InternetGatewayDevice.DeviceInfo.ProductClass", {value: 1});
> declare("InternetGatewayDevice.DeviceInfo.ManufacturerOUI", {value: 1});
> declare("InternetGatewayDevice.DeviceInfo.Manufacturer", {value: 1});
> 
> declare("Device.*", {value: now});
> 
> log('end refresh2 script SN=' + serialNumber.value[0]);
> 
> 
> In the log, I see the first time after the device was new registered, the script was executed two times:
> 
> May  5 09:56:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:56:59.204Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Inform; cpeRequestId="846930886" informEvent="2 PERIODIC" informRetryCount=0
> May  5 09:56:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:56:59.306Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Script: start refresh2 script SN=xyz
> May  5 09:56:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:56:59.310Z [INFO] 192.168.1.10 D837BE-ONU-xyz: ACS request; acsRequestId="15bd79ca5b7100" acsRequestName="GetParameterValues"
> May  5 09:56:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:56:59.378Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Script: end refresh2 script SN=xyz
> May  5 09:56:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:56:59.383Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Script: start refresh2 script SN=xyz
> May  5 09:56:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:56:59.385Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Script: end refresh2 script SN=xyz
> 
> May  5 09:58:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:58:59.276Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Inform; cpeRequestId="1681692777" informEvent="2 PERIODIC" informRetryCount=0
> May  5 09:58:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:58:59.329Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Script: start refresh2 script SN=xyz
> May  5 09:58:59 acs2 genieacs-cwmp[887]: 2017-05-05T07:58:59.332Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Script: end refresh2 script SN=xyz
> 
> May  5 10:00:59 acs2 genieacs-cwmp[887]: 2017-05-05T08:00:59.374Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Inform; cpeRequestId="1714636915" informEvent="2 PERIODIC" informRetryCount=0
> May  5 10:00:59 acs2 genieacs-cwmp[887]: 2017-05-05T08:00:59.425Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Script: start refresh2 script SN=xyz
> May  5 10:00:59 acs2 genieacs-cwmp[887]: 2017-05-05T08:00:59.430Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Script: end refresh2 script SN=xyz
> 
> May  5 10:02:59 acs2 genieacs-cwmp[887]: 2017-05-05T08:02:59.392Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Inform; cpeRequestId="1957747793" informEvent="2 PERIODIC" informRetryCount=0
> May  5 10:02:59 acs2 genieacs-cwmp[887]: 2017-05-05T08:02:59.460Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Script: start refresh2 script SN=xyz
> May  5 10:02:59 acs2 genieacs-cwmp[887]: 2017-05-05T08:02:59.462Z [INFO] 192.168.1.10 D837BE-ONU-xyz: Script: end refresh2 script SN=xyz
> 
> 
> 
> Why did acs has this behaviour?
> _______________________________________________
> Users mailing list
> Users at lists.genieacs.com
> http://lists.genieacs.com/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20170505/63ee7101/attachment-0001.html>


More information about the Users mailing list