Logging System Messages to a File
For more information, see the Cisco Nexus 9000 Series NX-OS System Management Configuration Guide:
Configuring the Persistent Logging Utilization Alert Threshold in Percentage
Configuring the Persistent Logging Utilization Alert Threshold in Percentage
POST http://<mgmt0_IP>/api/mo/sys/syslog.json
{
"syslogSyslog": {
"children": [
{
"syslogFile": {
"attributes": {
"adminState": "enabled",
"name": "messages",
"persistentThreshold": "99",
"severity": "notifications",
"size": "4194304"
}}}]}}
{
imdata:[]
}
<System>
<syslog-items>
<file-items>
<adminState>enabled</adminState>
<name>messages</name>
<persistentThreshold>99</persistentThreshold>
<severity>notifications</severity>
<size>4194304</size>
</file-items>
</syslog-items>
</System>
Note: This example was added in Release 9.3(5).
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
logging logfile messages 5 persistent threshold 99
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
syslogSyslog | sys/syslog |
syslogFile | sys/syslog/file |
syslogFile Properties
The following table contains information about the syslogFile properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
adminState | mon:AdminState (scalar:Enum8) | The administrative state of the local file. | SELECTION: 1 - enabled 2 - disabled DEFAULT: enabled |
name | pol:ObjName (naming:Name256) | Object name | MAX SIZE: 199 DEFAULT: messages |
persistentThreshold | syslog:ThresholdPercent (scalar:Uint32) | Set persistent logging utilization alert threshold in percentage | RANGE: [0 , 99] DEFAULT: 0 |
severity | syslog:Severity (scalar:Enum8) | The severity of the event, alert, or issue that caused the syslog entry to be generated. | SELECTION: 0 - emergencies 1 - alerts 2 - critical 3 - errors 4 - warnings 5 - notifications 6 - information 7 - debugging DEFAULT: information |
size | syslog:FileSize (scalar:Uint32) | Specifies the maximum file size. | RANGE: [4096 , 4194304] DEFAULT: 4194304 |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
Unconfiguring the Persistent Logging Utilization Alert Threshold in Percentage
Unconfiguring the Persistent Logging Utilization Alert Threshold in Percentage
POST http://<mgmt0_IP>/api/mo/sys/syslog.json
{
"syslogSyslog": {
"children": [
{
"syslogFile": {
"attributes": {
"adminState": "disabled",
"name": "messages",
"persistentThreshold": "99",
"severity": "notifications",
"size": "4194304"
}}}]}}
{
imdata:[]
}
<System>
<syslog-items>
<file-items>
<adminState>disabled</adminState>
<name>messages</name>
<persistentThreshold>99</persistentThreshold>
<severity>notifications</severity>
<size>4194304</size>
</file-items>
</syslog-items>
</System>
Note: This example was added in Release 9.3(5).
This example disables the logging to both the persistent and non-persistent location. To unconfigure only the persistentThreshold value, set the value to 0 (the default).
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no logging logfile messages 5 persistent threshold 99
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
syslogSyslog | sys/syslog |
syslogFile | sys/syslog/file |
syslogFile Properties
The following table contains information about the syslogFile properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
adminState | mon:AdminState (scalar:Enum8) | The administrative state of the local file. | SELECTION: 1 - enabled 2 - disabled DEFAULT: enabled |
name | pol:ObjName (naming:Name256) | Object name | MAX SIZE: 199 DEFAULT: messages |
persistentThreshold | syslog:ThresholdPercent (scalar:Uint32) | Set persistent logging utilization alert threshold in percentage | RANGE: [0 , 99] DEFAULT: 0 |
severity | syslog:Severity (scalar:Enum8) | The severity of the event, alert, or issue that caused the syslog entry to be generated. | SELECTION: 0 - emergencies 1 - alerts 2 - critical 3 - errors 4 - warnings 5 - notifications 6 - information 7 - debugging DEFAULT: information |
size | syslog:FileSize (scalar:Uint32) | Specifies the maximum file size. | RANGE: [4096 , 4194304] DEFAULT: 4194304 |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide: