summaryrefslogtreecommitdiff
path: root/source4/scripting/libjs/management.js
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-05-28 08:11:05 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-05-28 08:11:05 +1000
commit51ae2302a68033b1b79a4ebc8d4cbab64adcf843 (patch)
treed8b1af54efe4ec70607ef2bcbd873c2cd667d894 /source4/scripting/libjs/management.js
parent5d0d239d1ab826c91839a603f93d2c0061658888 (diff)
parent52b230141b5ad9f317f97e7d257703614bab3985 (diff)
downloadsamba-51ae2302a68033b1b79a4ebc8d4cbab64adcf843.tar.gz
samba-51ae2302a68033b1b79a4ebc8d4cbab64adcf843.tar.bz2
samba-51ae2302a68033b1b79a4ebc8d4cbab64adcf843.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-abartlet
It seems the format of main.mk changed in my sleep... Conflicts: source/main.mk (This used to be commit 56f2288e4f4f1aa70d11fc5f118458baf5803627)
Diffstat (limited to 'source4/scripting/libjs/management.js')
-rw-r--r--source4/scripting/libjs/management.js157
1 files changed, 0 insertions, 157 deletions
diff --git a/source4/scripting/libjs/management.js b/source4/scripting/libjs/management.js
deleted file mode 100644
index 4a43275156..0000000000
--- a/source4/scripting/libjs/management.js
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- backend code for Samba4 management
- Copyright Andrew Tridgell 2005
- Released under the GNU GPL version 3 or later
-*/
-
-
-/*
- return a list of current sessions
-*/
-function smbsrv_sessions()
-{
- var irpc = irpc_init();
- status = irpc.connect("smb_server");
- if (status.is_ok != true) {
- return undefined;
- }
-
- var io = irpcObj();
- io.input.level = irpc.SMBSRV_INFO_SESSIONS;
- status = irpc.smbsrv_information(io);
- if (status.is_ok != true) {
- return undefined;
- }
-
- /* gather the results into a single array */
- var i, count=0, ret = new Array(0);
- for (i=0;i<io.results.length;i++) {
- var sessions = io.results[i].info.sessions.sessions;
- var j;
- for (j=0;j<sessions.length;j++) {
- ret[count] = sessions[j];
- count++;
- }
- }
- return ret;
-}
-
-/*
- return a list of current tree connects
-*/
-function smbsrv_tcons()
-{
- var irpc = irpc_init();
- status = irpc.connect("smb_server");
- if (status.is_ok != true) {
- return undefined;
- }
-
- var io = irpcObj();
- io.input.level = irpc.SMBSRV_INFO_TCONS;
- status = irpc.smbsrv_information(io);
- if (status.is_ok != true) {
- return undefined;
- }
-
- /* gather the results into a single array */
- var i, count=0, ret = new Object();
- for (i=0;i<io.results.length;i++) {
- var tcons = io.results[i].info.tcons.tcons;
- var j;
- for (j=0;j<tcons.length;j++) {
- ret[count] = tcons[j];
- count++;
- }
- }
- ret.length = count;
- return ret;
-}
-
-/*
- return nbtd statistics
-*/
-function nbtd_statistics()
-{
- var irpc = irpc_init();
- status = irpc.connect("nbt_server");
- if (status.is_ok != true) {
- return undefined;
- }
-
- var io = irpcObj();
- io.input.level = irpc.NBTD_INFO_STATISTICS;
- status = irpc.nbtd_information(io);
- if (status.is_ok != true) {
- return undefined;
- }
- return io.results[0].info.stats;
-}
-
-/*
- see if a service is enabled
-*/
-function service_enabled(name)
-{
- var lp = loadparm_init();
- var services = lp.get("server services");
- var i;
- for (i=0;i<services.length;i++) {
- if (services[i] == name) {
- return true;
- }
- }
- return false;
-}
-
-/*
- show status of a server
-*/
-function server_status(name)
-{
- var i;
- var io;
- var irpc = irpc_init();
-
- if (!service_enabled(name)) {
- return "DISABLED";
- }
-
- status = irpc.connect(name + "_server");
- if (status.is_ok != true) {
- return "DOWN";
- }
-
- var io = irpcObj();
- status = irpc.irpc_uptime(io);
- if (status.is_ok != true) {
- return "NOT RESPONDING";
- }
-
- return "RUNNING";
-}
-
-/*
- show status of a stream server
-*/
-function stream_server_status(name)
-{
- var irpc = irpc_init();
-
- if (!service_enabled(name)) {
- return "DISABLED";
- }
- status = irpc.connect(name + "_server");
- if (status.is_ok != true) {
- return "0 connections";
- }
-
- var io = irpcObj();
- status = irpc.irpc_uptime(io);
- if (status.is_ok != true) {
- return "NOT RESPONDING";
- }
-
- var n = io.results.length;
- return sprintf("%u connection%s", n, plural(n));
-}