Archived
1
0

40 Commits

Author SHA1 Message Date
ef69ab8d13 Upgraded code to Python3. 2016-12-14 16:53:49 +01:00
59f46ccc53 Proper default values for omitted parameters. 2016-12-14 16:53:34 +01:00
ccd56fd4c7 Skip matching if "(updateinfo)" found in line. 2016-12-14 16:51:14 +01:00
00133f8253 Output performance data. Loosely based on work from @dgoetz and
@calestyo .
2016-12-13 18:20:00 +01:00
13181f04e7 Output exception message on problems. 2016-12-13 18:19:50 +01:00
c8e06ba697 Changed from OptionParser to ArgumentParser. 2016-12-13 17:32:54 +01:00
f61586a9a3 Added short cli opts. (@HariSekhon) 2016-12-13 17:26:49 +01:00
6125297674 Trim trailing spaces. 2016-12-13 17:24:15 +01:00
35af11f2cd Improved matching taken from @HariSekhon . 2016-12-13 17:23:14 +01:00
d65e8e9f2d Exit after output of status. 2016-12-13 17:21:53 +01:00
44319e95af Fix for latest change in yum (Output of "... (updateinfo)" lines). Based
on work from @moschlar and @lewiseason .
2016-12-13 16:29:11 +01:00
6c0a5d8e5c Catch KeyboardInterrupt. 2016-12-13 16:29:03 +01:00
30cb67546d Renamed to updates-yum.py. (Copy to
/usr/lib/check_mk_agent/plugins/local/3600/ to check hourly.)
2016-12-13 16:22:10 +01:00
cb62308a95 Print syntax help on wrong argument. 2016-12-13 16:21:18 +01:00
bba9594962 Raised fail limit from 25 additional lines to 45. 2016-12-13 16:19:58 +01:00
2516fe7189 Change CRITICAL statuses to WARNING (as missing updates are not CRITICAL
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.)
2016-12-13 16:17:15 +01:00
9289a05e0b Change output to Check_MK plugin style. 2016-12-13 16:16:34 +01:00
ec51cbdc4f Fix coding declaration for Python. 2016-12-13 16:07:46 +01:00
6ccaa35cfc Tabs to spaces. No code change. 2016-12-13 16:06:25 +01:00
Christoph Anton Mitterer
d5aed5e81e bump version to 1.1.0
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
1.1.0
2014-09-26 02:20:48 +02:00
Alex Woehr
c2844ac991 add an option to set YUM’s --installroot
* 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>
2014-09-26 02:13:59 +02:00
Christoph Anton Mitterer
1dc0d65eb3 cosmetical changes
* Move definition of the YUM constant up the the other constants.
2012-10-09 03:41:22 +02:00
Christoph Anton Mitterer
5cffc02eba handle left-over arguments
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.
2012-10-09 03:36:28 +02:00
Christoph Anton Mitterer
e93d7f39e9 fix 5fa4ec301628472715fe7b5db9c0175465c8bd69
* Fixed a typo in commit 5fa4ec301628472715fe7b5db9c0175465c8bd69.
2012-10-09 03:32:56 +02:00
Christoph Anton Mitterer
1b8ddeaa48 cleanup SIGALRM handler
* 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.
2012-10-09 02:53:41 +02:00
Christoph Anton Mitterer
5fa4ec3016 handle any leftover exceptions
* 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.
2012-10-09 02:47:30 +02:00
Christoph Anton Mitterer
45b62cf073 version bump
* 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.
1.0.0
2012-09-30 01:13:28 +02:00
Christoph Anton Mitterer
7da4fd46ae align default timeout with Nagios/Icinga defaults
* 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.
2012-09-30 01:07:08 +02:00
Christoph Anton Mitterer
533663f9ef note on enabling/disabling repos
* 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.
2012-09-30 00:56:10 +02:00
Christoph Anton Mitterer
8fc7eafcd5 minor spelling corrections
* 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.
2012-09-30 00:52:34 +02:00
Christoph Anton Mitterer
11bfebab8c minor spelling corrections
* Minor spelling corrections in the documentation of the options.
2012-09-30 00:49:49 +02:00
Christoph Anton Mitterer
38442b4731 Nagios/Icinga Plugin output improvements
* 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.
2012-09-30 00:38:01 +02:00
Christoph Anton Mitterer
8066a05f6d make the Nagios/Icinga status UNKNOWN on timeouts
* 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.
2012-09-30 00:21:37 +02:00
Christoph Anton Mitterer
140975c7fd clean up whitespace and comments
* 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.
2012-09-30 00:18:05 +02:00
Christoph Anton Mitterer
8dcf17bced Implement the “--no-warn-on-updates” option
* 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.
0.9.0
2012-09-14 00:49:43 +02:00
Christoph Anton Mitterer
a1993633dc * Set the title to “check_yum”, the name of the program, and not to a description.
* 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”.
0.8.0
2012-06-27 00:39:08 +02:00
Christoph Anton Mitterer
f11ae00c26 * Removed a superfluous “boolean == True” expression. 2012-06-27 00:32:12 +02:00
Christoph Anton Mitterer
bc7e5be1b2 * Marked the years from Hari Sekhon’s line in the license information as being unknown.
* 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
2012-06-16 03:04:51 +02:00
Christoph Anton Mitterer
0fefef80b2 * Added license information to the source file.
* 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.
0.7.3
2012-05-01 02:49:50 +02:00
Christoph Anton Mitterer
6921ad1ee0 * Added check_yum version 0.7.1. 0.7.1 2012-05-01 02:41:36 +02:00