PackageProvidesJava - command /bin/echo {java_command_package}


This module is deprecated, please use insights.parsers.package_provides instead.

This command reads the output of the pre-command:

for jp in `/bin/ps auxwww | grep java | grep -v grep| awk '{print $11}' | sort -u`; do echo $jp `readlink -e $jp | xargs rpm -qf`; done

This command looks for all versions of ‘java’ running and tries to find the RPM packages which provide them. The running command and its package name are stored as properties command and package of the object.

The reason why using above pre_command is that we need to record the links between running_java_command and package which provides the java command. In ps aux output, we can only get what java command starts a java application, instead of java package. Through this way, when there is jdk bug, we can detect whether a running java application will be affected.

Typical contents of the pre_command:

/usr/lib/jvm/jre/bin/java java-1.8.0-openjdk-headless-

Parsed result:

self.command = "/usr/lib/jvm/jre/bin/java"
self.package = "java-1.8.0-openjdk-headless-"


>>> command_package = shared[PackageProvidesJava]
>>> command_package.command
>>> command_package.package
raises insights.parsers.ParseException

if there is no java application running

raises insights.parsers.SkipException

if running java command is not provided by package installed through yum or rpm

class insights.parsers.package_provides_java.PackageProvidesJava(context, extra_bad_lines=None)[source]

Bases: insights.core.CommandParser


This Combiner is deprecated, please use insights.parsers.package_provides.PackageProvidesCommand instead.

Parse the output of pre_command:

``for jp in `/bin/ps auxwww | grep java | grep -v grep| awk '{print $11}' | sort -u`; do echo "$jp `readlink -e $jp | xargs rpm -qf`"; done``.

The java command that starts application.




Java package that provides above java command.




This method must be implemented by classes based on this class.