[packages/nagios-plugin-check_elvis_status] byteConvert: require 'B' suffix
glen
glen at pld-linux.org
Thu Mar 28 18:09:44 CET 2013
commit 66d8d9e058f78812c8aef872726f6bd95b8379f9
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Thu Mar 28 19:08:48 2013 +0200
byteConvert: require 'B' suffix
this will avoid matching '500' as '50' to $number and '0' to $type
check_elvis_status.php | 2 +-
nagios-plugin-check_elvis_status.spec | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/nagios-plugin-check_elvis_status.spec b/nagios-plugin-check_elvis_status.spec
index 2ef70b0..2f29471 100644
--- a/nagios-plugin-check_elvis_status.spec
+++ b/nagios-plugin-check_elvis_status.spec
@@ -4,7 +4,7 @@
Summary: Nagios plugin to check Elvis DAM status
Name: nagios-plugin-%{plugin}
Version: 0.1
-Release: 1
+Release: 2
License: GPL v2
Group: Networking
Source0: %{plugin}.php
diff --git a/check_elvis_status.php b/check_elvis_status.php
index e5b0f26..b842238 100755
--- a/check_elvis_status.php
+++ b/check_elvis_status.php
@@ -50,7 +50,7 @@ Plugin action specific options:
* http://stackoverflow.com/questions/11807115/php-convert-kb-mb-gb-tb-etc-to-bytes
*/
function byteConvert($input) {
- if (!preg_match('/^(?P<number>[\d.,]+)\s*(?P<type>\w+)$/', $input, $m)) {
+ if (!preg_match('/^(?P<number>[\d.,]+)\s*(?P<type>\w+B)$/i', $input, $m)) {
return $input;
}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/nagios-plugin-check_elvis_status.git/commitdiff/66d8d9e058f78812c8aef872726f6bd95b8379f9
More information about the pld-cvs-commit
mailing list