NBI add object

Dan Morphis dan at milkcarton.com
Tue Jun 19 10:43:01 EDT 2018


Provision script log to the cwmp log file. 

-dan

> On Jun 15, 2018, at 2:47 PM, Don Johnson <don.johnson at uniserveteam.com> wrote:
> 
> I’m attempting to update our instance of GenieACS to version 1.1.2, and in that attempt I am setting up the provisioning scripts and external scripts and our own api server for this work flow.   My question is where can I see all the log messages that your examples create?
>  
> I’ll admit I am not Ruby or Node.js proficient, and so I’m certain I am just not looking in the right spot.  They don’t appear in the output of the cwmp or gui, which I am running on a tmux session, and I can’t find anything in the development.log of the gui app.
>  
> I feel like I’m developing this blind, and I can’t even tell if the presets are firing the provisioning scripts.
>  
> -Don
>  
>  
> From: Users <users-bounces at lists.genieacs.com> On Behalf Of Dan Morphis
> Sent: May 15, 2018 9:31 AM
> To: Community support for GenieACS users <users at lists.genieacs.com>
> Subject: Re: NBI add object
>  
> Provision scripts will take care of adding object instances if needed. You will have so many fewer issues if you switch to using provisioning scripts and move away from using the API to add specific object instances. I went from getting several emails a week about modems not working properly when we used the old v1.0 way of configuring CPEs (manually adding/deleting object instances, etc), to going over a year with no complaints about the CPE provisioning process.
>  
> This right here is all the code in a provisioning script you need to ensure that a PPPoE connection is created for the device. Add a few dozen lines in your external script and whatever API code you need, and any device/mfgr specific code to the provisioning script and you can easily have CPEs auto provisioning in under 200 lines of code.
>  
> const now = Date.now();
>  
> let provisioned = declare("Tags.Provisioned", {value: 1});
> if (provisioned.value !== undefined) {
>   log('CPE is provisioned, returning');
>   return;
> }
>  
> let model = declare("InternetGatewayDevice.DeviceInfo.ModelName", {value: 1}).value[0];
> let serialNumber = declare("DeviceID.SerialNumber", {value: 1}).value[0];
> let productClass = declare("DeviceID.ProductClass", {value: 1}).value[0];
> let oui = declare("DeviceID.OUI", {value: 1}).value[0];
> let args = {serial: serialNumber, productClass: productClass, oui: oui};
>  
> //Get the PPPoE creds from our external script which calls out to our API
> let config = ext('cpe-config', 'resetPppoe', JSON.stringify(args));
> if (!config) {
>   log('SmartRG_Managed - No config returned from API');
>   return;
> }
>  
> //Ensure we have 1 WANPPPConnection instance on the ATM device
> log('SmartRG_Managed - Creating WANPPPConnection (if necessary)');
> declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.*", null, {path: 1});
>  
> log('SmartRG_Managed - Setting up WANPPPConnection');
> declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.*.*", {path: now}); //Refresh the node...
>  
> declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.*.Name", {value: now}, {value: "Internet"});
> declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.*.ConnectionType", {value: now}, {value: "IP_Routed"});
> declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.*.X_BROADCOM_COM_IfName", {value: now}, {value: "ppp0.1"});
> declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.*.NATEnabled", {value: now}, {value: true});
> declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.*.X_BROADCOM_COM_FirewallEnabled", {value: now}, {value: true});
> declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.*.Enable", {value: now}, {value: true});
> declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.*.PPPoEServiceName", {value: now}, {value: "broadband"});
>  
>  
> //{value: now} forces GenieACS to update the value of the username/password
> log('SmartRG_Managed - Setting un: ' + config.username + ', pw: ' + config.password);
> declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Username", {value: now}, {value: config.username});
> declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Password", {value: now}, {value: config.password});
>  
> log('Done configuring. Setting tags');
> declare("Tags.Provisioned", null, {value: true});
>  
>  
> _______________________________________________
> 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/20180619/6b9363aa/attachment-0001.html>


More information about the Users mailing list