summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-10 08:47:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:32 -0500
commitb7c6b20c37b4e44f6d6cb60bff187e76ac6c4b9b (patch)
treed29dd9801ea073ffa892fb015cb25fbb24df74ce
parent39b1d2b4c4a6a820c78440fb5d2c32f75de3289d (diff)
downloadsamba-b7c6b20c37b4e44f6d6cb60bff187e76ac6c4b9b.tar.gz
samba-b7c6b20c37b4e44f6d6cb60bff187e76ac6c4b9b.tar.bz2
samba-b7c6b20c37b4e44f6d6cb60bff187e76ac6c4b9b.zip
r8287: yay! finally irpc calls from ejs are all working.
This is a demo script that shows the nbt server statistics. For example: nbt_server statistics: total_received: 185 total_sent: 59 query_count: 13 release_count: 21 register_count: 7 (This used to be commit cd1ea857ce19ac2e105230703174634d8b9d5122)
-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;