1
00:00:00,000 --> 00:00:01,859
In this demonstration, we're going to go over

2
00:00:01,859 --> 00:00:04,680
how to monitor some of the kernel modules.

3
00:00:04,680 --> 00:00:07,890
We're going to primarily be focusing on the D message command.

4
00:00:07,890 --> 00:00:10,950
This will give us a lot of information about what's going on

5
00:00:10,950 --> 00:00:13,110
beneath the surface at the kernel level

6
00:00:13,110 --> 00:00:17,160
'cause every kernel module, drivers and other devices

7
00:00:17,160 --> 00:00:19,290
send messages back and forth to the kernel

8
00:00:19,290 --> 00:00:22,350
and now we can see you in real time what's happening there.

9
00:00:22,350 --> 00:00:24,030
Now, a key file that we can use

10
00:00:24,030 --> 00:00:26,400
to get some information about this kernel

11
00:00:26,400 --> 00:00:28,060
it's going to be on the proc folder

12
00:00:28,950 --> 00:00:30,350
under the version directory.

13
00:00:32,159 --> 00:00:33,870
And here we'll see that it gives us

14
00:00:33,870 --> 00:00:35,880
the Linux version information,

15
00:00:35,880 --> 00:00:39,900
as well as the GCC or the GNU compiler collection.

16
00:00:39,900 --> 00:00:42,450
That's going to be useful for troubleshooting.

17
00:00:42,450 --> 00:00:45,720
For example, if there's some out-of-date software

18
00:00:45,720 --> 00:00:47,970
or incompatible software,

19
00:00:47,970 --> 00:00:51,000
we'll know by getting this information from this file.

20
00:00:51,000 --> 00:00:52,680
Next, we're going to go ahead and examine

21
00:00:52,680 --> 00:00:54,570
the kernel message buffer.

22
00:00:54,570 --> 00:00:55,860
Okay, this is that D message command

23
00:00:55,860 --> 00:00:57,310
I was speaking about earlier.

24
00:00:59,250 --> 00:01:01,110
So first we're just going to look at the help command

25
00:01:01,110 --> 00:01:04,140
and we're just going to read through some of the information

26
00:01:04,140 --> 00:01:05,880
that's presented to us.

27
00:01:05,880 --> 00:01:08,010
It talks about the different type of facilities,

28
00:01:08,010 --> 00:01:10,380
talks about the different type of log levels.

29
00:01:10,380 --> 00:01:13,350
And we're going to use the warning as an example

30
00:01:13,350 --> 00:01:15,603
of how to key in on some of that information.

31
00:01:16,620 --> 00:01:18,120
So we're going to go ahead and get right to it.

32
00:01:18,120 --> 00:01:20,040
We're going to do the D message command

33
00:01:20,040 --> 00:01:21,693
and we're going to use the H option.

34
00:01:22,710 --> 00:01:24,510
So if you see, H is a lot of information

35
00:01:24,510 --> 00:01:27,030
going back and forth from different drivers,

36
00:01:27,030 --> 00:01:30,600
other parts of the system, hardware, software,

37
00:01:30,600 --> 00:01:34,350
anything that pertains to the kernel,

38
00:01:34,350 --> 00:01:38,790
system resource allocation, errors, starts, stops,

39
00:01:38,790 --> 00:01:40,740
pretty much anything that you need to know

40
00:01:40,740 --> 00:01:43,620
relative to information going back and forth to the kernel.

41
00:01:43,620 --> 00:01:44,670
You're going to get that here.

42
00:01:44,670 --> 00:01:46,680
Now, for the average system administrator

43
00:01:46,680 --> 00:01:48,870
this isn't going to be something that you use

44
00:01:48,870 --> 00:01:51,330
quite often and you might do a lot more research

45
00:01:51,330 --> 00:01:53,640
to understand exactly what these messages are going for,

46
00:01:53,640 --> 00:01:56,403
but this is the location that you go to to get it.

47
00:02:00,605 --> 00:02:01,673
All the way down to the bottom.

48
00:02:03,000 --> 00:02:06,180
Now, as for a filter, we're going to look for only messages

49
00:02:06,180 --> 00:02:08,100
that are giving us a warning about something.

50
00:02:08,100 --> 00:02:10,530
So again, we're going to go to D message

51
00:02:10,530 --> 00:02:12,210
and do the H for human readable.

52
00:02:12,210 --> 00:02:14,970
And this L option gives us a level.

53
00:02:14,970 --> 00:02:17,040
It's going to let us specify the levels

54
00:02:17,040 --> 00:02:18,660
that we would like to view.

55
00:02:18,660 --> 00:02:21,060
For example, if we want to view errors or warning.

56
00:02:21,060 --> 00:02:23,033
So the first one we want to do is a warning.

57
00:02:24,960 --> 00:02:27,660
So here it keys in on all the information

58
00:02:27,660 --> 00:02:29,760
that's deemed as a warning that's being sent

59
00:02:29,760 --> 00:02:31,233
back and forth to the kernel.

60
00:02:32,220 --> 00:02:34,920
Now, we're going to do this one more time,

61
00:02:34,920 --> 00:02:37,923
but this time we're going to do it with an error message.

62
00:02:40,110 --> 00:02:42,210
I only have two error messages thus far,

63
00:02:42,210 --> 00:02:44,280
but we can see it here.

64
00:02:44,280 --> 00:02:46,290
So we love to use a pipe operator

65
00:02:46,290 --> 00:02:48,960
because again it is a powerful filter for us.

66
00:02:48,960 --> 00:02:51,460
And so we're going to use a D message again

67
00:02:52,531 --> 00:02:53,910
and we're going to pipe it and we're going to search

68
00:02:53,910 --> 00:02:57,090
for the USB that we installed earlier.

69
00:02:57,090 --> 00:02:58,590
Okay now, we look at the screen we can see

70
00:02:58,590 --> 00:03:00,420
pretty much from start to finish

71
00:03:00,420 --> 00:03:04,605
anything pretty much kind of relating to USB device drivers,

72
00:03:04,605 --> 00:03:06,312
core drivers, registration,

73
00:03:06,312 --> 00:03:08,700
gives us information about the manufacturer, serial number.

74
00:03:08,700 --> 00:03:10,170
All this information that's being sent

75
00:03:10,170 --> 00:03:11,620
back and forth to the kernel.

76
00:03:12,930 --> 00:03:14,010
Now, we're going to do it one more time,

77
00:03:14,010 --> 00:03:16,710
but this time I'm going to use it with the Bluetooth USB.

78
00:03:17,640 --> 00:03:19,380
And the most important thing that we're looking for

79
00:03:19,380 --> 00:03:23,070
is that it's being registered as a new interface driver.

80
00:03:23,070 --> 00:03:25,350
So I registered and de-registered earlier,

81
00:03:25,350 --> 00:03:27,570
and so I'll re-register it for this example.

82
00:03:27,570 --> 00:03:29,550
So we can see all the information here

83
00:03:29,550 --> 00:03:31,350
and it's clear, and of course, when we use the grip,

84
00:03:31,350 --> 00:03:33,990
it highlights it, so it's nice, clean, readable for us.

85
00:03:33,990 --> 00:03:35,400
All right, that was just a quick walkthrough

86
00:03:35,400 --> 00:03:36,960
on the D message command.

87
00:03:36,960 --> 00:03:39,240
Pretty much, again, that's the message buffer

88
00:03:39,240 --> 00:03:40,073
for the kernel.

89
00:03:40,073 --> 00:03:42,480
And we'll see a lot of key information that we need

90
00:03:42,480 --> 00:03:44,280
from kernel modules, device drivers,

91
00:03:44,280 --> 00:03:46,170
and just the order of operations

92
00:03:46,170 --> 00:03:47,610
that's happening beneath the hood.

93
00:03:47,610 --> 00:03:49,560
Again, thank you for sticking me with this walkthrough

94
00:03:49,560 --> 00:03:51,360
and I'll see you in the next lesson.

