From b7c6b20c37b4e44f6d6cb60bff187e76ac6c4b9b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 10 Jul 2005 08:47:34 +0000 Subject: 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) --- testprogs/ejs/nbtstats | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 testprogs/ejs/nbtstats (limited to 'testprogs') 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; -- cgit