Skip to content
Yannick Croissant edited this page Aug 17, 2013 · 7 revisions
  • connection: Return the list of the current connections.
  • info: Return informations about the NAS.
  • logViewer: Return system logs.
  • service: Return the service's list and their status.

dsm.connection

Return the list of the current connections.

Parameters

None.

Example

var Synology = require('synology');

var syno = new Synology();

syno.dsm.connection(function(err, data) {
  if (err) throw err;
  console.log(data);
});

Results

{
    "data": {
        "connections": [{
            "activity": "Storage1",
            "address": "HTPC(192.168.0.26)",
            "timestamp": 1376596086,
            "type": "samba",
            "user": "xbmc"
        }, {
            "activity": "DiskStation Manager",
            "address": "192.168.0.10",
            "timestamp": 1376698031,
            "type": "dsm",
            "user": "john"
        }]
    },
    "success": true
}

dsm.info

Return informations about the NAS.

Parameters

None.

Example

var Synology = require('synology');

var syno = new Synology();

syno.dsm.info(function(err, data) {
  if (err) throw err;
  console.log(data);
});

Results

{
    "data": {
        "codepage": "fre",
        "model": "DS412+",
        "ram": 1024,
        "serial": "C8GDN06509",
        "temperature": 48,
        "temperature_warn": false,
        "time": "Sat Aug 17 00:37:38 2013",
        "uptime": 3299114,
        "version": "3750",
        "version_string": "DSM 4.3-3750"
    },
    "success": true
}

dsm.logViewer

Return system logs.

Parameters

Parameter Mandatory Default value Description
start 0 Offset where to start the listing.
limit 1000 Maximum number of logs to return.
sort time Field used to order the files. Possible values: time, level, logtype, who and descr
dir DESC Set to ASC for an ascending order or to DESC for a descending one.
logtype syslog Type of logs to return. Possible values: syslog, connlog, ftpxfer, dsmfmxfer, webdavxfer, smbxfer, tftpxfer, bkplog and netbkplog. You can concatenate multiple logtype with a ,.
datefrom 0 Start of the date range (Unix timestamp).
dateto 0 End of the date range (Unix timestamp).
keyword Keyword filter
loglevel 1,2,3 Level filter. Possibles values: 1 (info), 2 (warning), 3 (error). You can concatenate multiple loglevel with a ,.
action Actions to perform on the logs. Possible values: download.
exporttype Type of export. Possible values: html and csv.
title general Title of the exported file.
filename general Filename of the exported file.

Example

var Synology = require('synology');

var syno = new Synology();

syno.dsm.logViewer(function(err, data) {
  if (err) throw err;
  console.log(data);
});

Results

{
    "errorCount": 18,
    "infoCount": 759,
    "isSupportFileTransferLog": true,
    "items": [{
        "descr": "User [john] logged in from [192.168.1.64]",
        "level": "info",
        "logtype": "System",
        "orginalLogType": "syslog",
        "time": "2012/12/13 22:49:19",
        "who": "john"
    }, {
        "descr": "Apple file service was started.",
        "level": "info",
        "logtype": "System",
        "orginalLogType": "syslog",
        "time": "2012/12/12 23:45:24",
        "who": "SYSTEM"
    }, {
        "descr": "Host [122.125.157.90] has been blocked at [Mon Dec 10 09:46:16 2012].",
        "level": "warn",
        "logtype": "System",
        "orginalLogType": "syslog",
        "time": "2012/12/10 09:46:16",
        "who": "SYSTEM"
    }],
    "total": 1287,
    "warnCount": 511
}

dsm.service

Return the service's list and their status.

Parameters

None.

Example

var Synology = require('synology');

var syno = new Synology();

syno.dsm.service(function(err, data) {
  if (err) throw err;
  console.log(data);
});

Results

{
    "data": {
        "offset": 0,
        "services": [{
            "enabled": true,
            "name": "Samba"
        }, {
            "enabled": true,
            "name": "AutoBlock"
        }, {
            "enabled": false,
            "name": "WebDAV"
        }],
        "total": 3
    },
    "success": true
}