[icinga-checkins] icinga.org: icinga-web/master: Perfdata pipe is not added if perfdata is an empty string (fixes #3148)

git at icinga.org git at icinga.org
Tue Oct 9 12:09:08 CEST 2012


Module: icinga-web
Branch: master
Commit: 1b2e95e11e0d4838e8cb6a03c608a79896da871b
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=1b2e95e11e0d4838e8cb6a03c608a79896da871b

Author: Jannis Mohammer <jannis.mosshammer at netways.de>
Date:   Tue Oct  9 12:06:42 2012 +0200

Perfdata pipe is not added if perfdata is an empty string (fixes #3148)

---

 .../Commands/CommandDispatcherModel.class.php      |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/modules/Api/models/Commands/CommandDispatcherModel.class.php b/app/modules/Api/models/Commands/CommandDispatcherModel.class.php
old mode 100644
new mode 100755
index 37dc8c3..709232b
--- a/app/modules/Api/models/Commands/CommandDispatcherModel.class.php
+++ b/app/modules/Api/models/Commands/CommandDispatcherModel.class.php
@@ -110,8 +110,10 @@ class Api_Commands_CommandDispatcherModel extends IcingaApiBaseModel implements
                 // Perfdata is a a special case that requires | instead of ;
                 if($param != "COMMAND_PERFDATA")
                     $str .= ";".$val;
-                else
-                    $str .= "|".$val;
+                else {
+                    if(trim($val) != "")
+                        $str .= "|".$val;
+                }
             }
 
         }





More information about the icinga-checkins mailing list