From cb060f8bac4114766a1945c2929a75848d0d7185 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 19 Jul 2005 06:18:48 +0000 Subject: r8584: added --nbt option to smbstatus for nbt server statistics (This used to be commit 26a676a4e3596d34aee391bf132f2525972c81df) --- source4/scripting/bin/smbstatus | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'source4/scripting/bin') 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; -- cgit