diff --git a/doc/03-Configuration.md b/doc/03-Configuration.md index c79ce66bf..72122f28a 100644 --- a/doc/03-Configuration.md +++ b/doc/03-Configuration.md @@ -69,26 +69,26 @@ configuration file `/etc/icingaweb2/modules/icingadb/config.ini`. ### Available Settings and defaults -Option | Description | Default -----------------------------------|-----------------------------------|------------ -acknowledge_expire | Sets "Use Expire Time" in Acknowledgement dialog. | **0 (false)** -acknowledge_expire_time | Sets the value for "Expire Time" in Acknowledgement dialog, its calculated as now + this setting. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **1 hour (PT1H)**. -acknowledge_notify | Sets "Send Notification" in Acknowledgement dialog. | **1 (true)** -acknowledge_persistent | Sets "Persistent Comment" in Acknowledgement dialog. | **0 (false)** -acknowledge_sticky | Sets "Sticky Acknowledgement" in Acknowledgement dialog. | **0 (false)** -comment_expire | Sets "Use Expire Time" in Comment dialog. | **0 (false)** -hostdowntime_comment_text | Sets default text for "Comment" in Host Downtime dialog | "" -servicedowntime_comment_text | Sets default text for "Comment" in Service Downtime dialog. | "" -comment_expire_time | Sets default value for "Expire Time" in Comment dialog, its calculated as now + this setting. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **1 hour (PT1H)** -custom_notification_forced | Sets "Forced" in Custom Notification dialog. | **0 (false)** -hostdowntime_all_services | Sets "All Services" in Schedule Host Downtime dialog. | **0 (false)** -hostdowntime_end_fixed | Sets default value for "End Time" in Schedule Host Downtime dialog for **Fixed** downtime, its calculated as now + this setting. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **1 hour (PT1H)**. -hostdowntime_end_flexible | Sets default value for "End Time" in Schedule Host Downtime dialog for **Flexible** downtime, its calculated as now + this setting. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **2 hours (PT2H)**. -hostdowntime_flexible_duration | Sets default value for "Flexible Duration" in Schedule Host Downtime dialog for **Flexible** downtime. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **2 hour (PT2H)**. -servicedowntime_end_fixed | Sets default value for "End Time" in Schedule Service Downtime dialog for **Fixed** downtime, its calculated as now + this setting. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **1 hour (PT1H)**. -servicedowntime_end_flexible | Set default value for "End Time" in Schedule Service Downtime dialog for **Flexible** downtime, its calculated as now + this setting. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **1 hour (PT1H)**. -servicedowntime_flexible_duration | Set default value for "Flexible Duration" in Schedule Service Downtime dialog for **Flexible** downtime. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **2 hour (PT2H)**. - +| Option | Description | Default | +|-----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------| +| acknowledge_expire | Toggles "Use Expire Time" in the Acknowledgement dialog. | **0 (false)** | +| acknowledge_expire_time | Sets the value for "Expire Time" in the Acknowledgement dialog. It is calculated as now + this setting. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **1 hour (PT1H)**. | +| acknowledge_notify | Toggles "Send Notification" in the Acknowledgement dialog. | **1 (true)** | +| acknowledge_persistent | Toggles "Persistent Comment" in the Acknowledgement dialog. | **0 (false)** | +| acknowledge_sticky | Toggles "Sticky Acknowledgement" in the Acknowledgement dialog. | **0 (false)** | +| comment_expire | Toggles "Use Expire Time" in the Comment dialog. | **0 (false)** | +| hostdowntime_comment_text | Sets the value for "Comment" in the Host Downtime dialog | "" | +| servicedowntime_comment_text | Sets the value for "Comment" in the Service Downtime dialog. | "" | +| comment_expire_time | Sets the value for "Expire Time" in the Comment dialog. It is calculated as now + this setting. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **1 hour (PT1H)** | +| custom_notification_forced | Toggles "Forced" in the Custom Notification dialog. | **0 (false)** | +| hostdowntime_all_services | Toggles "All Services" in the Schedule Host Downtime dialog. | **0 (false)** | +| hostdowntime_end_fixed | Sets the value for "End Time" in the Schedule Host Downtime dialog for a **Fixed** downtime. It is calculated as now + this setting. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **1 hour (PT1H)**. | +| hostdowntime_end_flexible | Sets the value for "End Time" in the Schedule Host Downtime dialog for a **Flexible** downtime. It is calculated as now + this setting. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **2 hours (PT2H)**. | +| hostdowntime_flexible_duration | Sets the value for "Flexible Duration" in the Schedule Host Downtime dialog for a **Flexible** downtime. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **2 hour (PT2H)**. | +| servicedowntime_end_fixed | Sets the value for "End Time" in the Schedule Service Downtime dialog for a **Fixed** downtime. It is calculated as now + this setting. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **1 hour (PT1H)**. | +| servicedowntime_end_flexible | Sets the value for "End Time" in the Schedule Service Downtime dialog for a **Flexible** downtime. It is calculated as now + this setting. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **1 hour (PT1H)**. | +| servicedowntime_flexible_duration | Sets the value for "Flexible Duration" in the Schedule Service Downtime dialog for a **Flexible** downtime. Format is a [PHP Dateinterval](http://www.php.net/manual/en/dateinterval.construct.php). | **2 hour (PT2H)**. | +| plugin_output_character_limit | Sets the maximum number of characters to display in plugin output. | **10000** | ### Example diff --git a/library/Icingadb/Widget/Detail/EventDetail.php b/library/Icingadb/Widget/Detail/EventDetail.php index aaf76082f..cf0e5cfbb 100644 --- a/library/Icingadb/Widget/Detail/EventDetail.php +++ b/library/Icingadb/Widget/Detail/EventDetail.php @@ -6,6 +6,7 @@ use DateTime; use DateTimeZone; +use Icinga\Application\Config; use Icinga\Date\DateFormatter; use Icinga\Module\Icingadb\Common\Auth; use Icinga\Module\Icingadb\Common\Database; @@ -79,6 +80,10 @@ protected function assembleNotificationEvent(NotificationHistory $notification) ->setCommandName($notification->object_type === 'host' ? $this->event->host->checkcommand_name : $this->event->service->checkcommand_name) + ->setCharacterLimit( + (int) Config::module('icingadb') + ->get('settings', 'plugin_output_character_limit', 10000) + ) ); CopyToClipboard::attachTo($notificationText); @@ -191,6 +196,10 @@ protected function assembleStateChangeEvent(StateHistory $stateChange) $commandOutput = new PluginOutputContainer( (new PluginOutput($stateChange->output . "\n" . $stateChange->long_output)) ->setCommandName($commandName) + ->setCharacterLimit( + (int) Config::module('icingadb') + ->get('settings', 'plugin_output_character_limit', 10000) + ) ); CopyToClipboard::attachTo($commandOutput); diff --git a/library/Icingadb/Widget/Detail/ObjectDetail.php b/library/Icingadb/Widget/Detail/ObjectDetail.php index 4ba0e6984..d3db63111 100644 --- a/library/Icingadb/Widget/Detail/ObjectDetail.php +++ b/library/Icingadb/Widget/Detail/ObjectDetail.php @@ -6,6 +6,7 @@ use Exception; use Icinga\Application\ClassLoader; +use Icinga\Application\Config; use Icinga\Application\Hook; use Icinga\Application\Hook\GrapherHook; use Icinga\Application\Icinga; @@ -425,7 +426,10 @@ protected function createPluginOutput(): array } else { $pluginOutput = new PluginOutputContainer( PluginOutput::fromObject($this->object) - ->setCharacterLimit(10000) + ->setCharacterLimit( + (int) Config::module('icingadb') + ->get('settings', 'plugin_output_character_limit', 10000) + ) ); CopyToClipboard::attachTo($pluginOutput); } diff --git a/phpstan-baseline-standard.neon b/phpstan-baseline-standard.neon index cc744dfed..994c0d556 100644 --- a/phpstan-baseline-standard.neon +++ b/phpstan-baseline-standard.neon @@ -5985,6 +5985,11 @@ parameters: count: 1 path: library/Icingadb/Widget/Detail/EventDetail.php + - + message: "#^Cannot cast mixed to int\\.$#" + count: 2 + path: library/Icingadb/Widget/Detail/EventDetail.php + - message: "#^Method Icinga\\\\Module\\\\Icingadb\\\\Widget\\\\Detail\\\\EventDetail\\:\\:assemble\\(\\) has no return type specified\\.$#" count: 1 @@ -6265,6 +6270,11 @@ parameters: count: 4 path: library/Icingadb/Widget/Detail/ObjectDetail.php + - + message: "#^Cannot cast mixed to int\\.$#" + count: 1 + path: library/Icingadb/Widget/Detail/ObjectDetail.php + - message: "#^Method Icinga\\\\Module\\\\Icingadb\\\\Widget\\\\Detail\\\\ObjectDetail\\:\\:__construct\\(\\) has parameter \\$object with no type specified\\.$#" count: 1