]> git.pld-linux.org Git - packages/nagios-plugin-check_elvis_status.git/commitdiff
byteConvert: require 'B' suffix auto/th/nagios-plugin-check_elvis_status-0.1-2
authorElan Ruusamäe <glen@delfi.ee>
Thu, 28 Mar 2013 17:08:48 +0000 (19:08 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Thu, 28 Mar 2013 17:09:38 +0000 (19:09 +0200)
this will avoid matching '500' as '50' to $number and '0' to $type

check_elvis_status.php
nagios-plugin-check_elvis_status.spec

index e5b0f26de190e939964da2e8d655a73c33d6f94d..b8422384126e321860dcdd19699d0b9f78a42d8e 100755 (executable)
@@ -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;
        }
 
index 2ef70b0cf8d7675f6986d1b94a47ce7e17cf45d9..2f29471ca86310286a14ee51a340d84f3da30ac4 100644 (file)
@@ -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
This page took 0.140469 seconds and 4 git commands to generate.