as long as the machine is still running). Also only go to WARNING state
when at least 30 security updates are missing. (Otherwise it goes to
warning every 2 days.)
* Add an option to set the --installroot option for YUM, in order to ease the
usage of check_yum with chroots.
Signed-off-by: Alex Woehr <awwoehr@gmail.com>
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
When left-over arguments were found:
* Do not print the program help.
* Print an info line for Nagios/Icinga, noting that invalid arguments were specified.
* Gave the SIGALRM handler a new name, with the upcomming other signal handler(s) in mind.
* Sensible parameter names for the handler function.
* No longer assign the handler function parameters to each other for no good reason.
* Globally catch any unhandled expections (but SystemExit) and report an UNKNOWN status.
This includes catching of KeyboardInterrupt, for which I don’t see any reason for special handling.
* Bumped the version to 1.0.0.
I decided for a new major version, given that there is a small chance that people actually parsed the text output (which changed quite a bit in commit 38442b47313f6cf18f230171abd33a04fe849552) of the plugin somehow.
* Set the default timeout to 55 seconds.
This is intended to be aligned to Nagios’s/Icinga’s default values for “service_check_timeout” which is 60 seconds. The gap of 5 seconds should leave enough time to e.g. have remote connections like ssh or NRPE closed.
Comparing it with e.g. APT (which is always really fast), YUM is very very slow - even when using chached mode. Therefore I try to use most of the time, Nagios/Icinga would grant a service check per default plus some gap.
Of course, administrators should still manually constrain their check_yum invocations if the see, that less time is always enough.
* Add text to the options that notes about unexpected results when enabling/disabling repositories.
Consider for a protected repository is disabled. Now updates from other repositories that may have been excluded before (because of the protection) may pop up. So disabling a repository may actually lead to (more) updates being found to be available.
The same applies analogously for enabling repositories.
* Minor spelling corrections in the documentation of the options.
* Write “YUM” everywhere where the program YUM (and not the binary, the package, etc.) is meant.
* Do not longer print "YUM <status>: " in the Nagios/Icinga plugin output.
This change was made gor the reasons of, and following my own proposal at http://sourceforge.net/tracker/?func=detail&aid=3572875&group_id=29880&atid=397597 , which already got consent by at lead developers from at least Nagios.
* If there is no performance data, do not print "|" in the Nagios/Icinga plugin output.
Currently, check_yum never gives performance data output anyway and even if this would be the case, there may be statuses for which no performance data is applicable (typically when the status would be UNKNOWN).
As this simplyfies parsing of the plugin output by Nagios/Icinga, it seemed useful.
* Changed the Nagios/Icinga status to UNKNOWN on timeouts.
IMHO, a timeout does not imply that updates or security updates, therefore the proper status is UNKNOWN.
* Clean up identation of the whole program by replacing spaces with tabs.
Python is an inherently ugly and unclean language, most infamous its use of in
dentation to control semantics.
Previously, the program used a very inconsistent number of spaces for that indenting, which easily lead to bugs IMHO and made maintenance much more difficult.
Now, tabs show the identaiton level of a line (and therefore where it belongs to) and spaces are only used to vertically arrange something (which belongs however to the same identation level).
* Apart from cases where I found it usefule (e.g. large structs), resolved line continuations.
All people (should) have powerful editors, which are capable of doing automatic line wrapping if wanted. Its not the business of the programmer to take care on this, especailly in text blocks, where it’s really annoying to insert something and then need to re-wrap everything in shape.
* Cleaned up some spelling of the """ doc comments.
* Further minor cosmetic changes.
* As suggested and based on a patch by Matthew Castanien <mcastanien@crunchtime.com>, implemented a new option “--no-warn-on-updates” which allows to return OK states even when updates are found, while still showing the update information.
* Removed the author name from the functional code.
This is surely not meant as unfriendely against Hari Sekhon who did as far as known most of the coding so far, but has been code contributed by other people, too, and I don’t want to add all their names to the output.
The names of all known contributors is added in the license comment of the source code anyway.
* Contacted Hari Sekhon about the license, which he confirmed to be GPL version 2.
* Bumped the version to “0.8.0”.
* Changed the shebang interpreter line to the more standard “/usr/bin/python”.
* Added Python source code encoding information as per PEP 263 (http://python.org/dev/peps/pep-0263/).
Thanks to "Stephen Brown <stephen.brown2@gmail.com>" for the hint.
Closes: Issue #6
* Improved some comments to reflect that the plugin should work with YUM on any distribution.
* Capitalised spelling of YUM in places where the program and not the binary itself is meant.
* Merged a patch that adds structures for Nagios performance data.
* Merged a patch that makes the check_yum working with newer versions of YUM, especially to get support for RHEL 6 based distributions.
* Bumped version to 0.7.3.