OcNOS SP : OpenConfig Command Reference : System OpenConfig Translation
System OpenConfig Translation
Host
This XML configuration snippet is used to set the network name for the device that OcNOS uses in system prompts and default configuration filenames.
Using this command to set a network name also sets the host name in the Kernel.
Release
This configuration was introduced in OcNOS version 5.0.
OpenConfig NETCONF Payload
Here is a sample OpenConfig NetConf Payload to set the network name for the device.
<system xmlns="http://openconfig.net/yang/system">
<config>
<hostname>host123</hostname>
</config>
</system>
OcNOS CLI command
This CLI command is used to set the network name for the device.
OcNOS#conf t
Enter configuration commands, one per line. End with CNTL/Z.
OcNOS(config)#hostname host123
OcNOS(config)#commit
OcNOS NETCONF Payload
Here is a sample OcNOS NetConf Payload to set the network name for the device.
<system-info xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-system">
<config>
<hostname>host123</hostname>
</config>
</system-info>
Validation
Here is a NetConf validation response that provides detailed information about setting the network name for the device.
Get OpenConfig Payload
This filter for the Get operation results in the Get OpenConfig Return output shown below.
<system xmlns="http://openconfig.net/yang/system">
<config/>
<state/>
</system>
Get OpenConfig Return
This validation response provides information on the configuration and runtime for setting a network name for the device.
<system xmlns="http://openconfig.net/yang/system">
<config>
<hostname>host123</hostname>
</config>
<state>
<hostname>host123</hostname>
<current-datetime>2021-11-18T12:36:44Z</current-datetime>
</state>
</system>
Unconfiguration
Use operation='delete'to unconfigure the configuration of network name on the device. Once unconfigured, the host name returns to the default name “OcNOS”.
OpenConfig NETCONF Payload
Here is a sample OpenConfig NetConf Payload to unconfigure.
<system xmlns="http://openconfig.net/yang/system">
<config>
<hostname operation="delete" />
</config>
</system>
Restriction
As per RFC 952 and RFC 1123, a host name string can contain only the special characters period (“.”) and hyphen (“-”). These special characters cannot be at the start or end of a host name. The host name must be between 1 and 63 characters.
TimeZone Clock
This XML configuration snippet is used to set the system time zone.
Release
This configuration was introduced in OcNOS version 5.0.
OpenConfig NETCONF Payload
Here is a sample OpenConfig NetConf Payload to set the system time zone.
<system xmlns="http://openconfig.net/yang/system">
<clock>
<config>
<timezone-name>Pacific</timezone-name>
</config>
</clock>
</system>
OcNOS CLI command
This CLI command is used to set the system time zone.
OcNOS#conf t
Enter configuration commands, one per line. End with CNTL/Z.
OcNOS(config)#clock timezone Pacific
OcNOS(config)#commit
OcNOS NETCONF Payload
Here is a sample OcNOS NetConf Payload to set the system time zone.
<system xmlns="http://openconfig.net/yang/system">
<clock>
<config>
<timezone-name>Pacific</timezone-name>
</config>
</clock>
</system>
Validation
Here is a NetConf validation response that provides detailed information about setting system time zone.
Get OpenConfig Payload
This filter for the Get operation results in the Get OpenConfig Return output shown below.
<system xmlns="http://openconfig.net/yang/system">
<clock/>
</system>
Get OpenConfig Return
This validation response provides information on the configuration and runtime for setting system time zone.
<system xmlns="http://openconfig.net/yang/system">
<clock>
<config>
<timezone-name>Pacific</timezone-name>
</config>
<state>
<timezone-name>Pacific</timezone-name>
</state>
</clock>
</system>
Restrictions
The names allowed to be used for the time zone can be queried using the show timezone <macro region> CLI command.
There is currently no provision to query this list through OpenConfig.
Rsyslog
This XML configuration snippet is used to change the Virtual Routing and Forwarding (VRF) of Rsyslog log processing system.
Release
This configuration was introduced in OcNOS version 5.0.
OpenConfig NETCONF Payload
Here is a sample OpenConfig NetConf Payload to change the VRF of Rsyslog.
<system xmlns="http://openconfig.net/yang/system">
<logging>
<remote-servers>
<config xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-sys-deviations">
<vrf>management</vrf>
</config>
</remote-servers>
</logging>
</system>
OcNOS CLI command
This CLI command is used to change the VRF of Rsyslog.
OcNOS#conf t
Enter configuration commands, one per line. End with CNTL/Z.
OcNOS(config)#feature rsyslog vrf management
OcNOS(config)#commit
OcNOS NETCONF Payload
Here is a sample OcNOS NetConf Payload to change the VRF of Rsyslog.
<logging xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-logging">
<rsyslog>
<vrf>management</vrf>
<config>
<vrf>management</vrf>
</config>
</rsyslog>
</logging>
Validation
Here is a NetConf validation response that provides detailed information about changing VRF of Rsyslog.
Get OpenConfig Payload
This filter for the Get operation results in the Get OpenConfig Return output shown below.
<system xmlns="http://openconfig.net/yang/system">
<logging/>
</system>
Get OpenConfig Return
This validation response provides information on the configuration and runtime for changing VRF for Rsyslog.
<system xmlns="http://openconfig.net/yang/system">
<logging>
<remote-servers>
<config xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-sys-deviations">
<vrf>management</vrf>
</config>
<state xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-sys-deviations">
<vrf>management</vrf>
</state>
</remote-servers>
</logging>
</system>
Restrictions
The leaf system/logging/remote-servers/config/vrf accepts only default or management.
Logging Remote Server
This XML configuration snippet is used to set a syslog server.
OcNOS supports logging messages to a syslog server in addition to logging to a file or the console (local or ssh/telnet console). Messages can be logged to a local syslog server (the machine on which OcNOS executes) as well as one or more remote syslog servers.
Release
This configuration was introduced in OcNOS version 5.0.
OpenConfig NETCONF Payload
Here is a sample OpenConfig NetConf Payload to set a syslog server.
<system xmlns="http://openconfig.net/yang/system">
<logging>
<remote-servers>
<config xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-sys-deviations">
<vrf>management</vrf>
</config>
<remote-server>
<host>2.2.2.3</host>
<config>
<host>2.2.2.3</host>
</config>
<selectors>
<selector>
<severity>DEBUG</severity>
<config>
<severity>DEBUG</severity>
</config>
</selector>
</selectors>
</remote-server>
</remote-servers>
</logging>
</system>
OcNOS CLI command
This CLI command is used to set a syslog server.
OcNOS#conf t
Enter configuration commands, one per line. End with CNTL/Z.
OcNOS(config)#logging remote server 2.2.2.3 7 vrf management
OcNOS(config)#commit
OcNOS NETCONF Payload
Here is a sample OcNOS NetConf Payload to set a syslog server.
<logging xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-logging">
<rsyslog>
<vrf>management</vrf>
<remote-servers>
<remote-server>
<address>2.2.2.3</address>
<config>
<address>2.2.2.3</address>
<severity>7</severity>
</config>
</remote-server>
</remote-servers>
<config>
<vrf>management</vrf>
<vrf>default</vrf>
<enable-rsyslog>rsyslog</enable-rsyslog>
</config>
</rsyslog>
</logging>
Validation
Here is a NetConf validation response that provides detailed information about setting a syslog server.
Get Openconfig Payload
This filter for the Get operation results in the Get OpenConfig Return output shown below.
<system xmlns="http://openconfig.net/yang/system">
<logging/>
</system>
Get OpenConfig Return
This validation response provides information on the configuration and runtime for setting a syslog server.
<system xmlns="http://openconfig.net/yang/system">
<logging>
<remote-servers>
<config xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-sys-deviations">
<vrf>management</vrf>
</config>
<state xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-sys-deviations">
<vrf>management</vrf>
</state>
<remote-server>
<host>2.2.2.3</host>
<config>
<host>2.2.2.3</host>
</config>
<selectors>
<selector>
<severity>DEBUG</severity>
<config>
<severity>DEBUG</severity>
</config>
<state>
<severity>DEBUG</severity>
</state>
</selector>
</selectors>
<state>
<host>2.2.2.3</host>
</state>
</remote-server>
</remote-servers>
</logging>
</system>
Restrictions
When configuring /system/logging/remote-servers/remote-server/selectors/selector/config/facility leaf, it is mapped on IPI data model as /logging/global/config/remote-server-facility leaf, which is a single and global configuration. To avoid issues during configuration, the value of OpenConfig facility leaf must be the same on all facility leaves indicated on Payload. Otherwise, IPI chooses one facility value among all the values present on payload for the configuration of all facility leaves.
When the delete operation is set on OpenConfig path /system/logging/remote-servers, it triggers the deletion of IPI data model /logging/global/config/remote-server-facility leaf.
When the OpenConfig objects/system/logging/remote-servers/remote-server are deleted individually, it will not trigger the deletion of IPI datamodel /logging/global/config/remote-server-facility leaf. In this case, this leaf will not be shown on NetConf Get output, but will be shown on show running-config CLI.
Logging Remote Facility
This XML configuration snippet is used to set a syslog servers facility.
OcNOS supports logging messages to one or more remote syslog servers, but the same facility is used for all the servers.
Use the number form of this command to apply the default facility value, which is local7.
Release
This configuration was introduced in OcNOS version 5.0
OpenConfig NETCONF Payload
Here is a sample OpenConfig NetConf Payload to set syslog servers facility.
<system xmlns="http://openconfig.net/yang/system">
<logging>
<remote-servers>
<config xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-sys-deviations">
<vrf>management</vrf>
</config>
<remote-server>
<host>2.2.2.3</host>
<config>
<host>2.2.2.3</host>
</config>
<selectors>
<selector>
<facility>oc-log:LOCAL5</facility>
<severity>DEBUG</severity>
<config>
<facility>oc-log:LOCAL5</facility>
<severity>DEBUG</severity>
</config>
</selector>
</selectors>
</remote-server>
</remote-servers>
</logging>
</system>
OcNOS CLI command
The below CLI command is used to set syslog servers facility.
OcNOS#conf t
Enter configuration commands, one per line. End with CNTL/Z.
OcNOS(config)#logging remote facility local5
OcNOS(config)#commit
OcNOS NETCONF Payload
Here is a sample OcNOS NetConf Payload to set syslog servers facility.
<logging>
<remote-servers>
<config xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-sys-deviations">
<vrf>management</vrf>
</config>
<remote-server>
<host>2.2.2.3</host>
<config>
<host>2.2.2.3</host>
</config>
<selectors>
<selector>
<facility>oc-log:LOCAL5</facility>
<severity>DEBUG</severity>
<config>
<facility>oc-log:LOCAL5</facility>
<severity>DEBUG</severity>
</config>
</selector>
</selectors>
</remote-server>
</remote-servers>
</logging>
Validation
Here is a NetConf validation response that provides detailed information about setting a syslog servers facility.
Get OpenConfig Payload
This filter for the Get operation results in the Get OpenConfig Return output shown below.
<system xmlns="http://openconfig.net/yang/system">
<logging/>
</system>
Get OpenConfig Return
This validation response provides information on the configuration and runtime for setting a syslog servers facility.
<system xmlns="http://openconfig.net/yang/system">
<logging>
<remote-servers>
<config xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-sys-deviations">
<vrf>management</vrf>
</config>
<state xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-sys-deviations">
<vrf>management</vrf>
</state>
<remote-server>
<host>2.2.2.3</host>
<config>
<host>2.2.2.3</host>
</config>
<selectors>
<selector>
<facility>oc-log:LOCAL5</facility>
<severity>DEBUG</severity>
<config>
<facility>oc-log:LOCAL5</facility>
<severity>DEBUG</severity>
</config>
<state>
<facility>oc-log:LOCAL5</facility>
<severity>DEBUG</severity>
</state>
</selector>
</selectors>
<state>
<host>2.2.2.3</host>
</state>
</remote-server>
</remote-servers>
</logging>
</system>
Restrictions
The facility leaf can only be added using OpenConfig to a configured remote server, as it is a part of the object’s key on the path /system/logging/remote-servers/remote-server/selectors/selector.
When configuring /system/logging/remote-servers/remote-server/selectors/selector/config/facility leaf, it is mapped on IPI data model as /logging/global/config/remote-server-facility leaf, which is a single and global configuration. To avoid issues during configuration, the value of OpenConfig facility leaf must be the same on all facility leaves indicated on Payload. Otherwise, IPI chooses one facility value among all the values present on payload for the configuration of all facility leaves.
When the delete operation is set on OpenConfig path /system/logging/remote-servers, it triggers the deletion of IPI data model /logging/global/config/remote-server-facility leaf.
When the OpenConfig objects/system/logging/remote-servers/remote-server are deleted individually, it will not trigger the deletion of IPI datamodel /logging/global/config/remote-server-facility leaf. In this case, this leaf will not be shown on NetConf Get output, but will be shown on show running-config CLI.
Alarms
Alarms do not have a configuration on OpenConfig. It is a runtime attribute, and when some event triggers the alarm, it can be viewed on OpenConfig.
Use the following CLI command to enable Alarms:
OcNOS#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
OcNOS(config)#fault-management enable
OcNOS(config)#commit
To enable Alarms., it is necessary to change the logging levels to 4 or more using the following command:
OcNOS#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
OcNOS(config)#logging level all 4
OcNOS(config)#commit
Release
This configuration was introduced in OcNOS version 5.1.
Get OpenConfig Payload
This filter for the Get operation results in the Get OpenConfig Return output shown below.
<system xmlns="http://openconfig.net/yang/system">
<alarms/>
</system>
Get OpenConfig Return
This validation response provides information on the configuration and runtime for enabling the alarm.
<system xmlns="http://openconfig.net/yang/system">
<alarms>
<alarm>
<id>IFMGR_IF_DOWN:ce2/1</id>
<state>
<id>IFMGR_IF_DOWN:ce2/1</id>
<type-id>EQPT</type-id>
<severity xmlns:oc-alarm-types="http://openconfig.net/yang/alarms/types">oc-alarm-types:MAJOR</severity>
<alarm-reported-timestamp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-sys-deviations">Thu Dec 16 2021 20:31:28 UTC</alarm-reported-timestamp>
<time-created>1639686688</time-created>
<text>OcNOS [IFMGR_IF_DOWN] Interface ce2/1 changed state to down</text>
<resource>ce2/1</resource>
</state>
</alarm>
</alarms>
</system>
OcNOS CLI show command
This OcNOS CLI show command is used to enable the alarm.
OcNOS#show alarm active
Active Alarms received:-
Active Alarm Count: 2
Severity Status Alarm Description
MAJOR Active OcNOS [IFMGR_IF_DOWN] Interface ce2/1 changed state to down
Restrictions
The alarms get generated only for some events as mentioned in the list here:
https://jira-ipi.atlassian.net/wiki/spaces/IPI/pages/741900306/Alarms+Datamodel+Design+Document#3.1.3--List-of-supported%2Fregistered-alarms-in-OcNOS-5.1