Changes of Revision 2
[-] | Changed | nagios-plugins-yum.spec |
x 1
2 # 3 -# spec file for package nagios-plugins-yum (Version 0.6.9) 4 +# spec file for package nagios-plugins-yum (Version 0.7.1) 5 # 6 # 7 8
9 10 Name: nagios-plugins-yum 11 Summary: Checks for Yum Updates on Redhat Enterprise Linux or CentOS systems 12 -Version: 0.6.9 13 +Version: 0.7.1 14 Release: 1 15 -Url: http://nagiosexchange.altinity.org/nagiosexchange/Check_Yum/ 16 +Url: http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/Check_Yum/details 17 License: BSD 4-Clause 18 Group: System/Monitoring 19 Source0: check_yum 20
21 %libexecdir/check_yum 22 23 %changelog 24 +* Thu Jan 27 2011 Carsten Schoene <cs@linux-administrator.com> - 0.7.1 25 +- update to release 0.7.1 26 + 27 * Mon Mar 16 2009 Carsten Schoene <cs@linux-administrator.com> 28 - initial release 29 |
||
[+] | Changed | check_yum ^ |
@@ -1,21 +1,4 @@ #!/usr/bin/env python -# -# Copyright Hari Sekhon 2008 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# """Nagios plugin to test for Yum updates on RedHat/CentOS Linux. Can optionally alert on any available updates as well as just @@ -23,7 +6,7 @@ __author__ = "Hari Sekhon" __title__ = "Nagios Plugin for Yum updates on RedHat/CentOS systems" -__version__ = "0.6.9" +__version__ = "0.7.1" # Standard Nagios return codes OK = 0 @@ -275,6 +258,7 @@ print "\nSection:\n%s\n" % section if len(output2) > 2 or \ not ( "Setting up repositories" in output2[0] or \ + "Loaded plugins: " in output2[0] or \ re.search('Loading\s+".+"\s+plugin', output2[0]) ): end(WARNING, "Yum output signature does not match current known " \ + "format. Please make sure you have upgraded to the " \ @@ -286,7 +270,7 @@ number_packages = 0 else: number_packages = len([x for x in output2[1].split("\n") \ - if x != "" ]) + if len(x.split()) > 1 ]) try: number_packages = int(number_packages) @@ -305,6 +289,12 @@ count = 0 re_package_format = \ re.compile("^.+\.(i[3456]86|x86_64|noarch)\s+.+\s+.+$") + # This is to work around a yum truncation issue effectively changing + # the package output format. Currently only very long kmod lines + # are seen to have caused this so we stick to what we know for safety + # and raise an unknown error on anything else for maximum security + #re_package_format_truncated = \ + # re.compile("^[\w-]+-kmod-\d[\d\.-]+.*\s+.+\s+.+$") for line in output: if re_package_format.match(line): count += 1 |