Add imports support to Service
This commit is contained in:
parent
bc57937078
commit
fd74a8dfd5
|
@ -84,5 +84,10 @@ class IcingaServiceForm extends DirectorObjectForm
|
||||||
'label' => $this->translate('Servicegroups'),
|
'label' => $this->translate('Servicegroups'),
|
||||||
'description' => $this->translate('One or more comma separated servicegroup names')
|
'description' => $this->translate('One or more comma separated servicegroup names')
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$this->addElement('text', 'imports', array(
|
||||||
|
'label' => $this->translate('Imports'),
|
||||||
|
'description' => $this->translate('The inherited service template names')
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,8 @@ class IcingaService extends IcingaObject
|
||||||
|
|
||||||
protected $supportsCustomVars = true;
|
protected $supportsCustomVars = true;
|
||||||
|
|
||||||
|
protected $supportsImports = true;
|
||||||
|
|
||||||
protected function renderCheck_command_id()
|
protected function renderCheck_command_id()
|
||||||
{
|
{
|
||||||
return $this->renderCommandProperty($this->check_command_id);
|
return $this->renderCommandProperty($this->check_command_id);
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
CREATE TABLE icinga_service_inheritance (
|
||||||
|
service_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
parent_service_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
weight MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||||
|
PRIMARY KEY (service_id, parent_service_id),
|
||||||
|
UNIQUE KEY unique_order (service_id, weight),
|
||||||
|
CONSTRAINT icinga_service_inheritance_service
|
||||||
|
FOREIGN KEY host (service_id)
|
||||||
|
REFERENCES icinga_service (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_service_inheritance_parent_service
|
||||||
|
FOREIGN KEY host (parent_service_id)
|
||||||
|
REFERENCES icinga_service (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
@ -384,6 +384,24 @@ CREATE TABLE icinga_service (
|
||||||
ON UPDATE CASCADE
|
ON UPDATE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE icinga_service_inheritance (
|
||||||
|
service_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
parent_service_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
weight MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||||
|
PRIMARY KEY (service_id, parent_service_id),
|
||||||
|
UNIQUE KEY unique_order (service_id, weight),
|
||||||
|
CONSTRAINT icinga_service_inheritance_service
|
||||||
|
FOREIGN KEY host (service_id)
|
||||||
|
REFERENCES icinga_service (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_service_inheritance_parent_service
|
||||||
|
FOREIGN KEY host (parent_service_id)
|
||||||
|
REFERENCES icinga_service (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE icinga_service_var (
|
CREATE TABLE icinga_service_var (
|
||||||
service_id INT(10) UNSIGNED NOT NULL,
|
service_id INT(10) UNSIGNED NOT NULL,
|
||||||
varname VARCHAR(255) DEFAULT NULL,
|
varname VARCHAR(255) DEFAULT NULL,
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
CREATE TABLE icinga_service_inheritance (
|
||||||
|
service_id integer NOT NULL,
|
||||||
|
parent_service_id integer NOT NULL,
|
||||||
|
weight integer DEFAULT NULL,
|
||||||
|
PRIMARY KEY (service_id, parent_service_id),
|
||||||
|
CONSTRAINT icinga_service_inheritance_service
|
||||||
|
FOREIGN KEY (service_id)
|
||||||
|
REFERENCES icinga_service (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_service_inheritance_parent_service
|
||||||
|
FOREIGN KEY (parent_service_id)
|
||||||
|
REFERENCES icinga_service (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX service_inheritance_unique_order ON icinga_service_inheritance (service_id, weight);
|
||||||
|
CREATE INDEX service_inheritance_service ON icinga_service_inheritance (service_id);
|
||||||
|
CREATE INDEX service_inheritance_service_parent ON icinga_service_inheritance (parent_service_id);
|
||||||
|
|
|
@ -473,6 +473,28 @@ CREATE INDEX service_event_command ON icinga_service (event_command_id);
|
||||||
CREATE INDEX service_command_endpoint ON icinga_service (command_endpoint_id);
|
CREATE INDEX service_command_endpoint ON icinga_service (command_endpoint_id);
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE icinga_service_inheritance (
|
||||||
|
service_id integer NOT NULL,
|
||||||
|
parent_service_id integer NOT NULL,
|
||||||
|
weight integer DEFAULT NULL,
|
||||||
|
PRIMARY KEY (service_id, parent_service_id),
|
||||||
|
CONSTRAINT icinga_service_inheritance_service
|
||||||
|
FOREIGN KEY (service_id)
|
||||||
|
REFERENCES icinga_service (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_service_inheritance_parent_service
|
||||||
|
FOREIGN KEY (parent_service_id)
|
||||||
|
REFERENCES icinga_service (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX service_inheritance_unique_order ON icinga_service_inheritance (service_id, weight);
|
||||||
|
CREATE INDEX service_inheritance_service ON icinga_service_inheritance (service_id);
|
||||||
|
CREATE INDEX service_inheritance_service_parent ON icinga_service_inheritance (parent_service_id);
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE icinga_service_var (
|
CREATE TABLE icinga_service_var (
|
||||||
service_id integer NOT NULL,
|
service_id integer NOT NULL,
|
||||||
varname character varying(255) DEFAULT NULL,
|
varname character varying(255) DEFAULT NULL,
|
||||||
|
|
Loading…
Reference in New Issue