Description:

With the following Add-in script you can configure the syslog on a LANCOM XS-51xx / XS-61xx or GS-45xx series switch.

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

Add-in as JSON file:

xs_syslog.json