Explanation & Hint:
To add a timestamp to log messages on a Cisco router, the network manager should use the command:
service timestamps log datetime
This command configures the router to include the date and time in the log messages, providing a record of when each message was generated. Here’s a brief overview of the purpose of each command you mentioned:
service timestamps log datetime : Enables timestamping of log messages with the date and time. This is the correct command for adding a time record to log messages.
show cdp interface : This command is used to display information about the Cisco Discovery Protocol (CDP) on interfaces. It’s not related to logging or timekeeping.
ntp server 10.10.14.9 : This command is used to configure the router to synchronize its clock with a Network Time Protocol (NTP) server (in this case, the server at IP address 10.10.14.9). While it’s important for ensuring that the router’s clock is accurate, it doesn’t directly enable timestamping in log messages.
clock timezone PST -7 : This command sets the router’s time zone to Pacific Standard Time (PST), with an offset of -7 hours from Coordinated Universal Time (UTC). This is useful for ensuring that the router’s clock displays the correct local time, but it doesn’t enable timestamping in log messages.
|