$Header: /cvsroot/aolserver/aolserver.com/docs/devel/tcl/api/admin.html,v 1.1 2002/03/07 19:15:35 kriston Exp $
If -exact is specified, matching on key is case-sensitive. By default matching is case-insensitive.
If -bool is specified, ns_config will perform the conversion of a boolean value from "on", "1", "y", "yes", "t", and "true" to "1", and it will convert a boolean value of "off", "0", "n", "no", "f", and "false" to "0". If a boolean contains any other value, a warning is written to the log file and an empty string {"") is returned. If no value is specified in the configuration file for the specified key, an empty string ("") is returned.
If -int is specified, ns_config will return the integer value of the specified key. If there is a non-integer value in the configuration file, a warning is written to the log file and an empty string ("") is returned.
ns_eval set g 1
in one interpreter, later operations will see $g equal to 1 no matter what interpreter they are assigned to.
ns_info config
ns_info home
ns_info host
ns_info hostname
ns_info interp
ns_info label
ns_info location
ns_info log
ns_info name
ns_info pageroot
ns_info platform
ns_info port
ns_info server
ns_info tcllib
ns_info uptime
ns_info version
ns_info config returns the file name of the configuration file.
ns_info home returns the directory where the AOLserver was installed.
ns_info host is no longer available. Use ns_conn location.
ns_info hostname returns the name of the host that the server is running on (e.g., www.myhost.com).
ns_info interp returns the number of the Tcl interpreter currently being used.
ns_info label returns the source code label for the server. If no label was used, "unlabeled" is returned. You can use this function to provide the source code label when you report problems with the server. Also, the /NS/About page for the server reports the source code label along with the other server information.
ns_info location is obsolete. Use ns_conn location instead.
ns_info log returns the location of the server log file (e.g., /home/myserver/log/server.log).
ns_info name returns the name of the AOLserver. It's usually "AOLserver."
ns_info pageroot returns the directory containing the HTML pages for this virtual server.
ns_info platform returns the name of the platform that the server is running on (e.g., Solaris).
ns_info port is no longer available. Use ns_conn location.
ns_info server returns the name of this virtual server.
ns_info tcllib returns the directory where the AOLserver Tcl source code resides for this virtual server.
ns_info uptime returns the time in seconds that the server has been up.
ns_info version returns the version of the AOLserver.
ns_log writes the message to the server error log file. Allowable values for severity are:
Notice
Something interesting occurred.
Warning
Something that could mean something bad occurred.
Error
Something bad occurred.
Fatal
Something extremely bad occurred. The server will shut down after logging the message.
Bug
Something occurred that implies that there is a bug in the code.
Debug
If the server is in Debug mode, the message is printed. Debug mode is specified in the [ns/parameters] section of the configuration file. Otherwise, the message is not printed.
See Also
Ns_Log(), Ns_LogRaw() (C API)
nsd.ini (AOLserver Configuration File)
ns_perm addgroup name user ?user ...?
ns_perm allowuser ?-noinherit? method url user
ns_perm denyuser ?-noinherit? method url user
ns_perm allowgroup ?-noinherit? method url group
ns_perm denygroup ?-noinherit? method url group
ns_perm checkpass user passwd
ns_perm setpass user encpass
ns_perm adduser adds the user with the specified name and the encrypted password (encpass) and the specified user text (userfield) into the users database.
If -allow and hostnames are specified, the user will be allowed on the specified hostnames. If -deny and hostnames are specified, the user will be denied on the specified hostnames. The hostname must be specified as ipaddress/netmask or dnshostname. For example: 128.2.142.0/255.255.255.0 or www.microsoft.com or .microsoft.com.
ns_perm addgroup creates a new group with the specified name that includes the users listed after the name.
ns_perm allowuser allows the specified user access to the specified method and URL combination. If -noinherit is specified, only access to the exact URL is allowed; otherwise, URLs under that URL are allowed as well.
ns_perm denyuser denies the specified user access to the specified method and URL combination. If -noinherit is specified, only access to the exact URL is denied; otherwise, URLs under that URL are denied as well.
ns_perm allowgroup allows the specified group access to the specified method and URL combination. If -noinherit is specified, only access to the exact URL is allowed; otherwise, URLs under that URL are allowed as well.
ns_perm denygroup denies the specified group access to the specified method and URL combination. If -noinherit is specified, only access to the exact URL is denied; otherwise, URLs under that URL are denied as well.
ns_perm checkpass checks that the specified plain-text password is correct for the specified user. A Tcl error is thrown if it does not match.
ns_perm setpass updates the specified user's password to the encrypted password encpass. The password should be encrypted using ns_encrypt.
ns_server ?-server servername? all
ns_server ?-server servername? connections
ns_server ?-server servername? queued
ns_server ?-server servername? threads
ns_server ?-server servername? verbose ?on/off?
ns_server ?-server servername? waiting
id:
An ever-increasing number that identifies the connection.
peer:
The remote address.
state:
The state of the connection, one of the following:
queued: waiting for a thread
init: thread is initializing a connection
request: reading the request
authorize: authorizing the request
running: running the request
tcl: in a Tcl script
traces: running all trace procedures
method:
The request method. If the state is before request, an asterisk "*" is shown.
url:
The request URL. If the state is before request, an asterisk "*" is shown.
time:
The number of seconds since the connection started.
bytes:
The number of bytes sent through the connection.
For example:
id
peer
state
method
url
time
bytes
3
128.111.100.50
traces
GET
/some/page.htm
5
1134
ns_server all returns the same information as ns_server active about both active and waiting connections for the specified virtual server, or the current virtual server if none is specified.
ns_server connections returns the total number of connections for the specified virtual server, or the current virtual server if none is specified.
ns_server queued returns the same information as ns_server active about the waiting connections for the specified virtual server, or the current virtual server if none is specified.
ns_server threads returns a Tcl list containing the minimum number of threads, the maximum number of threads, the number of currently active threads, the number of idle threads, and the number of stopping threads for the specified virtual server, or the current virtual server if none is specified. For example: {min 0} {max 50} {current 2} {idle 1} {stopping 0}
ns_server verbose returns 1 if the server is in verbose mode and 0 if it is not for the specified virtual server, or the current virtual server if none is specified. If "on" is specified, sets verbose mode on. If "off" is specified, sets verbose mode off.
ns_server waiting returns the number of waiting connections for the specified virtual server, or the current virtual server if none is specified.
Notes
This function replaces the tcl_precision variable, which is not recognized by expr.