mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 02:20:17 +00:00
The output now returns objects with value, type, and description of each sysctl instead of just the values.
REST Request (example):
-------------------------------
PUT /sysadm/systemmanager
{
"action" : "sysctllist"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"namespace" : "sysadm",
"args" : {
"action" : "sysctllist"
},
"name" : "systemmanager"
}
Response:
-------------------------------
{
"args": {
"sysctllist": {
"compat.ia32.maxdsiz": {
"type": "unsigned long",
"value": "536870912"
},
"compat.ia32.maxssiz": {
"type": "unsigned long",
"value": "67108864"
},
"compat.ia32.maxvmem": {
"type": "unsigned long",
"value": "0"
},
"compat.linux.osname": {
"description": "Linux kernel OS name",
"type": "string",
"value": "Linux"
},
"compat.linux.osrelease": {
"description": "Linux kernel OS release",
"type": "string",
"value": "2.6.32"
},
"compat.linux.oss_version": {
"description": "Linux OSS version",
"type": "integer",
"value": "198144"
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
//===========================================
|
|
// PC-BSD source code
|
|
// Copyright (c) 2015, PC-BSD Software/iXsystems
|
|
// Available under the 3-clause BSD license
|
|
// See the LICENSE file for full details
|
|
//===========================================
|
|
#ifndef __PCBSD_LIB_UTILS_SYSMGMT_H
|
|
#define __PCBSD_LIB_UTILS_SYSMGMT_H
|
|
|
|
#include <QJsonObject>
|
|
#include "sysadm-global.h"
|
|
|
|
|
|
namespace sysadm{
|
|
|
|
class SysMgmt{
|
|
public:
|
|
static QJsonObject batteryInfo();
|
|
static QJsonObject cpuPercentage();
|
|
static QJsonObject cpuTemps();
|
|
static QJsonObject externalDevicePaths();
|
|
static QJsonObject killProc(QJsonObject);
|
|
static QJsonObject memoryStats();
|
|
static QJsonObject procInfo();
|
|
static QJsonObject getSysctl(QJsonObject);
|
|
static QJsonObject setSysctl(QJsonObject);
|
|
static QJsonObject sysctlList();
|
|
static QJsonObject systemInfo();
|
|
static QJsonObject systemReboot();
|
|
static QJsonObject systemHalt();
|
|
|
|
static QJsonObject systemDevices();
|
|
static QJsonObject fetchPortsTree(QString altDir = ""); //QStringList &cmds, QStringList &dirs);
|
|
//static QJsonObject fetchSourceTree(QString branch, QStringList &cmds, QStringList &dirs); // This is not ready yet
|
|
};
|
|
|
|
} //end of namespace
|
|
|
|
#endif
|