Hostname in syslog message

The syslog now messages the sender identified by hostname. The hostname field identifies the switch that originally sends the syslog message. Configurable through the CLI and SNMP, the format of the hostname field supports the following formats.

ip-address

The IP address of the sending interface will be used as the message origin identifier. This is the default format for the origin identifier. The IP address of the sending interface (in dotted decimal notation) is the default format.

hostname

The hostname of the sending switch will be used as the message origin identifier.

none

No origin identifier will be embedded in the syslog message. Nilvalue is used as defined by ““. This configuration is system-wide, not per syslog server.


[NOTE: ]

NOTE: There is no support in this feature for menu interface, WebUI or a fully qualified domain name. There are no changes in this feature to IMC or IDM. There are no new log events added in this feature.


Using syslog servers

Adds an IP address to the list of receiving syslog servers.

Use of [no]without an IP address specified will remove all IP addresses from the list of syslog receivers. If an IP address is specified, that receiver will be removed. Both link-local with zone ID and global IPv6 addresses are supported.

  • Specify syslog server facility with the option [facility]. The command no logging facility <facility> sets the facility to defaults.

  • Specify filtering rules.

  • Specify severity for event messages to be filtered to the syslog server with the option [severity]. The command [no]logging severity <severity> sets the severity to default.

  • Event messages of specified system module will be sent to the syslog server. Using [no] sends messages from all system modules. Messages are first filtered by selected severity.

  • Specify syslog server transport layer with options [[udp]|[tcp]|[tls]].

  • Specify syslog server port number with options [[udp PORT-NUM] | [tcp PORT-NUM] | [tls PORT-NUM]].

  • Specify notification types to be sent to the syslog server.

  • Use the option [transmission-interval] to control the egress rate limit for transmitting notifications, 0 value means there is no rate limit (values are in seconds.) Only one syslog message is allowed for transmission within specified time interval.

  • Specify the origin information for the syslog messages with the option origin-id


[NOTE: ]

NOTE: When the syslog server receives messages from the switch, the IPv6 address of the switch is partly displayed.



Configured Host Ipv6 Address: 2001::1
Expected Syslog message:
Syslog message: USER.INFO: Oct 11 02:40:02 2001::1 00025 ip:
ST1CMDR: VLAN60: ip address 30.1.1.1/24 configured on vlan 60

Actual Truncated syslog message:
Syslog message: USER.INFO: Oct 11 02:40:02 2001:: 00025 ip: ST1CMDR:
VLAN60: ip address 30.1.1.1/24 configured on vlan 60



Logging origin-id

Use the logging origin-id command to specify the content for the hostname field.

Syntax:

logging origin-id [ip-address | hostname | none]

To reset the hostname field content back to default (IP-address), use the no form of the command.

Example:

Use the following command to set the origin-id to the hostname:

HP_Switch(config)# logging origin-id hostname

The following syslog message will occur:

<14> Jan 1 00:15:35 HP-2910al-24G 00076 ports: port 2 is now on-line

Example:

Use the following command to set the origin-id to none (nilvalue):

HP_Switch(config)# logging origin-id none

The following syslog message will occur:

<14> Jan 1 00:15:35 - 00076 ports: port 2 is now on-line

Example:

Use any of the following commands to set the origin-id to ip-address (default):

HP_Switch(config)# logging origin-id ip-address

HP_Switch(config)# no logging origin-id hostname

HP_Switch(config)# no logging origin-id none

The following syslog message will occur:

<14> Jan 1 00:15:35 169.254.230.236 00076 ports: port 2 is now on-line

Example:

HP_Switch(config)# show running-config

Default option is ip-address. The following output of show debug will occur when configured without loggin origin-id.

Debug Logging
Origin identifier: Outgoing Interface IP
Destination: None
Enabled debug types:
None are enabled.

Viewing Syslog/debug message sender

Use the commands show debug orshow running-config to display the identification of the syslog message sender. The default option for origin-id is ip-address. The command show running-config will not display the configured option when origin-id is set to the default value of ip address.

When hostname or none is configured using logging origin-id, the same displays as part of the show running-configcommand.

Example:

HP_Switch(config)# show debug

Default option is ip-address. The following output of show debugwill occur when configured without loggin origin-id.

Debug Logging
Origin identifier: Outgoing Interface IP
Destination: None
Enabled debug types:
None are enabled.

Example:

HP_Switch(config)# show running-config

The command logging origin-id hostname displays the following.

logging origin-id hostname

Example:

HP_Switch(config)# show debug

The command logging origin-id hostname produces the following syslog message.

Debug Logging
Origin identifier: Hostname
Destination: None
Enabled debug types: None are enabled.

Example:

HP_Switch(config)# show debug

The command logging origin-id none produces the following syslog message.

Debug Logging
Origin identifier: none
Destination: None
Enabled debug types: None are enabled.

Example:

HP_Switch(config)# show running-config

The command logging origin-id none displays the following.

logging origin-id none

Syslog messages

Syslog messages have been made to incorporate origin identifier changes.

Example:

HP_Switch(config)# logging origin-id ip-address

Resulting syslog message:

Jan 1 00:15:35 169.254.230.236 00076 ports: port 2 is now on-line

Example:

HP_Switch(config)# logging origin-id hostname

Resulting syslog message:

Jan 1 00:15:35 HP-2910al-24G 00076 ports: port 2 is now on-line.

Example:

HP_Switch(config)# logging origin-id none

Resulting syslog message:

Jan 1 00:15:35 - 00076 ports: port 2 is now on-line.

Syslog messages using UDP, TCP and TLS

Sends Syslog messages to the configured Syslog Servers using UDP, TCP and the TLS transport layer to deliver the Syslog messages.

Syntax:

(config)# logging <ip-addr>[udp <port> | tcp <port> | tls <port>]

To specify that syslog communications should use a TLS connection, transport type and port number parameters are available for the logging command in the switch configuration context. IP-ADDR is required when the transport protocol is specified. Setting the transport protocol is optional.

The default transport protocol is UDP. The port value is optional, but must be preceded by UDP, TCP or TLS.

Default port values are:

  • UDP: 514

  • TCP: 1470

  • TLS: 6514

Example:

Syslog server at 192.168.1.1 is using UDP with the default port value of 514:

(config)# logging 192.168.1.1

Example:

Syslog server at 192.168.1.2 is using UDP at port 9514:

(config)# logging 192.168.1.2 udp 9514

Example:

Syslog server at 192.168.1.3 is using TCP at port 1470 (the default):

(config)# logging 192.168.1.3 tcp

Example:

Syslog server at 192.168.1.4 is using TCP at port 9514:

(config)# logging 192.168.1.4 tcp 9514

Example:

Syslog server at 192.168.1.5 is using TLS at port 6514 (the default):

(config)# logging 192.168.1.5 tls

Example:

Syslog server at 192.168.1.6 is using TCP at port 10000:

(config)# logging 192.168.1.6 tls 10000

Adds an IP address to the list of receiving syslog servers. The use of no without an IP address specified will remove all IP addresses from the list of syslog receivers. If an IP address is specified, that receiver will be removed. Both link-local with zone ID and global IPv6 addresses are supported.

  • Specify syslog server facility with <facility>. The command [no] logging facility <facility> sets facility back to defaults.

  • Specify filtering rules.

  • Specify severity for event messages to be filtered to the syslog server with <severity>. The command [no] logging severity <severity> sets severity back to default.

  • Event messages of specified system module will be sent to the syslog server. A [no] parameter sends messages from all system modules. Messages are first filtered by selected severity.

  • Specify syslog server transport layer with [udp]|[tcp]|[tls].

  • Specify syslog server port number with [udp PORT-NUM]|[tcp PORT-NUM] | [tls PORT-NUM].

  • Specify notification types to be sent to the syslog server(s). Use 'transmission-interval' to control the egress rate limit for transmitting notifications, '0' value means there is no rate limit. The values are in seconds. Only one syslog message is allowed for transmission within specified time interval.

  • Specify origin information with [orgin-id].