-
Notifications
You must be signed in to change notification settings - Fork 68
feat: add dmesg log plugin #3830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
daf074d
to
789a292
Compare
Robot Results
|
Signed-off-by: reubenmiller <reuben.d.miller@gmail.com>
789a292
to
d14bc05
Compare
printf 'auth\n' # security/authorization messages | ||
printf 'syslog\n' # messages generated internally by syslogd | ||
printf 'lpr\n' # line printer subsystem | ||
printf 'news\n' # network news subsystem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The standard set seems to be 15 although I came across a few other blogs where that number was 11. But most of the online docs had 15 listed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rina23q @albinsuresh Ok, since the list seems to vary significantly (depends on the dmesg implementation), I'll refactor to remove all the types (as it will be more predictable for users), and just have a single "all" type.
Do you both agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though I'll still have to add a check to find out when the datetime filtering can be used (as that is also dependent on the implementation).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine to keep only all
.
The 15 facilities are based on RFC5424 (syslog protocol). I assume and it seems dmesg
doesn't have to align with the facilities defined on RFC5424?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though the problem is that I don't think that all dmesg implementations support it anyway...so it would just be adding an extra 15 items to the types, where we don't know which ones would work or not.
So if we keep things simple for now, and just have one type, as it is anyway for more advanced usecases (as this is more for powerusers who want to monitor kernel messages to debug driver problems etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the PR to used the single "all" type. The PR's description also reflects the updated scope.
Signed-off-by: reubenmiller <reuben.d.miller@gmail.com>
Signed-off-by: reubenmiller <reuben.d.miller@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
since="1 day ago" | ||
until="0 second ago" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is wrong with these defaults. I got no entries when no values is given for --since
and --until
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though that might be because there are no values within the time range (which isn't uncommon)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you can confirm this by just increasing the look back.
/var/share/tedge/log-plugins/dmesg get all --since "180 days ago" --until "0 second ago"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could change the default to something higher, like 90 days?
Proposed changes
Add a dmesg log plugin to the out-of-the-box features. The dmesg plugin only provide one type called "all" due to the vast differences in the dmesg implementations (e.g. busybox/bsd don't support filtering by log facility or datetime).
The plugin will attempt to call dmesg with a datetime filter, however if it fails for any reason, then dmesg will be called without any arguments (and in this case all the messages will be returned). This is due to the various implementations of dmesg.
Types of changes
Paste Link to the issue
Checklist
just prepare-dev
once)just format
as mentioned in CODING_GUIDELINESjust check
as mentioned in CODING_GUIDELINESFurther comments