mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
1864b27857
(This used to be commit 5f079d7463
)
35 lines
710 B
Plaintext
Executable File
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;
|