Difference between revisions of "GenieACS: Script config, provision dll"

From Catatan IBM
Jump to navigation Jump to search
(Created page with "* Tambah Permission untuk device Role: Device Resource: devices Access: write Validate: true * Tambah User baru untuk authentikasi ke device. nama user: [email protected] password: sandiku Roles: Device ===Config=== ===index page=== - label: "'Serial number'" parameter: DeviceID.SerialNumber type: "'device-link'" components: - type: "'parameter'" - label: "'Product class'" parameter: DeviceID.ProductClass - label: "'Software version'" pa...")
 
 
Line 122: Line 122:
===Provisions===
===Provisions===
  ===Inform===
  ===Inform===
 
  // Device ID as user name
  // Device ID as user name
  //const username = declare("DeviceID.ID", {value: 1}).value[0]
  //const username = declare("DeviceID.ID", {value: 1}).value[0]

Latest revision as of 07:20, 1 October 2023

  • Tambah Permission untuk device
Role: Device
Resource: devices
Access: write
Validate: true
  • Tambah User baru untuk authentikasi ke device.
nama user: [email protected]
password: sandiku
Roles: Device

Config

===index page===

- label: "'Serial number'"
  parameter: DeviceID.SerialNumber
  type: "'device-link'"
  components:
    - type: "'parameter'"
- label: "'Product class'"
  parameter: DeviceID.ProductClass
- label: "'Software version'"
  parameter: InternetGatewayDevice.DeviceInfo.SoftwareVersion
- label: "'IP'"
  parameter: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress
- label: "'SSID'"
  parameter: InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSID
- element: "'span.inform'"
  label: "'Last inform'"
  parameter: DATE_STRING(Events.Inform)
  type: "'container'"
  components:
    - type: "'parameter'"
    - chart: "'online'"
      type: "'overview-dot'"
- label: "'Tags'"
  parameter: Tags
  type: "'tags'"
  unsortable: true
  writable: false
===Device Page===

- type: "'tags'"
- type: "'ping'"
- type: "'parameter-list'"
  parameters:
    - element: "'span.inform'"
      label: "'Last inform'"
      parameter: DATE_STRING(Events.Inform)
      type: "'container'"
      components:
        - type: "'parameter'"
        - chart: "'online'"
          type: "'overview-dot'"
        - type: "'summon-button'"
          parameters:
            - InternetGatewayDevice.DeviceInfo.HardwareVersion
            - InternetGatewayDevice.DeviceInfo.SoftwareVersion
            - InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANIPConnection.*.MACAddress
            - InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANIPConnection.*.ExternalIPAddress
            - InternetGatewayDevice.LANDevice.*.WLANConfiguration.*.SSID
            - InternetGatewayDevice.LANDevice.*.WLANConfiguration.*.KeyPassphrase
            - InternetGatewayDevice.LANDevice.*.Hosts.Host.*.HostName
            - InternetGatewayDevice.LANDevice.*.Hosts.Host.*.IPAddress
            - InternetGatewayDevice.LANDevice.*.Hosts.Host.*.MACAddress
    - label: "'Serial number'"
      parameter: DeviceID.SerialNumber
    - label: "'Product class'"
      parameter: DeviceID.ProductClass
    - label: "'OUI'"
      parameter: DeviceID.OUI
    - label: "'Manufacturer'"
      parameter: DeviceID.Manufacturer
    - label: "'Hardware version'"
      parameter: InternetGatewayDevice.DeviceInfo.HardwareVersion
    - label: "'Software version'"
      parameter: InternetGatewayDevice.DeviceInfo.SoftwareVersion
    - label: "'MAC'"
      parameter: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.MACAddress
    - label: "'IP WAN'"
      parameter: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.2.ExternalIPAddress
    - label: "'IP WAN'"
      parameter: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.ExternalIPAddress
    - label: "'IP'"
      parameter: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress
    - label: "'WLAN SSID'"
      parameter: InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSID
    - label: "'WLAN passphrase'"
      parameter: InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.KeyPassphrase
    - label: "'Redaman'"
      parameter: InternetGatewayDevice.WANDevice.1.X_ZTE-COM_WANPONInterfaceConfig.RXPower
- label: "'LAN hosts'"
  parameter: InternetGatewayDevice.LANDevice.1.Hosts.Host
  type: "'parameter-table'"
  childParameters:
    - label: "'Host name'"
      parameter: HostName
    - label: "'IP address'"
      parameter: IPAddress
    - label: "'MAC address'"
      parameter: MACAddress
- element: "'div'"
  type: "'container'"
  components:
    - element: "'h3'"
      type: "'container'"
      components:
        - "'Faults'"
    - type: "'device-faults'"
- element: "'div.container-full-width'"
  type: "'container'"
  components:
    - element: "'h3'"
      type: "'container'"
      components:
        - "'All parameters'"
    - type: "'all-parameters'"
- type: "'device-actions'" 


Provisions

===Inform===

// Device ID as user name
//const username = declare("DeviceID.ID", {value: 1}).value[0]
const username = "[email protected]";
const requestname = "acs";

// Password will be fixed for a given device because Math.random() is seeded with device ID by default.
//const password = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER).toString(36);
const password = "sandiku";
const requestpassword = "acs";

const informInterval = 300;

// Refresh values daily
const daily = Date.now(86400000);

// Unique inform offset per device for better load distribution
const informTime = daily % 86400000;

declare("InternetGatewayDevice.ManagementServer.Username", {value: daily}, {value: username});
declare("InternetGatewayDevice.ManagementServer.Password", {value: daily}, {value: password});
declare("InternetGatewayDevice.ManagementServer.ConnectionRequestUsername", {value: daily}, {value: requestname});
declare("InternetGatewayDevice.ManagementServer.ConnectionRequestPassword", {value: daily}, {value: requestpassword});
declare("InternetGatewayDevice.ManagementServer.PeriodicInformEnable", {value: daily}, {value: true});
declare("InternetGatewayDevice.ManagementServer.PeriodicInformInterval", {value: daily}, {value: informInterval});
//declare("InternetGatewayDevice.ManagementServer.PeriodicInformTime", {value: daily}, {value: informTime});

declare("Device.ManagementServer.Username", {value: daily}, {value: username});
declare("Device.ManagementServer.Password", {value: daily}, {value: password});
declare("Device.ManagementServer.ConnectionRequestUsername", {value: daily}, {value: requestname});
declare("Device.ManagementServer.ConnectionRequestPassword", {value: daily}, {value: requestpassword});
declare("Device.ManagementServer.PeriodicInformEnable", {value: daily}, {value: true});
declare("Device.ManagementServer.PeriodicInformInterval", {value: daily}, {value: informInterval});
//declare("Device.ManagementServer.PeriodicInformTime", {value: daily}, {value: informTime});

//const username = declare("DeviceID.ID", {value: 1}).value[0] - user admin modem
const adminusername = "admin";
const adminpassword = "passadmin";

//declare F670L
declare("InternetGatewayDevice.User.1.Username", {value: daily}, {value: adminusername});
declare("InternetGatewayDevice.User.1.Password", {value: daily}, {value: adminpassword});

//declare F690 v1
declare("InternetGatewayDevice.X_ZTE-COM_UserInterface.X_ZTE-COM_WebUserInfo.AdminName", {value: daily}, {value: adminusername});
declare("InternetGatewayDevice.X_ZTE-COM_UserInterface.X_ZTE-COM_WebUserInfo.AdminPassword", {value: daily}, {value: adminpassword});