@@ -16,8 +16,7 @@ $helper = $this->getHelper('CommandForm');
if (count($downtimes) === 0) {
echo t('No downtimes matching the filter');
}
-?>
-downtimes as $downtime): ?>
+foreach ($this->downtimes as $downtime): ?>
= $this->dateFormat()->formatDateTime($downtime->start); ?> -
diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml
new file mode 100644
index 000000000..609bbbc69
--- /dev/null
+++ b/modules/monitoring/application/views/scripts/show/contact.phtml
@@ -0,0 +1,56 @@
+getHelper('ContactFlags');
+?>
+
+
+
+
+
+
+ = htmlspecialchars($contact->contact_name) ?> (=
+ htmlspecialchars($contact->contact_alias)
+ ?>)
+ |
+
+
+
+
+ = t('Email') ?> |
+ %1$s',
+ htmlspecialchars($contact->contact_email)
+ ); ?> |
+
+ contact_pager): ?>
+
+ = t('Pager') ?> |
+ = htmlspecialchars($contact->contact_pager) ?> |
+
+
+
+ = t('Flags (service)') ?> |
+ = htmlspecialchars($contactHelper->contactFlags($contact, 'service')) ?> |
+
+
+ = t('Flags (host)') ?> |
+ = htmlspecialchars($contactHelper->contactFlags($contact, 'host')) ?> |
+
+
+ = t('Service notification period') ?> |
+ = htmlspecialchars($contact->contact_notify_service_timeperiod) ?> |
+
+
+ = t('Host notification period') ?> |
+ = htmlspecialchars($contact->contact_notify_host_timeperiod) ?> |
+
+
+
+
+
diff --git a/modules/monitoring/bin/action/list.inc.php b/modules/monitoring/bin/action/list.inc.php
index e49b6a71f..65a0ca61d 100644
--- a/modules/monitoring/bin/action/list.inc.php
+++ b/modules/monitoring/bin/action/list.inc.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php
index 3d3ffdf65..8149c1c67 100644
--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php
index 75998e3de..5d600be03 100644
--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php
index 81712bdff..eedb2f1e9 100644
--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php
index 4d4bf82dc..f0f927487 100644
--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php
index 7abb466ca..e557f4c7b 100644
--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/RuntimesummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/RuntimesummaryQuery.php
index ba550ed54..cf3b6ea6d 100644
--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/RuntimesummaryQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/RuntimesummaryQuery.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/RuntimevariablesQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/RuntimevariablesQuery.php
index b259562b1..479142547 100644
--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/RuntimevariablesQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/RuntimevariablesQuery.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php
index ac3ad16e7..84ad94b86 100644
--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php
index 0338969ed..ce61c8f1b 100644
--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Livestatus/Query/StatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Livestatus/Query/StatusQuery.php
index cdca2e8ae..20ffe57e5 100644
--- a/modules/monitoring/library/Monitoring/Backend/Livestatus/Query/StatusQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Livestatus/Query/StatusQuery.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Statusdat\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ContactQuery.php b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ContactQuery.php
index f69b18452..d4ea895e3 100644
--- a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ContactQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ContactQuery.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Statusdat\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/GroupsummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/GroupsummaryQuery.php
index 77b833ffb..1168d6da3 100644
--- a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/GroupsummaryQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/GroupsummaryQuery.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Statusdat\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/HostlistQuery.php b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/HostlistQuery.php
index 810a87fcc..48ee82284 100644
--- a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/HostlistQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/HostlistQuery.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Statusdat\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ServicegroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ServicegroupQuery.php
index a08243ec7..8d3f9a4ec 100644
--- a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ServicegroupQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ServicegroupQuery.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Statusdat\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ServicegroupsummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ServicegroupsummaryQuery.php
index cf76f7744..cd712d801 100644
--- a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ServicegroupsummaryQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ServicegroupsummaryQuery.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Statusdat\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ServicelistQuery.php b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ServicelistQuery.php
index dabc7026e..86a7310d0 100644
--- a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ServicelistQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/ServicelistQuery.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Statusdat\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusQuery.php
index d17468bd3..e78942f4c 100644
--- a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusQuery.php
@@ -1,11 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Statusdat\Query;
diff --git a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusdatQuery.php b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusdatQuery.php
index 5e6abb4cb..33b006c86 100644
--- a/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusdatQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusdatQuery.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Backend\Statusdat\Query;
diff --git a/modules/monitoring/library/Monitoring/Cli/CliUtils.php b/modules/monitoring/library/Monitoring/Cli/CliUtils.php
index fd894aeb9..5b443c714 100644
--- a/modules/monitoring/library/Monitoring/Cli/CliUtils.php
+++ b/modules/monitoring/library/Monitoring/Cli/CliUtils.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Command;
diff --git a/modules/monitoring/library/Monitoring/Command/AddCommentCommand.php b/modules/monitoring/library/Monitoring/Command/AddCommentCommand.php
index 703735c25..0464d5cb2 100644
--- a/modules/monitoring/library/Monitoring/Command/AddCommentCommand.php
+++ b/modules/monitoring/library/Monitoring/Command/AddCommentCommand.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Command;
diff --git a/modules/monitoring/library/Monitoring/Command/CustomNotificationCommand.php b/modules/monitoring/library/Monitoring/Command/CustomNotificationCommand.php
index 97e55c3d3..21cf22520 100644
--- a/modules/monitoring/library/Monitoring/Command/CustomNotificationCommand.php
+++ b/modules/monitoring/library/Monitoring/Command/CustomNotificationCommand.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Command;
diff --git a/modules/monitoring/library/Monitoring/Command/DelayNotificationCommand.php b/modules/monitoring/library/Monitoring/Command/DelayNotificationCommand.php
index 67c0823b5..7f8dcf749 100644
--- a/modules/monitoring/library/Monitoring/Command/DelayNotificationCommand.php
+++ b/modules/monitoring/library/Monitoring/Command/DelayNotificationCommand.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Command;
diff --git a/modules/monitoring/library/Monitoring/Command/DisableNotificationWithExpireCommand.php b/modules/monitoring/library/Monitoring/Command/DisableNotificationWithExpireCommand.php
index 5c91f0411..d6fb6322a 100644
--- a/modules/monitoring/library/Monitoring/Command/DisableNotificationWithExpireCommand.php
+++ b/modules/monitoring/library/Monitoring/Command/DisableNotificationWithExpireCommand.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Command;
diff --git a/modules/monitoring/library/Monitoring/Command/ScheduleCheckCommand.php b/modules/monitoring/library/Monitoring/Command/ScheduleCheckCommand.php
index 14b8d4794..7908e637d 100644
--- a/modules/monitoring/library/Monitoring/Command/ScheduleCheckCommand.php
+++ b/modules/monitoring/library/Monitoring/Command/ScheduleCheckCommand.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Command;
diff --git a/modules/monitoring/library/Monitoring/Command/ScheduleDowntimeCommand.php b/modules/monitoring/library/Monitoring/Command/ScheduleDowntimeCommand.php
index 50b55ed8a..e1d79ddce 100644
--- a/modules/monitoring/library/Monitoring/Command/ScheduleDowntimeCommand.php
+++ b/modules/monitoring/library/Monitoring/Command/ScheduleDowntimeCommand.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Command;
diff --git a/modules/monitoring/library/Monitoring/Command/SingleArgumentCommand.php b/modules/monitoring/library/Monitoring/Command/SingleArgumentCommand.php
index 162c8f3ef..27fecd48d 100644
--- a/modules/monitoring/library/Monitoring/Command/SingleArgumentCommand.php
+++ b/modules/monitoring/library/Monitoring/Command/SingleArgumentCommand.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Command;
diff --git a/modules/monitoring/library/Monitoring/Command/SubmitPassiveCheckresultCommand.php b/modules/monitoring/library/Monitoring/Command/SubmitPassiveCheckresultCommand.php
index ce79ece2f..262987de1 100644
--- a/modules/monitoring/library/Monitoring/Command/SubmitPassiveCheckresultCommand.php
+++ b/modules/monitoring/library/Monitoring/Command/SubmitPassiveCheckresultCommand.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Command;
diff --git a/modules/monitoring/library/Monitoring/Controller.php b/modules/monitoring/library/Monitoring/Controller.php
index fd1358c12..32bafb8b2 100644
--- a/modules/monitoring/library/Monitoring/Controller.php
+++ b/modules/monitoring/library/Monitoring/Controller.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring;
@@ -86,4 +61,4 @@ class Controller extends ModuleActionController
}
}
}
-// @codingStandardsIgnoreEnd
+
diff --git a/modules/monitoring/library/Monitoring/DataView/Comment.php b/modules/monitoring/library/Monitoring/DataView/Comment.php
index 1047854a0..4d62fd27c 100644
--- a/modules/monitoring/library/Monitoring/DataView/Comment.php
+++ b/modules/monitoring/library/Monitoring/DataView/Comment.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/DataView/Contact.php b/modules/monitoring/library/Monitoring/DataView/Contact.php
index d095e2982..7d24d1255 100644
--- a/modules/monitoring/library/Monitoring/DataView/Contact.php
+++ b/modules/monitoring/library/Monitoring/DataView/Contact.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/DataView/DataView.php b/modules/monitoring/library/Monitoring/DataView/DataView.php
index 5d8301749..b8ccbb852 100644
--- a/modules/monitoring/library/Monitoring/DataView/DataView.php
+++ b/modules/monitoring/library/Monitoring/DataView/DataView.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/DataView/Downtime.php b/modules/monitoring/library/Monitoring/DataView/Downtime.php
index 73eb5c547..8bd97673a 100644
--- a/modules/monitoring/library/Monitoring/DataView/Downtime.php
+++ b/modules/monitoring/library/Monitoring/DataView/Downtime.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/DataView/EventHistory.php b/modules/monitoring/library/Monitoring/DataView/EventHistory.php
index b1b76459b..09779b27d 100644
--- a/modules/monitoring/library/Monitoring/DataView/EventHistory.php
+++ b/modules/monitoring/library/Monitoring/DataView/EventHistory.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php
index dc1a2ed4b..a623dab45 100644
--- a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php
+++ b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/DataView/HostStatus.php b/modules/monitoring/library/Monitoring/DataView/HostStatus.php
index 9bf1f97a1..60f224264 100644
--- a/modules/monitoring/library/Monitoring/DataView/HostStatus.php
+++ b/modules/monitoring/library/Monitoring/DataView/HostStatus.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/DataView/Hostgroup.php b/modules/monitoring/library/Monitoring/DataView/Hostgroup.php
index fc5090b65..94fc7ac56 100644
--- a/modules/monitoring/library/Monitoring/DataView/Hostgroup.php
+++ b/modules/monitoring/library/Monitoring/DataView/Hostgroup.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
diff --git a/modules/monitoring/library/Monitoring/DataView/Notification.php b/modules/monitoring/library/Monitoring/DataView/Notification.php
index cf2882c06..6156a5f15 100644
--- a/modules/monitoring/library/Monitoring/DataView/Notification.php
+++ b/modules/monitoring/library/Monitoring/DataView/Notification.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/DataView/Runtimesummary.php b/modules/monitoring/library/Monitoring/DataView/Runtimesummary.php
index 1ea362b49..d9d15a517 100644
--- a/modules/monitoring/library/Monitoring/DataView/Runtimesummary.php
+++ b/modules/monitoring/library/Monitoring/DataView/Runtimesummary.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/DataView/Runtimevariables.php b/modules/monitoring/library/Monitoring/DataView/Runtimevariables.php
index 2b41c3957..dbdd338c0 100644
--- a/modules/monitoring/library/Monitoring/DataView/Runtimevariables.php
+++ b/modules/monitoring/library/Monitoring/DataView/Runtimevariables.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php b/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php
index 108261b89..b81b56764 100644
--- a/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php
+++ b/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/DataView/Servicegroup.php b/modules/monitoring/library/Monitoring/DataView/Servicegroup.php
index d3f65d79c..00a6f7d5f 100644
--- a/modules/monitoring/library/Monitoring/DataView/Servicegroup.php
+++ b/modules/monitoring/library/Monitoring/DataView/Servicegroup.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
diff --git a/modules/monitoring/library/Monitoring/DataView/StateHistorySummary.php b/modules/monitoring/library/Monitoring/DataView/StateHistorySummary.php
index 0f2a27837..0c7ca68a5 100644
--- a/modules/monitoring/library/Monitoring/DataView/StateHistorySummary.php
+++ b/modules/monitoring/library/Monitoring/DataView/StateHistorySummary.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/DataView/StatusSummary.php b/modules/monitoring/library/Monitoring/DataView/StatusSummary.php
index efba4e37d..74574bc72 100644
--- a/modules/monitoring/library/Monitoring/DataView/StatusSummary.php
+++ b/modules/monitoring/library/Monitoring/DataView/StatusSummary.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\DataView;
diff --git a/modules/monitoring/library/Monitoring/Environment.php b/modules/monitoring/library/Monitoring/Environment.php
index 0213118a2..f9ad28654 100644
--- a/modules/monitoring/library/Monitoring/Environment.php
+++ b/modules/monitoring/library/Monitoring/Environment.php
@@ -1,4 +1,6 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
diff --git a/modules/monitoring/library/Monitoring/Object/AbstractObject.php b/modules/monitoring/library/Monitoring/Object/AbstractObject.php
index 17be0cacf..73314fbc9 100644
--- a/modules/monitoring/library/Monitoring/Object/AbstractObject.php
+++ b/modules/monitoring/library/Monitoring/Object/AbstractObject.php
@@ -1,4 +1,6 @@
perfdataValue = $perfdataValue;
+ $this->perfdataValue = $value;
+ $this->label = $label;
$this->parse();
if ($this->unit === '%') {
@@ -78,25 +87,30 @@ class Perfdata
}
/**
- * Return a new Perfdata object based on the given performance data value
+ * Return a new Perfdata object based on the given performance data key=value pair
*
- * @param string $perfdataValue The value to parse
+ * @param string $perfdata The key=value pair to parse
*
* @return Perfdata
*
- * @throws ProgrammingError In case the given performance data value has no content
+ * @throws InvalidArgumentException In case the given performance data has no content or a invalid format
*/
- public static function fromString($perfdataValue)
+ public static function fromString($perfdata)
{
- if (empty($perfdataValue)) {
- throw new ProgrammingError('Perfdata::fromString expects a string with content');
+ if (empty($perfdata)) {
+ throw new InvalidArgumentException('Perfdata::fromString expects a string with content');
+ } elseif (false === strpos($perfdata, '=')) {
+ throw new InvalidArgumentException(
+ 'Perfdata::fromString expects a key=value formatted string. Got "' . $perfdata . '" instead'
+ );
}
- return new static($perfdataValue);
+ list($label, $value) = explode('=', $perfdata, 2);
+ return new static(trim($label), trim($value));
}
/**
- * Return whether this performance data value is a number
+ * Return whether this performance data's value is a number
*
* @return bool True in case it's a number, otherwise False
*/
@@ -106,7 +120,7 @@ class Perfdata
}
/**
- * Return whether this performance data value are seconds
+ * Return whether this performance data's value are seconds
*
* @return bool True in case it's seconds, otherwise False
*/
@@ -116,7 +130,7 @@ class Perfdata
}
/**
- * Return whether this performance data value is in percentage
+ * Return whether this performance data's value is in percentage
*
* @return bool True in case it's in percentage, otherwise False
*/
@@ -126,7 +140,7 @@ class Perfdata
}
/**
- * Return whether this performance data value is in bytes
+ * Return whether this performance data's value is in bytes
*
* @return bool True in case it's in bytes, otherwise False
*/
@@ -136,7 +150,7 @@ class Perfdata
}
/**
- * Return whether this performance data value is a counter
+ * Return whether this performance data's value is a counter
*
* @return bool True in case it's a counter, otherwise False
*/
@@ -145,6 +159,14 @@ class Perfdata
return $this->unit === 'c';
}
+ /**
+ * Return this perfomance data's label
+ */
+ public function getLabel()
+ {
+ return $this->label;
+ }
+
/**
* Return the value or null if it is unknown (U)
*
@@ -176,7 +198,7 @@ class Perfdata
}
/**
- * Return this value's warning treshold or null if it is not available
+ * Return this performance data's warning treshold or null if it is not available
*
* @return null|string
*/
@@ -186,7 +208,7 @@ class Perfdata
}
/**
- * Return this value's critical treshold or null if it is not available
+ * Return this performance data's critical treshold or null if it is not available
*
* @return null|string
*/
@@ -215,6 +237,16 @@ class Perfdata
return $this->maxValue;
}
+ /**
+ * Return this performance data as string
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf(strpos($this->label, ' ') === false ? '%s=%s' : "'%s'=%s", $this->label, $this->perfdataValue);
+ }
+
/**
* Parse the current performance data value
*
diff --git a/modules/monitoring/library/Monitoring/Plugin/PerfdataSet.php b/modules/monitoring/library/Monitoring/Plugin/PerfdataSet.php
index 8038354a4..c62904bb3 100644
--- a/modules/monitoring/library/Monitoring/Plugin/PerfdataSet.php
+++ b/modules/monitoring/library/Monitoring/Plugin/PerfdataSet.php
@@ -85,7 +85,7 @@ class PerfdataSet implements IteratorAggregate
$value = trim($this->readUntil(' '));
if ($label && $value) {
- $this->perfdata[$label] = Perfdata::fromString($value);
+ $this->perfdata[] = new Perfdata($label, $value);
}
}
}
diff --git a/modules/monitoring/library/Monitoring/Web/Hook/TopBar.php b/modules/monitoring/library/Monitoring/Web/Hook/TopBar.php
index 9fa981c99..32efaca9a 100644
--- a/modules/monitoring/library/Monitoring/Web/Hook/TopBar.php
+++ b/modules/monitoring/library/Monitoring/Web/Hook/TopBar.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Monitoring\Web\Hook;
diff --git a/modules/monitoring/public/css/module.less b/modules/monitoring/public/css/module.less
index d7e3dbe38..1d60b75c7 100644
--- a/modules/monitoring/public/css/module.less
+++ b/modules/monitoring/public/css/module.less
@@ -1,3 +1,6 @@
+// {{{ICINGA_LICENSE_HEADER}}}
+// {{{ICINGA_LICENSE_HEADER}}}
+
table.action.comments td p, table.action.downtimes td p {
margin: 0;
font-size: 0.8em;
@@ -29,3 +32,24 @@ table.objectstate td.state {
padding-top: 0.5em;
padding-bottom: 0.5em;
}
+
+div.contacts div.contact {
+ background-color: lightgray;
+ padding: 0.5em;
+ border-radius: 0.5em;
+ overflow: hidden;
+ margin: 0.125em;
+ float: left;
+}
+
+div.contacts div.contact > img {
+ width: 60px;
+ border: 4px solid white;
+ border-radius: 8px;
+ margin-right: 8px;
+ float: left;
+}
+
+div.contacts div.notification-periods {
+ margin-top: 0.5em;
+}
diff --git a/modules/monitoring/public/js/module.js b/modules/monitoring/public/js/module.js
index ea31f18d8..b3ba863ff 100644
--- a/modules/monitoring/public/js/module.js
+++ b/modules/monitoring/public/js/module.js
@@ -1,3 +1,5 @@
+// {{{ICINGA_LICENSE_HEADER}}}
+// {{{ICINGA_LICENSE_HEADER}}}
(function(Icinga) {
diff --git a/modules/monitoring/run.php b/modules/monitoring/run.php
index 51ca985c7..8f4ee1b67 100644
--- a/modules/monitoring/run.php
+++ b/modules/monitoring/run.php
@@ -1,10 +1,6 @@
registerHook(
'TopBar',
diff --git a/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataSetTest.php b/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataSetTest.php
index 86c0f71a7..3edd20857 100644
--- a/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataSetTest.php
+++ b/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataSetTest.php
@@ -17,19 +17,19 @@ class PerfdataSetTest extends BaseTestCase
public function testWhetherValidSimplePerfdataLabelsAreProperlyParsed()
{
$pset = PerfdataSetWithPublicData::fromString('key1=val1 key2=val2 key3 =val3');
- $this->assertArrayHasKey(
+ $this->assertEquals(
'key1',
- $pset->perfdata,
+ $pset->perfdata[0]->getLabel(),
'PerfdataSet does not correctly parse valid simple labels'
);
- $this->assertArrayHasKey(
+ $this->assertEquals(
'key2',
- $pset->perfdata,
+ $pset->perfdata[1]->getLabel(),
'PerfdataSet does not correctly parse valid simple labels'
);
- $this->assertArrayHasKey(
+ $this->assertEquals(
'key3',
- $pset->perfdata,
+ $pset->perfdata[2]->getLabel(),
'PerfdataSet does not correctly parse valid simple labels'
);
}
@@ -37,14 +37,14 @@ class PerfdataSetTest extends BaseTestCase
public function testWhetherNonQuotedPerfdataLablesWithSpacesAreProperlyParsed()
{
$pset = PerfdataSetWithPublicData::fromString('key 1=val1 key 1 + 1=val2');
- $this->assertArrayHasKey(
+ $this->assertEquals(
'key 1',
- $pset->perfdata,
+ $pset->perfdata[0]->getLabel(),
'PerfdataSet does not correctly parse non quoted labels with spaces'
);
- $this->assertArrayHasKey(
+ $this->assertEquals(
'key 1 + 1',
- $pset->perfdata,
+ $pset->perfdata[1]->getLabel(),
'PerfdataSet does not correctly parse non quoted labels with spaces'
);
}
@@ -52,14 +52,14 @@ class PerfdataSetTest extends BaseTestCase
public function testWhetherValidQuotedPerfdataLabelsAreProperlyParsed()
{
$pset = PerfdataSetWithPublicData::fromString('\'key 1\'=val1 "key 2"=val2');
- $this->assertArrayHasKey(
+ $this->assertEquals(
'key 1',
- $pset->perfdata,
+ $pset->perfdata[0]->getLabel(),
'PerfdataSet does not correctly parse valid quoted labels'
);
- $this->assertArrayHasKey(
+ $this->assertEquals(
'key 2',
- $pset->perfdata,
+ $pset->perfdata[1]->getLabel(),
'PerfdataSet does not correctly parse valid quoted labels'
);
}
@@ -67,14 +67,14 @@ class PerfdataSetTest extends BaseTestCase
public function testWhetherInvalidQuotedPerfdataLabelsAreProperlyParsed()
{
$pset = PerfdataSetWithPublicData::fromString('\'key 1=val1 key 2"=val2');
- $this->assertArrayHasKey(
+ $this->assertEquals(
'key 1',
- $pset->perfdata,
+ $pset->perfdata[0]->getLabel(),
'PerfdataSet does not correctly parse invalid quoted labels'
);
- $this->assertArrayHasKey(
+ $this->assertEquals(
'key 2"',
- $pset->perfdata,
+ $pset->perfdata[1]->getLabel(),
'PerfdataSet does not correctly parse invalid quoted labels'
);
}
@@ -85,8 +85,8 @@ class PerfdataSetTest extends BaseTestCase
public function testWhetherAPerfdataSetIsIterable()
{
$pset = PerfdataSet::fromString('key=value');
- foreach ($pset as $label => $value) {
- $this->assertEquals('key', $label);
+ foreach ($pset as $p) {
+ $this->assertEquals('key', $p->getLabel());
return;
}
diff --git a/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataTest.php b/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataTest.php
index be1de875e..2d8a98b73 100644
--- a/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataTest.php
+++ b/modules/monitoring/test/php/library/Monitoring/Plugin/PerfdataTest.php
@@ -10,142 +10,189 @@ use Icinga\Module\Monitoring\Plugin\Perfdata;
class PerfdataTest extends BaseTestCase
{
/**
- * @expectedException Icinga\Exception\ProgrammingError
+ * @expectedException \InvalidArgumentException
*/
public function testWhetherFromStringThrowsExceptionWhenGivenAnEmptyString()
{
Perfdata::fromString('');
}
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testWhetherFromStringThrowsExceptionWhenGivenAnInvalidString()
+ {
+ Perfdata::fromString('test');
+ }
+
+ public function testWhetherFromStringParsesAGivenStringCorrectly()
+ {
+ $p = Perfdata::fromString('key=1234');
+ $this->assertEquals(
+ 'key',
+ $p->getLabel(),
+ 'Perfdata::fromString does not properly parse performance data labels'
+ );
+ $this->assertEquals(
+ 1234,
+ $p->getValue(),
+ 'Perfdata::fromString does not properly parse performance data values'
+ );
+ }
+
+ /**
+ * @depends testWhetherFromStringParsesAGivenStringCorrectly
+ */
public function testWhetherGetValueReturnsValidValues()
{
$this->assertEquals(
1337.0,
- Perfdata::fromString('1337')->getValue(),
+ Perfdata::fromString('test=1337')->getValue(),
'Perfdata::getValue does not return correct values'
);
$this->assertEquals(
1337.0,
- Perfdata::fromString('1337;;;;')->getValue(),
+ Perfdata::fromString('test=1337;;;;')->getValue(),
'Perfdata::getValue does not return correct values'
);
}
+ /**
+ * @depends testWhetherFromStringParsesAGivenStringCorrectly
+ */
public function testWhetherDecimalValuesAreCorrectlyParsed()
{
$this->assertEquals(
1337.5,
- Perfdata::fromString('1337.5')->getValue(),
+ Perfdata::fromString('test=1337.5')->getValue(),
'Perfdata objects do not parse decimal values correctly'
);
$this->assertEquals(
1337.5,
- Perfdata::fromString('1337.5B')->getValue(),
+ Perfdata::fromString('test=1337.5B')->getValue(),
'Perfdata objects do not parse decimal values correctly'
);
}
+ /**
+ * @depends testWhetherFromStringParsesAGivenStringCorrectly
+ */
public function testWhetherGetValueReturnsNullForInvalidOrUnknownValues()
{
$this->assertNull(
- Perfdata::fromString('U')->getValue(),
+ Perfdata::fromString('test=U')->getValue(),
'Perfdata::getValue does not return null for unknown values'
);
$this->assertNull(
- Perfdata::fromString('i am not a value')->getValue(),
+ Perfdata::fromString('test=i am not a value')->getValue(),
'Perfdata::getValue does not return null for invalid values'
);
}
+ /**
+ * @depends testWhetherFromStringParsesAGivenStringCorrectly
+ */
public function testWhetherGetWarningTresholdReturnsCorrectValues()
{
$this->assertEquals(
'10',
- Perfdata::fromString('1;10')->getWarningThreshold(),
+ Perfdata::fromString('test=1;10')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values'
);
$this->assertEquals(
'10:',
- Perfdata::fromString('1;10:')->getWarningThreshold(),
+ Perfdata::fromString('test=1;10:')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values'
);
$this->assertEquals(
'~:10',
- Perfdata::fromString('1;~:10')->getWarningThreshold(),
+ Perfdata::fromString('test=1;~:10')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values'
);
$this->assertEquals(
'10:20',
- Perfdata::fromString('1;10:20')->getWarningThreshold(),
+ Perfdata::fromString('test=1;10:20')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values'
);
$this->assertEquals(
'@10:20',
- Perfdata::fromString('1;@10:20')->getWarningThreshold(),
+ Perfdata::fromString('test=1;@10:20')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values'
);
}
+ /**
+ * @depends testWhetherFromStringParsesAGivenStringCorrectly
+ */
public function testWhetherGetCriticalTresholdReturnsCorrectValues()
{
$this->assertEquals(
'10',
- Perfdata::fromString('1;;10')->getCriticalThreshold(),
+ Perfdata::fromString('test=1;;10')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values'
);
$this->assertEquals(
'10:',
- Perfdata::fromString('1;;10:')->getCriticalThreshold(),
+ Perfdata::fromString('test=1;;10:')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values'
);
$this->assertEquals(
'~:10',
- Perfdata::fromString('1;;~:10')->getCriticalThreshold(),
+ Perfdata::fromString('test=1;;~:10')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values'
);
$this->assertEquals(
'10:20',
- Perfdata::fromString('1;;10:20')->getCriticalThreshold(),
+ Perfdata::fromString('test=1;;10:20')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values'
);
$this->assertEquals(
'@10:20',
- Perfdata::fromString('1;;@10:20')->getCriticalThreshold(),
+ Perfdata::fromString('test=1;;@10:20')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values'
);
}
+ /**
+ * @depends testWhetherFromStringParsesAGivenStringCorrectly
+ */
public function testWhetherGetMinimumValueReturnsCorrectValues()
{
$this->assertEquals(
1337.0,
- Perfdata::fromString('1;;;1337')->getMinimumValue(),
+ Perfdata::fromString('test=1;;;1337')->getMinimumValue(),
'Perfdata::getMinimumValue does not return correct values'
);
$this->assertEquals(
1337.5,
- Perfdata::fromString('1;;;1337.5')->getMinimumValue(),
+ Perfdata::fromString('test=1;;;1337.5')->getMinimumValue(),
'Perfdata::getMinimumValue does not return correct values'
);
}
+ /**
+ * @depends testWhetherFromStringParsesAGivenStringCorrectly
+ */
public function testWhetherGetMaximumValueReturnsCorrectValues()
{
$this->assertEquals(
1337.0,
- Perfdata::fromString('1;;;;1337')->getMaximumValue(),
+ Perfdata::fromString('test=1;;;;1337')->getMaximumValue(),
'Perfdata::getMaximumValue does not return correct values'
);
$this->assertEquals(
1337.5,
- Perfdata::fromString('1;;;;1337.5')->getMaximumValue(),
+ Perfdata::fromString('test=1;;;;1337.5')->getMaximumValue(),
'Perfdata::getMaximumValue does not return correct values'
);
}
+ /**
+ * @depends testWhetherFromStringParsesAGivenStringCorrectly
+ */
public function testWhetherMissingValuesAreReturnedAsNull()
{
- $perfdata = Perfdata::fromString('1;;3;5');
+ $perfdata = Perfdata::fromString('test=1;;3;5');
$this->assertNull(
$perfdata->getWarningThreshold(),
'Perfdata objects do not return null for missing warning tresholds'
@@ -162,7 +209,7 @@ class PerfdataTest extends BaseTestCase
public function testWhetherValuesAreIdentifiedAsNumber()
{
$this->assertTrue(
- Perfdata::fromString('666')->isNumber(),
+ Perfdata::fromString('test=666')->isNumber(),
'Perfdata objects do not identify ordinary digits as number'
);
}
@@ -173,15 +220,15 @@ class PerfdataTest extends BaseTestCase
public function testWhetherValuesAreIdentifiedAsSeconds()
{
$this->assertTrue(
- Perfdata::fromString('666s')->isSeconds(),
+ Perfdata::fromString('test=666s')->isSeconds(),
'Perfdata objects do not identify seconds as seconds'
);
$this->assertTrue(
- Perfdata::fromString('666us')->isSeconds(),
+ Perfdata::fromString('test=666us')->isSeconds(),
'Perfdata objects do not identify microseconds as seconds'
);
$this->assertTrue(
- Perfdata::fromString('666ms')->isSeconds(),
+ Perfdata::fromString('test=666ms')->isSeconds(),
'Perfdata objects do not identify milliseconds as seconds'
);
}
@@ -192,7 +239,7 @@ class PerfdataTest extends BaseTestCase
public function testWhetherValuesAreIdentifiedAsPercentage()
{
$this->assertTrue(
- Perfdata::fromString('66%')->isPercentage(),
+ Perfdata::fromString('test=66%')->isPercentage(),
'Perfdata objects do not identify percentages as percentages'
);
}
@@ -202,7 +249,7 @@ class PerfdataTest extends BaseTestCase
*/
public function testWhetherMinAndMaxAreNotRequiredIfUnitIsInPercent()
{
- $perfdata = Perfdata::fromString('1%');
+ $perfdata = Perfdata::fromString('test=1%');
$this->assertEquals(
0.0,
$perfdata->getMinimumValue(),
@@ -221,23 +268,23 @@ class PerfdataTest extends BaseTestCase
public function testWhetherValuesAreIdentifiedAsBytes()
{
$this->assertTrue(
- Perfdata::fromString('66666B')->isBytes(),
+ Perfdata::fromString('test=66666B')->isBytes(),
'Perfdata objects do not identify bytes as bytes'
);
$this->assertTrue(
- Perfdata::fromString('6666KB')->isBytes(),
+ Perfdata::fromString('test=6666KB')->isBytes(),
'Perfdata objects do not identify kilobytes as bytes'
);
$this->assertTrue(
- Perfdata::fromString('666MB')->isBytes(),
+ Perfdata::fromString('test=666MB')->isBytes(),
'Perfdata objects do not identify megabytes as bytes'
);
$this->assertTrue(
- Perfdata::fromString('66GB')->isBytes(),
+ Perfdata::fromString('test=66GB')->isBytes(),
'Perfdata objects do not identify gigabytes as bytes'
);
$this->assertTrue(
- Perfdata::fromString('6TB')->isBytes(),
+ Perfdata::fromString('test=6TB')->isBytes(),
'Perfdata objects do not identify terabytes as bytes'
);
}
@@ -248,7 +295,7 @@ class PerfdataTest extends BaseTestCase
public function testWhetherValuesAreIdentifiedAsCounter()
{
$this->assertTrue(
- Perfdata::fromString('123c')->isCounter(),
+ Perfdata::fromString('test=123c')->isCounter(),
'Perfdata objects do not identify counters as counters'
);
}
@@ -260,7 +307,7 @@ class PerfdataTest extends BaseTestCase
{
$this->assertEquals(
666 / pow(10, 6),
- Perfdata::fromString('666us')->getValue(),
+ Perfdata::fromString('test=666us')->getValue(),
'Perfdata objects do not correctly convert microseconds to seconds'
);
}
@@ -272,7 +319,7 @@ class PerfdataTest extends BaseTestCase
{
$this->assertEquals(
666 / pow(10, 3),
- Perfdata::fromString('666ms')->getValue(),
+ Perfdata::fromString('test=666ms')->getValue(),
'Perfdata objects do not correctly convert microseconds to seconds'
);
}
@@ -284,20 +331,20 @@ class PerfdataTest extends BaseTestCase
{
$this->assertEquals(
66.0,
- Perfdata::fromString('66%')->getPercentage(),
+ Perfdata::fromString('test=66%')->getPercentage(),
'Perfdata objects do not correctly handle native percentages'
);
$this->assertEquals(
50.0,
- Perfdata::fromString('0;;;-250;250')->getPercentage(),
+ Perfdata::fromString('test=0;;;-250;250')->getPercentage(),
'Perfdata objects do not correctly convert suitable values to percentages'
);
$this->assertNull(
- Perfdata::fromString('50')->getPercentage(),
+ Perfdata::fromString('test=50')->getPercentage(),
'Perfdata objects do return a percentage though their unit is not % and no maximum is given'
);
$this->assertNull(
- Perfdata::fromString('25;;;50;100')->getPercentage(),
+ Perfdata::fromString('test=25;;;50;100')->getPercentage(),
'Perfdata objects do return a percentage though their value is lower than it\'s allowed minimum'
);
}
@@ -309,7 +356,7 @@ class PerfdataTest extends BaseTestCase
{
$this->assertEquals(
6666.0 * pow(2, 10),
- Perfdata::fromString('6666KB')->getValue(),
+ Perfdata::fromString('test=6666KB')->getValue(),
'Perfdata objects do not corretly convert kilobytes to bytes'
);
}
@@ -321,7 +368,7 @@ class PerfdataTest extends BaseTestCase
{
$this->assertEquals(
666.0 * pow(2, 20),
- Perfdata::fromString('666MB')->getValue(),
+ Perfdata::fromString('test=666MB')->getValue(),
'Perfdata objects do not corretly convert megabytes to bytes'
);
}
@@ -333,7 +380,7 @@ class PerfdataTest extends BaseTestCase
{
$this->assertEquals(
66.0 * pow(2, 30),
- Perfdata::fromString('66GB')->getValue(),
+ Perfdata::fromString('test=66GB')->getValue(),
'Perfdata objects do not corretly convert gigabytes to bytes'
);
}
@@ -345,7 +392,7 @@ class PerfdataTest extends BaseTestCase
{
$this->assertEquals(
6.0 * pow(2, 40),
- Perfdata::fromString('6TB')->getValue(),
+ Perfdata::fromString('test=6TB')->getValue(),
'Perfdata objects do not corretly convert terabytes to bytes'
);
}
diff --git a/modules/translation/application/clicommands/CompileCommand.php b/modules/translation/application/clicommands/CompileCommand.php
index be4f6b4f9..77116d74a 100644
--- a/modules/translation/application/clicommands/CompileCommand.php
+++ b/modules/translation/application/clicommands/CompileCommand.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team
- *
- */
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Translation\Clicommands;
diff --git a/modules/translation/application/clicommands/RefreshCommand.php b/modules/translation/application/clicommands/RefreshCommand.php
index 9da6cc9e5..78b58f55c 100644
--- a/modules/translation/application/clicommands/RefreshCommand.php
+++ b/modules/translation/application/clicommands/RefreshCommand.php
@@ -1,30 +1,5 @@
- * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
- * @author Icinga Development Team |