smbwebstatus
Andy Bakun - abakun@thwartedefforts.org
smbwebstatus is a Samba Status program based off smbstatus that displays information to a web browser.
smbwebstatus is fully functional, but it's still rough around the edges in some places.
It is its own little web server similar to swat. It generates HTML Tables and uses frames, so a browser with those capabilities is necessary.
I've successfully used it without problems with samba-2.0.4. Please let me know if you have problems.
Bug reports are welcome and encouraged.
Description
There are two frames. In the top frame, three different reports can be generated:
- Sessions (screenshot)
- Shows the currently active sessions (the first listing output by smbstatus)
Clicking on one of the cell contents will show sessions that match that item. For example, clicking on an entry in the Machine column will show all services that are open from that machine.
- Resources (screenshot)
- If this is enabled, it shows all the shares and printers you have defined (no smbstatus equlivent)
By default, will list all resources, but selecting "exclude idle services" will remove from the list all the services which currently have no connections.
Clicking on a service name will display the sessions that match that service name.
Clicking on lock count will display a (best guess) of the locked files which are in that share.
- Locked Files (screenshot)
- Shows the locked files list, who has it open. (the last listing output by smbstatus).
Clicking on the filename will show specific information about that locked file.
All columns in all tables are sortable, in both ascending and descending order (the little arrow indicates which direction they are currently sorted in, of course).
History
- 2/16/99 - version 0.8.7 - worked around some strangeness with differences between sprintf and snprintf in glibc-2.0.111, removed useless extra spaces scattered around all over the place
that only became visible when you have "underline links" turned on in your browser. Fixed some other general strangeness with the sessions table that populates the bottom frame when
you select a share name from the resources screen.
- 2/15/99 - version 0.8.1 - cleaned up source, removed dependancy on inet_aton in favor of inet_addr (thanks Martin Hofbauer), added ALT options for IMG tags for the sort arrows,
so you can tell which order they are sorted in when using lynx.
- 2/12/99 - version 0.8 - first public release
Goals
- be self contained
- be no more intrusive into the operation of samba than smbstatus
- we are one shot (do the work and exit) so being speed and space conscience is not top priority; usablity is
Todo
- Logging capability
- Access restrictions
- Clean up source code
- Customized colorization.
- Add patches to the rest of samba to make this more robust... if the locked file structure had the name of the share that contains
the locked file, we wouldn't need do as much guess as we currently do in complex setups like mine (where
mulitple shares exist whose path's are nested within each other's).
- Display shared memory usage info.
- Make the interface snazzier.
- When clicking on an IP address to show sessions from that IP, the lower frame shows the decimal represtation of struct in_addr. This is confusing.
Open Issues
See the comments at the top of the source file.
Screenshots
-rw-rw-r-- 1 abakun abakun 12982 Jan 26 18:16 sessions_scn.gif
-rw-rw-r-- 1 abakun abakun 20465 Jan 26 18:16 resources_scn.gif
-rw-rw-r-- 1 abakun abakun 27672 Jan 26 18:16 lockedfiles_scn.gif
Instructions
- patch Makefile.in with Makefile.in.patch
- copy smbwebstatus.c into source/web
- make
- for fresh install, make install,
for already running smbd, copy bin/smbwebstatus to the same location as your samba binaries
- install the inetd.conf.addition to your inetd.conf file, restart inetd. You may need to change the path to smbwebstatus,
depending on where it lives on your system.
- Check out the comments at the top of make_share_list_file, modify as necessary (modification might not be necessary) run
make_share_list_file > SAMBA_LOCK_DIR/share_list
This is not necessary, and if you don't do this step, the resources screen will be disabled.
You'll have to rerun this if you change any of your share definitions.
The files
-rw-rw-r-- 1 abakun abakun 1647 Jan 26 18:13 Makefile.in.patch
-rw-rw-r-- 1 abakun abakun 255 Jan 26 18:16 inetd.conf.addition
-rwxrwxr-x 1 abakun abakun 3369 Jan 27 16:56 make_share_list_file
-rw-rw-r-- 1 abakun abakun 55453 Feb 12 16:47 smbwebstatus.c