From b18bc644404e02b57635bfcc8258e85abb141146 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:44:46 +0200 Subject: Adding upstream version 1.1.1. Signed-off-by: Daniel Baumann --- library/Icingadb/Model/FlappingHistory.php | 91 ++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 library/Icingadb/Model/FlappingHistory.php (limited to 'library/Icingadb/Model/FlappingHistory.php') diff --git a/library/Icingadb/Model/FlappingHistory.php b/library/Icingadb/Model/FlappingHistory.php new file mode 100644 index 0000000..69711eb --- /dev/null +++ b/library/Icingadb/Model/FlappingHistory.php @@ -0,0 +1,91 @@ + t('Environment Id'), + 'endpoint_id' => t('Endpoint Id'), + 'object_type' => t('Object Type'), + 'host_id' => t('Host Id'), + 'service_id' => t('Service Id'), + 'start_time' => t('Flapping Start Time'), + 'end_time' => t('Flapping End Time'), + 'percent_state_change_start' => t('Flapping Percent State Change Start'), + 'percent_state_change_end' => t('Flapping Percent State Change End'), + 'flapping_threshold_low' => t('Flapping Threshold Low'), + 'flapping_threshold_high' => t('Flapping Threshold High') + ]; + } + + public function createBehaviors(Behaviors $behaviors) + { + $behaviors->add(new MillisecondTimestamp([ + 'start_time', + 'end_time' + ])); + + $behaviors->add(new Binary([ + 'id', + 'environment_id', + 'endpoint_id', + 'host_id', + 'service_id' + ])); + } + + public function createRelations(Relations $relations) + { + $relations->belongsTo('endpoint', Endpoint::class); + $relations->belongsTo('environment', Environment::class); + $relations->belongsTo('history', History::class) + ->setCandidateKey('id') + ->setForeignKey('flapping_history_id'); + $relations->belongsTo('host', Host::class); + $relations->belongsTo('service', Service::class)->setJoinType('LEFT'); + } +} -- cgit v1.2.3