Syslog
Synchronized Transcript
138 cues indexed • Click dialogue or words to jumpWelcome to Jeremy’s IT Lab. This is a free, complete course for the CCNA. If you like these videos, please subscribe to follow along with the series.
Also, please like and leave a comment, and share the video to help spread this free series of videos. Thanks for your help. In this video we will cover Syslog.
Syslog is a protocol used to keep logs of various events that happen on the device, for example interfaces going up or down, OSPF neighbor relationships going up or down, etc.
The log messages can be shown in real-time in the CLI of the device to inform you of important events as they occur, and they can also be stored in the device or on an external server and examined later.
These logs are very important, so understanding Syslog is essential for network admins and engineers. Syslog is mentioned in exam topic 4.5, which says you must be able to describe the use of syslog features including facilities and levels.
In this video I plan to cover everything you need to know about Syslog for the CCNA. Here’s what we’ll cover in this video. First I’ll give a brief overview of Syslog and outline how it works.
Then I’ll introduce the Syslog message format. Syslog messages have a standard format, and it’s important that you know the format so you can read and understand Syslog messages.
Then I’ll introduce the various Syslog facilities and severity levels. You probably aren’t sure exactly what ‘facility’ and ‘severity’ mean yet, but they were both mentioned in the exam topics list so we’ll cover them in this video.
Then I’ll introduce some basic Syslog configurations. Just like SNMP, Syslog configuration isn’t mentioned in the exam topics, but I think it’s important to get some hands-on practice.
So, I’ll go over the basic Syslog configuration commands. Make sure to watch until the end of the video for a bonus practice question from Boson Software’s ExSim for CCNA, the best practice exams for the CCNA.
Here’s a quick overview of Syslog. Syslog is an industry standard protocol for message logging. On network devices, Syslog can be used to log events such as changes in interface status, changes in OSPF neighbor status, or neighbor status in other routing protocols
like EIGRP and BGP, also system restarts, etc. Tons of different events can be logged, so I’m not going to try to list them all. The messages can be displayed in the CLI as you configure the device, saved in the device’s RAM, or sent to an external Syslog server.
I’m sure you’ve seen these messages as you configure devices in Packet Tracer. For example, I used NO SHUTDOWN to enable a router interface.
Notice that two Syslog messages are displayed, indicating that the interface state has changed to UP. Logs are essential when troubleshooting issues, examining the cause of incidents, etc.
Syslog and SNMP are both used for monitoring and troubleshooting devices. They are complementary to each other, but their functionalities are quite different.
After covering Syslog in this video, I’ll give a brief summary of how Syslog and SNMP are different at the end. Now let’s take a look at the Syslog message format.
There are the fields you can expect to see in a standard Syslog message. Let’s go through them. First, there is a sequence number indicating the order, the sequence, of the log messages.
Next there is a timestamp indicating at what time the message was generated. These timestamps are particularly important, especially when comparing the logs of different devices.
Assuming both devices have accurate time thanks to NTP, you can use these timestamps to compare when different events occurred on different devices. Note that these two fields may or may not be displayed, depending on the device’s configuration.
Sequence numbers are often not used, however the timestamps are very important and I highly recommend including them in Syslog messages.
Next there is the facility, this is a value that indicates which process on the device generated this message. For example, if OSPF generated the message when an OSPF neighbor came up, OSPF would be displayed in this field.
Next is the severity, which indicates the severity of the event. Some messages are just informational, simply letting you know that something happened.
Other messages indicate something much more serious that might need to be dealt with immediately. There are 8 severity levels, and you’ll need to know them all for the exam.
Then there is a mnemonic, which is a short code for the message that indicates what happened. For example, if the facility is OSPF, this mnemonic might be a code indicating that the message is about OSPF neighbor adjacencies.
If the facility is LINK, it might be a code indicating that the message is about an interface going up or down. Finally, there is the description.
This is the detailed information about the event being reported, about what actually happened. Before looking at some examples of Syslog messages, let’s cover the different Syslog severity levels.
As I briefly mentioned, these levels indicate how serious, how severe, the event is. For example, something like a serious hardware failure is more severe than an OSPF neighbor moving to the FULL state.
There are 8 severity levels, as displayed here. Each severity level has a number, 0 being the most severe and 7 being the least severe.
Each level also has a keyword, which is a name identifying the level. Then there is a brief description. I took these descriptions directly from the official RFC for Syslog.
First there is level 0, emergency, events which render the system unusable. Level 1, alert, is for events for which action must be taken immediately.
So, these are also very serious events. Level 2 is called critical, and the description is simply ‘critical conditions’. Same for level 3, error, and level 4, warning.
Next is level 5, notice, used for messages representing a ‘normal but significant condition’. In the official RFC for Syslog, the keyword for level 5 is ‘Notice’, but in the CLI of Cisco IOS the name is Notification, so make sure you know of both
names. Notice and Notification for level 5. Level 6 is ‘Informational’, and then finally the least severe level, level 7, is Debugging.
These are the least severe messages. Now, the RFC doesn’t give detailed definitions about exactly what events fit into each severity level.
So, each vendor will interpret these levels differently. Here’s a quote from the RFC. Because severities are very subjective, a relay or collector (basically that means a Syslog server) should not assume that all originators have the same definition of severity.
That’s from RFC 5424, The Syslog Protocol, which is free to read online if you Google it. Basically it means that you shouldn’t expect a Cisco router’s ‘Warning’ level to be exactly the same as a Juniper router’s ‘Warning’ level, for example.
Each vendor may interpret each level differently. For the CCNA exam, make sure you have memorized the levels and keywords. You should know that level 1 is Alert, and Informational is level 6, for example.
If you want some help remembering them, here’s a mnemonic. Every Awesome Cisco Engineer Will Need Ice cream Daily. Just like the OSI model, if you know any other good ways to remember these levels post them in the comment section!
Let’s look at some examples of Syslog messages. Here’s one, first there’s the timestamp, indicating the month, date, hours, minutes, seconds, and milliseconds.
Notice that there is no sequence number before the timestamp. As I mentioned earlier, the sequence number and timestamp fields may or may not be displayed, depending on the device’s configuration.
Here’s the facility, LINK. And the severity is 3. The mnemonic is UPDOWN, which tells us the message is about an interface going up or down.
Finally, here’s the description, which tells us exactly what happened. Interface gigabitethernet0/0 changed state to up. So, that’s an example Syslog message.
Make sure you’re able to identify each part of this message. For example, you might be asked, what’s the facility of this Syslog message? You should be able to answer ‘LINK’.
Or if asked about the severity, you should be able to answer ‘3’ or ‘error’, depending on the options. I can’t say for sure, but judging by the exam topics list those seem like the kind of question you can expect on the exam.
Okay, let’s see some more examples. Here’s a message about an OSPF neighbor moving to the FULL state. The facility is OSPF, and IOS declares this a level 5, notification level, message.
The mnemonic is A D J C H G, adjacency change. Here’s another example, and for this one I turned on the sequence numbers so you can see what it looks like.
In this case the facility is SYS for system, the severity is 5 again, and remember those keywords for level 5, ‘notice’ or ‘notification’.
And the mnemonic is CONFIG_I, with a description of ‘configured from console by jeremy on console.’ You get messages like this when you exit global config mode and return to privileged exec mode.
And one more example, this time I just changed the timezone from UTC to JST and this messages was displayed. Again, the facility is SYS, but this time the severity is 6.
What’s the keyword for level 6? It’s ‘informational’. And the mnemonic is CLOCKUPDATE. So, once again make sure you can identify each part of a Syslog message, it’s stated directly in the exam topics list.
Soon we’ll take a look at how to configure Syslog in the CLI, but before that here’s an overview of the different locations Syslog messages can be sent to.
First is the console line. This means that Syslog messages will be displayed when connected to the device via the console port. By default, all messages, from level 0 through level 7, are displayed when connected to the CLI via the device’s console port.
In Packet Tracer, for example, when you click on a device and go to the CLI tab, it operates as if you’re connected via the console port of the device.
So, that’s why Syslog messages are displayed when configuring devices in packet tracer via the CLI tab. Okay, the next location is the VTY lines.
This means that Syslog messages will be displayed in the CLI when connected to the device via Telnet or SSH. Telnet and SSH will be covered in a later video.
They are protocols used to connect to a device over a network, without being directly connected to the device’s console port. Logging to the VTY lines is disabled by default, so Syslog messages will not be displayed if you’re connecting to the device via Telnet or SSH.
So, if you shutdown an interface, for example, no message will be displayed. The next location for Syslog messages is the ‘buffer’ of the device.
This means that Syslog messages will be saved to RAM. By default, all messages, from level 0 to level 7, will be displayed in the buffer. You can view the messages in the buffer with the SHOW LOGGING command.
We’ll take a look at that command in the lab video. You can also configure the device to send Syslog messages to an external server. This is very useful, especially in large networks, but also in small networks.
Having a central server for the Syslog messages makes network management easier and makes it easier to compare the logs of multiple devices.
By the way, Syslog servers will listen for Syslog messages on UDP port 514. So, if a device sends a Syslog message to a Syslog server, the destination port will be UDP 514.
Remember that! So here are some basic Syslog configurations. First, at the top, configuring logging to the console line. This is enabled by default, but here’s how you configure it.
The command is LOGGING CONSOLE, followed by the level. I specified 6. Note that, in all of these commands, you can specify either the number or the keyword of the level.
So in this case I specified 6, but I could have used the keyword INFORMATIONAL instead. Also note that this doesn’t only enable informational messages.
This enables logging for informational severity and higher, so informational to emergency, which includes levels 6, 5, 4, 3, 2, 1, and 0.
By default the console logs all messages, including level 7, debugging, so setting the level to 6 actually slightly restricts the messages that will be displayed via the console.
Okay, next the command to configure logging to the VTY lines is LOGGING MONITOR, followed by the level. Just like above, you can specify the level number or keyword, this time I used the keyword of INFORMATIONAL instead of the level, 6.
Next, to configure logging to the buffer the command is LOGGING BUFFERED, followed by the size of the buffer in bytes and the level. The size is optional, if you don’t specify it the device will use its default size.
Just be careful not to set the buffer size too large, because that can take system memory away from other essential operations. Also to repeat, to specify the logging level you can use either the number or the keyword, and it enables logging for not only level 6 but also levels 5, 4, 3, 2,
1, and 0. Finally, logging to an external server can be configured with LOGGING, followed by the server IP, or LOGGING HOST, followed by the server IP.
The commands are the same, you can use whichever. Now, to configure the levels of messages sent to the external server, you need to use a different command. It’s LOGGING TRAP, followed by the level.
This time I specified DEBUGGING, but once again I could have used the level number of 7 instead. This enables logging of all levels, not just 7 but also 6, 5, 4, 3, 2, 1, and 0.
So, that’s how you enable Syslog logging to different locations and specify which levels of messages should be displayed. Because Syslog configuration isn’t specified in the exam topics, you probably don’t have to memorize these commands for the exam.
However, I will include flashcards for them and also you can get some practice with them in the following lab video. Let me introduce another command.
Even if LOGGING MONITOR is enabled, by default Syslog messages will not be displayed when connected via Telnet or SSH. You need another command, too.
For the messages to be displayed, you must use the following command: TERMINAL MONITOR, from privileged exec mode. But not only that, this command must be used every time you connect to the device via Telnet or SSH.
So, if you connect via SSH and use the TERMINAL MONITOR command, Syslog messages will be displayed as you configure the device. However, after you log out, that ‘session’ is finished and the TERMINAL MONITOR command is no longer effective.
To display Syslog messages in the CLI when you connect again next time, you’ll need to use the TERMINAL MONITOR command again. I’ll demonstrate this in the lab video.
This next command isn’t essential, but very convenient. By default, logging messages displayed in the CLI while you are in the middle of typing a command will result in something like this.
Notice in the middle of typing SHOW IP IN, the log message was displayed. I continued typing the command, and the command continued right after the log message.
I changed the color of the command to make it easier to see, but when this actually happens in the CLI it can be hard to see where the Syslog message ends and where the command continues.
To prevent this, you should use the logging synchronous command on the appropriate line, and I will talk more about ‘line’ configuration in the Telnet and SSH video.
You don’t need to learn this yet, but for example here’s how you can enter the console line, LINE CONSOLE 0, and then configure LOGGING SYNCHRONOUS.
This will cause a new line to be printed if your typing is interrupted by a message. Here’s an example. I typed SHOW IP INT, a log message was displayed, and then SHOW IP INT was reprinted on a new line.
This makes it easier to continue typing the command. So, this is a nice command to know and a command I usually use when doing labs. It just makes things easier to see.
Okay, the last two commands I want to show you are SERVICE TIMESTAMPS and SERVICE SEQUENCE-NUMBERS. This is how you control whether or not the timestamps and sequence numbers will be displayed in Syslog messages.
To enable timestamps for Syslog messages, use SERVICE TIMESTAMPS LOG, followed either by DATETIME or UPTIME. If you specify DATETIME, timestamps will display the actual date and time when the event occurred.
If you specify UPTIME, timestamps won’t display the date and time, they will display how long the device had been running when the event occurred.
DATETIME is usually the preferred option, so that’s what I chose. Then I enabled sequence numbers with the SERVICE SEQUENCE-NUMBERS command. After I exit global config mode, you can see that the Syslog message has both a sequence number and a timestamp.
I think it’s a good idea to always enable timestamps, although personally I don’t find sequence numbers particularly useful, so I prefer to keep them disabled. Here’s a summary of the commands I just showed you.
I think trying these out in a lab will be very helpful, not just for remembering the commands but for understanding how Syslog works. So make sure to watch the next video and try out the lab yourself in Packet Tracer.
Finally, here’s a brief comparison of Syslog and SNMP. As I said before, Syslog and SNMP are both used for monitoring and troubleshooting of devices.
They are complementary, but their functionalities are different. Syslog is used for message logging. Events that occur within the system are categorized based on facility and severity and logged, both within the device and likely to an external Syslog server.
Syslog is used for system management, analysis, and troubleshooting. Here’s a big difference. Messages are sent from the devices to the server, but the server can’t actively pull information from the devices, like an SNMP Get message, or modify variables
on the devices, like an SNMP Set message. Now SNMP. It is used to retrieve and organize information about the SNMP managed devices.
Things like IP addresses, current interface status, device temperature, CPU usage, etc are stored as variables and organized within the MIB.
SNMP servers can use Get to query the clients and Set to modify variables on the clients. Syslog and SNMP are used together to facilitate network device management, and you need to be familiar with both of them for the test.
Before the quiz, here’s a review of what we covered today. First I gave a brief overview of Syslog. It’s an industry standard protocol for logging events that occur on devices.
I introduced the Syslog message format, as well as facilities and severity levels. Make sure you know all of those severity level numbers and names, and make sure you can identify the different parts of a Syslog message.
Finally, I showed you some basic Syslog configurations. You probably won’t be asked about Syslog configuration on the exam, but I think the hands-on practice in Packet Tracer will be very helpful.
Make sure to watch until the end of the quiz for a bonus practice question from Boson Software’s ExSim, the best practice exams for the CCNA, and the ones I used to prepare for my exams.
Okay, let’s go to question 1 of the quiz. What is the severity level of the following Syslog message? Here are the options.
Pause the video now to examine the message and select the correct answer. The answer is C, Notification. This is indicated by the 5 here, between the facility and the mnemonic.
This severity level is called ‘Notice’ in the RFC for Syslog, but it’s also known as ‘Notification’. In the CLI of Cisco IOS, ‘Notification’ is used.
Okay, let’s go to question 2. Here’s another one. What is the severity level of the following Syslog message?
Here are the options. Pause the video now to examine the message and select the correct answer. The answer is B, Error.
That is the name of severity level 3. Make sure you know all of the severity levels and their names. They’re mentioned in the exam topics list, so they’re definitely important.
Okay, let’s go to question 3. Which of the following locations are Syslog messages sent to by default, without any specific Syslog configuration?
(select two). Here are the options. Pause the video now to think about the answers, select two.
The answers are B, the console line and C, the buffer. So, by default you will see Syslog messages in realtime when connected to the CLI of the device via the console port.
You can also use SHOW LOGGING to view those messages stored in the logging buffer, in the memory of the device. The device will not send Syslog messages to an external server until you configure it to do so, and Syslog messages also won’t be displayed in the CLI while connecting to the device via the VTY lines
using Telnet or SSH. I’ll cover Telnet and SSH in detail in another video, don’t worry about them for now. Okay, let’s go to question 4.
You issue the logging buffered 6 command on R1. Syslog messages of which severity levels will be saved to the logging buffer? Here are the options.
Pause the video to think about the answer. The answer is C, severity 0 to 6. When you specify a level of log messages, all messages of that level and higher severity, meaning numerically lower because the lower numbers are more
severe, will be displayed or saved to the buffer. Okay, let’s go to question 5. Which of the following Syslog message fields might not be displayed, depending on the device’s configuration?
(select two). Here are the options. Pause the video to think about the answers, select two.
The answers are A, sequence and D, time stamp. You can configure these with the SERVICE TIMESTAMPS and SERVICE SEQUENCE-NUMBERS command.
I highly recommend having timestamps on log messages, although I don’t think sequence numbers are as important. Okay, that’s all for the quiz.
Now let’s take a look at a bonus question in Boson Software’s ExSim for CCNA. Okay here's today's Boson ExSim practice question.
So, this is a drag and drop simulator question, so I'll click on this button to open it up. And here it is. Select the Syslog message logging keywords from the left and drag them to the corresponding Syslog levels on the right.
Okay, so I have said this multiple times, but this is very important, that you know all of these levels for the CCNA exam.
So pause the video now and try to do that. Okay let's check. So, first level 0. This is the most severe.
So the number is lower but the severity level is the highest. And that is emergencies. Next one after that is number 1, alerts.
And the critical, number 2. Errors, next level 4 is warnings. After that, notifications, or notices.
And then level 6 is informational and level 7 is debugging. So, if it helps you remember that, use the mnemonic 'every awesome Cisco engineer will need ice cream daily'.
So, I personally don't really use mnemonics but I know a lot of people do, so if that helps you remember these seven (*eight!) levels, you can use that one.
Okay, so I'll click on done and then let's check. So the answer is correct, there it is. And as always Boson has a great explanation down here, detailing the levels, some information about filtering the levels on the console, to
the server. And some other extra information. There is also a reference here to some Cisco documentation about the message logging level keywords.
So, if you google this title here you'll probably find it because this documentation is available for free online from Cisco, and it's another great study resource.
Okay so that was a question from Boson Software's ExSim for CCNA. These are without a doubt the best practice exams for the CCNA and I highly recommend them.
If you want to get Boson ExSim, please follow the link in the video description. There are supplementary materials for this video. There is a flashcard deck to use with the software ‘Anki’.
There will also be a packet tracer practice lab so you can get some hands-on practice. That will be in the next video. Sign up for my mailing list via the link in the description, and I’ll send you all of the flashcards and packet tracer lab files for the course.
Before finishing today’s video I want to thank my JCNP-level channel members. To join, please click the ‘Join’ button under the video. Thank you to Kenneth, Seamus, H W, Brandon, Samil, Aaron, Tech Alameda, Marcel, Kone, Donald, C Mohd, Gustavo, Anthony, Biraj, Junhong, Benjamin,
Tshepiso, Justin, Prakaash, Nasir, Erlison, Apogee, Marko, Daming, Jhilmar, Ed, Value, John, Funnydart, Velvijaykum, Mark, Yousif, Boson Software, Devin, Lito, Yonatan, and Vance.
Sorry if I pronounced your name incorrectly, but thank you so much for your support. This is the list of JCNP-level members at the time of recording by the way, February 13th 2021.
If you signed up recently and your name isn’t on here don’t worry, you’ll be in future videos. Thank you for watching. Please subscribe to the channel, like the video, leave a comment, and share the video with anyone else studying for the CCNA.
If you want to leave a tip, check the links in the description. I'm also a Brave verified publisher and accept BAT, or Basic Attention Token, tips via the Brave browser.
That's all for now.