1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-05 09:18:06 +03:00
samba-mirror/testprogs/ejs/nbtstats
Andrew Tridgell fef7a81478 r9491: fixed up a few scripts that need to be updated for the new GetOptions syntax. Mimir, its
a good idea to use grep -r to find places that need fixing when you change the syntax of
a call :-)
(This used to be commit 1ead49f8e8)
2007-10-10 13:34:21 -05:00

34 lines
704 B
Plaintext
Executable File

#!/usr/bin/env smbscript
/*
demonstrate access to irpc calls from ejs
*/
var options = GetOptions(ARGV,
"POPT_AUTOHELP",
"POPT_COMMON_SAMBA");
if (options == undefined) {
println("Failed to parse options");
return -1;
}
var conn = new Object();
var irpc = irpc_init();
status = irpc_connect(conn, "nbt_server");
assert(status.is_ok == true);
io = new Object();
io.input = new Object();
io.input.level = irpc.NBTD_INFO_STATISTICS;
status = irpc.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;