NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXTENDED DESCRIPTION | EXAMPLES | FILES | sysctl() Nodes | ATTRIBUTES | SEE ALSO | BUGS
sysctl is a target utility.
sysctl retrieves the microkernel state and allows processes with appropriate privilege to set the microkernel state. The state to be retrieved or set is described using a Management Information Base (MIB)-style name, described as a dotted set of components.
sysctl takes the following options:
List all the known MIB names including opaques. Those with string or integer values are printed as with the -a option. For opaque values, information about the format and the length is printed in addition to the first few bytes, which are dumped in hexadecimal form.
List all the currently available string or integer values.
Force the value of the variable(s) to be output in raw, binary format. No names are printed and no terminating newlines are output. This is mostly useful with a single variable.
Specify that the printing of the field name should be suppressed and that only its value should be output. This flag is useful for setting shell variables.
Requests the
utility to display the numeric OID (object ID) associated to a sysctl
node, in addition to its canonical ASCII name
Set the MIB name to the new value. If just a MIB style name is given, the corresponding value is retrieved.
Same as -A except the entire value of opaque variables is dumped in hexadecimal form.
The information available using sysctl consists of integers, strings, and opaques. sysctl only knows about a couple of opaque types, and will resort to hexdumps for the rest. The opaque information is much more useful if retrieved by special purpose programs such as ps, systat, and netstat.
The string and integer information is summarized below. The changeable column indicates if a process with appropriate privileges can change the value.
Name | Type | Changeable |
---|---|---|
kern.ostype | string | no |
kern.osrelease | string | no |
kern.osrevision | integer | no |
kern.version | string | no |
kern.maxvnodes | integer | yes |
kern.maxproc | integer | yes |
kern.maxfiles | integer | yes |
kern.maxfilesperproc | integer | yes |
kern.mkstats.mem |
structure |
yes |
kern.mkstats.svpages |
structure |
yes |
kern.mkstats.actors |
structure |
yes |
kern.mkstats.threads |
structure |
yes |
kern.stats.cpu |
structure |
yes |
kern.stats.procs |
structure |
yes |
kern.stats.files |
structure |
yes |
kern.stats.vnodes |
structure |
yes |
kern.argmax | integer | no |
kern.securelevel | integer | raise only |
kern.hostname | string | yes |
kern.hostid | integer | yes |
kern.clockrate | struct | no |
kern.posix1version | integer | no |
kern.ngroups | integer | no |
kern.job_control | integer | no |
kern.saved_ids | integer | no |
kern.boottime | struct | no |
kern.domainname | string | yes |
kern.update | integer | yes |
kern.osreldate | string | no |
kern.bootfile | string | yes |
vm.loadavg | struct | no |
hw.machine | string | no |
hw.model | string | no |
hw.ncpu | integer | no |
hw.byteorder | integer | no |
hw.physmem | integer | no |
hw.usermem | integer | no |
hw.pagesize | integer | no |
hw.floatingpoint | integer | no |
hw.machine_arch | string | no |
machdep.console_device | dev_t | no |
machdep.adjkerntz | integer | yes |
machdep.disable_rtc_set | integer | yes |
user.cs_path | string | no |
user.bc_base_max | integer | no |
user.bc_dim_max | integer | no |
user.bc_scale_max | integer | no |
user.bc_string_max | integer | no |
user.coll_weights_max | integer | no |
user.expr_nest_max | integer | no |
user.line_max | integer | no |
user.re_dup_max | integer | no |
user.posix2_version | integer | no |
user.posix2_c_bind | integer | no |
user.posix2_c_dev | integer | no |
user.posix2_char_term | integer | no |
user.posix2_fort_dev | integer | no |
user.posix2_fort_run | integer | no |
user.posix2_localedef | integer | no |
user.posix2_sw_dev | integer | no |
user.posix2_upe | integer | no |
user.stream_max | integer | no |
user.tzname_max | integer | no |
The following example gets the maximum number of files that can be open in the system:
sysctl kern.maxfiles
The following example sets the maximum number of files that can be open in the system to 1000:
sysctl -w kern.maxfiles=1000
More variables than these are available, consult the source where they are defined.
For more information see the following files:
Definitions for fourth level ICMP identifiers
Definitions for third level Internet identifiers and fourth level IP identifiers
Definitions for fourth level IGMP identifiers
Definitions for fourth level TCP identifiers
Definitions for fourth level UDP identifiers
Definitions for second level network identifiers
Definitions for top level identifiers, second level microkernel and hardware identifiers, and user level identifiers
The sysctl() facililty uses the following nodes:
Microkernel memory
instrumentation is provided via the kern.mkstats.mem
node.
Attribute: Measures the amount of physical pages of memory available on the node
Gauge (low threshold): Measures the amount of physical pages of memory currently available
Counter: Number of memory allocation failures since boot
Attribute: Size in bytes of physical page
Microkernel supervisor
page instrumentation is provided via the kern.mkstats.svpages
node.
Gauge (high threshold): Measures number of supervisor pages currently allocated
Microkernel execution
instrumentation is provided via the kern.mkstats.actors
and kern.mkstats.threads
nodes.
Attribute: Measures the maximum number of actorsthat can be created
Gauge(high threshold): Measures the current number of actors in use
Attribute: Measures the maximum number of threads that can be created
Gauge (high threshold): Measures the current number of threads in use
Microkernel CPU instrumentation is provided via the kern.mkstats.cpu
node.
Counter: Measures the number of milliseconds CPU has been used since boot
Counter: Measures the number of milliseconds the CPU has been used outside execution actor since boot
Counter: Measures the number of milliseconds the CPU has been used inside execution actor supervisor mode since boot
This basic instrumentation provides only raw measurements on top of which applications can compute ratios of CPU use according to their needs.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
sysctl presently exploits an undocumented interface to the microkernel sysctl() facility to traverse the sysctl tree and to retrieve format and name information. The correct interface is being discussed.
NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXTENDED DESCRIPTION | EXAMPLES | FILES | sysctl() Nodes | ATTRIBUTES | SEE ALSO | BUGS