summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/ejs/nbtstats24
1 files changed, 24 insertions, 0 deletions
diff --git a/testprogs/ejs/nbtstats b/testprogs/ejs/nbtstats
new file mode 100755
index 0000000000..f2655e8c6e
--- /dev/null
+++ b/testprogs/ejs/nbtstats
@@ -0,0 +1,24 @@
+#!/usr/bin/env smbscript
+/*
+ demonstrate access to irpc calls from ejs
+*/
+
+var conn = new Object();
+
+status = irpc_connect(conn, "nbt_server");
+assert(status.is_ok == true);
+
+io = new Object();
+io.input = new Object();
+io.input.level = NBTD_INFO_STATISTICS;
+status = dcerpc_nbtd_information(conn, io);
+assert(status.is_ok == true);
+assert(io.results.length == 1);
+
+print("nbt_server statistics:\n");
+stats = io.results[0].info.stats;
+
+for (r in stats) {
+ print("\t" + r + ":\t" + stats[r] + "\n");
+}
+return 0;