Kernel system control information
Shared parsers for parsing file /etc/sysctl.conf and command sysctl -a.
Parsers included in this module are:
Sysctl - command sysctl -a
SysctlConf - file /etc/sysctl.conf
SysctlDConfEtc - file /etc/sysctl.d/*.conf
SysctlDConfUsr - file /usr/lib/sysctl.d/*.conf
SysctlConfInitramfs - command lsinitrd
- class insights.parsers.sysctl.Sysctl(context)[source]
Bases:
SysctlBaseParse the output of sysctl -a command.
Note
Please refer to its base class
SysctlBasefor the sample data and examples.
- class insights.parsers.sysctl.SysctlBase(context)[source]
Bases:
Parser,dictParse sysctl conf files, and sysctl command output.
Sample input:
# sysctl.conf sample # kernel.domainname = example.com ; this one has a space which will be written to the sysctl! kernel.modprobe = /sbin/mod probe
- data
Dictionary containing key/value pairs for the lines in the configuration file. Dictionary is in order keywords first appear in the lines.
- Type:
OrderedDict
Examples
>>> sysctl_conf.data['kernel.domainname'] 'example.com' >>> sysctl_conf.data['kernel.modprobe'] '/sbin/mod probe'
- class insights.parsers.sysctl.SysctlConf(context)[source]
Bases:
SysctlBaseParse /etc/sysctl.conf file.
Note
Please refer to its base class
SysctlBasefor the sample data and examples.
- class insights.parsers.sysctl.SysctlConfInitramfs(context, extra_bad_lines=None)[source]
Bases:
CommandParser,TextFileOutputShared parser for the output of
lsinitrdapplied to kdump initramfs images to viewsysctl.confandsysctl.dconfigurations.The file is treated as raw lines (as a
TextFileOutputparser, as no serialial parsing result is required for this spec for now.Note
Please refer to its super-class
insights.core.TextFileOutputSample input:
initramfs:/etc/sysctl.conf ======================================================================== # sysctl settings are defined through files in # /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/. # # Vendors settings live in /usr/lib/sysctl.d/. # To override a whole file, create a new file with the same in # /etc/sysctl.d/ and put new settings there. To override # only specific settings, add a file with a lexically later # name in /etc/sysctl.d/ and put new settings there. # # For more information, see sysctl.conf(5) and sysctl.d(5). fs.inotify.max_user_watches=524288 ======================================================================== initramfs:/etc/sysctl.d/*.conf ========================================================================
Examples
>>> type(sysctl_initramfs) <class 'insights.parsers.sysctl.SysctlConfInitramfs'> >>> sysctl_initramfs.get('max_user_watches')[0]['raw_line'] 'fs.inotify.max_user_watches=524288'
- class insights.parsers.sysctl.SysctlDConfEtc(context)[source]
Bases:
SysctlBaseParse /etc/sysctl.d/*.conf files.
Note
Please refer to its base class
SysctlBasefor the sample data and examples.
- class insights.parsers.sysctl.SysctlDConfUsr(context)[source]
Bases:
SysctlBaseParse /usr/lib/sysctl.d/*.conf files.
Note
Please refer to its base class
SysctlBasefor the sample data and examples.