1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/testprogs/ejs/nbtstats
2007-10-10 13:20:06 -05:00

35 lines
710 B
Plaintext
Executable File

#!/usr/bin/env smbscript
/*
demonstrate access to irpc calls from ejs
*/
var options = new Object();
ok = GetOptions(ARGV, options,
"POPT_AUTOHELP",
"POPT_COMMON_SAMBA");
if (ok == false) {
println("Failed to parse options: " + options.ERROR);
return -1;
}
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;