GithubHelp home page GithubHelp logo

furlongm / patchman Goto Github PK

View Code? Open in Web Editor NEW
355.0 18.0 77.0 3.16 MB

Patchman is a Linux Patch Status Monitoring System

Home Page: http://patchman.openbytes.ie

License: GNU General Public License v3.0

Shell 6.65% Python 73.74% CSS 0.25% JavaScript 0.50% HTML 18.86%
monitoring patchman patch patch-management django-application django linux package-management patchman-server patchman-client

patchman's Introduction

Patchman

Summary

Patchman is a Django-based patch status monitoring tool for linux systems. Patchman provides a web interface for monitoring the package updates available for linux hosts.

How does Patchman work?

Patchman clients send a list of installed packages and enabled repositories to the Patchman server. The Patchman server updates its package list for each repository and determines which hosts require updates, and whether those updates are normal or security updates. The web interface also gives information on potential issues, such as installed packages that are not from any repository.

Hosts, packages, repositories and operating systems can all be filtered. For example, it is possible to find out which hosts have a certain version of a package installed, and which repository it comes from.

Patchman does not install update packages on hosts, it determines and displays what updates are available for each host.

yum, apt and zypper plugins can send reports to the Patchman server every time packages are installed or removed on a host.

Installation

See the installation guide for installation options.

Usage

The web interface contains a dashboard with items that need attention, and various pages to manipulate hosts, repositories, packages, operating systems and reports.

To populate the database, simply run the client on some hosts:

$ patchman-client -s http://patchman.example.org

This should provide some initial data to work with.

On the server, the patchman command line utility can be used to run certain maintenance tasks, e.g. processing the reports sent from hosts, downloading repository update information from the web. Run patchman -h for a rundown of the usage:

$ sbin/patchman -h
usage: patchman [-h] [-f] [-q] [-r] [-R REPO] [-lr] [-lh] [-u] [-A] [-H HOST]
                [-p] [-c] [-d] [-n] [-a] [-D hostA hostB]

Patchman CLI tool

optional arguments:
  -h, --help            show this help message and exit
  -f, --force           Ignore stored checksums and force-refresh all mirrors
  -q, --quiet           Quiet mode (e.g. for cronjobs)
  -r, --refresh-repos   Refresh repositories
  -R REPO, --repo REPO  Only perform action on a specific repository (repo_id)
  -lr, --list-repos     List all repositories
  -lh, --list-hosts     List all hosts
  -u, --host-updates    Find host updates
  -A, --host-updates-alt
                        Find host updates (alternative algorithm that may be
                        faster when there are many homogeneous hosts)
  -H HOST, --host HOST  Only perform action on a specific host (fqdn)
  -p, --process-reports
                        Process pending reports
  -c, --clean-reports   Remove all but the last three reports
  -d, --dbcheck         Perform some sanity checks and clean unused db entries
  -n, --dns-checks      Perform reverse DNS checks if enabled for that host
  -a, --all             Convenience flag for -r -A -p -c -d -n
  -D hostA hostB, --diff hostA hostB
                        Show differences between two hosts in diff-like output
  -e, --errata          Download CentOS errata from https://cefs.steve-
                        meier.de/

Dependencies

Server-side dependencies

python3-django
python3-django-tagging
python3-django-extensions
python3-django-bootstrap3
python3-djangorestframework
python3-debian
python3-rpm
python3-progressbar
python3-lxml
python3-defusedxml
python3-requests
python3-colorama
python3-magic
python3-humanize

The server can optionally make use of celery to asynchronously process the reports sent by hosts.

Client-side dependencies

The client-side dependencies are kept to a minimum. rpm and dpkg are required to report packages, yum, dnf, zypper and/or apt are required to report repositories. These packages are normally installed by default on most systems.

deb-based OS's do not always change the kernel version when a kernel update is installed, so the update-notifier-common package can optionally be installed to enable this functionality. rpm-based OS's can tell if a reboot is required to install a new kernel by looking at uname -r and comparing it to the highest installed kernel version, so no extra packages are required on those OS's.

Concepts

The default settings will be fine for most people but depending on your setup, there may be some initial work required to logically organise the data sent in the host reports. The following explanations may help in this case.

There are a number of basic objects - Hosts, Repositories, Packages, Operating Systems and Reports. There are also Operating System Groups (which are optional) and Mirrors.

Host

A Host is a single host, e.g. test01.example.org.

Operating System

A Host runs an Operating System, e.g. CentOS 7.7, Debian 10.1, Ubuntu 18.04

Package

A Package is a package that is either installed on a Host, or is available to download from a Repository mirror, e.g. strace-4.8-11.el7.x86_64, grub2-tools-2.02-0.34.el7.centos.x86_64, etc.

Mirror

A Mirror is a collection of Packages available on the web, e.g. a yum, yast or apt repo.

Repository

A Repository is a collection of Mirrors. Typically all the Mirrors will contain the same Packages. For Red Hat-based Hosts, Repositories automatically link their Mirrors together. For Debian-based hosts, you may need to link all Mirrors that form a Repository using the web interface. This may reduce the time required to find updates. Repositories can be marked as being security or non-security. This makes most sense with Debian and Ubuntu repositories where security updates are delivered via security repositories. For CentOS security updates, see the Erratum section below.

Report

A Host creates a Report using patchman-client. This Report is sent to the Patchman server. The Report contains the Host's Operating System, and lists of the installed Packages and enabled Repositories on the Host. The Patchman server processes and records the list of Packages and Repositories contained in the Report.

Operating System Group (optional)

An OSGroup is a collection of OS's. For example, an OSGroup named "Ubuntu 18.04" would be comprised of the following OS's:

Ubuntu 18.04.1
Ubuntu 18.04.2
Ubuntu 18.04.5

Likewise, an OSGroup named "CentOS 7" would be made up of the following OS's:

CentOS 7.5
CentOS 7.7.1511

Repositories can be associated with an OSGroup, or with the Host itself. If the use_host_repos variable is set to True for a Host, then updates are found by looking only at the Repositories that belong to that Host. This is the default behaviour and does not require OSGroups to be configured.

If use_host_repos is set to False, the update-finding process looks at the OSGroup that the Host's Operating System is in, and uses the OSGroup's Repositories to determine the applicable updates. This is useful in environments where many hosts are homogeneous (e.g. cloud/cluster environments).

Erratum

Errata for CentOS can be downloaded from https://cefs.steve-meier.de/ . These errata are parsed and stored in the database. If a PackageUpdate contains a package that is a security update in the errata, then that update is marked as being a security update.

patchman's People

Contributors

andrewspiers avatar bololz avatar dependabot[bot] avatar furlongm avatar garbled1 avatar gasperzupancic avatar hafkensite avatar osfrickler avatar ptrsny avatar pyup-bot avatar quantifiedcode-bot avatar quixoten avatar russell avatar sorrison avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

patchman's Issues

add (apt) proxy support

We hav an apt-cacher-ng as apt proxy for our local debians/ubuntus. How can I achieve that patchman uses also this proxy?

On my debian/ubuntu boxes I configure it (for example) in /etc/apt/apt-conf.d/02-proxy:
Acquire::http::Proxy "http://<some-IP>:3142";

Patchman on Ubuntu 16.04 not associating additional repos with subsequent hosts

This is an odd one.

Patchman 1.09-1 on Ubuntu Server 16.04 LTS with fixed /usr/lib/python2.7/dist-packages/patchman/repos/utils.py as per #55.

Running "patchman-client" on Server with regular Ubuntu repos followed by "patchman -a" creates a host in Patchman with associated repos, etc. So far, so good.

Running "patchman-client" on Desktop with regular Ubuntu repos plus 8 additional ones following by "patchman -a" creates a host in Patchman but doesn't associate it with any repos. Patchman then reports that "2 Hosts have no associated Repositories", "8 Repositories are unused (no associated Hosts or OS Groups)", and "8 Repositories are not used by any Hosts". It also says (in this case) "36 Installed Packages are not from any Repository" - these packages are from the unused repos.
screenshot from 2018-11-09 14-55-26

As far as I can tell (by running "patchman-client -vr") the Desktop is sending all the necessary information for Patchman to associate repos, etc. I don't see a way of running patchman with verbosity to see what it thinks when processing - is there an option and/or debug log?

Whilst I think I could now associate Hosts with Repos I don't really want to have to do that when all our Desktops will be added.

patchman -r failed on repos

Today i added more servers to patchman and run the -r option to run refresh on repos. It fails on some repo like:

Found yum rpm repo - http://mirror.lihnidos.org/CentOS/7.2.1511/os/x86_64/repodata/repomd.xml
Downloading repo info (2/2): 100%|####################################################################################################################################################|Time: 0:00:00
Extracting packages: 100%|####################################################################################################################################################|Time: 0:00:03
Adding 9007 new packages: 100%|####################################################################################################################################################|Time: 0:01:05

Extra Packages for Enterprise Linux 7 - x86_64 x86_64
Traceback (most recent call last):
File "/usr/bin/patchman", line 5, in
pkg_resources.run_script('patchman==0.9.4', 'patchman')
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 540, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1455, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/lib/python2.7/site-packages/patchman-0.9.4-py2.7.egg/EGG-INFO/scripts/patchman", line 603, in
main()
File "/usr/lib/python2.7/site-packages/patchman-0.9.4-py2.7.egg/EGG-INFO/scripts/patchman", line 597, in main
showhelp = process_args(args)
File "/usr/lib/python2.7/site-packages/patchman-0.9.4-py2.7.egg/EGG-INFO/scripts/patchman", line 569, in process_args
refresh_repos(args.repo, args.force)
File "/usr/lib/python2.7/site-packages/patchman-0.9.4-py2.7.egg/EGG-INFO/scripts/patchman", line 112, in refresh_repos
repo.refresh(force)
File "/usr/lib/python2.7/site-packages/patchman-0.9.4-py2.7.egg/patchman/repos/models.py", line 84, in refresh
refresh_rpm_repo(self)
File "/usr/lib/python2.7/site-packages/patchman-0.9.4-py2.7.egg/patchman/repos/utils.py", line 518, in refresh_rpm_repo
mirrorlists_check(repo)
File "/usr/lib/python2.7/site-packages/patchman-0.9.4-py2.7.egg/patchman/repos/utils.py", line 275, in mirrorlists_check
mirror_urls = mirrorlist_check(mirror.url)
File "/usr/lib/python2.7/site-packages/patchman-0.9.4-py2.7.egg/patchman/repos/utils.py", line 255, in mirrorlist_check
res = get_url(mirror_url)
File "/usr/lib/python2.7/site-packages/patchman-0.9.4-py2.7.egg/patchman/repos/utils.py", line 196, in get_url
res = urlopen(url=Request(url), timeout=10)
File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 423, in open
protocol = req.get_type()
File "/usr/lib64/python2.7/urllib2.py", line 285, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: 5

and another where it couldnt find "<" sign but i deleted repo from database and output also. I'll do it again tomorrow when my client reports itself.

Is there an easy fix?

improvement: marking repository as security enabled/disabled page refreshing

i noticed that if i click on the button to mark repository as security sometimes refreshes the page and clears search filter and sometimes it just marks the and you can edit others.

The thing is, if you click on the button in the middle (red or green icon inside) its ok. But if you click anywhere else on the button it refreshes the page and clears filter. Is this a feature or can it be "fixed" so that if you click anywhere on the button it stays on the page?

edit:
that is from the chrome browser. In firefox this feature doesn't seem to work at all. if you click on a button you get a refresh and button doesnt reflect the change.

'RegexURLPattern' object has no attribute '_callback'

Not sure what i did, just regular update and also installed latest version of django 1.11.8. Now on dashboard i get an error like this:

AttributeError at /dashboard/
'RegexURLPattern' object has no attribute '_callback'
Request Method: GET
Request URL: http://patchman.localhost/patchman/dashboard/
Django Version: 1.11.7
Exception Type: AttributeError
Exception Value:
'RegexURLPattern' object has no attribute '_callback'
Exception Location: /usr/lib/python2.7/site-packages/rest_framework/urlpatterns.py in apply_suffix_patterns, line 27
Python Executable: /usr/bin/python
Python Version: 2.7.5
Python Path:
['/opt/patchman',
'/opt/patchman/patchman',
'/usr/lib64/python27.zip',
'/usr/lib64/python2.7',
'/usr/lib64/python2.7/plat-linux2',
'/usr/lib64/python2.7/lib-tk',
'/usr/lib64/python2.7/lib-old',
'/usr/lib64/python2.7/lib-dynload',
'/usr/lib64/python2.7/site-packages',
'/usr/lib64/python2.7/site-packages/gtk-2.0',
'/usr/lib/python2.7/site-packages']
Server time: Mon, 27 Nov 2017 09:09:56 +0100

Malformed repo string causes error

One of the EPEL mirrors sent via patchman-client is not a full repo string:

'rpm' 'http://mirror.overthewire.com.au/pub/epel/7/x86_64' 

This causes the following:

Traceback (most recent call last):
  File "/usr/bin/patchman", line 4, in <module>
    __import__('pkg_resources').run_script('patchman==1.0.17', 'patchman')
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 658, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1438, in run_script
    exec(code, namespace, namespace)
  File "/usr/lib/python2.7/site-packages/patchman-1.0.17-py2.7.egg/EGG-INFO/scripts/patchman", line 593, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/patchman-1.0.17-py2.7.egg/EGG-INFO/scripts/patchman", line 588, in main
    showhelp = process_args(args)
  File "/usr/lib/python2.7/site-packages/patchman-1.0.17-py2.7.egg/EGG-INFO/scripts/patchman", line 555, in process_args
    process_reports(args.host, args.force)
  File "/usr/lib/python2.7/site-packages/patchman-1.0.17-py2.7.egg/EGG-INFO/scripts/patchman", line 430, in process_reports
    report.process(find_updates=False)
  File "/usr/lib/python2.7/site-packages/patchman-1.0.17-py2.7.egg/patchman/reports/models.py", line 151, in process
    process_repos(report=self, host=host)
  File "/usr/lib/python2.7/site-packages/patchman-1.0.17-py2.7.egg/patchman/reports/utils.py", line 43, in process_repos
    repo, priority = process_repo(repo_str, report.arch)
  File "/usr/lib/python2.7/site-packages/patchman-1.0.17-py2.7.egg/patchman/reports/utils.py", line 213, in process_repo
    if repo[2] == '':
IndexError: list index out of range

My quick fix for this was to modify the process_repos function in patchman/reports/utils.py as follows:

# Line 43
if len(repo_str) > 2:
                repo, priority = process_repo(repo_str, report.arch)
            else:
                repo = None

This just skips the repo and allows my report to succeed. I've seen mention in previous issues that this is the fault of the patchman-client, but perhaps a check for a properly formed repo string in the patchman server isn't such a bad idea?

Dockerfile for patchman server

It would be nice to have a ready to go docker container to run patchman webservice.

It also allow new users to test the software quickly.

apt post-invoke hook disabled by default through nonexistent path to patchman client

Hi Marcus,

Thanks for this great piece of kit! :) One question though:

DPkg::Post-Invoke { "if [ -x /usr/sbin/patchman-client ]; then echo 'Sending report to patchman server ...'; patchman-client -n ; fi"; };
looks for /usr/sbin/patchman-client but
client/patchman-client usr/bin
installs it as /usr/bin/patchman-client. Therefore the hook is disabled until I either edit the hook to fix the path or create a symlink. Is that intentional and if so, how is it supposed to be used?

Thanks,
Michael

Refreshing repos results in get() returned more than one MirrorPackage

Please let me know if this is a patchman issue or something is wrong with the package list received from the repos. -

root@server$ PYTHONPATH=/srv/patchman /srv/patchman/sbin/patchman -r

Repository 15 : Debian 8.7 x86_64 repo at http://mirror.company.net/debian//dists/jessie/main/binary-amd64
Found deb repo - http://mirror.company.net/debian//dists/jessie/main/binary-amd64/Packages.xz
Downloading repo info: 100%|######################################################################################################################################################|Time: 0:00:00
Extracting packages: 100%|######################################################################################################################################################|Time: 0:00:24
Obtaining stored packages: 100%|######################################################################################################################################################|Time: 0:00:08
Traceback (most recent call last): 0%| |ETA: --:--:--
File "/srv/patchman/sbin/patchman", line 593, in
main()
File "/srv/patchman/sbin/patchman", line 588, in main
showhelp = process_args(args)
File "/srv/patchman/sbin/patchman", line 561, in process_args
refresh_repos(args.repo, args.force)
File "/srv/patchman/sbin/patchman", line 120, in refresh_repos
repo.refresh(force)
File "/srv/patchman/patchman/repos/models.py", line 86, in refresh
refresh_deb_repo(self)
File "/srv/patchman/patchman/repos/utils.py", line 538, in refresh_deb_repo
update_mirror_packages(mirror, packages)
File "/srv/patchman/patchman/repos/utils.py", line 96, in update_mirror_packages
MirrorPackage.objects.get(mirror=mirror, package=p).delete()
File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 338, in get
(self.model._meta.object_name, num)
patchman.repos.models.MultipleObjectsReturned: get() returned more than one MirrorPackage -- it returned 2!

patchman installation issue

Installation Process
cat <> /etc/yum.repos.d/openbytes.repo
[openbytes]
name=openbytes
baseurl=http://repo.openbytes.ie/yum
enabled=1
gpgcheck=0
EOF
yum install -y epel-release
yum makecache
yum install -y patchman

cd /srv
git clone https://github.com/furlongm/patchman
cd /srv/patchman/patchman

After had installation of patchman whenever trying to execute below mentioned

patchman-manage migrate
patchman-manage createsuperuser

Im receiving below mentioned error

"ImportError: Could not import 'rest_framework.pagination.PageNumberPagination' for API setting 'DEFAULT_PAGINATION_CLASS'. ImportError: No module named urls."

broken with jessie

Our puppet output shows it is trying to install update-notifier-common that is no longer in Jessie. What is update-notifier-common and is it really needed?

Also patch-man-client is generating some interesting looking messages. Apparently it is trying to divide jessie by sid.

/usr/local/sbin/patchman-client: line 280: let: debver=jessie/sid: division by 0 (error token is "sid")
/usr/local/sbin/patchman-client: line 282: [: -lt: unary operator expected
sed: -e expression #1, char 67: unknown option to `s'
sed: -e expression #1, char 71: unknown option to `s'

This looks like insufficient quoting in the shell script.

That is two issues, both related to Jessie however. If you want I can split them up into two separate tickets.

TypeError: cannot concatenate 'str' and 'error' objects

/etc/cron.daily/python-patchman:
patchman.localdomain : Traceback (most recent call last):
File "/usr/bin/patchman", line 593, in
main()
File "/usr/bin/patchman", line 588, in main
showhelp = process_args(args)
File "/usr/bin/patchman", line 578, in process_args
update_errata(args.force)
File "/usr/lib/python2.7/dist-packages/patchman/packages/utils.py", line 84, in update_errata
data = download_errata()
File "/usr/lib/python2.7/dist-packages/patchman/packages/utils.py", line 94, in download_errata
return gunzip(data)
File "/usr/lib/python2.7/dist-packages/patchman/util/init.py", line 149, in gunzip
error_message.send(sender=None, text='gunzip: ' + e)
TypeError: cannot concatenate 'str' and 'error' objects
run-parts: /etc/cron.daily/python-patchman exited with return code 1

Installation Procedure

Hi,
I've tried to install it either to Ubuntu 14.04 or Debian 7 or 8 but I can't get it to work.
How I can install it properly?

skip_if_unavailable=True not co-operating with patchman-client

When a yum repo has
skip_if_unavailable=True
set, then patchman-client fails:

/etc/patchman/patchman-client -v
Attempting to obtain lock: /var/lock/patchman/patchman.lock
Patchman configuration seems ok:
Patchman Server: http://<patchman-host>/patchman
Tags: Server
Report: 0
Finding installed rpms...
Finding yum repos...
sed: -e expression #1, char 83: unterminated `s' command
sed: -e expression #1, char 59: unterminated `s' command
sed: -e expression #1, char 92: unterminated `s' command
Sending data to http://<patchman_host/patchman with curl:
curl --insecure --connect-timeout 60 --max-time 300 -F verbose="1" -F host="<client>" -F tags="Server" -F kernel="3.10.0-514.2.2.el7.x86_64" -F arch="x86_64" -F protocol="1" -F os="Centos 7" -F report="0" -F packages=\</tmp/tmp.1TwGiplQfc -F repos=\</tmp/tmp.Hadq6XYjbl -F sec_updates=\</tmp/tmp.sown6hduXp -F bug_updates=\</tmp/tmp.ewWkGEbvXe -F reboot="ServerCheck" http://<patchman-host>/patchman/reports/upload/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 71788    0     0  100 71788      0  84878 --:--:-- --:--:-- --:--:-- 84855
Deleting /tmp/tmp.1TwGiplQfc
Deleting /tmp/tmp.Hadq6XYjbl
Deleting /tmp/tmp.sown6hduXp
Deleting /tmp/tmp.ewWkGEbvXe

Patchman is cloned from master on 11-th April

ValueError: too many values to unpack

Hello,

I am testing this out on my home lab and think this app is pretty awesome however, I am running into the following when running PYTHONPATH=/srv/patchman /srv/patchman/sbin/pa
tchman -a

Finding updates for all Hosts

banjo.example.com
dovecot-2.2.36-2.cp1162-x86_64 -> dovecot-1:2.2.10-8.el7-x86_64 (Bugfix)
filesystem-3.2-21.el7-x86_64 -> filesystem-3.2-25.el7-x86_64 (Bugfix)
mariadb-devel-10.2.16-1.el7.centos-x86_64 -> mariadb-devel-1:5.5.56-2.el7-x86_64 (Bugfi
x)
mariadb-server-10.2.16-1.el7.centos-x86_64 -> mariadb-server-1:5.5.56-2.el7-x86_64 (Bug
fix)
p0f-3.09b-1.cp1150-x86_64 -> p0f-3.09b-1.el7-x86_64 (Bugfix)
Traceback (most recent call last):
File "/srv/patchman/sbin/patchman", line 593, in
main()
File "/srv/patchman/sbin/patchman", line 588, in main
showhelp = process_args(args)
File "/srv/patchman/sbin/patchman", line 569, in process_args
host_updates_alt(args.host)
File "/srv/patchman/sbin/patchman", line 282, in host_updates_alt
host.find_updates()
File "/srv/patchman/patchman/hosts/models.py", line 197, in find_updates
repo_packages)
File "/srv/patchman/patchman/hosts/models.py", line 311, in find_kernel_updates
self.check_if_reboot_required(host_highest)
File "/srv/patchman/patchman/hosts/models.py", line 277, in check_if_reboot_required
ver, rel = kernel.rsplit('-')
ValueError: too many values to unpack

I am not very good with python yet and don't know where to go from here.
Goet everything insalled and 3 servers added 2 Ubuntu 16.04 servers and one CentOS 7.5 server.
The above command appears to work as long as there aren't any packages updates.
Would really like to use this as it's exactly what I'm looking for.
Any assistance is appreciated.

Thanks

problems with client getting deb/ubuntu repos properly

We recently implemented your solution for update checking on our linux hosts. Our distributions are mainly centos and ubuntu.
Problem arises when we're adding repos for ubuntu 10 and ubuntu 16. Patchman-client for ubuntu 10 dosen't add /dists/ folder and with ubuntu 16 client misses a backslash. So what i did was to change client script to change the output and now it works, but im not sure what is the difference with dists and non-dists repos?

ubuntu 10 output was like this:
'deb' 'Ubuntu 10.04 x86_64 repo at http://security.ubuntu.com/ubuntu/lucid-security/multiverse' '500' 'http://security.ubuntu.com/ubuntu/lucid-security/multiverse'

and ubuntu 16 output was:
'deb' 'Ubuntu 16.04 x86_64 repo at http://security.ubuntu.com/ubuntudists/xenial-security/multiverse/binary-i386' '500' 'http://security.ubuntu.com/ubuntudists/xenial-security/multiverse/binary-i386'

as we changed the client side and not really understanding everything maybe you could send as more universal solution as this seems to be just a workaround.

Reboot pending duration indicator

Hi Marcus,

is there an easy way to tell how long a reboot has been pending on a machine? My use-case is that I want to give users some time to do the reboot when convenient for them but remind them after a couple of days or a week.

After studying the database schema and patchman-client code, I guess we could (for Ubuntu at least) transfer the ctime of /var/run/reboot-pending to the server and save it in addition to the reboot flag. The UI could then flag the pending reboot with a warning after a configurable DAYS_WITHOUT_REBOOT time.

Thanks, Michael

CentOS RPM Issues

I tried to spin up a fresh CentOS 7 install and found patchman didn't work using the instructions. On diagnosis, it was expecting the patchman package to be in /usr/lib/python2.7/site-packages instead of /usr/local/lib/python2.7/dist-packages as it currently is. This especially leads to the database not being made as well.

Equally, the rpm-post-install script fails to work correctly as it is unable to find patchman-manage and patchman-set-secret-key. I find this also holds true trying to call them via sudo, but does work fine from a normal user context (login / su -l; patchman-*).

I was able to work around this manually copying the packages accordingly and then manually running each line of the post-install script. After that everything works without incident so far.

I have no qualms destroying/rebuilding the virtual machine so will be happy to assist in testing.

patchman -a version KeyError for Visual Studio Code repo

Hi there,

I've recently found Patchman and I'm trying it with a few Ubuntu 16.04 LTS desktops having installed it on Ubuntu 16.04 LTS Server. Patchman worked fine processing a report from the Server but when I ran "patchman -a" to process the reports from a couple of Desktops it errors on the repo for Visual Studio Code:

--begin--
Repository 33 : Ubuntu 16.04 x86_64 repo at http://packages.microsoft.com/repos/vscode/dists/stable/main/binary-amd64
Found deb repo - http://packages.microsoft.com/repos/vscode/dists/stable/main/binary-amd64/Packages.bz2
Downloading repo info: 100%|#################|Time: 0:00:00
Traceback (most recent call last): 35%|###### |ETA: 0:00:00
File "/usr/bin/patchman", line 593, in
main()
File "/usr/bin/patchman", line 588, in main
showhelp = process_args(args)
File "/usr/bin/patchman", line 561, in process_args
refresh_repos(args.repo, args.force)
File "/usr/bin/patchman", line 120, in refresh_repos
repo.refresh(force)
File "/usr/lib/python2.7/dist-packages/patchman/repos/models.py", line 86, in refresh
refresh_deb_repo(self)
File "/usr/lib/python2.7/dist-packages/patchman/repos/utils.py", line 535, in refresh_deb_repo
packages = extract_deb_packages(data, mirror_url)
File "/usr/lib/python2.7/dist-packages/patchman/repos/utils.py", line 311, in extract_deb_packages
fullversion = Version(stanza['version'])
File "/usr/lib/python2.7/dist-packages/debian/deb822.py", line 245, in getitem
value = self.__dict[key]
KeyError: 'version'
---end---

Server is fully patched with Patchman 1.09-1.

Since this is a test I'm going to try building an Ubuntu 18.04 Server which has an updated python-debian package to see if that behaves better.

Any ideas welcome.

Thanks,
Simon

Required django versions.

Hi, I've been trying to build and install the package, and have a couple of questions.

Which version of Django is required for Patchman version 0.9?

Which OS releases do the debs built from your Debian packaging target?

FYI I've found that Debian Wheezy does not have python-django-extensions packaged.

Input Sanitization

I'm enjoying patchman so far but have found some issues concerning RPM repos.
If the repo somehow contains a backslash [0] this breaks rather badly and will cause the server to choke on the report.
Equally, if the repository contains an apostrophe [1], this also breaks the server, causing a duplicate url error.
While it might break original formatting a little, possibly just stripping bad characters out might be the simplest, unless it's possible to find and escape them.
Aside, on rDNS checks, it should probably ignore case [3].

[0] https://docs.influxdata.com/influxdb/v1.7/introduction/installation/

name = InfluxDB Repository - RHEL \$releasever
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable

[1] https://rpms.remirepo.net/

name=Remi's RPM repository for Enterprise Linux 7 - $basearch

[3] SVR-fserv vs. svr-fserv

IntegrityError 1062 on mysql - Duplicate entry ' ' for key 'url' when processing reports.

$ PYTHONPATH=/srv/patchman /srv/patchman/sbin/patchman -p

Traceback (most recent call last): 69%|############################# |ETA: 0:00:00
File "/srv/patchman/sbin/patchman", line 593, in
main()
File "/srv/patchman/sbin/patchman", line 588, in main
showhelp = process_args(args)
File "/srv/patchman/sbin/patchman", line 555, in process_args
process_reports(args.host, args.force)
File "/srv/patchman/sbin/patchman", line 430, in process_reports
report.process(find_updates=False)
File "/srv/patchman/patchman/reports/models.py", line 151, in process
process_repos(report=self, host=host)
File "/srv/patchman/patchman/reports/utils.py", line 45, in process_repos
repo, priority = process_repo(repo_str, report.arch)
File "/srv/patchman/patchman/reports/utils.py", line 266, in process_repo
Mirror.objects.create(repo=repository, url=url)
File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 348, in create
obj.save(force_insert=True, using=self.db)
File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 734, in save
force_update=force_update, update_fields=update_fields)
File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 762, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 846, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 885, in _do_insert
using=using, raw=raw)
File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 920, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 974, in execute_sql
cursor.execute(sql, params)
File "/usr/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 100, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/usr/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 124, in execute
return self.cursor.execute(query, args)
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 226, in execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorvalue
django.db.utils.IntegrityError: (1062, "Duplicate entry ' ' for key 'url'")

Unknown checksum type: sha1

Trying out patchman for the first time. Seems upset about one of my repos though. (https://packagecloud.io/prometheus-rpm/release/el/7/x86_64 mirrored by pulp)

Unknown checksum type: sha1
Traceback (most recent call last):
  File "/bin/patchman", line 593, in <module>
    main()
  File "/bin/patchman", line 588, in main
    showhelp = process_args(args)
  File "/bin/patchman", line 561, in process_args
    refresh_repos(args.repo, args.force)
  File "/bin/patchman", line 120, in refresh_repos
    repo.refresh(force)
  File "/usr/lib/python2.7/site-packages/patchman/repos/models.py", line 88, in refresh
    refresh_rpm_repo(self)
  File "/usr/lib/python2.7/site-packages/patchman/repos/utils.py", line 552, in refresh_rpm_repo
    refresh_yum_repo(mirror, data, mirror_url, ts)
  File "/usr/lib/python2.7/site-packages/patchman/repos/utils.py", line 435, in refresh_yum_repo
    sha = get_sha(checksum_type, data)
  File "/usr/lib/python2.7/site-packages/patchman/repos/utils.py", line 174, in get_sha
    return sha
UnboundLocalError: local variable 'sha' referenced before assignment

Maybe sha and sha1 are synonyms and a simple change here would work???

problem with editing repo/mirror when clicking on checksum id on dashboard page

image

when clicking on any repo marked on the picture i get an error:

TemplateSyntaxError at /repos/mirrors/
Could not parse the remainder: '/mirror_edit_repo.html' from 'repos/mirror_edit_repo.html'
Request Method: GET
Request URL: http://patchman.ts.telekom.si/patchman/repos/mirrors/?checksum=77b026cbc7fb74e36a8137874cc59244bfc8f075
Django Version: 1.8.12
Exception Type: TemplateSyntaxError
Exception Value:
Could not parse the remainder: '/mirror_edit_repo.html' from 'repos/mirror_edit_repo.html'
Exception Location: /usr/lib64/python2.7/site-packages/django/template/base.py in init, line 640
Python Executable: /usr/bin/python
Python Version: 2.7.5
Python Path:
['/opt/patchman',
'/opt/patchman_new/patchman',
'/usr/lib/python2.7/site-packages/patchman-0.9.4-py2.7.egg',
'/usr/lib64/python27.zip',
'/usr/lib64/python2.7',
'/usr/lib64/python2.7/plat-linux2',
'/usr/lib64/python2.7/lib-tk',
'/usr/lib64/python2.7/lib-old',
'/usr/lib64/python2.7/lib-dynload',
'/usr/lib64/python2.7/site-packages',
'/usr/lib64/python2.7/site-packages/gtk-2.0',
'/usr/lib/python2.7/site-packages']
Server time: Mon, 30 May 2016 11:55:33 +0200

XML ValueError: can only parse strings

/etc/cron.daily/python-patchman:
patchman.localdomain : gunzip: Error -3 while decompressing data: incorrect header check
Traceback (most recent call last):
File "/usr/bin/patchman", line 593, in
main()
File "/usr/bin/patchman", line 588, in main
showhelp = process_args(args)
File "/usr/bin/patchman", line 578, in process_args
update_errata(args.force)
File "/usr/lib/python2.7/dist-packages/patchman/packages/utils.py", line 85, in update_errata
parse_errata(data, force)
File "/usr/lib/python2.7/dist-packages/patchman/packages/utils.py", line 100, in parse_errata
result = etree.XML(data)
File "src/lxml/lxml.etree.pyx", line 3192, in lxml.etree.XML (src/lxml/lxml.etree.c:82678)
File "src/lxml/parser.pxi", line 1818, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:124513)
ValueError: can only parse strings
run-parts: /etc/cron.daily/python-patchman exited with return code

Upgrading Patchman on Ubuntu 16.04 replaces Apache configuration file

Upgrading Patchman 1.0.9 to 1.0.12 on Ubuntu Server 16.04 LTS replaced the /etc/apache2/conf-available/patchman.conf thus the "Require ip ..." line I'd added for my installation went AWOL.

Should I be (also) adding that to /etc/patchman/patchman-apache.conf so it gets (re)added when upgrading?

If not, perhaps this file should not be overwritten when upgrading ... ?

Thanks.

Repo causing errors

http://download.proxmox.com/debian/dists/wheezy/pve-no-subscription/binary-amd64/Packages.bz2 - HTTP Error 404: Not Found
Found deb repo - http://download.proxmox.com/debian/dists/wheezy/pve-no-subscription/binary-amd64/Packages.gz
Traceback (most recent call last):
File "/srv/patchman/sbin/patchman-cli", line 383, in
showhelp = process_args(args)
File "/srv/patchman/sbin/patchman-cli", line 348, in process_args
process_reports(args.host)
File "/srv/patchman/sbin/patchman-cli", line 292, in process_reports
report.process(False)
File "/usr/local/lib/python2.6/dist-packages/patchman/reports/models.py", line 144, in process
process_updates(report=self, host=host)
File "/usr/local/lib/python2.6/dist-packages/patchman/reports/utils.py", line 62, in process_updates
add_updates(bug_updates, host, False)
File "/usr/local/lib/python2.6/dist-packages/patchman/reports/utils.py", line 79, in add_updates
update = process_update(host, u, security)
File "/usr/local/lib/python2.6/dist-packages/patchman/reports/utils.py", line 118, in process_update
hp = host.packages.filter(name=p_name, arch=p_arch, packagetype='R')[0]
File "/usr/lib/python2.6/dist-packages/django/db/models/query.py", line 207, in getitem
return list(qs)[0]
IndexError: list index out of range

Add ssl certificate on the repo

Hello,

I was checking your installation instructions and I noticed that the repo is not secured with a ssl certificate. Could you please add a certificate?

Thanks in advance

gets error 500 on debian jessie after install

Seems like it redirects and then gets error 500.

Debug info

Request Method: GET
Request URL: http://XXX.XXX.XX.XXX/patchman/login/?next=/patchman/dashboard/
Django Version: 1.7.11
Exception Type: AttributeError
Exception Value: 'dict' object has no attribute 'render_context'
Exception Location: /usr/lib/python2.7/dist-packages/django/template/base.py in render, line 146
Python Executable: /usr/bin/python
Python Version: 2.7.9
Python Path: ['/opt/patchman',
'/opt/patchman/patchman',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/pymodules/python2.7']

Please consider compressing reports

And another request.

Please consider compressing reports before they get sent to patchman host. Reason for that is to save network bandwidth while sending reports to host. In our environment we have some servers that are available over satellite connection and it would help to speed things up and, as mentioned, save a few bucks on network traffic.

I have not actually measured how much it would save though :)

Patchman on Ubuntu 18.04 LTS

Installing Patchman and running "patchman-manage createsuperuser" on Ubuntu Server 18.04.1 LTS both display the following warnings:

--begin--
?: (rest_framework.W001) You have specified a default PAGE_SIZE pagination rest_framework setting,without specifying also a DEFAULT_PAGINATION_CLASS.
HINT: The default for DEFAULT_PAGINATION_CLASS is None. In previous versions this was PageNumberPagination. If you wish to define PAGE_SIZE globally whilst defining pagination_class on a per-view basis you may silence this check.
---end---

and whilst you can log in via the Patchman URL you then hit an error 500 page.

Since there is no Ubuntu 18.04 repo available for Patchman had to use the 16.04 xenial one.

CloudFlare repository throwing error on patchman -r

Hey!

I manage a series of servers that use CloudFlare's repository for some packages and I can't seem to refresh that repo, for some reason.

Here is the output of patchman -lr:

22 : CloudFlare Packages x86_64
security: False    arch: x86_64
Mirrors:
 56 : http://pkg.cloudflare.com/dists/7/main/binary-x86_64
 last updated: 2019-01-29 15:40:21.337702    checksum: None

And the error stack:

Repository 22 : CloudFlare Packages x86_64
Checking http://pkg.cloudflare.com/dists/7/main/binary-x86_64/repodata/repomd.xml.xz
Checking http://pkg.cloudflare.com/dists/7/main/binary-x86_64/repodata/repomd.xml.bz2
Checking http://pkg.cloudflare.com/dists/7/main/binary-x86_64/repodata/repomd.xml.gz
Checking http://pkg.cloudflare.com/dists/7/main/binary-x86_64/repodata/repomd.xml
Found yum rpm repo - http://pkg.cloudflare.com/dists/7/main/binary-x86_64/repodata/repomd.xml
Traceback (most recent call last):
  File "/usr/bin/patchman", line 593, in <module>
    main()
  File "/usr/bin/patchman", line 588, in main
    showhelp = process_args(args)
  File "/usr/bin/patchman", line 561, in process_args
    refresh_repos(args.repo, args.force)
  File "/usr/bin/patchman", line 120, in refresh_repos
    repo.refresh(force)
  File "/usr/lib/python2.7/site-packages/patchman/repos/models.py", line 88, in refresh
    refresh_rpm_repo(self)
  File "/usr/lib/python2.7/site-packages/patchman/repos/utils.py", line 552, in refresh_rpm_repo
    refresh_yum_repo(mirror, data, mirror_url, ts)
  File "/usr/lib/python2.7/site-packages/patchman/repos/utils.py", line 417, in refresh_yum_repo
    primary_url, checksum, checksum_type = get_primary_url(mirror_url, data)
  File "/usr/lib/python2.7/site-packages/patchman/repos/utils.py", line 147, in get_primary_url
    namespaces={'ns': ns})[0]
IndexError: list index out of range

What could be the issue?
Thanks!

Error after removing an apt source

Summary

Removing an apt source from a VM causes the patchman server to fail to process reports for that VM.

My use-case

  • I removed a package:

    apt-get purge newrelic-sysmond -y
    
  • Removed its apt source:

    rm /etc/apt/sources.list.d/newrelic.list*
    
  • I then ran these to sync to the patchman server

    apt update
    patchman-client
    
  • I then went to my patchman server and processed the report:

    patchman -a
    
  • It threw a Python stack trace w/ this error message:

    patchman AssertionError: Repository object can't be deleted because its id attribute is set to None.
    

My workaround

I found the offending repositories in the UI and deleted them manually.

Then patchman -a worked as expected.

High CPU usage, Dashboard inaccessible

I'm using Ubuntu 16.04.2 (64bit), MariaDB 10.0.29 and followed the git install instructions.
Installation itself was successful , but when running manage.py it threw an error about pymysql not installed.

Traceback (most recent call last):
  File "./manage.py", line 30, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 328, in execute
    django.setup()
  File "/usr/lib/python2.7/dist-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/lib/python2.7/dist-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/usr/lib/python2.7/dist-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/models.py", line 41, in <module>
    class Permission(models.Model):
  File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 139, in __new__
    new_class.add_to_class('_meta', Options(meta, **kwargs))
  File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 324, in add_to_class
    value.contribute_to_class(cls, name)
  File "/usr/lib/python2.7/dist-packages/django/db/models/options.py", line 250, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "/usr/lib/python2.7/dist-packages/django/db/__init__.py", line 36, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 241, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 112, in load_backend
    return import_module('%s.base' % backend_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 23, in <module>
    import pymysql
ImportError: No module named pymysql

Easily fixed by doing apt-get install python-pymysql

With no data at all, dashboard loads fine, but I noticed while patchman -a was running (local data) i got 100% CPU usage. I started with a Digital Ocean droplet with 1GB RAM and 1xCPU, later I tried upgrading it to 2GB RAM and 2xCPUs, also 100% usage on both recently i've upgraded it to 8GB RAM and 4xCPUs, still getting 100% CPU usage on some of the CPUs, but even worse, once the database has actual content, loading the dashboard seems impossible.

I have done no optimization for MySQL, and it seems to be a query issue specifically:

SELECT COUNT(*) FROM (SELECT DISTINCT `packages_package`.`id` AS Col1, `packages_package`.`name_id` AS Col2, `packages_package`.`epoch` AS Col3, `packages_package`.`version` AS Col4, `packages_package`.`release` AS Col5, `packages_package`.`arch_id` AS Col6, `packages_package`.`packagetype` AS Col7, `packages_package`.`description` AS Col8, `packages_package`.`url` AS Col9 FROM `packages_package` LEFT OUTER JOIN `hosts_host_packages` ON ( `packages_package`.`id` = `hosts_host_packages`.`package_id` ) LEFT OUTER JOIN `repos_mirrorpackage` ON ( `packages_package`.`id` = `repos_mirrorpackage`.`package_id` ) WHERE (`hosts_host_packages`.`host_id` IS NULL AND `repos_mirrorpackage`.`mirror_id` IS NULL)) subquery;

it just goes on forever and ever and causing 100% CPU usage on atleast 1 CPU.

As the latest test, I removed python-pymysql - then the dashboard loads instantly, but then manage.py and the actual patchman -a doesn't work.

Disabled mirrors are still checked by patchman-cli

Hi
I marked an elrepo mirror
as disabled in the web interface and it seems it is still being checked
by our cronjob:

/srv/django/patchman/sbin/patchman-cli -u -d -U -c -r -p -n

I know this because patchman-cli is currently throwing an exception when it encounters
this repo. (I'll open another issue once I've got a better idea what to do about this).

patchman-client: baseurl with %20 (space)

I'm pulling "bind" from bkraft's repo, and for CentOS/RHEL 6, he has this nifty baseurl:
http://bkraft.fr/files/RPM%20stuff/ - yes, a space in the URL!

when running patchman-client -d -v, this triggers:

awk: (FILENAME=- FNR=28) fatal: not enough arguments to satisfy format string
        `'http://bkraft.fr/files/RPM%20stuff/' '
                                      ^ ran out for this one

I'm not overly concerned, just wanted to point this out.

Thanks for your work!

patchman registration error

When I have executed patchman -a that time I have received below error

patchman.packages.models.MultipleObjectsReturned: get() returned more than one Erratum -- it returned 2!

spurious rhn warnings

Thanks to the the latest update of yum-rhn-plugin (i think), yum now outputs this to stderr instead of stdout:

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

So now patchman-client spews this out when run:

[root@merri-m sbin]# patchman-client
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Would be nice to catch it in the client so I don't need to redirect stderr when running the client.

[SOLVED] CentOS 7 problem "Unfortunately, no servers have registered yet."

Hey guys,

(This is just an information post because i run into alot of troubles to let the management panel verify my server even when Plesk told me everything was "ok")


i installed patchman on my CentOS 7(Plesk Onyx 17) by using the wget install script u provided.
I was able to install everything correctly and got no error.
I could even insert my licence key while installing (using the script) without problems so that Plesk now tells me that the Patchman service is running, the licence is valid and i can use the plugin.
I then tried to click on "verify" but ended up getting the error over and over again.
I checked everything again and found out that the licence was never put into the /etc/patchman/licence/ directory.

So just in case u run into the same error like me u may want to check if the key was REALLY successfully put into the right directory.
U can add it by using the following command:

  1. echo "PutYourKeyInHere" > /etc/patchman/license/key
  2. service patchman restart

That worked for me! :)

Cheers,
PitchBendStretch

Automated reporting interface (API)

Is it possible to query data and return json enabling external tooling to retrieve the various pieces of data, namely the available updates separated by severity level?

InvalidTemplateLibrary at /login/ after installing on CentOS 7

Hey!

I'm trying to install this on a CentOS 7 machine since the INSTALL.md was updated and I've ran into some issues. This is what I did:

  • Downloaded all the RPMs from http://repo.openbytes.ie/yum, since the repo is missing python-django-extensions, and got the missing package from here;

  • Did yum install httpd mod_wsgi and yum localinstall *.rpm;

  • Finally did patchman-manage createsuperuser and then patchman-manage migrate --run-syncdb.

After enabling DEBUG = True, I get the following error:
image

What am I missing here?

Problems with Oracle EL 6 repo?

I've been playing with patchman for most of the weekend and noticed a problem with Oracle 6 repo. I don't know if it is patchman bug or OEL repo specialty.

PYTHONPATH=/opt/patchman /opt/patchman/sbin/patchman -r
....
Repository 47 : Oracle Linux 6Server Latest (x86_64) x86_64
Downloading repo info (1/2):       100%|###########################################|Time: 0:00:00
Found yum rpm repo - http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/repodata/repomd.xml
Downloading repo info (2/2):       100%|###########################################|Time: 0:00:00
Killed

And this causes patchman -a -q to fail. If I disable that repo and mirror in UI, then patchman -r succeeds.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.