[icinga-checkins] icinga.org: icingaweb2-module-pnp/master: Just some cleanup

git at icinga.org git at icinga.org
Mon Jan 2 18:56:49 CET 2017


Module: icingaweb2-module-pnp
Branch: master
Commit: 463096ffe9a7a6b425cc779f4a65699bfbce7e29
URL:    https://git.icinga.org/?p=icingaweb2-module-pnp.git;a=commit;h=463096ffe9a7a6b425cc779f4a65699bfbce7e29

Author: Thomas Gelf <thomas at gelf.net>
Date:   Mon Jan  2 18:56:33 2017 +0100

Just some cleanup

---

 README.md                            |   20 ++++++++++++--------
 configuration.php                    |    4 +---
 library/Pnp/ProvidedHook/Grapher.php |   10 +++++++---
 run.php                              |    1 -
 4 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/README.md b/README.md
index c0029a2..a50f902 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
-# PNP module for Icinga Web 2
+PNP module for Icinga Web 2
+===========================
 
-## General Information
+General Information
+-------------------
 
 PNP is an addon to Icinga  which analyzes performance data provided by plugins
 and stores them automatically into RRD-databases.
@@ -10,15 +12,17 @@ This module integrates PNP4Nagios into your
 frontend. It requires [PNP4Nagios](https://docs.pnp4nagios.org/)
 to installed and configured.
 
-## Installation
+Installation
+------------
 
 Just drop this module to a folder named `pnp` in one of your Icinga Web 2 module
-directories. Then enable it in your frontend (Configuration -> Modules
- -> pnp -> enable) and it should work out of the box. Check the modules
-config tab right there in case you are using a customized installation instead
-of standard PNP4Nagios packages.
+directories. Then enable it in your frontend (Configuration -> Modules -> pnp
+-> enable) and it should work out of the box. Check the modules config tab right
+there in case you are using a customized installation instead of standard
+PNP4Nagios packages.
 
-## TODO
+TODO
+----
 
 We should also provide an easy way to integrate our authentication and
 permission system into PNP4Nagios. This would require a small wrapper doing an
diff --git a/configuration.php b/configuration.php
index c90bdec..6c62055 100644
--- a/configuration.php
+++ b/configuration.php
@@ -1,8 +1,6 @@
 <?php
-/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
-
-/** @var $this \Icinga\Application\Modules\Module */
 
+/** @var $this Icinga\Application\Modules\Module */
 $this->provideConfigTab('config', array(
     'title' => $this->translate('Configure this module'),
     'label' => $this->translate('Config'),
diff --git a/library/Pnp/ProvidedHook/Grapher.php b/library/Pnp/ProvidedHook/Grapher.php
index 089dfa6..ba301fd 100644
--- a/library/Pnp/ProvidedHook/Grapher.php
+++ b/library/Pnp/ProvidedHook/Grapher.php
@@ -46,10 +46,14 @@ class Grapher extends GrapherHook
 
     public function getPreviewHtml(MonitoredObject $object)
     {
-        if (! $object->process_perfdata) return;
+        if (! $object->process_perfdata) {
+            return '';
+        }
 
         // Skip preview images when missing, for local installations only
-        if (false === strpos($this->baseUrl, '://') && ! $this->has($object)) return;
+        if (false === strpos($this->baseUrl, '://') && ! $this->has($object)) {
+            return '';
+        }
 
         if ($object instanceof Host) {
             $service = '_HOST_';
@@ -192,7 +196,7 @@ class Grapher extends GrapherHook
     private function pnpClean($string)
     {
         if ($string === false) {
-            return;
+            return null;
         }
         return preg_replace('~[ :/\\\]~', '_', $string);
     }
diff --git a/run.php b/run.php
index 7d7a887..7b66ae4 100644
--- a/run.php
+++ b/run.php
@@ -1,4 +1,3 @@
 <?php
 
 $this->provideHook('grapher');
-



More information about the icinga-checkins mailing list