sysctl() Function (Python, SLAX, and XSLT)
Namespaces
http://xml.juniper.net/junos/commit-scripts/1.0 http://xml.libslax.org/slax
Python Syntax
value = jcs.sysctl("sysctl-value", "(i | s)")
SLAX Syntax
var $value = prefix:sysctl("sysctl-value", "(i | s)");
XSLT Syntax
<xsl:variable name="value" select="prefix:sysctl('sysctl-value', '(i | s)')"/>
Description
Return the given sysctl
value.
Python scripts require you to specify the return value's type. However, the type
argument is optional in SLAX and XSLT scripts. In Junos OS, use 'i
'
to specify an integer, and use 's
' to specify a string. In Junos OS
Evolved, you should only use 's
'.
The prefix associated with the namespace URI should be defined in the prefix-to-namespace mapping in the style sheet.
Parameters
sysctl-value |
Name of the |
Return Value
value |
Returned string or integer value. |
Usage Examples
jcs:sysctl() Function (Junos OS)
var $value = jcs:sysctl("kern.hostname", "s");
jcs:sysctl() Function (Junos OS Evolved)
var $value = jcs:sysctl("kernel.hostname", "s");
Release Information
Function introduced in Junos OS Release 7.6
Support for the slax namespace http://xml.libslax.org/slax added in Junos OS Release 12.2.
Support for Python added in Junos OS Release 16.1R1.