summaryrefslogtreecommitdiff
path: root/source4/scripting/bin/smbstatus
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting/bin/smbstatus')
-rwxr-xr-xsource4/scripting/bin/smbstatus29
1 files changed, 26 insertions, 3 deletions
diff --git a/source4/scripting/bin/smbstatus b/source4/scripting/bin/smbstatus
index eaf3aa1616..df8864f7e8 100755
--- a/source4/scripting/bin/smbstatus
+++ b/source4/scripting/bin/smbstatus
@@ -13,7 +13,8 @@ var options = new Object();
ok = GetOptions(ARGV, options,
"POPT_AUTOHELP",
- "POPT_COMMON_SAMBA");
+ "POPT_COMMON_SAMBA",
+ "nbt");
if (ok == false) {
println("Failed to parse options: " + options.ERROR);
return -1;
@@ -62,8 +63,30 @@ function show_trees()
}
}
+/*
+ show nbtd information
+*/
+function show_nbt()
+{
+ var stats = nbtd_statistics();
+ if (stats == undefined) {
+ println("nbt server not running");
+ return;
+ }
+ var r;
+ println("NBT server statistics:");
+ for (r in stats) {
+ print("\t" + r + ":\t" + stats[r] + "\n");
+ }
+ println("");
+}
-show_sessions();
-show_trees();
+
+if (options['nbt'] != undefined) {
+ show_nbt();
+} else {
+ show_sessions();
+ show_trees();
+}
return 0;