NaviServer - programmable web server

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_info(n) 4.99.19 naviserver "NaviServer Built-in Commands"

Name

ns_info - Return information about various aspects of the running NaviServer

Table Of Contents

Synopsis

Description

This command provides information about the current state of the running NaviServer.

COMMANDS

ns_info option ?arg arg ...?
ns_info address

Returns the primary IP address of the hostname of this machine, or the unspecified IP address (for IPv4 "0.0.0.0", for IPv6 "::") if unable to determine.

ns_info argv0

Returns file path to executable binary

ns_info boottime

Returns the time in epoch seconds since the current server was started

ns_info builddate

Returns the date and time at which the current server was compiled, e.g.: "Jul 20 2004 at 14:57:20"

ns_info callbacks

Returns all registered startup/exit/shutdown callbacks

ns_info config

Returns the absolute path to the config file used to start the server

ns_info home

Returns the current working directory of the server

ns_info hostname

Returns the value of gethostname(), or "localhost" if that fails

ns_info ipv6

Returns information if the binary was compiled with IPv6 support.

ns_info locks

Lists the mutexes that currently exist. A 5-element list is returned for each mutex: : mutex name, {}, unique id, lock counter, busy counter.

ns_info log

Returns the name of the error log file. The name is specified by the "serverlog" parameter in the "ns/parameters" section.

ns_info major

Returns the major version number.

ns_info minor

Returns the minor version number.

ns_info mimetypes

Returns the current mime-type mappings.

ns_info name

Returns the name of the server implementation, i.e. "NaviServer".

ns_info nsd

Returns absolute path and name of the nsd binary, which is currently executed.

ns_info patchlevel

Returns the full version number of the server (including patch level).

ns_info pid

Returns the process id of the running nsd process.

ns_info pools

Returns usage info from the memory pools (returned by Tcl_GetMemoryInfo() if configured).

ns_info scheduled

Returns the list of the scheduled procedures in the current process (all virtual servers). Each list element is itself a 9-element list of {id, flags, interval, nextqueue, lastqueue, laststart, lastend, procname, arg}:

  • id - unique id returned by the scheduling command

  • flags - Bitmap of one or more of:

    • 1 -- NS_SCHED_THREAD

    • 2 -- NS_SCHED_ONCE

    • 4 -- NS_SCHED_DAILY

    • 8 -- NS_SCHED_WEEKLY

    • 16 - NS_SCHED_PAUSED

    • 32 - NS_SCHED_RUNNING

  • interval - interval specification (i.e. seconds from midnight for daily schedule)

  • nextqueue - Next time to queue for run

  • lastqueue - Last time queued for run

  • laststart - Last time run started

  • lastend - Last time run finished

  • procname - for tasks scheduled with ns_schedule_proc this will be ns:tclschedproc and arg will be the actual scheduled Tcl script.

  • arg - client data

ns_info server

Returns the name of the current virtual server.

ns_info servers

Returns the names of all virtual servers in the current nsd process.

ns_info shutdownpending

Returns 1 if shutdown is pending, 0 otherwise.

ns_info sockcallbacks

Returns returns a list of all socket callbacks such as the socket listening callback for the nscp module. Each list element is itself a 4-element list like this:

 {11 {read exit} nscp {127.0.0.1 9999} 0}
ns_info ssl

Returns information if the binary was compiled with OpenSSL support.

ns_info started

Returns 1 if the server is fully started, 0 otherwise.

ns_info tag

Returns the most detailed revision info, which might be shipped with the tar file or obtained from mercurial.

ns_info threads

Returns a list of all threads in the current process (all virtual servers). Each list element is itself a 7-element list of {name, parent, id, flag, ctime, procname, arg}:

  • name - current name of the thread

  • parent - parent thread name

  • id - id of the thread

  • flag - 1 if this is a detached thread, 0 otherwise

  • ctime - Thread creation time

  • procname - for conn threads this will be ns:connthread

  • arg - client data - for a running conn thread arg will be a 7-element list in the format returned by ns_server all - {conn id, peeraddr, state, method, url, running time, bytes sent}, where state is either "running" or "queued": {cns25 127.0.0.1 running POST /ds/shell 0.5158 0}

ns_info uptime

Returns the number of seconds since the nsd process started.

ns_info version

Returns the version number of the server (major and minor version number combined with a dot).

ns_info winnt

Returns boolean whether running under windows NT.

Keywords

global built-in, introspection