Ken Moore
c9aa4d30b9
Merge branch 'master' of github.com:pcbsd/sysadm
2016-01-26 12:56:27 -05:00
Ken Moore
01124d2719
Commit my work in progress for the new Dispatcher subsystem. This is ~80% done right now (still filling out some of the internals - but the class framework is set in stone).
2016-01-26 12:55:08 -05:00
Kris Moore
4800f5b618
Update pkg-plist and RUN_DEPENDS for sysadm port
2016-01-26 12:39:40 -05:00
dlavigne
f8df6d4325
Clarify UUID and type.
2016-01-26 11:29:53 -05:00
dlavigne
8e7123e94a
Doc new events namespace.
2016-01-26 11:25:57 -05:00
dlavigne
2d407775b4
Doc listjails action.
2016-01-26 10:46:28 -05:00
dlavigne
70b8cd31ed
Doc listbranches action.
2016-01-26 10:31:04 -05:00
dlavigne
7c2f15717d
Doc systeminfo action.
2016-01-26 10:15:25 -05:00
Kris Moore
478bdb204c
Add the first iocage sysadm API call
...
REST Request:
-------------------------------
PUT /sysadm/iocage
{
"action" : "listjails"
}
REST Response:
-------------------------------
{
"args": {
"listjails": {
"611c89ae-c43c-11e5-9602-54ee75595566": {
"boot": "off",
"jid": "-",
"state": "down",
"tag": "testjail",
"type": "basejail"
}
}
}
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "listjails"
},
"name" : "iocage",
"id" : "fooid",
"namespace" : "sysadm"
}
WebSocket Response:
-------------------------------
{
"args": {
"listjails": {
"611c89ae-c43c-11e5-9602-54ee75595566": {
"boot": "off",
"jid": "-",
"state": "down",
"tag": "testjail",
"type": "basejail"
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-01-26 10:11:14 -05:00
Kris Moore
dd0f7bb45b
Fix on -CURRENT starting the various services
2016-01-26 10:09:07 -05:00
Kris Moore
2f99b12f61
Merge branch 'master' of https://github.com/pcbsd/sysadm
2016-01-26 09:38:11 -05:00
Kris Moore
56a3fb21b1
Add systeminfo / update / iocage to subsystems we test for
2016-01-26 09:37:28 -05:00
dlavigne
5abd03bf7c
Update to memorystats.
2016-01-26 09:31:31 -05:00
Kris Moore
ccd41322bd
Replace the 'memorypercentage' API call with 'memorystats', which returns
...
much more meaningfull information to let us do graphs and whatnot
REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
"action" : "memorystats"
}
REST Response:
-------------------------------
{
"args": {
"memorystats": {
"active": "818",
"cache": "69",
"free": "4855",
"inactive": "2504",
"wired": "1598"
}
}
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "memorystats"
},
"namespace" : "sysadm",
"id" : "fooid",
"name" : "systeminfo"
}
WebSocket Response:
-------------------------------
{
"args": {
"memorystats": {
"active": "826",
"cache": "69",
"free": "4847",
"inactive": "2505",
"wired": "1598"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-01-25 15:51:43 -05:00
Kris Moore
d873746bfe
Add new API call to get a bunch of various system information back
...
REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
"action" : "systeminfo"
}
REST Response:
-------------------------------
{
"args": {
"systeminfo": {
"arch": "amd64",
"cpucores": "4",
"cputype": "Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz",
"hostname": "krisdesktop",
"kernelident": "GENERIC",
"kernelversion": "10.2-RELEASE-p11",
"systemversion": "10.2-RELEASE-p12",
"totalmem": 10720,
"uptime": "up 2 days 5:09"
}
}
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "systeminfo"
},
"id" : "fooid",
"name" : "systeminfo",
"namespace" : "sysadm"
}
WebSocket Response:
-------------------------------
{
"args": {
"systeminfo": {
"arch": "amd64",
"cpucores": "4",
"cputype": "Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz",
"hostname": "krisdesktop",
"kernelident": "GENERIC",
"kernelversion": "10.2-RELEASE-p11",
"systemversion": "10.2-RELEASE-p12",
"totalmem": 10720,
"uptime": "up 2 days 5:09"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-01-25 14:55:41 -05:00
Kris Moore
98087f0faa
Add new API call for listing available branches to update to
...
REST Request:
-------------------------------
PUT /sysadm/update
{
"action" : "listbranches"
}
REST Response:
-------------------------------
{
"args": {
"listbranches": {
"10.1-RELEASE": "available",
"10.2-RELEASE": "active",
"11.0-CURRENTJAN2016": "available"
}
}
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "listbranches"
},
"namespace" : "sysadm",
"name" : "update",
"id" : "fooid"
}
WebSocket Response:
-------------------------------
{
"args": {
"listbranches": {
"10.1-RELEASE": "available",
"10.2-RELEASE": "active",
"11.0-CURRENTJAN2016": "available"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-01-25 14:21:37 -05:00
Kris Moore
6eec1c9148
Change port name
2016-01-25 11:57:00 -05:00
Kris Moore
50dc399d2b
Add the 'mkports.sh' helper we will use to update the port files
...
for sysadm server
2016-01-25 11:25:10 -05:00
dlavigne
30f12740bc
Doc cputemps action.
2016-01-22 10:35:04 -05:00
dlavigne
174f0bc815
Doc cpupercentage action.
2016-01-22 10:28:15 -05:00
dlavigne
3b51062f74
Doc memorypercentage action.
2016-01-22 10:21:36 -05:00
Ken Moore
f8f8762616
Merge branch 'master' of github.com:pcbsd/sysadm
2016-01-21 16:58:37 -05:00
Ken Moore
80d1023921
Add a class of static functions for logfile management. This is designed to automatically create/manage daily logs, with auto-pruning of old logs to be added soon. There are a number of various overloaded functions for writing to a log file right now (QStringList, QString, QJsonObject, QJsonArray), but only the QStringList output for reading a file right now.
...
To add a new type of log file:
1) Add a new enumeration definition for the file in LogManager.h
2) Add an entry for that new enumeration in the flagToPath() function right below the enumeration definion.
2016-01-21 16:51:51 -05:00
Kris Moore
1fc7b3cabd
Add a new API call which returns the total memory in use
...
This will be expanded upon later so we can return more of the
particulars of where memory is used
REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
"action" : "memorypercentage"
}
REST Response:
-------------------------------
{
"args": {
"memorypercentage": {
"memoryused": 42
}
}
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"args" : {
"action" : "memorypercentage"
},
"namespace" : "sysadm",
"name" : "systeminfo"
}
WebSocket Response:
-------------------------------
{
"args": {
"memorypercentage": {
"memoryused": 42
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-01-21 13:47:11 -05:00
Kris Moore
aa5755d4b4
New API call to get cpupercentage stats
...
REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
"action" : "cpupercentage"
}
REST Response:
-------------------------------
{
"args": {
"cpupercentage": {
"busytotal": "28",
"cpu1": {
"busy": "28"
},
"cpu2": {
"busy": "31"
},
"cpu3": {
"busy": "29"
},
"cpu4": {
"busy": "24"
}
}
}
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "cpupercentage"
},
"name" : "systeminfo",
"id" : "fooid",
"namespace" : "sysadm"
}
WebSocket Response:
-------------------------------
{
"args": {
"cpupercentage": {
"busytotal": "28",
"cpu1": {
"busy": "28"
},
"cpu2": {
"busy": "31"
},
"cpu3": {
"busy": "29"
},
"cpu4": {
"busy": "24"
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-01-21 13:39:22 -05:00
Kris Moore
609bba2ded
New API call to get a listing of all the CPU temps on the system,
...
if the "coretemp" module isn't loaded, it will be loaded beforehand
REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
"action" : "cputemps"
}
REST Response:
-------------------------------
{
"args": {
"cputemps": {
"cpu0": "27.0C",
"cpu1": "34.0C",
"cpu2": "33.0C",
"cpu3": "31.0C"
}
}
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "cputemps"
},
"id" : "fooid",
"name" : "systeminfo",
"namespace" : "sysadm"
}
WebSocket Response:
-------------------------------
{
"args": {
"cputemps": {
"cpu0": "34.0C",
"cpu1": "32.0C",
"cpu2": "34.0C",
"cpu3": "31.0C"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-01-21 12:58:12 -05:00
Kris Moore
305c8da71c
Add the "timeleft":"<seconds>" to the battery info
2016-01-21 12:31:17 -05:00
Ken Moore
1ae716ebfc
Add IP blacklisting to the sysadm server.
...
Current Settings:
1) 5 auth attempts allowed before failover
2) If no communications for 10 minutes, the failover counter gets reset
3) On failover - the IP is placed on the server blacklist for 1 hour
Note: The blacklist system is connection independant, and uses the host IP for unique tracking/blocking.
2016-01-21 10:12:13 -05:00
Ken Moore
96fa70a1fe
Merge branch 'master' of github.com:pcbsd/sysadm
2016-01-21 07:51:06 -05:00
Ken Moore
7d6ea3ff11
Make the SSL settings for the servers appear as defined within globals-qt.h. This makes it easy to change key/cert files or SSL versions later on for both types of server simultaneously.
2016-01-21 07:49:47 -05:00
dlavigne
9b065a1937
Doc batteryinfo action.
2016-01-20 13:57:07 -05:00
Kris Moore
58e7e7a4e3
Add new API call for batteryinfo
...
Will return battery:"true/false" if one exists
If one exists, it will also return "level":"1-99"
and "status":"offline/charging/backup/unknown"
REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
"action" : "batteryinfo"
}
REST Response:
-------------------------------
{
"args": {
"batteryinfo": {
"battery": "false"
}
}
}
WebSocket Request:
-------------------------------
{
"namespace" : "sysadm",
"name" : "systeminfo",
"id" : "fooid",
"args" : {
"action" : "batteryinfo"
}
}
WebSocket Response:
-------------------------------
{
"args": {
"batteryinfo": {
"battery": "false"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-01-20 13:26:38 -05:00
dlavigne
783bca9dbf
Doc new systeminfo class.
2016-01-20 13:08:51 -05:00
Kris Moore
7d839787bd
Add first API call for the "systeminfo" class
...
This API call will return a list of external mounts
on the system
TYPE: UNKNOWN/USB/HDRIVE/DVD/SDCARD
REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
"action" : "externalmounts"
}
REST Response:
-------------------------------
{
"args": {
"externalmounts": {
"/dev/fuse": {
"filesystem": "fusefs",
"path": "/usr/home/kris/.gvfs",
"type": "UNKNOWN"
}
}
}
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"namespace" : "sysadm",
"name" : "systeminfo",
"args" : {
"action" : "externalmounts"
}
}
WebSocket Response:
-------------------------------
{
"args": {
"externalmounts": {
"/dev/fuse": {
"filesystem": "fusefs",
"path": "/usr/home/kris/.gvfs",
"type": "UNKNOWN"
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-01-20 12:13:25 -05:00
Ken Moore
155026aab1
Fix up the file watcher system in the events class. Now it actually functions in it's own thread.
2016-01-20 11:42:41 -05:00
Ken Moore
539e2bf64e
Commit some debugging on the event watcher system - trying to figure out why no events are getting picked up from lp log changes.
2016-01-20 10:18:51 -05:00
Ken Moore
f347c5ac56
Merge branch 'master' of github.com:pcbsd/sysadm
2016-01-20 09:54:36 -05:00
Ken Moore
fd5bc59d00
Fix up a bit more of the event system within the websocket class after some testing with the client.
2016-01-20 09:54:00 -05:00
ldemouy
730bd194fc
Merge pull request #7 from ldemouy/master
...
Create ServiceManager Class
2016-01-19 14:44:42 -07:00
Ken Moore
89865b5a2d
Merge branch 'master' of github.com:pcbsd/sysadm
2016-01-19 16:18:56 -05:00
Ken Moore
d99871c117
Add in support for Life Preserver events.
2016-01-19 16:17:59 -05:00
Kris Moore
d4f2e302bc
OSX Doesn't support TLS 1.1 or 1.2, so we fallback to 1.0
2016-01-19 15:05:18 -05:00
Ken Moore
2155947438
Merge branch 'master' of github.com:pcbsd/sysadm
2016-01-19 14:50:13 -05:00
Ken Moore
7ebc12aaf7
Add handling/debug output for connection errors in the websocket server.
2016-01-19 14:49:46 -05:00
dlavigne
f2daaddea6
Doc checkupdates action. While here, fix formatting error.
2016-01-19 13:13:35 -05:00
Ken Moore
27ebde481d
Make sure the "auth" requests are always run in order - do asyncronous event handling after auth is already setup.
2016-01-19 12:36:19 -05:00
Ken Moore
2260d06ee2
Merge branch 'master' of github.com:pcbsd/sysadm
2016-01-19 12:33:32 -05:00
Ken Moore
ee7a5a9d43
Enable QtConcurrent for the message reply generation systems.
2016-01-19 12:33:00 -05:00
Kris Moore
01cad39043
Add new API call for "update" class to check system for updates.
...
Possible response arrays include
"security":{ "name":"FreeBSD System Update" }
"majorupgrade":{ "name":"Update to 10.3", "tag":"releng10.3", "version":"10.3-RELEASE" }
"patch":{ "name":"StandAlone Update", "tag":"mypatch", "details":"Updates PKG to FOO", "date":"20160120", "size":"5MB" }
"pkgupdate":{ "name":"System Package Updates" }
REST Request:
-------------------------------
PUT /sysadm/update
{
"action" : "checkupdates"
}
REST Response:
-------------------------------
{
"args": {
"checkupdates": {
"status": "noupdates"
}
}
}
bSocket Request:
-------------------------------
{
"name" : "update",
"args" : {
"action" : "checkupdates"
},
"namespace" : "sysadm",
"id" : "fooid"
}
WebSocket Response:
-------------------------------
{
"args": {
"checkupdates": {
"status": "noupdates"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-01-19 12:27:03 -05:00
Kris Moore
f948edc354
Fix the place where we close the WS connection, so we don't close
...
too fast before a reply can be formed
2016-01-19 12:25:55 -05:00