Commit Graph

174 Commits

Author SHA1 Message Date
Ken Moore
be12e18983 Fix up the log function so that now it will actually create/save the log. 2016-02-01 16:51:31 -05:00
Ken Moore
b36958b33a Enable a bit more logging from host/client connections. Still seems to be a problem with the log getting saved to disk though. 2016-02-01 16:37:39 -05:00
Ken Moore
6fd315f8cc Merge branch 'master' of github.com:pcbsd/sysadm 2016-02-01 15:40:59 -05:00
Ken Moore
c8f97a69fe Clean up a fair bit of the server backends. Getting rid of compilation warnings, signal/slot connection issues, etc.. 2016-02-01 15:39:29 -05:00
Kris Moore
bd53bbc29b Add new API class for 'iohyve' along with the initial 'listvms'
API call

REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "action" : "listvms"
}

REST Response:
-------------------------------
{
    "args": {
        "listvms": {
            "testguest": {
                "description": "February 1, 2016 at 03:11:57 PM EST",
                "rcboot": "NO",
                "running": "NO",
                "vmm": "YES"
            }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "args" : {
      "action" : "listvms"
   },
   "name" : "iohyve",
   "id" : "fooid"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "listvms": {
      "testguest": {
        "description": "February 1, 2016 at 03:11:57 PM EST",
        "rcboot": "NO",
        "running": "NO",
        "vmm": "YES"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-01 15:23:21 -05:00
Kris Moore
e65a967729 Don't show errors if the service isn't running anymore 2016-02-01 14:46:17 -05:00
Kris Moore
90ee8021d6 Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-02-01 14:37:12 -05:00
Kris Moore
2b0fbcc2a2 Get rid of all the extra compile warnings 2016-02-01 14:36:58 -05:00
Ken Moore
7463d84229 Merge branch 'master' of github.com:pcbsd/sysadm 2016-02-01 14:22:27 -05:00
Ken Moore
87c545230c New API: Change the sysadm dispatcher access to use the built-in dispatcher system now instead of the old shell script. This new API will have the server queue up generic processes/commands as the user needs (main output will return through the event system). The example blow included a single command queue (procID1), as well an an example of chaining a couple commands together as a single process call (procID2).
REST Request:
-------------------------------
PUT /rpc/dispatcher
{
   "action" : "run",
   "procID2" : [
      "echo chainCmd1",
      "echo chainCmd2"
   ],
   "procID1" : "echo sample1"
}

REST Response:
-------------------------------
{
    "args": {
        "started": [
            "procID1",
            "procID2"
        ]
    }
}

WebSocket Request:
-------------------------------
{
   "name" : "dispatcher",
   "namespace" : "rpc",
   "id" : "fooid",
   "args" : {
      "procID1" : "echo sample1",
      "procID2" : [
         "echo chainCmd1",
         "echo chainCmd2"
      ],
      "action" : "run"
   }
}

WebSocket Response:
-------------------------------
{
  "args": {
    "started": [
      "procID1",
      "procID2"
    ]
  },
  "id": "fooid",
  "name": "response",
  "namespace": "rpc"
}
2016-02-01 14:19:25 -05:00
Kris Moore
a5c594f3da Cleanup pkg-plist 2016-02-01 14:05:40 -05:00
Kris Moore
dabbc5398c Update API call for lpreserver runreplication to now queue
the action and return right away
2016-02-01 14:04:21 -05:00
Ken Moore
ad2f352a5d Merge branch 'master' of github.com:pcbsd/sysadm 2016-02-01 14:03:07 -05:00
Ken Moore
cabcd0a2b2 Fix up the sysadm.pro file - forgot to clean up the old library subdir in it. 2016-02-01 14:02:37 -05:00
Kris Moore
62465ad03e Add the 'startupdate' API call which allows you to queue a
system update

Valid args:

target : "chbranch/pkgupdate/fbsdupdate/fbsdupdatepkgs/standalone"
branch: "newbranch" - (Only used with chbranch target)
tag: "pkgng-1.6.9" - (Only used with standalone target)

REST Request:
-------------------------------
PUT /sysadm/update
{
   "action" : "startupdate",
   "target" : "pkgupdate"
}

REST Response:
-------------------------------
{
    "args": {
      "startupdate": {
        "queueid": "611c89ae-c43c-11e5-9602-54ee75595566",
        "command": "pc-updatemanager pkgupdate",
        "comment": "Task Queued"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "startupdate",
      "target" : "pkgupdate"
   },
   "name" : "update",
   "id" : "fooid",
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "startupdate": {
      "queueid": "611c89ae-c43c-11e5-9602-54ee75595566",
      "command": "pc-updatemanager pkgupdate",
      "comment": "Task Queued"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-01 13:21:17 -05:00
Ken Moore
6aeb05b825 Remove the old library directory from the sysadm source tree 2016-02-01 12:33:28 -05:00
Ken Moore
1146b14917 Cleanup the library/server interactions for sysadm: Now the "library" directory is just an internal collection of classes/files, rather than an actual library of system calls. This allows for in-server globals usage (such as the dispatcher/events systems) within the library files as needed. 2016-02-01 12:29:25 -05:00
Kris Moore
df3500b274 Update sysadm-update with the upcoming startUpdates() internal
call, will doc it later when its finished
2016-02-01 12:13:59 -05:00
Ken Moore
a95404c88d Merge branch 'master' of github.com:pcbsd/sysadm 2016-02-01 11:21:04 -05:00
Ken Moore
df94531644 Setup the subsystem access to automatically deny access to systems which are not currently available (read/write access needs to be managed by the individual subsystems) 2016-02-01 11:18:24 -05:00
Ken Moore
1e9ec2d4b6 Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-01-29 16:27:48 -05:00
Ken Moore
04c366f114 Finish adding in the new dispatcher system (untested). This should be ready for trying out in some subsystem now.
Note: to queue up a job you just need to run one of the DISPATCHER->queue() functions (there are a few overloaded versions for simplicity)
2016-01-29 16:24:40 -05:00
Kris Moore
5a53aacf9f Add new API call to get all iocage default settings
REST Request:
-------------------------------
PUT /sysadm/iocage
{
   "action" : "getdefaultsettings"
}

REST Response:
-------------------------------
{
    "args": {
        "getdefaultsettings": {
            "defaults": {
                "allow_chflags": "0",
                "allow_mount": "0",
                "allow_mount_devfs": "0",
                "allow_mount_nullfs": "0",
                "allow_mount_procfs": "0",
                "allow_mount_tmpfs": "0",
                "allow_mount_zfs": "0",
                "allow_quotas": "0",
                "allow_raw_sockets": "0",
                "allow_set_hostname": "1",
                "allow_socket_af": "0",
                "allow_sysvipc": "0",
                "available": "426G",
                "boot": "off",
                "bpf": "off",
                "children_max": "0",
                "compression": "lz4",
                "compressratio": "1.00x",
                "coredumpsize": "off",
                "count": "1",
                "cpuset": "off",
                "cputime": "off",
                "datasize": "off",
                "dedup": "off",
                "defaultrouter": "none",
                "defaultrouter6": "none",
                "devfs_ruleset": "4",
                "dhcp": "off",
                "enforce_statfs": "2",
                "exec_clean": "1",
                "exec_fib": "0",
                "exec_jail_user": "root",
                "exec_poststart": "/usr/bin/true",
                "exec_poststop": "/usr/bin/true",
                "exec_prestart": "/usr/bin/true",
                "exec_prestop": "/usr/bin/true",
                "exec_start": "/bin/sh /etc/rc",
                "exec_stop": "/bin/sh /etc/rc.shutdown",
                "exec_system_jail_user": "0",
                "exec_system_user": "root",
                "exec_timeout": "60",
                "ftpfiles": "base.txz doc.txz lib32.txz src.txz",
                "ftphost": "ftp.freebsd.org",
                "gitlocation": "https://github.com",
                "hack88": "0",
                "host_domainname": "none",
                "host_hostname": "442a5843-c6bd-11e5-bbe9-fcaa14deb15d",
                "host_hostuuid": "442a5843-c6bd-11e5-bbe9-fcaa14deb15d",
                "hostid": "4145fbb8-c5b6-11e5-9f2f-fcaa14deb15d",
                "interfaces": "vnet0:bridge0,vnet1:bridge1",
                "ip4": "new",
                "ip4_addr": "none",
                "ip4_autoend": "none",
                "ip4_autostart": "none",
                "ip4_autosubnet": "none",
                "ip4_saddrsel": "1",
                "ip6": "new",
                "ip6_addr": "none",
                "ip6_saddrsel": "1",
                "istemplate": "no",
                "jail_zfs": "off",
                "jail_zfs_dataset": "iocage/jails/442a5843-c6bd-11e5-bbe9-fcaa14deb15d/data",
                "jail_zfs_mountpoint": "none",
                "last_started": "none",
                "login_flags": "-f root",
                "maxproc": "off",
                "memorylocked": "off",
                "memoryuse": "8G:log",
                "mount_devfs": "1",
                "mount_fdescfs": "1",
                "mount_linprocfs": "0",
                "mount_procfs": "0",
                "mountpoint": "/iocage/.defaults",
                "msgqqueued": "off",
                "msgqsize": "off",
                "nmsgq": "off",
                "notes": "none",
                "nsemop": "off",
                "nshm": "off",
                "nthr": "off",
                "openfiles": "off",
                "origin": "-",
                "owner": "root",
                "pcpu": "off",
                "pkglist": "none",
                "priority": "99",
                "pseudoterminals": "off",
                "quota": "none",
                "release": "11.0-CURRENTJAN2016",
                "reservation": "none",
                "resolver": "none",
                "rlimits": "off",
                "securelevel": "2",
                "shmsize": "off",
                "stacksize": "off",
                "stop_timeout": "30",
                "swapuse": "off",
                "sync_target": "none",
                "sync_tgt_zpool": "none",
                "tag": "2016-01-29@14:19:49",
                "type": "basejail",
                "used": "96K",
                "vmemoryuse": "off",
                "vnet": "off",
                "vnet0_mac": "none",
                "vnet1_mac": "none",
                "vnet2_mac": "none",
                "vnet3_mac": "none",
                "wallclock": "off"
            }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "getdefaultsettings"
   },
   "id" : "fooid",
   "name" : "iocage",
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "getdefaultsettings": {
      "defaults": {
        "allow_chflags": "0",
        "allow_mount": "0",
        "allow_mount_devfs": "0",
        "allow_mount_nullfs": "0",
        "allow_mount_procfs": "0",
        "allow_mount_tmpfs": "0",
        "allow_mount_zfs": "0",
        "allow_quotas": "0",
        "allow_raw_sockets": "0",
        "allow_set_hostname": "1",
        "allow_socket_af": "0",
        "allow_sysvipc": "0",
        "available": "426G",
        "boot": "off",
        "bpf": "off",
        "children_max": "0",
        "compression": "lz4",
        "compressratio": "1.00x",
        "coredumpsize": "off",
        "count": "1",
        "cpuset": "off",
        "cputime": "off",
        "datasize": "off",
        "dedup": "off",
        "defaultrouter": "none",
        "defaultrouter6": "none",
        "devfs_ruleset": "4",
        "dhcp": "off",
        "enforce_statfs": "2",
        "exec_clean": "1",
        "exec_fib": "0",
        "exec_jail_user": "root",
        "exec_poststart": "/usr/bin/true",
        "exec_poststop": "/usr/bin/true",
        "exec_prestart": "/usr/bin/true",
        "exec_prestop": "/usr/bin/true",
        "exec_start": "/bin/sh /etc/rc",
        "exec_stop": "/bin/sh /etc/rc.shutdown",
        "exec_system_jail_user": "0",
        "exec_system_user": "root",
        "exec_timeout": "60",
        "ftpfiles": "base.txz doc.txz lib32.txz src.txz",
        "ftphost": "ftp.freebsd.org",
        "gitlocation": "https://github.com",
        "hack88": "0",
        "host_domainname": "none",
        "host_hostname": "442a5843-c6bd-11e5-bbe9-fcaa14deb15d",
        "host_hostuuid": "442a5843-c6bd-11e5-bbe9-fcaa14deb15d",
        "hostid": "4145fbb8-c5b6-11e5-9f2f-fcaa14deb15d",
        "interfaces": "vnet0:bridge0,vnet1:bridge1",
        "ip4": "new",
        "ip4_addr": "none",
        "ip4_autoend": "none",
        "ip4_autostart": "none",
        "ip4_autosubnet": "none",
        "ip4_saddrsel": "1",
        "ip6": "new",
        "ip6_addr": "none",
        "ip6_saddrsel": "1",
        "istemplate": "no",
        "jail_zfs": "off",
        "jail_zfs_dataset": "iocage/jails/442a5843-c6bd-11e5-bbe9-fcaa14deb15d/data",
        "jail_zfs_mountpoint": "none",
        "last_started": "none",
        "login_flags": "-f root",
        "maxproc": "off",
        "memorylocked": "off",
        "memoryuse": "8G:log",
        "mount_devfs": "1",
        "mount_fdescfs": "1",
        "mount_linprocfs": "0",
        "mount_procfs": "0",
        "mountpoint": "/iocage/.defaults",
        "msgqqueued": "off",
        "msgqsize": "off",
        "nmsgq": "off",
        "notes": "none",
        "nsemop": "off",
        "nshm": "off",
        "nthr": "off",
        "openfiles": "off",
        "origin": "-",
        "owner": "root",
        "pcpu": "off",
        "pkglist": "none",
        "priority": "99",
        "pseudoterminals": "off",
        "quota": "none",
        "release": "11.0-CURRENTJAN2016",
        "reservation": "none",
        "resolver": "none",
        "rlimits": "off",
        "securelevel": "2",
        "shmsize": "off",
        "stacksize": "off",
        "stop_timeout": "30",
        "swapuse": "off",
        "sync_target": "none",
        "sync_tgt_zpool": "none",
        "tag": "2016-01-29@14:19:49",
        "type": "basejail",
        "used": "96K",
        "vmemoryuse": "off",
        "vnet": "off",
        "vnet0_mac": "none",
        "vnet1_mac": "none",
        "vnet2_mac": "none",
        "vnet3_mac": "none",
        "wallclock": "off"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-29 15:37:43 -05:00
Kris Moore
188f20ff16 Add new 'getjailsettings' API call which returns all the
'iocage get all <jail>' properties in json

REST Request:
-------------------------------
PUT /sysadm/iocage
{
   "jail" : "testjail",
   "action" : "getjailsettings"
}

REST Response:
-------------------------------
{
    "args": {
        "getjailsettings": {
            "testjail": {
                "allow_chflags": "0",
                "allow_mount": "0",
                "allow_mount_devfs": "0",
                "allow_mount_nullfs": "0",
                "allow_mount_procfs": "0",
                "allow_mount_tmpfs": "0",
                "allow_mount_zfs": "0",
                "allow_quotas": "0",
                "allow_raw_sockets": "0",
                "allow_set_hostname": "1",
                "allow_socket_af": "0",
                "allow_sysvipc": "0",
                "boot": "off",
                "bpf": "off",
                "branch": "-",
                "children_max": "0",
                "coredumpsize": "off",
                "count": "1",
                "cpuset": "off",
                "cputime": "off",
                "datasize": "off",
                "defaultrouter": "none",
                "defaultrouter6": "none",
                "devfs_ruleset": "4",
                "dhcp": "off",
                "enforce_statfs": "2",
                "exec_clean": "1",
                "exec_fib": "0",
                "exec_jail_user": "root",
                "exec_poststart": "/usr/bin/true",
                "exec_poststop": "/usr/bin/true",
                "exec_prestart": "/usr/bin/true",
                "exec_prestop": "/usr/bin/true",
                "exec_start": "/bin/sh /etc/rc",
                "exec_stop": "/bin/sh /etc/rc.shutdown",
                "exec_system_jail_user": "0",
                "exec_system_user": "root",
                "exec_timeout": "60",
                "ftpdir": "-",
                "ftpfiles": "-",
                "ftphost": "-",
                "ftplocaldir": "-",
                "gitlocation": "https",
                "hack88": "0",
                "host_domainname": "none",
                "host_hostname": "4bb3f929-c6bf-11e5-bbe9-fcaa14deb15d",
                "host_hostuuid": "4bb3f929-c6bf-11e5-bbe9-fcaa14deb15d",
                "hostid": "4145fbb8-c5b6-11e5-9f2f-fcaa14deb15d",
                "interfaces": "vnet0",
                "ip4": "new",
                "ip4_addr": "none",
                "ip4_autoend": "none",
                "ip4_autostart": "none",
                "ip4_autosubnet": "none",
                "ip4_saddrsel": "1",
                "ip6": "new",
                "ip6_addr": "none",
                "ip6_saddrsel": "1",
                "istemplate": "no",
                "jail_zfs": "off",
                "jail_zfs_dataset": "iocage/jails/4ba5d76b-c6bf-11e5-bbe9-fcaa14deb15d/data",
                "jail_zfs_mountpoint": "none",
                "last_started": "none",
                "login_flags": "-f root",
                "maxproc": "off",
                "memorylocked": "off",
                "memoryuse": "8G",
                "mount_devfs": "1",
                "mount_fdescfs": "1",
                "mount_linprocfs": "0",
                "mount_procfs": "0",
                "msgqqueued": "off",
                "msgqsize": "off",
                "nmsgq": "off",
                "notes": "none",
                "nsemop": "off",
                "nshm": "off",
                "nthr": "off",
                "openfiles": "off",
                "owner": "root",
                "pcpu": "off",
                "pkglist": "none",
                "priority": "99",
                "pseudoterminals": "off",
                "release": "10.2-RELEASE",
                "resolver": "none",
                "rlimits": "off",
                "securelevel": "2",
                "shmsize": "off",
                "stacksize": "off",
                "start": "-",
                "stop_timeout": "30",
                "swapuse": "off",
                "sync_stat": "-",
                "sync_target": "none",
                "sync_tgt_zpool": "none",
                "tag": "testjail",
                "template": "-",
                "type": "basejail",
                "vmemoryuse": "off",
                "vnet": "off",
                "vnet0_mac": "none",
                "vnet1_mac": "none",
                "vnet2_mac": "none",
                "vnet3_mac": "none",
                "wallclock": "off"
            }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "jail" : "testjail",
      "action" : "getjailsettings"
   },
   "id" : "fooid",
   "name" : "iocage",
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "getjailsettings": {
      "testjail": {
        "allow_chflags": "0",
        "allow_mount": "0",
        "allow_mount_devfs": "0",
        "allow_mount_nullfs": "0",
        "allow_mount_procfs": "0",
        "allow_mount_tmpfs": "0",
        "allow_mount_zfs": "0",
        "allow_quotas": "0",
        "allow_raw_sockets": "0",
        "allow_set_hostname": "1",
        "allow_socket_af": "0",
        "allow_sysvipc": "0",
        "boot": "off",
        "bpf": "off",
        "branch": "-",
        "children_max": "0",
        "coredumpsize": "off",
        "count": "1",
        "cpuset": "off",
        "cputime": "off",
        "datasize": "off",
        "defaultrouter": "none",
        "defaultrouter6": "none",
        "devfs_ruleset": "4",
        "dhcp": "off",
        "enforce_statfs": "2",
        "exec_clean": "1",
        "exec_fib": "0",
        "exec_jail_user": "root",
        "exec_poststart": "/usr/bin/true",
        "exec_poststop": "/usr/bin/true",
        "exec_prestart": "/usr/bin/true",
        "exec_prestop": "/usr/bin/true",
        "exec_start": "/bin/sh /etc/rc",
        "exec_stop": "/bin/sh /etc/rc.shutdown",
        "exec_system_jail_user": "0",
        "exec_system_user": "root",
        "exec_timeout": "60",
        "ftpdir": "-",
        "ftpfiles": "-",
        "ftphost": "-",
        "ftplocaldir": "-",
        "gitlocation": "https",
        "hack88": "0",
        "host_domainname": "none",
        "host_hostname": "4bb3f929-c6bf-11e5-bbe9-fcaa14deb15d",
        "host_hostuuid": "4bb3f929-c6bf-11e5-bbe9-fcaa14deb15d",
        "hostid": "4145fbb8-c5b6-11e5-9f2f-fcaa14deb15d",
        "interfaces": "vnet0",
        "ip4": "new",
        "ip4_addr": "none",
        "ip4_autoend": "none",
        "ip4_autostart": "none",
        "ip4_autosubnet": "none",
        "ip4_saddrsel": "1",
        "ip6": "new",
        "ip6_addr": "none",
        "ip6_saddrsel": "1",
        "istemplate": "no",
        "jail_zfs": "off",
        "jail_zfs_dataset": "iocage/jails/4ba5d76b-c6bf-11e5-bbe9-fcaa14deb15d/data",
        "jail_zfs_mountpoint": "none",
        "last_started": "none",
        "login_flags": "-f root",
        "maxproc": "off",
        "memorylocked": "off",
        "memoryuse": "8G",
        "mount_devfs": "1",
        "mount_fdescfs": "1",
        "mount_linprocfs": "0",
        "mount_procfs": "0",
        "msgqqueued": "off",
        "msgqsize": "off",
        "nmsgq": "off",
        "notes": "none",
        "nsemop": "off",
        "nshm": "off",
        "nthr": "off",
        "openfiles": "off",
        "owner": "root",
        "pcpu": "off",
        "pkglist": "none",
        "priority": "99",
        "pseudoterminals": "off",
        "release": "10.2-RELEASE",
        "resolver": "none",
        "rlimits": "off",
        "securelevel": "2",
        "shmsize": "off",
        "stacksize": "off",
        "start": "-",
        "stop_timeout": "30",
        "swapuse": "off",
        "sync_stat": "-",
        "sync_target": "none",
        "sync_tgt_zpool": "none",
        "tag": "testjail",
        "template": "-",
        "type": "basejail",
        "vmemoryuse": "off",
        "vnet": "off",
        "vnet0_mac": "none",
        "vnet1_mac": "none",
        "vnet2_mac": "none",
        "vnet3_mac": "none",
        "wallclock": "off"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-29 14:45:37 -05:00
Ken Moore
502d048d97 Merge branch 'master' of github.com:pcbsd/sysadm 2016-01-29 10:11:44 -05:00
Ken Moore
c747d1f44c Commit some more work on finishing up the new Dispatcher. 2016-01-29 10:11:18 -05:00
Kris Moore
9a32c2553e Add Qt concurrent support 2016-01-29 08:00:01 -05:00
Kris Moore
b34ed3073e Update port files for sysadm 2016-01-28 19:49:56 -05:00
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
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
56a3fb21b1 Add systeminfo / update / iocage to subsystems we test for 2016-01-26 09:37:28 -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
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
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
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