Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Deutsch

Beschreibung:

Liste der verwendeten Variablen:

VariableBeschreibung




Add-In Code

/**
 * @param {Config} config
 * @param {Context} context
 * Do not edit this comment or parameter types. Required for code suggestions
*/
exports.main = function (config, context) {
    // Function to create VRRP Entry
    var addVRRPEntry = function (routerID, routerIP, mainPrio, backupPrio, remoteSite, comment) {
        var table1_2_8_21_2 = config.getTableByOid("1.2.8.21.2");
        var table_1_2_8_21_2_row_1 = table1_2_8_21_2.createNewRow();
        table_1_2_8_21_2_row_1.setByOid(1, routerID);
        table_1_2_8_21_2_row_1.setByOid(2, routerIP);
        table_1_2_8_21_2_row_1.setByOid(3, mainPrio);
        table_1_2_8_21_2_row_1.setByOid(4, backupPrio);
        table_1_2_8_21_2_row_1.setByOid(5, remoteSite);
        table_1_2_8_21_2_row_1.setByOid(6, comment);
        table1_2_8_21_2.addOrMerge(table_1_2_8_21_2_row_1);
    };
    // If Statement to only create VRRP Entry, if device has the variable VRRP_Prio
    if (context.vars.VRRP_PRIO != "") {
        config.setScalarByOid("1.2.8.21.1", "1");
        // Function Call to create a new Entry
        addVRRPEntry("1", "10.10.10.254", context.vars.VRRP_PRIO, "0", "INTERNET", "");
    }
};

Addin als JSON-Datei:



Englisch

Description: 

Configure the Syslog on LANCOM Switches of the XS series.

With the following Addin script you can configure the syslog on LANCOM Switches of the XS series:

Used variables:

VariableDescription
Add-In Code




/**
 * @param {Config} config
 * @param {Context} context
 * Do not edit this comment or parameter types. Required for code suggestions
*/
exports.main = function (config, context) {
    //Local Syslog Settings
    config.setScalarByOid("16.14.1.4.1", "1"); // Enable (1) or Disable Syslog (2)
    config.setScalarByOid("16.14.1.4.8", "0"); // Syslog Protocol Version RFC 3164 (0) or Version RFC 5424 (1)
    config.setScalarByOid("16.14.1.4.3", "514"); // Local UDP Port Default 514
    //External Syslog Server
    var SyslogServer = config.getTableByOid("16.14.1.4.5");
    var SyslogServer_row = SyslogServer.createNewRow();
    SyslogServer_row.setByOid("2", AddressType); // Addresstype unknown (0), ipv4 (1), ipv6 (2), dns (16)
    SyslogServer_row.setByOid("3", Address); // Address
    SyslogServer_row.setByOid("4", "514"); // UDP Port of Syslog Server Default 514
    SyslogServer_row.setByOid("5", LogSeverity); // Log Severity emergency (0), alert (1), critical (2), error (3), warning (4), notice (5), informational (6), debug (7)

    /*TLS Settings: Include only if needed
    SyslogServer_row.setByOid("8", "0"); // TLS On (1) or Off (0)
    SyslogServer_row.setByOid("9", "1"); // Authentication Method anon (0) x509name (1)
    SyslogServer_row.setByOid("10", ""); // Certificate Number RangeMin 0 RangeMax 8
    */
    SyslogServer.addOrMerge(SyslogServer_row);
};

View file
namexs_syslog.json
height250

...