2013-06-13 11:33:00 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* Icinga 2 *
|
2017-01-10 15:54:22 +01:00
|
|
|
* Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/) *
|
2013-06-13 11:33:00 +02:00
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU General Public License *
|
|
|
|
* as published by the Free Software Foundation; either version 2 *
|
|
|
|
* of the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the Free Software Foundation *
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
|
|
******************************************************************************/
|
|
|
|
|
2016-08-12 13:44:51 +02:00
|
|
|
System.assert(Internal.run_with_activation_context(function() {
|
2016-08-12 13:42:22 +02:00
|
|
|
var _Internal = Internal.clone()
|
|
|
|
|
|
|
|
template CheckCommand "icinga-check-command" use (_Internal) {
|
|
|
|
execute = _Internal.IcingaCheck
|
|
|
|
}
|
|
|
|
|
|
|
|
template CheckCommand "cluster-check-command" use (_Internal) {
|
|
|
|
execute = _Internal.ClusterCheck
|
2016-08-09 10:40:29 +02:00
|
|
|
}
|
|
|
|
|
2016-08-12 13:42:22 +02:00
|
|
|
template CheckCommand "cluster-zone-check-command" use (_Internal) {
|
|
|
|
execute = _Internal.ClusterZoneCheck
|
2016-08-09 10:40:29 +02:00
|
|
|
}
|
|
|
|
|
2016-08-28 10:27:43 +02:00
|
|
|
template CheckCommand "plugin-check-command" use (_Internal) default {
|
2016-08-12 13:42:22 +02:00
|
|
|
execute = _Internal.PluginCheck
|
2016-08-09 10:40:29 +02:00
|
|
|
}
|
|
|
|
|
2016-08-12 13:42:22 +02:00
|
|
|
template CheckCommand "clr-check-command" use (_Internal) {
|
2016-08-18 10:27:41 +02:00
|
|
|
if (_Internal.ClrCheck) {
|
|
|
|
execute = _Internal.ClrCheck
|
|
|
|
} else {
|
|
|
|
execute = _Internal.NullCheck
|
|
|
|
}
|
2016-08-09 10:40:29 +02:00
|
|
|
}
|
|
|
|
|
2016-08-28 10:27:43 +02:00
|
|
|
template NotificationCommand "plugin-notification-command" use (_Internal) default {
|
2016-08-12 13:42:22 +02:00
|
|
|
execute = _Internal.PluginNotification
|
2016-08-09 10:40:29 +02:00
|
|
|
}
|
|
|
|
|
2016-08-28 10:27:43 +02:00
|
|
|
template EventCommand "plugin-event-command" use (_Internal) default {
|
2016-08-12 13:42:22 +02:00
|
|
|
execute = _Internal.PluginEvent
|
2016-08-09 10:40:29 +02:00
|
|
|
}
|
|
|
|
|
2016-08-12 13:42:22 +02:00
|
|
|
template CheckCommand "random-check-command" use (_Internal) {
|
|
|
|
execute = _Internal.RandomCheck
|
2016-08-09 10:40:29 +02:00
|
|
|
}
|
|
|
|
|
2016-08-12 13:42:22 +02:00
|
|
|
template CheckCommand "exception-check-command" use (_Internal) {
|
|
|
|
execute = _Internal.ExceptionCheck
|
2016-08-09 10:40:29 +02:00
|
|
|
}
|
|
|
|
|
2016-08-12 13:42:22 +02:00
|
|
|
template CheckCommand "null-check-command" use (_Internal) {
|
|
|
|
execute = _Internal.NullCheck
|
|
|
|
}
|
|
|
|
|
|
|
|
template EventCommand "null-event-command" use (_Internal) {
|
|
|
|
execute = _Internal.NullEvent
|
|
|
|
}
|
|
|
|
|
|
|
|
template TimePeriod "empty-timeperiod" use (_Internal) {
|
2016-08-15 16:16:23 +02:00
|
|
|
update = _Internal.EmptyTimePeriod
|
2016-08-12 13:42:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template TimePeriod "even-minutes-timeperiod" use (_Internal) {
|
2016-08-15 16:16:23 +02:00
|
|
|
update = _Internal.EvenMinutesTimePeriod
|
2016-08-09 10:40:29 +02:00
|
|
|
}
|
|
|
|
}))
|
2016-08-12 13:42:22 +02:00
|
|
|
|
|
|
|
var methods = [
|
|
|
|
"IcingaCheck",
|
|
|
|
"ClusterCheck",
|
|
|
|
"ClusterZoneCheck",
|
|
|
|
"PluginCheck",
|
|
|
|
"ClrCheck",
|
|
|
|
"PluginNotification",
|
|
|
|
"PluginEvent",
|
|
|
|
"RandomCheck",
|
|
|
|
"ExceptionCheck",
|
|
|
|
"NullCheck",
|
|
|
|
"NullEvent",
|
|
|
|
"EmptyTimePeriod",
|
|
|
|
"EvenMinutesTimePeriod"
|
|
|
|
]
|
|
|
|
|
|
|
|
for (method in methods) {
|
|
|
|
Internal.remove(method)
|
|
|
|
}
|