candlepin / rho

ssh scanner for your network
GNU General Public License v2.0
32 stars 20 forks source link

Subscription Manager Error Check #19

Closed mdvickst closed 8 years ago

mdvickst commented 8 years ago

Added error checking for subscription manager command that caused an exception to be thrown in system was not running subscription manager (CentOS)

cnsnyder commented 8 years ago

@mdvickst Can you give steps to reproduce the issue that this fixes? I've not been able to reproduce the issue scanning a local vm running CentOS running a report that includes one of the subman facts.

Aside from that it seems fine to me.

barnabycourt commented 8 years ago

@cnsnyder Do you get this error if sub-man has not been installed?

cnsnyder commented 8 years ago

@barnabycourt I do not see that in the output csv of scanning a centos 7 box without subscription-manager installed.

Below is the csv that is output:

""" date.date,uname.hostname,redhat-release.release,redhat-packages.is_redhat,redhat-packages.num_rh_packages,redhat-packages.num_installed_packages,redhat-packages.last_installed,redhat-packages.last_built,virt-what.type,virt.virt,virt.num_guests,virt.num_running_guests,cpu.count,cpu.socket_count,ip,port,subman.virt.host_type Tue Jun 7 13:24:54 EDT 2016,dev.example.com,2.1511.el7.centos.2.10,,0,402,,,,virt-guest,0,0,1,"bash: dmidecode: command not found ",192.168.121.68,22, """

barnabycourt commented 8 years ago

@cnsnyder did you install dmidecode, it looks like the error would be from the calculation of subman.virt.host_type

cnsnyder commented 8 years ago

@barnabycourt /me forgot to run the scan with high enough permissions. Dmidecode is installed on my test machine. Below is the output with the appropriate permissions:

""" date.date,uname.hostname,redhat-release.release,redhat-packages.is_redhat,redhat-packages.num_rh_packages,redhat-packages.num_installed_packages,redhat-packages.last_installed,redhat-packages.last_built,virt-what.type,virt.virt,virt.num_guests,virt.num_running_guests,cpu.count,cpu.socket_count,ip,port,subman.virt.host_type Tue Jun 7 14:03:14 EDT 2016,dev.example.com,2.1511.el7.centos.2.10,,0,402,,,"""kvm""",virt-guest,0,0,1,1,192.168.121.68,22, """

barnabycourt commented 8 years ago

@mdvickst we are having trouble duplicating this issue. Can you provide details on the exact centos version where you were having this problem?

mdvickst commented 8 years ago

I have not been able to reproduce this bug either but I have seen stack traces from multiple scans that have had this error.

Attached is an example of one such stack trace. PkgInfoParseException.txt

cnsnyder commented 8 years ago

@mdvickst @barnabycourt It looks to me like this would only be raised if one of the commands that is using rpm failed to get all the fields requested. My suspicion is it is either a version of centos that has a much older version of rpm installed or it is not a machine that has rpm installed at all.

barnabycourt commented 8 years ago

@mdvickst for the system showing the error, do you know what version of Centos was installed?