-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a list hosts CSV output with security/bugfix broken out. #127
base: master
Are you sure you want to change the base?
Conversation
Add files via upload No \n at end no \n Add call to list_hosts if -lhc remove stray @models thing
What is the use-case for this PR? |
Current report format is not easily machine parsable. I need to be able to archive reports for audit purposes. Current report also does not separate out bugfix/security whereas the web interface does. The web interface is useful for quick looks, but I need reporting features and the ability to parse the data. |
However, there is a REST API that could be used to produce machine-parsable output. |
When calling For example:
Otherwise, I'll have to do something like this (psuedo-code), which I expect to take much longer (at least, I assume...this is untested):
For me, I want to be alerted only when there are security updates available. And right now, my script only alerts me when the list of updates is not empty since I don't have the knowledge of update "type". |
Hi, just to reinforce that this in general would be nice to have. My usecase is that I have multiple Patchman instances, and I want to create a basic dashboard for those. I'd love to have basically a summary for the hosts (at least hostname, additional host information, number of critical updates, updates). The current API would require me to crawl all the update-URLs, which is prohibitively expensive. CSV is good common format, however I'd prefer it to be JSON like the rest of the API. Another API approach would be to allow 'joining' Models before serializing them, however that'd make the API-Responses even more heavyweight. |
I am looking at updating the API to give the info requested. This script might be useful for anyone who wants to test: https://gist.github.com/furlongm/a194697b7aa171411b7fffe2a64b06cc Crawling the update urls is expensive so trying to think of the best way of representing the updates in the current API? I think the API could probably give info about the number of security and bugfix updates per host, and that might be enough, or maybe just a list of package names that are out of date? |
I'd think the backwards compatibility of the current API should largely be retained. I'd avoid removing the current fields, however adding fields shouldn't be a problem. I would be happy with just new count fields as a kind of 'summary'. I think the OP only needed the counts as well? |
c9f29f1 adds the counts for security and bugfix updates to the API. Let me know if that works |
Very cool, I will try it out, thank you @furlongm |
@furlongm I rolled out the newest Version, it works perfectly for my usecase. Thank you so much! |
Patch 4/4: Create a CSV output report with the addition of bugfix and security patches needed broken out.