Custom Datasources Catalog

insights.specs.datasources

Custom datasources provide functionality beyond simple_file and simple_command type datasources. If the custom datasource is short and concise it may be added to this module. Other datasources should be added as a separate module. Normally custom datasources are necessary for core-collection. In order for a custom datasource to execute, all of its dependencies must be explicitly loaded by the client. The client uses the YAML template insights.collect.default_manifest and each parser/combiner/component required by a custom datasource must be included in the YAML template to ensure it is loaded.

insights.specs.datasources.DEFAULT_SHELL_TIMEOUT = 10

Default timeout in seconds for ctx.shell_out() commands, must be provided as an arg

Type:int
insights.specs.datasources.get_running_commands(ps, ctx, commands)[source]

Search for a list of commands in Ps combiner output and returns the full path to the command

Parameters:
  • ps -- Ps combiner object
  • ctx -- Context of the current collection
  • commands (list) -- List of commands to search for in ps output
Returns:

List of the full command paths of the all command.

Return type:

list

Raises:

TypeError -- Raised when commands args is not a list

insights.specs.datasources.aws

Custom datasources for aws information

insights.specs.datasources.aws.aws_imdsv2_token(broker)[source]

This datasource provides a session token for use by other specs to collect metadata information on AWS EC2 nodes with IMDSv2 support..

Typical output of the input spec, which is also the output of this datasource:

AQAEABcCFaLcKRfXhLV9_ezugiVzra-qMBoPbdWGLrbdfqSLEJzP8w==
Returns:String that is the actual session token to be used in other commands
Return type:str
Raises:SkipComponent -- When an error occurs or no token is generated
class insights.specs.datasources.aws.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by aws datasources

aws_imdsv2_token = <insights.core.spec_factory.simple_command object>
context_handlers = {}
registry = {}

insights.specs.datasources.awx_manage

Custom datasources for awx_manage information

insights.specs.datasources.awx_manage.awx_manage_check_license_data_datasource(broker)

This datasource provides the not-sensitive information collected from /usr/bin/awx-manage check_license --data.

Typical content of /usr/bin/awx-manage check_license --data file is:

{"contact_email": "test@redhat.com", "company_name": "test Inc", "instance_count": 100, "license_date": 1655092799, "license_type": "enterprise", "subscription_name": "Red Hat Ansible Automation, Standard (100 Managed Nodes)", "sku": "MCT3691", "support_level": "Standard", "product_name": "Red Hat Ansible Automation Platform", "valid_key": true, "satellite": null, "pool_id": "2c92808179803e530179ea5989a157a4", "current_instances": 1, "available_instances": 100, "free_instances": 99, "time_remaining": 29885220, "trial": false, "grace_period_remaining": 32477220, "compliant": true, "date_warning": false, "date_expired": false}
Returns:JSON string containing non-sensitive information.
Return type:str
Raises:SkipComponent -- When the filter/path does not exist or any exception occurs.
class insights.specs.datasources.awx_manage.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by awx_manage datasources

awx_manage_check_license_data_raw = <insights.core.spec_factory.simple_command object>

Returns the output of command /usr/bin/awx-manage check_license --data

context_handlers = {}
registry = {}

insights.specs.datasources.candlepin_broker

Custom datasources for candlepin broker.xml

insights.specs.datasources.candlepin_broker.candlepin_broker(broker)

This datasource provides the candlepn broker configuration information collected from /etc/candlepin/broker.xml.

Typical content of /etc/candlepin/broker.xml file is:

<configuration xmlns="urn:activemq"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
    <core xmlns="urn:activemq:core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:activemq:core ">
        <acceptors>
            <acceptor name="in-vm">vm://0</acceptor>
            <acceptor name="stomp">tcp://localhost:61613?protocols=STOMP;useEpoll=false;sslEnabled=true;trustStorePath=/etc/candlepin/certs/truststore;trustStorePassword=CDX9i3K5uPPBzcNtzz5tcycVf5PuXA5w;keyStorePath=/etc/candlepin/certs/keystore;keyStorePassword=4iBpTS45VZjFmVdNzRhRKNXtxbsH5Dij;needClientAuth=true</acceptor>
        </acceptors>
        <security-enabled>true</security-enabled>
    </core>
</configuration>

Note

This datasource may be executed using the following command:

insights cat --no-header candlepin_broker

Returns:XML string after removeing sensitive information.
Return type:str
Raises:SkipComponent -- When the path does not exist or any exception occurs.
class insights.specs.datasources.candlepin_broker.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by candlepin_broker datasources

candlepin_broker_input = <insights.core.spec_factory.simple_file object>

Returns the contents of the file /etc/candlepin/broker.xml

context_handlers = {}
registry = {}

insights.specs.datasources.client_metadata

Custom datasource for client metadata

insights.specs.datasources.client_metadata.ansible_host(broker)[source]

Custom datasource for ansible_host getting from insights-client configuration.

Raises:SkipComponent -- When there is no ansible_host is configured.
Returns:The Ansible Hostname
Return type:str
insights.specs.datasources.client_metadata.blacklist_report(broker)

Custom datasource for blacklist_report getting from insights-client configuration.

Raises:SkipComponent -- When there is no file-redaction is configured.
Returns:The JSON strings
Return type:str
insights.specs.datasources.client_metadata.blacklisted_specs(broker)[source]

Custom datasource for blacklisted_specs getting from insights-client configuration.

Raises:SkipComponent -- When there is no file-redaction is configured.
Returns:The JSON strings
Return type:str
insights.specs.datasources.client_metadata.branch_info(broker)[source]

Custom datasource for branch_info getting from insights-client configuration.

Returns:The JSON strings
Return type:str
insights.specs.datasources.client_metadata.display_name(broker)[source]

Custom datasource for display_name getting from insights-client configuration.

Raises:SkipComponent -- When there is no display_name is configured.
Returns:The JSON strings
Return type:str
insights.specs.datasources.client_metadata.egg_release(broker)

Custom datasource for display_name getting from insights-client configuration.

Raises:SkipComponent -- When cannot get the egg_release.
Returns:The JSON strings
Return type:str
insights.specs.datasources.client_metadata.tags(broker)[source]

Custom datasource for tags getting from insights-client configuration.

Raises:
  • SkipComponent -- When there is no tags.yaml is configured.
  • ContentException -- When any exceptions occur.
Returns:

The JSON strings

Return type:

str

insights.specs.datasources.client_metadata.version_info(broker)[source]

Custom datasource for version_info getting from insights-client configuration.

Returns:The JSON strings of version info
Return type:str

insights.specs.datasources.cloud_init

Custom datasources for cloud initialization information

insights.specs.datasources.cloud_init.cloud_cfg(broker)

This datasource provides configuration of /etc/cloud/cloud.cfg file.

Note

Since this file may contain sensitive information, it should be filtered before the Insights collecting it. The filters will be added via the insights.specs.Specs.cloud_cfg Spec. If nothing is added to the filter, nothing will be collected.

Typical content of /etc/cloud/cloud.cfg file is:

#cloud-config
users:
  - name: demo
    ssh-authorized-keys:
      - key_one
      - key_two
    passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7

ssh_deletekeys: 1

network:
    version: 1
    config:
      - type: physical
        name: eth0
        subnets:
          - type: dhcp
          - type: dhcp6

system_info:
    default_user:
    name: user2
    plain_text_passwd: 'someP@assword'
    home: /home/user2

debug:
    output: /var/log/cloud-init-debug.log
    verbose: true
Returns:YAML string after removing the sensitive information.
Return type:str
Raises:SkipComponent -- When the path does not exist, nothing is collected, or any exception occurs.
class insights.specs.datasources.cloud_init.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by cloud_init datasources

cloud_cfg_input = <insights.core.spec_factory.simple_file object>

Returns the contents of the file /etc/cloud/cloud.cfg

context_handlers = {}
registry = {}

insights.specs.datasources.container.containers_inspect

Custom datasources for containers inspect information

insights.specs.datasources.container.containers_inspect.running_rhel_containers_id(broker)[source]

Returns a list of container_id of the running containers.

insights.specs.datasources.container.containers_inspect.containers_inspect_data_datasource(broker)

This datasource provides the filtered information collected from /usr/bin/docker|podman inspect <container ID>.

Note

The path of the target key is like raw_data[key1][key2][target_key], then the filter pattern is like “key1|key2|target_key”. If the value type of raw_data[key1][key2] is list, although the target_key is in the list, the filter pattern must be “key1|key2”, this datasource returns the whole value of the list. The value of “Id” and “Image” are checked from raw data directly, no need filter these items.

Typical content of /usr/bin/docker|podman inspect <container ID> file is:

[
    {
        "Id": "aeaea3ead52724bb525bb2b5c619d67836250756920f0cb9884431ba53b476d8",
        "Created": "2022-10-21T23:47:24.506159696-04:00",
        "Path": "sleep"
        ...
    }
    ...
]
Returns:item is JSON string containing filtered information.
Return type:list
Raises:SkipComponent -- When the filter/path does not exist or any exception occurs.

insights.specs.datasources.container

Basic datasources for container specs

insights.specs.datasources.container.running_rhel_containers(broker)[source]

Returns a list of tuple of (image, <podman|docker>, container_id) of the running containers.

From RHEL 8, the “docker” command is from the package “podman-docker”. In general when using command “docker” to access a container, the following message will be reported on the top:

Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.

But sometimes, this line won’t be outputted as expected, in this case, it’s necessary to remove the duplicated containers from the output of “docker”.

insights.specs.datasources.container.nginx_conf

Datasources to collect the nginx configuration files from containers

insights.specs.datasources.container.nginx_conf.nginx_conf(broker)[source]

Returns a list of tuple of (<podman|docker>, container_id, conf_path, image)

class insights.specs.datasources.container.nginx_conf.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by nginx container datasources

container_find_etc_opt_conf = <insights.core.spec_factory.container_execute object>
context_handlers = {}
registry = {}

insights.specs.datasources.corosync

Custom datasources related to corosync

insights.specs.datasources.corosync.corosync_cmapctl_cmds(broker)[source]

corosync-cmapctl use different arguments on RHEL7 and RHEL8.

Returns:A list of related corosync-cmapctl commands based the RHEL version.
Return type:list

insights.specs.datasources.dir_list

Custom datasources to get a list of directories to check disk size.

insights.specs.datasources.dir_list.du_dir_list(broker)[source]

Return a list of directories from the spec filter

insights.specs.datasources.ethernet

Custom datasource for gathering a list of the ethernet interface names.

insights.specs.datasources.ethernet.interfaces(broker)[source]

This datasource provides a list of the ethernet interfaces available.

Typical content of the spec is:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000\    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000\    link/ether 52:54:00:13:14:b5 brd ff:ff:ff:ff:ff:ff
3: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000\    link/ether 52:54:00:e5:11:d4 brd ff:ff:ff:ff:ff:ff
4: enp1s0.2@enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000\    link/ether 52:54:00:13:14:b5 brd ff:ff:ff:ff:ff:ff
5: ib0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 4092 qdisc mq state DOWN group default qlen 256\    link/infiniband 00:01:02:03:fd:90:0:00:00:00:00:00:ef:0d:8b:02:01:d9:82:fd

Note

This datasource may be executed using the following command:

insights cat --no-header ethernet.interfaces

Sample data returned:

['enp1s0', 'enp8s0', 'enp1s0.2']
Returns:List of the ethernet interfaces available.
Return type:list
Raises:SkipComponent -- When there is not any content.
class insights.specs.datasources.ethernet.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by ethernet.interfaces datasource.

context_handlers = {}
registry = {}

insights.specs.datasources.httpd

Custom datasources related to httpd

insights.specs.datasources.httpd.httpd_cmds(broker)[source]

Function to search the output of ps auxcww to find all running Apache webserver processes and extract the binary path.

Returns:List of the binary paths to each running process
Return type:list
insights.specs.datasources.httpd.httpd_on_nfs(broker)

Function to get the count of httpd opened file on nfs v4

Returns:JSON string with keys: “httpd_ids”, “nfs_mounts”, “open_nfs_files”
Return type:str

insights.specs.datasources.intersystems

Custom datasources to get the iris working configuration/log files.

insights.specs.datasources.intersystems.iris_working_configuration(broker)[source]

This datasource get information from iris.cpf file.

Returns:the file path of the iris.cpf files
Return type:list
Raises:SkipComponent -- there is no iris.cpf file
insights.specs.datasources.intersystems.iris_working_messages_log(broker)[source]

This datasource get information from messages.log file.

Returns:the file path of the messages.log files
Return type:list
Raises:SkipComponent -- there is no messages.log file

insights.specs.datasources.ipcs

Custom datasources to get the semid of all the inter-processes.

insights.specs.datasources.ipcs.semid(broker)[source]

This datasource provides a list of the semid of all the inter-processes.

Note

This datasource may be executed using the following command:

insights cat --no-header ipcs_s_i

Sample output:

[
    '65570', '98353', '98354'
]
Returns:A list of the semid of all the inter-processes.
Return type:list

insights.specs.datasources.kernel

Custom datasource to get the current kernel version.

insights.specs.datasources.kernel.current_version(broker)[source]

This datasource provides the current booting kernel version.

Sample data returned:

'4.18.0-240.el8.x86_64'
Returns:The current kernel version.
Return type:String
Raises:UnameError -- When there is a problem occurs with uname data.
insights.specs.datasources.kernel.default_version(broker)[source]

This datasource provides the default kernel version.

Sample data returned:

'4.18.0-240.el8.x86_64'
Returns:The default kernel version.
Return type:String
Raises:SkipComponent -- When output is empty or an error occurs

insights.specs.datasources.kernel_module_list

Custom datasources to get a list of modules to check the detailed module info.

insights.specs.datasources.kernel_module_list.kernel_module_filters(broker)[source]

Return a string of a list of modules from the spec filter, separated with space.

insights.specs.datasources.leapp

Custom datasources for leapp

insights.specs.datasources.leapp.leapp_report(broker)

This datasource get useful information from leapp-report.json.

Note

Since this file may contain sensitive information, this datasource does filter and only keep required data.

Returns:

JSON string after get the required data.

Return type:

str

Raises:
  • SkipComponent -- When the file does not exist or nothing need to collect
  • ContentException -- When any exception occurs.

insights.specs.datasources.ls

Custom datasources for ls commands

insights.specs.datasources.ls.list_with_la(broker)[source]
insights.specs.datasources.ls.list_with_la_filtered(broker)[source]
insights.specs.datasources.ls.list_with_lan(broker)[source]
insights.specs.datasources.ls.list_with_lan_filtered(broker)[source]
insights.specs.datasources.ls.list_with_lanL(broker)[source]
insights.specs.datasources.ls.list_with_lanR(broker)[source]
insights.specs.datasources.ls.list_with_lanRL(broker)[source]
insights.specs.datasources.ls.list_with_lanRZ(broker)[source]
insights.specs.datasources.ls.list_with_lanZ(broker)[source]

insights.specs.datasources.lpstat

Custom datasources for lpstat information

insights.specs.datasources.lpstat.lpstat_protocol_printers_info(broker)

This datasource provides the not-sensitive information collected from /usr/bin/lpstat -v.

Typical content of /usr/bin/lpstat -v file is:

"device for test_printer1: ipp://cups.test.com/printers/test_printer1"
Returns:Returns the collected content containing non-sensitive information
Return type:DatasourceProvider
Raises:SkipComponent -- When the filter/path does not exist or any exception occurs.
class insights.specs.datasources.lpstat.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by lpstat datasources

context_handlers = {}
lpstat_o = <insights.core.spec_factory.simple_command object>

Returns the output of command /usr/bin/lpstat -o

lpstat_v = <insights.core.spec_factory.simple_command object>

Returns the output of command /usr/bin/lpstat -v

registry = {}

insights.specs.datasources.luks_devices

Custom datasource for gathering a list of encrypted LUKS block devices and their properties.

insights.specs.datasources.luks_devices.luks_block_devices(broker)[source]

This datasource provides a list of LUKS encrypted device.

Sample data returned:

['/dev/sda', '/dev/nvme0n1p3']
Returns:

List of the LUKS encrypted block devices.

Return type:

list

Raises:
  • SkipComponent -- When there is not any LUKS encrypted block device on the
  • system.
insights.specs.datasources.luks_devices.luks_data_sources(broker)

This datasource provides the output of ‘cryptsetup luksDump’ command for every LUKS encrypted device on the system. The digest and salt fields are filtered out as they can be potentially sensitive.

Returns:

List of outputs of the cryptsetup luksDump command.

Return type:

list

Raises:
  • SkipComponent -- When there is not any LUKS encrypted block device on the
  • system.
class insights.specs.datasources.luks_devices.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by LUKS_data_sources datasource.

context_handlers = {}
cryptsetup_luks_dump_commands = <insights.core.spec_factory.foreach_execute object>
cryptsetup_luks_dump_token_commands = <insights.core.spec_factory.foreach_execute object>
registry = {}

insights.specs.datasources.machine_ids

Custom datasource to get the duplicate machine info.

insights.specs.datasources.machine_ids.dup_machine_id_info(broker)

This datasource provides the duplicate machine info.

Sample Output:

dc194312-8cdd-4e75-8cf1-2094bf666f45 hostname1,hostname2
Returns:a string containing the machine id and the hostnames with the same machine id
Return type:str
Raises:SkipComponent -- When the filters does not exist or the machine id is not in the filters or the machine id is not duplicate or any exception occurs.

insights.specs.datasources.malware_detection

Custom datasource malware detection

insights.specs.datasources.malware_detection.malware_detection_app(broker)

Custom datasource to collects content for malware scanner if a scanner is present on the system

insights.specs.datasources.mount

Custom datasource relevant mount command

insights.specs.datasources.mount.xfs_mounts(broker)[source]

Return the required mount points with ‘xfs’ type.

Raises:SkipComponent -- Raised if no ‘xfs’ mount points is available
Returns:Sorted list of ‘xfs’ mount points.
Return type:List[str]

insights.specs.datasources.md5chk

Custom datasources related to md5

insights.specs.datasources.md5chk.files(broker)[source]

Return a list of files to be processed by the md5chk_files spec

insights.specs.datasources.package_provides

Custom datasource for package_provides

insights.specs.datasources.package_provides.cmd_and_pkg(broker)

Collect a list of running commands and the associated RPM package providing those commands. The commands are based on filters so rules must add the desired commands as filters to enable collection. If a command is not provided by an RPM then it will not be included in the output.

In order for the full command line to be present in the Ps combiner a filter must be added to the spec ps_auxww. A filter must also be added to package_provides_command so this datasource will look for the command in Ps.

Parameters:broker -- the broker object for the current session
Returns:Returns the collected information as a file with 1 line per command
Return type:DatasourceProvider
Raises:SkipComponent -- Raised if no data is collected
insights.specs.datasources.package_provides.get_package(ctx, file_path)[source]

Get the RPM package that owns the specified filename with path

Parameters:
  • ctx -- The current execution context
  • file_path (str) -- The full path and filename for RPM query
Returns:

The name of the RPM package that provides the file or None if file is not associated with an RPM.

Return type:

str

insights.specs.datasources.pcp

Custom datasource related PCP (Performance Co-Pilot)

insights.specs.datasources.pcp.pcp_enabled(broker)[source]
Returns:True if pmproxy service is on in services
Return type:bool
Raises:SkipComponent -- When pmproxy service is not enabled
insights.specs.datasources.pcp.pmlog_summary_args(broker)[source]

Determines the pmlogger file and the metrics to collect via pmlog_summary spec.

Returns:
Full arguments string that will be passed to the pmlogsummary,
which contains the pmlogger archive file and the required metrics.
Return type:str
Raises:SkipComponent -- Raises when meeting one of the following scenario: - No pmlogger process is running - No pmlogger file - No “mandatory on” metrics in config.ros

insights.specs.datasources.ps

Custom datasources for ps information

insights.specs.datasources.ps.jboss_runtime_versions(broker)

Custom datasource to collect the <JBOSS_HOME>/version.txt.

Sample output from the ps -ewwo pid, args command:

PID COMMAND
  1 /usr/lib/systemd/systemd --switched-root --system --deserialize 31
  2 [kthreadd]
  3 [rcu_gp]
  4 [rcu_par_gp]
  6 [kworker/0:0H-events_highpri]
  8686 java -D[Standalone] -server -verbose:gc -Xms64m -Xmx512m -Djboss.home.dir=/opt/jboss-datagrid-7.3.0-server -Djboss.server.base.dir=/opt/jboss-datagrid-7.3.0-server/standalone

Get the Jboss home directory and read the version.txt:

-Djboss.home.dir=/opt/jboss-datagrid-7.3.0-server
/opt/jboss-datagrid-7.3.0-server/version.txt
Returns:string of dict {<jboss_home>: <content of version.txt>}
Return type:str
Raises:SkipComponent -- Raised if no data is available
insights.specs.datasources.ps.ps_eo_cmd(broker)

Custom datasource to collect the full paths to all running commands on the system provided by the ps -ewwo pid,args command. After collecting the data, all of the args are trimmed to leave only the command including full path.

Sample output from the ps -ewwo pid, args command:

PID COMMAND
  1 /usr/lib/systemd/systemd --switched-root --system --deserialize 31
  2 [kthreadd]
  3 [rcu_gp]
  4 [rcu_par_gp]
  6 [kworker/0:0H-events_highpri]
  9 [mm_percpu_wq]
 10 [rcu_tasks_kthre]
 11 /usr/bin/python3 /home/user1/python_app.py
 12 [kworker/u16:0-kcryptd/253:0]

This datasource trims off the args to minimize possible PII and sensitive information. After trimming the data looks like this:

PID COMMAND
  1 /usr/lib/systemd/systemd
  2 [kthreadd]
  3 [rcu_gp]
  4 [rcu_par_gp]
  6 [kworker/0:0H-events_highpri]
  9 [mm_percpu_wq]
 10 [rcu_tasks_kthre]
 11 /usr/bin/python3
 12 [kworker/u16:0-kcryptd/253:0]
Returns:Returns a multiline string in the same format as ps output
Return type:str
Raises:SkipComponent -- Raised if no data is available
class insights.specs.datasources.ps.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by ps datasources

context_handlers = {}
ps_eo_args = <insights.core.spec_factory.simple_command object>

Returns ps output including pid and full args

registry = {}

insights.specs.datasources.rpm_pkgs

Custom datasource for RPM command

insights.specs.datasources.rpm_pkgs.pkgs_with_writable_dirs(broker)

Custom datasource for CVE-2021-35937, CVE-2021-35938, and CVE-2021-35939.

It collects packages from the rpm -qa --nosignature --qf="[%{=NAME}; %{=NEVRA}; %{FILENAMES}; %{FILEMODES:perms}; %{FILEUSERNAME}; %{FILEGROUPNAME}; %{=VENDOR}\n]" command.

The output is a sorted list of all packages, which have at least one directory with files inside, and this directory is writable by a specific user/group or the others.

Raises:SkipComponent -- Raised if no data is available
Returns:Sorted list of strings, where every string contains name, nevra and vendor for a given package, and the pipe is used as a separator. E.g. [“httpd-core|httpd-core-2.4.53-7.el9.x86_64|Red Hat, Inc.”]
Return type:List[str]
insights.specs.datasources.rpm_pkgs.rpm_v_pkg_list(broker)[source]

Custom datasources for /bin/rpm -V <package> commands

Return a list according to the spec filters.

insights.specs.datasources.rsyslog_confs

Custom datasource to get the list of the rsyslog errorfile paths.

insights.specs.datasources.rsyslog_confs.rsyslog_errorfile(broker)[source]

This datasource provides the list of the rsyslog errorfile paths.

Sample data returned:

'/var/log/omelasticsearch.log /var/log/oversized.log'
Returns:string of the errorfile paths that separated by a whitespace.
Return type:string
Raises:SkipComponent -- When ‘errorfile’ is not configured.

insights.specs.datasources.sap

Custom datasources for SAP related specs

insights.specs.datasources.sap.sap_sid(broker)[source]

list: List of the SID of all the SAP Instances.

insights.specs.datasources.sap.sap_hana_sid(broker)[source]

list: List of the SID of SAP HANA Instances.

insights.specs.datasources.sap.sap_hana_sid_SID_nr(broker)[source]

list: List of tuples (sid, SID, Nr) of SAP HANA Instances.

insights.specs.datasources.sap.ld_library_path_of_user(broker)

list: The list of “Username LD_LIBRARY_PATH”, e.g.:

[
  'sr1adm /usr/sap/RH1/SYS/exe/run:/usr/lib/',
  'sr2adm /usr/sap/RH2/SYS/exe/run',
]

Note

Currently, only Sap users are supported.

class insights.specs.datasources.sap.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by sap datasources

context_handlers = {}
registry = {}
sap_hana_instance()[source]

list: List of the SAP HANA Instances.

sap_instance()[source]

list: List of all SAP Instances.

insights.specs.datasources.satellite_missed_queues

insights.specs.datasources.satellite_missed_queues.satellite_missed_pulp_agent_queues(broker)

This datasource provides the missed pulp agent queues information on satellite server.

Note

This datasource may be executed using the following command:

insights cat --no-header satellite_missed_pulp_agent_queues

Sample output:

pulp.agent.09008eec-aba6-4174-aa9f-e930004ce5c9:2018-01-16 00:06:13
pulp.agent.fac7ebbc-ee4f-44b4-9fe0-3f4e42c7f024:2018-01-16 00:06:16
0
Returns:
All the missed pulp agent queues and the boolean mark if the data is
truncated in the last line. If the value of last line is 0, it means all the missed queues are returned. If the value of the last line is 1, it means there are a lot of missed queues, to avoid render error, only the first 10 missed queues are returned.
Return type:str
Raises:SkipComponent -- When the error doen’t happen or the missed queues have been recreated.
class insights.specs.datasources.satellite_missed_queues.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by get_satellite_missed_pulp_agent_queues datasources

content_host_uuids = <insights.core.spec_factory.simple_command object>
context_handlers = {}
qpid_queues = <insights.core.spec_factory.simple_command object>
registry = {}

insights.specs.datasources.semanage

Custom datasource to get the linux users count who map to a selinux user.

insights.specs.datasources.semanage.users_count_map_selinux_user(broker)

Get linux users count who map to the selinux user. It returns a dict with the selinux user type as the key, and the linux users count as the value.

Raises:SkipComponent -- Raised when there are no users map the filtered selinux user.
class insights.specs.datasources.semanage.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by users_count_map_selinux_user datasource

context_handlers = {}
registry = {}
selinux_user_mapping = <insights.core.spec_factory.simple_command object>

insights.specs.datasources.ssl_certificate

Custom datasource to get ssl certificate file path.

insights.specs.datasources.ssl_certificate.httpd_certificate_info_in_nss(broker)[source]

Get the certificate info configured in nss database

Parameters:broker -- the broker object for the current session
Returns:Returns a list of tuple with the Nss database path and the certificate nickname
Return type:list
Raises:SkipComponent -- Raised when NSSEngine isn’t enabled or “NSSCertificateDatabase” and “NSSNickname” directives aren’t found
insights.specs.datasources.ssl_certificate.httpd_ssl_certificate_files(broker)[source]

Get the httpd SSL certificate file path configured by “SSLCertificateFile”

Parameters:broker -- the broker object for the current session
Returns:Returns the SSL certificate file path configured by “SSLCertificateFile”
Return type:str
Raises:SkipComponent -- Raised if “SSLCertificateFile” directive isn’t found
insights.specs.datasources.ssl_certificate.nginx_ssl_certificate_files(broker)[source]

Get the nginx SSL certificate file path configured by “ssl_certificate”

Parameters:broker -- the broker object for the current session
Returns:Returns the SSL certificate file path configured by “ssl_certificate”
Return type:str
Raises:SkipComponent -- Raised if “ssl_certificate” directive isn’t found
insights.specs.datasources.ssl_certificate.mssql_tls_cert_file(broker)[source]

Get the mssql tls certificate file path configured by “ssl_certificate” :param broker: the broker object for the current session

Returns:Returns the SSL certificate file path configured by “ssl_certificate”
Return type:str
Raises:SkipComponent -- Raised if “ssl_certificate” directive isn’t found

insights.specs.datasources.sys_fs_cgroup_memory

Custom datasources for the files under /sys/fs/cgroup/memory

insights.specs.datasources.sys_fs_cgroup_memory.sys_fs_cgroup_uniq_memory_swappiness(broker)

This datasource reads all the memory.swappiness files under /sys/fs/cgroup/memory directory one by one and returns the uniq memory swappiness setting of the all control groups.

The output of this datasource looks like:
10 1 60 66
Returns:Returns a multiline string in the format as value   count.
Return type:str
Raises:SkipComponent -- When any exception occurs.

insights.specs.datasources.sys_fs_cgroup_memory_tasks_number

Custom datasources for the number of “tasks” files under /sys/fs/cgroup/memory

insights.specs.datasources.sys_fs_cgroup_memory_tasks_number.sys_fs_cgroup_memory_tasks_number_data_datasource(broker)

This datasource provides the numeber of “tasks” file collected from /usr/bin/find /sys/fs/cgroup/memory -name 'tasks'.

Typical content of /usr/bin/find /sys/fs/cgroup/memory -name 'tasks' command is:

/sys/fs/cgroup/memory/user.slice/tasks
/sys/fs/cgroup/memory/system.slice/rh-nginx120-nginx.service/tasks
/sys/fs/cgroup/memory/system.slice/named.service/tasks
/sys/fs/cgroup/memory/system.slice/rhel-push-plugin.service/tasks
Returns:the number of “tasks” file under /sys/fs/cgroup/memory
Return type:string
Raises:SkipComponent -- When any exception occurs.
class insights.specs.datasources.sys_fs_cgroup_memory_tasks_number.LocalSpecs[source]

Bases: insights.specs.Specs

Local specs used only by sys_fs_cgroup_memory_tasks_number datasources

context_handlers = {}
registry = {}
sys_fs_cgroup_memory_tasks_raw = <insights.core.spec_factory.simple_command object>

Returns the output of command /usr/bin/find /sys/fs/cgroup/memory -name 'tasks'

insights.specs.datasources.user_group

Custom datasources for user and group related specs

Note

It should be noted that the specs in this module might contains sensitive information, please avoid collecting any of them.

insights.specs.datasources.user_group.group_filters(broker)[source]

Return a string contains the list of groups getting from the spec filter, separated with space.

insights.specs.datasources.yum_updates

Custom datasource for collecting yum updates

insights.specs.datasources.yum_updates.yum_updates(broker)

This datasource provides a list of available updates on the system. It uses the yum python library installed locally, and collects list of available package updates, along with advisory info where applicable.

Sample data returned:

{
  "releasever": "8",
  "basearch": "x86_64",
  "update_list": {
    "NetworkManager-1:1.22.8-4.el8.x86_64": {
      "available_updates": [
        {
          "package": "NetworkManager-1:1.22.8-5.el8_2.x86_64",
          "repository": "rhel-8-for-x86_64-baseos-rpms",
          "basearch": "x86_64",
          "releasever": "8",
          "erratum": "RHSA-2020:3011"
        }
      ]
    }
  },
  "build_pkgcache": false,
  "metadata_time": "2021-01-01T09:39:45Z"
}
Returns:List of available updates
Return type:list
Raises:SkipComponent -- Raised when neither dnf nor yum is found