Remove unsupported livestatus functionality

Signed-off-by: Eric Lippmann <eric.lippmann@icinga.com>
This commit is contained in:
Michael Friedrich 2017-09-28 15:36:52 +02:00 committed by Eric Lippmann
parent 08b52ed8e9
commit ab364e0fc7
37 changed files with 144 additions and 1794 deletions

View File

@ -5,8 +5,3 @@ resource = ido-mysql
[ido-pgsql]
type = ido
resource = ido-pgsql
[livestatus]
disabled = 1
type = livestatus
resource = livestatus

View File

@ -1,86 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
namespace Icinga\Forms\Config\Resource;
use Exception;
use Icinga\Web\Form;
use Icinga\Application\Icinga;
use Icinga\Data\ConfigObject;
use Icinga\Data\ResourceFactory;
/**
* Form class for adding/modifying livestatus resources
*/
class LivestatusResourceForm extends Form
{
/**
* Initialize this form
*/
public function init()
{
$this->setName('form_config_resource_livestatus');
}
/**
* @see Form::createElements()
*/
public function createElements(array $formData)
{
$this->addElement(
'text',
'name',
array(
'required' => true,
'label' => $this->translate('Resource Name'),
'description' => $this->translate('The unique name of this resource')
)
);
$this->addElement(
'text',
'socket',
array(
'required' => true,
'label' => $this->translate('Socket'),
'description' => $this->translate('The path to your livestatus socket used for querying monitoring data'),
'value' => '/var/run/icinga2/cmd/livestatus'
)
);
return $this;
}
/**
* Validate that the current configuration points to a valid resource
*
* @see Form::onSuccess()
*/
public function onSuccess()
{
if (false === static::isValidResource($this)) {
return false;
}
}
/**
* Validate the resource configuration by trying to connect with it
*
* @param Form $form The form to fetch the configuration values from
*
* @return bool Whether validation succeeded or not
*/
public static function isValidResource(Form $form)
{
try {
$resource = ResourceFactory::createResource(new ConfigObject($form->getValues()));
$resource->connect()->disconnect();
} catch (Exception $_) {
$form->addError(
$form->translate('Connectivity validation failed, connection to the given resource not possible.')
);
return false;
}
return true;
}
}

View File

@ -15,7 +15,6 @@ use Icinga\Forms\ConfigForm;
use Icinga\Forms\Config\Resource\DbResourceForm;
use Icinga\Forms\Config\Resource\FileResourceForm;
use Icinga\Forms\Config\Resource\LdapResourceForm;
use Icinga\Forms\Config\Resource\LivestatusResourceForm;
use Icinga\Forms\Config\Resource\SshResourceForm;
use Icinga\Web\Form;
use Icinga\Web\Notification;
@ -59,8 +58,6 @@ class ResourceConfigForm extends ConfigForm
return new DbResourceForm();
} elseif ($type === 'ldap') {
return new LdapResourceForm();
} elseif ($type === 'livestatus') {
return new LivestatusResourceForm();
} elseif ($type === 'file') {
return new FileResourceForm();
} elseif ($type === 'ssh') {
@ -262,7 +259,6 @@ class ResourceConfigForm extends ConfigForm
$resourceTypes = array(
'file' => $this->translate('File'),
'livestatus' => 'Livestatus',
'ssh' => $this->translate('SSH Identity'),
);
if ($resourceType === 'ldap' || Platform::hasLdapSupport()) {

View File

@ -8,16 +8,16 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: dev@icinga.com\n"
"POT-Creation-Date: 2016-05-23 20:16+0300\n"
"PO-Revision-Date: 2016-06-02 10:02+0300\n"
"Last-Translator: Munzir Taha <munzirtaha@gmail.com>\n"
"PO-Revision-Date: 2017-09-28 15:05+0200\n"
"Last-Translator: Michael Friedrich <michael.friedrich@icinga.com>\n"
"Language-Team: Arabic <trans-ar@lists.fedoraproject.org>\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 &&"
" n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
"X-Generator: Lokalize 2.0\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && "
"n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
"X-Generator: Poedit 2.0.3\n"
#: /usr/share/php/Icinga/Web/Form/Validator/InArray.php:16
#, php-format
@ -180,7 +180,7 @@ msgstr "إضافة مستخدم جديد"
#: /usr/share/php/Icinga/Web/Widget/FilterEditor.php:410
msgid "Add another filter"
msgstr "إضافة مرشِّح جديد"
msgstr "إضافة مرشِّح جديد"
#: /usr/share/php/Icinga/Web/Widget/FilterWidget.php:80
msgid "Add filter..."
@ -205,8 +205,8 @@ msgid ""
"All configured authentication methods failed. Please check the system log or "
"Icinga Web 2 log for more information."
msgstr ""
"فشلت جميع طرق التحقق. رجاء قم بفحص سجلات النظام أو سجلات إسنجا وب 2 للمزيد"
" من المعلومات."
"فشلت جميع طرق التحقق. رجاء قم بفحص سجلات النظام أو سجلات إسنجا وب 2 للمزيد من "
"المعلومات."
#: /usr/share/icingaweb2/application/forms/Security/RoleForm.php:68
#, php-format
@ -234,8 +234,8 @@ msgid ""
"An additional filter to use when looking up groups using the specified "
"connection. Leave empty to not to use any additional filter rules."
msgstr ""
"مرشح إضافة لاستخدامه عند البحث عن المجموعات باستخدام الاتصال المحدد. دعه"
" فارغا حتى لا تستخدم أي قوانين مرشحات إضافية."
"مرشح إضافة لاستخدامه عند البحث عن المجموعات باستخدام الاتصال المحدد. دعه "
"فارغا حتى لا تستخدم أي قوانين مرشحات إضافية."
#: /usr/share/icingaweb2/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php:228
#: /usr/share/icingaweb2/application/forms/Config/UserBackend/LdapBackendForm.php:153
@ -243,8 +243,8 @@ msgid ""
"An additional filter to use when looking up users using the specified "
"connection. Leave empty to not to use any additional filter rules."
msgstr ""
"مرشح إضافة لاستخدامه عند البحث عن المستخدمين باستخدام الاتصال المحدد. دعه"
" فارغا حتى لا تستخدم أي قوانين مرشحات إضافية."
"مرشح إضافة لاستخدامه عند البحث عن المستخدمين باستخدام الاتصال المحدد. دعه "
"فارغا حتى لا تستخدم أي قوانين مرشحات إضافية."
#: /usr/share/php/Icinga/Web/Menu.php:274
#: /usr/share/php/Icinga/Application/Web.php:318
@ -282,15 +282,15 @@ msgstr "خدمة المصادقة \"%s\" لا توجد"
#: /usr/share/icingaweb2/application/forms/Config/UserBackendReorderForm.php:65
msgid "Authentication order updated"
msgstr "حُدِّث ترتيب المصادقة"
msgstr "حُدِّث ترتيب المصادقة"
#: /usr/share/icingaweb2/application/forms/AutoRefreshForm.php:44
msgid "Auto refresh successfully disabled"
msgstr "عُطِّل التحديث التلقائي"
msgstr "عُطِّل التحديث التلقائي"
#: /usr/share/icingaweb2/application/forms/AutoRefreshForm.php:41
msgid "Auto refresh successfully enabled"
msgstr "فُعِّل التحديث التلقائي"
msgstr "فُعِّل التحديث التلقائي"
#: /usr/share/php/Icinga/Web/Wizard.php:626
#: /usr/share/php/Icinga/Web/Wizard.php:650
@ -384,8 +384,7 @@ msgstr "لا يمكن البحث هنا"
#: /usr/share/php/Icinga/Repository/IniRepository.php:91
#: /usr/share/php/Icinga/Repository/IniRepository.php:108
#, php-format
msgid ""
"Cannot update. Column \"%s\" holds a section's name which must be unique"
msgid "Cannot update. Column \"%s\" holds a section's name which must be unique"
msgstr "تعذر التحديث. العمود \"%s\" يحوي اسم المقطع الذي يجب أن يكون وحيدا"
#: /usr/share/php/Icinga/Repository/IniRepository.php:123
@ -407,8 +406,8 @@ msgid ""
"Check this box for disallowing users to change the theme. If a default theme "
"is set, it will be used nonetheless"
msgstr ""
"اختر هذا المربع لمنع المستخدمين من تغيير السمة. إذا تم تعيين سمة افتراضية،"
" سيتم استخدامها في جميع الحالات"
"اختر هذا المربع لمنع المستخدمين من تغيير السمة. إذا تم تعيين سمة افتراضية، "
"سيتم استخدامها في جميع الحالات"
#: /usr/share/icingaweb2/application/forms/Config/Resource/DbResourceForm.php:154
msgid ""
@ -417,8 +416,8 @@ msgid ""
"experimental"
msgstr ""
"حدد هذا المربع لاتصالات قاعدة البيانات الثابتة. لا يتم إغلاق الاتصالات "
"المستمرة في نهاية الطلب، ولكنها تخزن في ذاكرة مؤقتة ويعاد "
"استخدامها. وهذه خاصية تجريبية"
"المستمرة في نهاية الطلب، ولكنها تخزن في ذاكرة مؤقتة ويعاد استخدامها. وهذه "
"خاصية تجريبية"
#: /usr/share/icingaweb2/application/forms/Dashboard/DashletForm.php:101
msgid "Check this box if you want to add the dashlet to a new dashboard"
@ -486,8 +485,7 @@ msgstr "تأكيد الإزالة"
#: /usr/share/icingaweb2/application/forms/Config/Resource/LivestatusResourceForm.php:79
msgid ""
"Connectivity validation failed, connection to the given resource not "
"possible."
"Connectivity validation failed, connection to the given resource not possible."
msgstr "فشل التحقق من الاتصال، الاتصال بالمورد المعطى غير ممكن."
#: /usr/share/php/Icinga/Chart/GridChart.php:90
@ -505,10 +503,9 @@ msgid ""
"be symlinked in the module folder, but won't show up in the list of disabled "
"modules."
msgstr ""
"يحتوي على المجلدات التي سيتم البحث فيها عن الوحدات المتاحة، "
"مفصولة بنقطتين. الوحدات التي لا وجود لها في هذه المجلدات يظل "
"بالإمكان ربطها من مجلد الوحدة، لكنها لن تظهر في قائمة الوحدات "
"المعطلة."
"يحتوي على المجلدات التي سيتم البحث فيها عن الوحدات المتاحة، مفصولة بنقطتين. "
"الوحدات التي لا وجود لها في هذه المجلدات يظل بالإمكان ربطها من مجلد الوحدة، "
"لكنها لن تظهر في قائمة الوحدات المعطلة."
#: /usr/share/icingaweb2/application/views/scripts/about/index.phtml:25
msgid "Copyright"
@ -519,8 +516,8 @@ msgid ""
"Could not find any valid user backend resources. Please configure a resource "
"for authentication first."
msgstr ""
"لا يمكن العثور على أي موارد لخلفية المستخدم صالحة. يرجى إعداد مورد "
"للمصادقة أولا."
"لا يمكن العثور على أي موارد لخلفية المستخدم صالحة. يرجى إعداد مورد للمصادقة "
"أولا."
#: /usr/share/icingaweb2/application/views/scripts/dashboard/error.phtml:2
msgid "Could not persist dashboard"
@ -563,8 +560,8 @@ msgid ""
"Create a new backend for authenticating your users. This backend will be "
"added at the end of your authentication order."
msgstr ""
"إنشاء خلفية جديدة لمصادقة المستخدمين. ستضاف هذه الخلفية "
"في نهاية ترتيب المصادقة الخاصة بك."
"إنشاء خلفية جديدة لمصادقة المستخدمين. ستضاف هذه الخلفية في نهاية ترتيب "
"المصادقة الخاصة بك."
#: /usr/share/icingaweb2/application/controllers/UsergroupbackendController.php:42
msgid "Create a new backend to associate users and groups with."
@ -629,8 +626,8 @@ msgid ""
"Currently there is no dashlet available. This might change once you enabled "
"some of the available %s."
msgstr ""
"لا يوجد حاليا لوحة مصغرة متاحة. يمكن لهذا أن يتغير بمجرد "
"تفعيلك لبعض الـ %s المتوفرة."
"لا يوجد حاليا لوحة مصغرة متاحة. يمكن لهذا أن يتغير بمجرد تفعيلك لبعض الـ %s "
"المتوفرة."
#: /usr/share/icingaweb2/application/forms/Dashboard/DashletForm.php:120
#: /usr/share/icingaweb2/application/controllers/DashboardController.php:257
@ -710,8 +707,8 @@ msgid ""
"Details can be found in the application log. (If you don't have access to "
"this log, call your administrator in this case)"
msgstr ""
"يمكن الاطلاع على التفاصيل في سجل التطبيق. (إذا لم يكن لديك "
"وصولا إلى هذا السجل، اتصل بالمسؤول في هذه الحالة)"
"يمكن الاطلاع على التفاصيل في سجل التطبيق. (إذا لم يكن لديك وصولا إلى هذا "
"السجل، اتصل بالمسؤول في هذه الحالة)"
#: /usr/share/icingaweb2/application/forms/AutoRefreshForm.php:65
msgid "Disable auto refresh"
@ -818,9 +815,8 @@ msgid ""
"Enter url being loaded in the dashlet. You can paste the full URL, including "
"filters."
msgstr ""
"أدخل الرابط الذي تم تحميله في اللوحة المصغرة. يمكنك لصق عنوان URL الكامل، بما"
" في ذلك "
"المرشحات."
"أدخل الرابط الذي تم تحميله في اللوحة المصغرة. يمكنك لصق عنوان URL الكامل، بما "
"في ذلك المرشحات."
#: /usr/share/icingaweb2/application/controllers/ErrorController.php:109
msgid "Error"
@ -894,8 +890,8 @@ msgid ""
"Failed to fully parse navigation configuration. Ensure that all referenced "
"parents are existing navigation items: %s"
msgstr ""
"فشل في إجراء تحليل كامل لإعداد التنقل. تأكد من أن جميع الآباء المشار "
"لهم هم عناصر تنقل موجودة: %s"
"فشل في إجراء تحليل كامل لإعداد التنقل. تأكد من أن جميع الآباء المشار لهم هم "
"عناصر تنقل موجودة: %s"
#: /usr/share/php/Icinga/Repository/IniRepository.php:72
#, php-format
@ -970,7 +966,7 @@ msgstr "تصفية هذه القائمة"
#: /usr/share/php/Icinga/Web/Widget/FilterWidget.php:93
msgid "Filtered"
msgstr "مُرشَّح"
msgstr "مُرشَّح"
#: /usr/share/php/Icinga/Web/Wizard.php:662
msgid "Finish"
@ -1117,21 +1113,19 @@ msgstr "أيقونة"
#: /usr/share/icingaweb2/application/views/scripts/authentication/logout.phtml:15
msgid ""
"If this message does not disappear, it might be necessary to quit the "
"current session manually by clearing the cache, or by closing the current "
"browser session."
"If this message does not disappear, it might be necessary to quit the current "
"session manually by clearing the cache, or by closing the current browser "
"session."
msgstr ""
"إذا لم تختفي هذه الرسالة، فقد يكون من اللازم إنهاء "
"الجلسة الحالية يدويا بتنظيف الذاكرة المخبأة أو بإغلاق "
"جلسة المتصفح الحالية."
"إذا لم تختفي هذه الرسالة، فقد يكون من اللازم إنهاء الجلسة الحالية يدويا "
"بتنظيف الذاكرة المخبأة أو بإغلاق جلسة المتصفح الحالية."
#: /usr/share/icingaweb2/application/views/scripts/showConfiguration.phtml:21
msgid ""
"In case you can access the file by yourself, you can open it and insert the "
"config manually:"
msgstr ""
"في حال كان بإمكانك الوصول إلى الملف بنفسك، يمكنك فتحه وإدراج "
"الإعداد يدويا:"
"في حال كان بإمكانك الوصول إلى الملف بنفسك، يمكنك فتحه وإدراج الإعداد يدويا:"
#: /usr/share/icingaweb2/application/views/scripts/user/show.phtml:33
msgid "Inactive"
@ -1165,10 +1159,10 @@ msgid ""
"authentication method by following the instructions in the %1$sdocumentation"
"%3$s or by using our %2$sweb-based setup-wizard%3$s."
msgstr ""
"يبدو أنك لم تقوم بإعداد إسنجا الويب 2 بعد لذلك فأنه من غير الممكن "
"الدخول دون أي أسلوب مصادقة معرف. يرجى تعريف أسلوب "
"مصادقة من خلال اتباع التعليمات في %1$sdocumentation "
"%3$s أو عن طريق استخدام معالج التثبيت%3$s المبني على الوب الخاص بنا%2$"
"يبدو أنك لم تقوم بإعداد إسنجا الويب 2 بعد لذلك فأنه من غير الممكن الدخول دون "
"أي أسلوب مصادقة معرف. يرجى تعريف أسلوب مصادقة من خلال اتباع التعليمات في "
"%1$sdocumentation %3$s أو عن طريق استخدام معالج التثبيت%3$s المبني على الوب "
"الخاص بنا%2$"
#: /usr/share/icingaweb2/application/forms/Config/UserBackend/LdapBackendForm.php:210
msgid "LDAP Base DN"
@ -1514,8 +1508,8 @@ msgid ""
"No authentication methods available. Did you create authentication.ini when "
"setting up Icinga Web 2?"
msgstr ""
"لا يُوجد طرق مصادقة متوفرة. هل قمت بإنشاء authentication.ini "
"عند إعداد إسنجا وب 2؟"
"لا يُوجد طرق مصادقة متوفرة. هل قمت بإنشاء authentication.ini عند إعداد إسنجا "
"وب 2؟"
#: /usr/share/icingaweb2/application/views/scripts/group/list.phtml:22
msgid "No backend found which is able to list user groups"
@ -1572,11 +1566,11 @@ msgstr "بلا"
#: /usr/share/icingaweb2/application/forms/Config/UserGroup/UserGroupForm.php:63
msgid ""
"Note that all users that are currently a member of this group will have "
"their membership cleared automatically."
"Note that all users that are currently a member of this group will have their "
"membership cleared automatically."
msgstr ""
"لاحظ أن جميع المستخدمين الذين هم حاليا أعضاء في هذه المجموعة ستحذف "
"عضويتهم تلقائيا."
"لاحظ أن جميع المستخدمين الذين هم حاليا أعضاء في هذه المجموعة ستحذف عضويتهم "
"تلقائيا."
#: /usr/share/icingaweb2/application/forms/Config/ResourceConfigForm.php:96
msgid "Old resource name missing"
@ -1648,8 +1642,8 @@ msgid ""
"Please note that not all authentication methods were available. Check the "
"system log or Icinga Web 2 log for more information."
msgstr ""
"يرجى ملاحظة أن ليس كل أساليب المصادقة متاحة. تحقق من سجل "
"النظام أو سجل إسنجا الويب 2 لمزيد من المعلومات."
"يرجى ملاحظة أن ليس كل أساليب المصادقة متاحة. تحقق من سجل النظام أو سجل إسنجا "
"الويب 2 لمزيد من المعلومات."
#: /usr/share/icingaweb2/application/forms/Config/UserGroup/AddMemberForm.php:143
msgid ""
@ -1709,8 +1703,7 @@ msgid ""
"Push this button to update the form to reflect the change that was made in "
"the field on the left"
msgstr ""
"ضغط هذا الزر لتحديث النموذج لعكس التغيير الذي تم إجراؤه في "
"الحقل على اليسار"
"ضغط هذا الزر لتحديث النموذج لعكس التغيير الذي تم إجراؤه في الحقل على اليسار"
#: /usr/share/php/Icinga/Web/Form/Decorator/Autosubmit.php:119
msgid ""
@ -1922,8 +1915,7 @@ msgstr "تقييد المجموعات التي يمكن لهذا الدور أن
#: /usr/share/icingaweb2/application/forms/Security/RoleForm.php:53
msgid "Restrict which users this role can share items and information with"
msgstr ""
"تقييد المستخدمين الذين يمكن لهذا الدور أن يشارك معهم العناصر والمعلومات"
msgstr "تقييد المستخدمين الذين يمكن لهذا الدور أن يشارك معهم العناصر والمعلومات"
#: /usr/share/icingaweb2/application/views/scripts/config/module.phtml:68
msgid "Restrictions"
@ -2037,8 +2029,8 @@ msgid ""
"Set whether to show an exception's stacktrace by default. This can also be "
"set in a user's preferences with the appropriate permission."
msgstr ""
"اختيار هل يظهر تتبع مكدس الاستثناء بشكل افتراضي. يمكن أيضا "
"تعيينه في تفضيلات المستخدم مع الإذن المناسب."
"اختيار هل يظهر تتبع مكدس الاستثناء بشكل افتراضي. يمكن أيضا تعيينه في تفضيلات "
"المستخدم مع الإذن المناسب."
#: /usr/share/icingaweb2/application/forms/PreferenceForm.php:224
msgid "Set whether to show an exception's stacktrace."
@ -2251,16 +2243,16 @@ msgid ""
"The filter needs to be expressed as standard LDAP expression, without outer "
"parentheses. (e.g. &(foo=bar)(bar=foo) or foo=bar)"
msgstr ""
"يحتاج المرشح أن يعبر عنه كتعبير LDAP قياسي، دون الأقواس "
"الخارجية. (مثلا: &(foo=bar)(bar=foo) or foo=bar)"
"يحتاج المرشح أن يعبر عنه كتعبير LDAP قياسي، دون الأقواس الخارجية. (مثلا: "
"&(foo=bar)(bar=foo) or foo=bar)"
#: /usr/share/icingaweb2/application/forms/Config/UserBackend/LdapBackendForm.php:157
msgid ""
"The filter needs to be expressed as standard LDAP expression. (e.g. "
"&(foo=bar)(bar=foo) or foo=bar)"
"The filter needs to be expressed as standard LDAP expression. (e.g. &(foo=bar)"
"(bar=foo) or foo=bar)"
msgstr ""
"يحتاج المرشح أن يعبر عنه كتعبير LDAP قياسي، "
"(مثلا: &(foo=bar)(bar=foo) or foo=bar)"
"يحتاج المرشح أن يعبر عنه كتعبير LDAP قياسي، (مثلا: &(foo=bar)(bar=foo) or "
"foo=bar)"
#: /usr/share/icingaweb2/application/forms/Config/UserBackend/ExternalBackendForm.php:54
msgid "The filter pattern must be a valid regular expression."
@ -2271,8 +2263,8 @@ msgid ""
"The filter to use to strip specific parts off from usernames. Leave empty if "
"you do not want to strip off anything."
msgstr ""
"الفلتر المستخدم لتجريد أجزاء معينة من من أسماء المستخدمين. دعه فارغا إذا "
"كنت لا تريد تجريد أي شيء."
"الفلتر المستخدم لتجريد أجزاء معينة من من أسماء المستخدمين. دعه فارغا إذا كنت "
"لا تريد تجريد أي شيء."
#: /usr/share/icingaweb2/application/forms/Config/General/LoggingConfigForm.php:116
msgid "The full path to the log file to write messages to."
@ -2292,11 +2284,9 @@ msgstr "اسم المضيف أو العنوان لخادم LDAP لاستخدام
#: /usr/share/icingaweb2/application/forms/Navigation/NavigationItemForm.php:70
msgid ""
"The icon of this navigation item. Leave blank if you do not want a icon "
"being displayed"
msgstr ""
"أيقونة عنصر التنقل هذا. دعها فارغة إن لم ترد "
"عرض الأيقونة"
"The icon of this navigation item. Leave blank if you do not want a icon being "
"displayed"
msgstr "أيقونة عنصر التنقل هذا. دعها فارغة إن لم ترد عرض الأيقونة"
#: /usr/share/icingaweb2/application/forms/Config/General/LoggingConfigForm.php:54
msgid "The maximum logging level to emit."
@ -2323,17 +2313,13 @@ msgstr "اسم الدور"
msgid ""
"The name of this authentication provider that is used to differentiate it "
"from others"
msgstr ""
"اسم مزود المصادقة لاستخدامه في التفرقة "
"بينه وبين الآخرين"
msgstr "اسم مزود المصادقة لاستخدامه في التفرقة بينه وبين الآخرين"
#: /usr/share/icingaweb2/application/forms/Config/UserBackend/LdapBackendForm.php:59
msgid ""
"The name of this authentication provider that is used to differentiate it "
"from others."
msgstr ""
"اسم مزود المصادقة لاستخدامه في التفرقة "
"بينه وبين الآخرين."
msgstr "اسم مزود المصادقة لاستخدامه في التفرقة بينه وبين الآخرين."
#: /usr/share/icingaweb2/application/forms/Navigation/NavigationConfigForm.php:584
msgid ""
@ -2345,9 +2331,7 @@ msgstr "اسم عنصر التنقل لاستخدامه في التفرقة بي
msgid ""
"The name of this user group backend that is used to differentiate it from "
"others"
msgstr ""
"اسم خلفية مجموعة المستخدم لاستخدامه في التفرقة بينه وبين "
"الآخرين"
msgstr "اسم خلفية مجموعة المستخدم لاستخدامه في التفرقة بينه وبين الآخرين"
#: /usr/share/icingaweb2/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php:123
msgid "The object class used for storing groups on the LDAP server."
@ -2363,16 +2347,16 @@ msgid ""
"The parent item to assign this navigation item to. Select \"None\" to make "
"this a main navigation item"
msgstr ""
"العنصر الأصل لتعيين بند التنقل هذا إليه. اختر \"بلا\" لجعل "
"بند التنقل هذا رئيسيا"
"العنصر الأصل لتعيين بند التنقل هذا إليه. اختر \"بلا\" لجعل بند التنقل هذا "
"رئيسيا"
#: /usr/share/icingaweb2/application/forms/Navigation/MenuItemForm.php:27
msgid ""
"The parent menu to assign this menu entry to. Select \"None\" to make this a "
"main menu entry"
msgstr ""
"القائمة الأم لتعيين مدخل القائمة هذا إليه. اختر \"بلا\" لجعل "
"مدخل القائمة هذا رئيسيا"
"القائمة الأم لتعيين مدخل القائمة هذا إليه. اختر \"بلا\" لجعل مدخل القائمة هذا "
"رئيسيا"
#: /usr/share/icingaweb2/application/forms/Config/Resource/DbResourceForm.php:138
msgid "The password to use for authentication"
@ -2382,18 +2366,13 @@ msgstr "كلمة المرور لاستخدامها في المصادقة"
msgid "The password to use for querying the ldap server"
msgstr "كلمة المرور لاستخدامها في الاستعلام عن خادم ldap"
#: /usr/share/icingaweb2/application/forms/Config/Resource/LivestatusResourceForm.php:45
msgid "The path to your livestatus socket used for querying monitoring data"
msgstr ""
"المسار إلى مقبس livestatus الخاصة بك لاستخدامه في الاستعلام عن بيانات المراقبة"
#: /usr/share/icingaweb2/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php:192
msgid ""
"The path where groups can be found on the LDAP server. Leave empty to select "
"all users available using the specified connection."
msgstr ""
"المسار حيث يمكن العثور على مجموعات على خادم LDAP. اتركه فارغا لتحديد "
"جميع المستخدمين المتوفرين باستخدام الاتصال المحدد."
"المسار حيث يمكن العثور على مجموعات على خادم LDAP. اتركه فارغا لتحديد جميع "
"المستخدمين المتوفرين باستخدام الاتصال المحدد."
#: /usr/share/icingaweb2/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php:273
#: /usr/share/icingaweb2/application/forms/Config/UserBackend/LdapBackendForm.php:212
@ -2401,8 +2380,8 @@ msgid ""
"The path where users can be found on the LDAP server. Leave empty to select "
"all users available using the specified connection."
msgstr ""
"المسار حيث يمكن العثور على مستخدمين على خادم LDAP. اتركه فارغا لتحديد "
"جميع المستخدمين المتوفرين باستخدام الاتصال المحدد."
"المسار حيث يمكن العثور على مستخدمين على خادم LDAP. اتركه فارغا لتحديد جميع "
"المستخدمين المتوفرين باستخدام الاتصال المحدد."
#: /usr/share/icingaweb2/application/forms/Config/Resource/FileResourceForm.php:59
msgid "The pattern by which to identify columns."
@ -2436,8 +2415,8 @@ msgid ""
"\"%s\". Removing the resource can result in noone being able to log in any "
"longer."
msgstr ""
"المورد \"%s\" يستخدم حاليا للمصادقة من قبل خلفية المستخدم \"%s\". "
"إزالة المورد يؤدي إلى عدم قدرة أي أحد على الدخول لفترة أطول."
"المورد \"%s\" يستخدم حاليا للمصادقة من قبل خلفية المستخدم \"%s\". إزالة "
"المورد يؤدي إلى عدم قدرة أي أحد على الدخول لفترة أطول."
#: /usr/share/icingaweb2/application/forms/Navigation/NavigationItemForm.php:39
msgid "The target where to open this navigation item's url"
@ -2482,17 +2461,16 @@ msgid ""
"identifier (e.g. http://example.tld)"
msgstr ""
"عنوان الموقع في بند التنقل هذا. اتركه فارغا إذا كنت تريد فقط للاسم أن يُعرض. "
"لعناوين المواقع الخارجية، تأكد من إلحاقها بمعرف بروتوكول مناسب "
"(مثل: http: //example.tld)"
"لعناوين المواقع الخارجية، تأكد من إلحاقها بمعرف بروتوكول مناسب (مثل: http: //"
"example.tld)"
#: /usr/share/icingaweb2/application/forms/Navigation/DashletForm.php:29
msgid ""
"The url to load in the dashlet. For external urls, make sure to prepend an "
"appropriate protocol identifier (e.g. http://example.tld)"
msgstr ""
"عنوان الموقع لتحميله في اللوحة الصغيرة. لعناوين المواقع الخارجية، تأكد من"
" إلحاقها "
"بمعرف بروتوكول مناسب (مثل: http://example.tld)"
"عنوان الموقع لتحميله في اللوحة الصغيرة. لعناوين المواقع الخارجية، تأكد من "
"إلحاقها بمعرف بروتوكول مناسب (مثل: http://example.tld)"
#: /usr/share/icingaweb2/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php:78
msgid "The user backend to link with this user group backend."
@ -2503,9 +2481,8 @@ msgid ""
"The user dn to use for querying the ldap server. Leave the dn and password "
"empty for attempting an anonymous bind"
msgstr ""
"الاسم المميز للمستخدم لاستخدامه في استعلام خادم ldap. اترك الاسم المميز وكلمة"
" المرور "
"فارغين لمحاولة الربط المجهول"
"الاسم المميز للمستخدم لاستخدامه في استعلام خادم ldap. اترك الاسم المميز وكلمة "
"المرور فارغين لمحاولة الربط المجهول"
#: /usr/share/icingaweb2/application/forms/Config/Resource/DbResourceForm.php:128
msgid "The user name to use for authentication"
@ -2539,8 +2516,8 @@ msgid ""
"This is a child of the navigation item %1$s. You can only unshare this item "
"by unsharing %1$s"
msgstr ""
"هذا تابع لعنصر التنقل %1$s. يمكنك فقط إلغاء مشارك هذا العنصر "
"بإلغاء مشاركة %1$s"
"هذا تابع لعنصر التنقل %1$s. يمكنك فقط إلغاء مشارك هذا العنصر بإلغاء مشاركة "
"%1$s"
#: /usr/share/icingaweb2/application/views/scripts/config/module.phtml:50
msgid "This module has no dependencies"
@ -2555,8 +2532,7 @@ msgid ""
"This option allows you to enable or to disable the global page content auto "
"refresh"
msgstr ""
"هذا الخيار يسمح لك بتفعيل أو تعطيل التحديث "
"التلقائي لمحتوى الصفحة الكامل"
"هذا الخيار يسمح لك بتفعيل أو تعطيل التحديث التلقائي لمحتوى الصفحة الكامل"
#: /usr/share/icingaweb2/application/forms/Navigation/NavigationConfigForm.php:603
msgid "Tick this box to share this item with others"
@ -2581,11 +2557,9 @@ msgstr "واجهة مستخدم تصحيح الأخطاء"
#: /usr/share/icingaweb2/application/forms/Navigation/NavigationConfigForm.php:486
#, php-format
msgid ""
"Unable to delete navigation item \"%s\". There are other items dependent "
"from it: %s"
msgstr ""
"غير قادر على حذف عنصر التنقل \"%s\". هناك عناصر أخرى "
"تابعة له: %s"
"Unable to delete navigation item \"%s\". There are other items dependent from "
"it: %s"
msgstr "غير قادر على حذف عنصر التنقل \"%s\". هناك عناصر أخرى تابعة له: %s"
#: /usr/share/icingaweb2/application/forms/Navigation/NavigationConfigForm.php:526
#, php-format
@ -2593,8 +2567,8 @@ msgid ""
"Unable to unshare navigation item \"%s\". It is dependent from item \"%s\". "
"Dependent items can only be unshared by unsharing their parent"
msgstr ""
"غير قادر على إلغاء مشاركة عنصر التنقل \"%s\". فهو تابع للعنصر \"%s\". "
"العناصر التابعة يمكن إلغاء مشاركتها فقط بإلغاء مشاركة أصلها"
"غير قادر على إلغاء مشاركة عنصر التنقل \"%s\". فهو تابع للعنصر \"%s\". العناصر "
"التابعة يمكن إلغاء مشاركتها فقط بإلغاء مشاركة أصلها"
#: /usr/share/icingaweb2/application/views/scripts/navigation/index.phtml:54
#: /usr/share/icingaweb2/application/views/scripts/navigation/shared.phtml:42
@ -2653,18 +2627,14 @@ msgstr "تحديث خلفية مجموعة مستخدم"
msgid ""
"Upon any of this form's fields were changed, this page is being updated "
"automatically."
msgstr ""
" عند تغيير أي من حقول هذا النموذج، فإن هذه الصفحة يتم تحديثها "
"تلقائيا."
msgstr " عند تغيير أي من حقول هذا النموذج، فإن هذه الصفحة يتم تحديثها تلقائيا."
#: /usr/share/php/Icinga/Web/Form.php:951
#: /usr/share/php/Icinga/Web/Form/Decorator/Autosubmit.php:100
msgid ""
"Upon its value has changed, this field issues an automatic update of this "
"page."
msgstr ""
"عند تغيير قيمتها، فإن هذا الحقل يصدر تحديث تلقائي لهذه "
"الصفحة."
msgstr "عند تغيير قيمتها، فإن هذا الحقل يصدر تحديث تلقائي لهذه الصفحة."
#: /usr/share/icingaweb2/application/views/scripts/dashboard/settings.phtml:14
#: /usr/share/icingaweb2/application/forms/Navigation/NavigationItemForm.php:54
@ -2808,8 +2778,8 @@ msgid ""
"User to log in as on the remote Icinga instance. Please note that key-based "
"SSH login must be possible for this user"
msgstr ""
"الاسم المستخدم لتسجيل الدخول به لحالة إسنجا البعيدة. يرجى ملاحظة أن "
"دخول SSH القائم على مفتاح يجب أن يكون متاحا لهذا المستخدم"
"الاسم المستخدم لتسجيل الدخول به لحالة إسنجا البعيدة. يرجى ملاحظة أن دخول SSH "
"القائم على مفتاح يجب أن يكون متاحا لهذا المستخدم"
#: /usr/share/php/Icinga/Web/Menu.php:294
msgid "Usergroups"
@ -2882,8 +2852,8 @@ msgid ""
"Whether to encrypt communication. Choose STARTTLS or LDAPS for encrypted "
"communication or none for unencrypted communication"
msgstr ""
"سواء لتشفير الاتصالات أو عدمه. اختر STARTTLS أو LDAPS للاتصال "
"المشفر أو \"بلا\" للاتصال غير المشفر"
"سواء لتشفير الاتصالات أو عدمه. اختر STARTTLS أو LDAPS للاتصال المشفر أو \"بلا"
"\" للاتصال غير المشفر"
#: /usr/share/icingaweb2/application/views/scripts/joystickPagination.phtml:70
#: /usr/share/icingaweb2/application/views/scripts/joystickPagination.phtml:96
@ -2913,11 +2883,10 @@ msgstr "ليس لديك أذونات في نظام الملفات للكتابة
#: /usr/share/icingaweb2/application/controllers/UserController.php:229
msgid ""
"You'll need to configure at least one user group backend first that allows "
"to create new memberships"
"You'll need to configure at least one user group backend first that allows to "
"create new memberships"
msgstr ""
"ستحتاج لإعداد خلفية مجموعة مستخدم واحدة على الأقل أولا تسمح "
"بإنشاء عضوية جديدة"
"ستحتاج لإعداد خلفية مجموعة مستخدم واحدة على الأقل أولا تسمح بإنشاء عضوية جديدة"
#: /usr/share/icingaweb2/application/forms/Authentication/LoginForm.php:138
msgid ""
@ -2925,9 +2894,8 @@ msgid ""
"authentication mechanisms. Make sure you'll configure such, otherwise you'll "
"not be able to login."
msgstr ""
"لا يمكنك حاليا المصادقة باستخدام أي من آليات مصادقة "
"خادم الوب. تأكد من أنك سوف تقوم بإعداد واحدة، "
"وإلا فسوف لن تكون قادرا على الدخول."
"لا يمكنك حاليا المصادقة باستخدام أي من آليات مصادقة خادم الوب. تأكد من أنك "
"سوف تقوم بإعداد واحدة، وإلا فسوف لن تكون قادرا على الدخول."
#: /usr/share/icingaweb2/application/forms/PreferenceForm.php:197
msgid "Your Current Language"
@ -3011,5 +2979,3 @@ msgstr "منذ %s"
#: /usr/share/icingaweb2/application/views/scripts/config/devtools.phtml:5
msgid "toggle"
msgstr "تبديل"

View File

@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: Icinga Web 2 (None)\n"
"Report-Msgid-Bugs-To: dev@icinga.com\n"
"POT-Creation-Date: 2017-07-27 11:44+0000\n"
"PO-Revision-Date: 2017-07-27 13:57+0200\n"
"Last-Translator: Markus Frosch <markus.frosch@icinga.com>\n"
"PO-Revision-Date: 2017-09-28 15:04+0200\n"
"Last-Translator: Michael Friedrich <michael.friedrich@icinga.com>\n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -17,7 +17,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Basepath: .\n"
"Language-Team: \n"
"X-Generator: Poedit 1.8.11\n"
"X-Generator: Poedit 2.0.3\n"
"X-Poedit-SearchPath-0: .\n"
#: ../../../../library/Icinga/Web/Form/Validator/InArray.php:16
@ -2732,12 +2732,6 @@ msgstr "Das Kennwort welches zur Authentifizierung benutzt werden soll"
msgid "The password to use for querying the ldap server"
msgstr "Das Kennwort welches zum Abfragen des LDAP-Servers benutzt werden soll"
#: ../../../../application/forms/Config/Resource/LivestatusResourceForm.php:45
msgid "The path to your livestatus socket used for querying monitoring data"
msgstr ""
"Der Pfad zu Ihrem Live-Status Socket, über welchen Monitoring-Daten "
"abgefragt werden sollen"
#: ../../../../application/forms/Config/UserGroup/LdapUserGroupBackendForm.php:210
msgid ""
"The path where groups can be found on the LDAP server. Leave empty to select "

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: Icinga Web 2 (None)\n"
"Report-Msgid-Bugs-To: dev@icinga.com\n"
"POT-Creation-Date: 2015-02-11 15:47+0100\n"
"PO-Revision-Date: 2015-02-28 01:56+0200\n"
"Last-Translator: Mikko Peltokangas <mikko@peltokangas.org>\n"
"PO-Revision-Date: 2017-09-28 15:06+0200\n"
"Last-Translator: Michael Friedrich <michael.friedrich@icinga.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.7.1\n"
"X-Generator: Poedit 2.0.3\n"
"Language: fi_FI\n"
#: /usr/share/icingaweb2/library/Icinga/Web/Menu/MonitoringMenuItemRenderer.php:40
@ -1097,10 +1097,6 @@ msgstr "Tunnistautumiseen käytettävä salasana"
msgid "The password to use for querying the ldap server"
msgstr "LDAP-palvelinkyselyihin käytettävä salasana"
#: /usr/share/icingaweb2/application/forms/Config/Resource/LivestatusResourceForm.php:45
msgid "The path to your livestatus socket used for querying monitoring data"
msgstr "Polku livestatus-socketiin valvontadatan kyselyä varten"
#: /usr/share/icingaweb2/application/forms/Config/Authentication/LdapBackendForm.php:111
msgid ""
"The path where users can be found on the ldap server. Leave empty to select all users "

View File

@ -4,6 +4,13 @@ msgstr ""
"MIME-Version: 1.0\n"
"Language: it_IT\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: Michael Friedrich <michael.friedrich@icinga.com>\n"
"Language-Team: \n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.3\n"
#, php-format
msgid "\"%s\" is not in the list of allowed values."
@ -1780,11 +1787,6 @@ msgstr "Password da usare per l'autenticazione"
msgid "The password to use for querying the ldap server"
msgstr "Password da usare per interrogare il server ldap"
msgid "The path to your livestatus socket used for querying monitoring data"
msgstr ""
"Percorso del socket di livestatus usato per il recupero dei dati di "
"monitoraggio"
msgid ""
"The path where groups can be found on the LDAP server. Leave empty to select "
"all users available using the specified connection."

View File

@ -8,15 +8,15 @@ msgstr ""
"Project-Id-Version: Icinga Web 2 (None)\n"
"Report-Msgid-Bugs-To: dev@icinga.com\n"
"POT-Creation-Date: 2014-12-03 09:11-0200\n"
"PO-Revision-Date: 2014-12-03 09:19-0300\n"
"Last-Translator: Carlos Cesario <carloscesario@gmail.com>\n"
"PO-Revision-Date: 2017-09-28 15:07+0200\n"
"Last-Translator: Michael Friedrich <michael.friedrich@icinga.com>\n"
"Language: pt_BR\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.5.4\n"
"X-Generator: Poedit 2.0.3\n"
"Language-Team: \n"
#: /usr/local/icingaweb/library/Icinga/Web/Menu/MonitoringMenuItemRenderer.php:41
#, php-format
@ -1172,12 +1172,6 @@ msgstr "A senha a ser utilizada para a autenticação"
msgid "The password to use for querying the ldap server"
msgstr "A senha a ser utilizada para consultar o servidor ldap"
#: /usr/local/icingaweb/application/forms/Config/Resource/LivestatusResourceForm.php:46
msgid "The path to your livestatus socket used for querying monitoring data"
msgstr ""
"O caminho para o soquete livestatus utilizado para consultar os dados de "
"monitoramento"
#: /usr/local/icingaweb/application/forms/Config/Authentication/LdapBackendForm.php:109
msgid ""
"The path where users can be found on the ldap server. Leave empty to select "

View File

@ -3,6 +3,13 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"MIME-Version: 1.0\n"
"Language: ru_RU\n"
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: Michael Friedrich <michael.friedrich@icinga.com>\n"
"Language-Team: \n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.3\n"
#, php-format
msgid "\"%s\" is not in the list of allowed values."
@ -1685,9 +1692,6 @@ msgstr "Пароль для аутентификации"
msgid "The password to use for querying the ldap server"
msgstr ""
msgid "The path to your livestatus socket used for querying monitoring data"
msgstr ""
msgid ""
"The path where groups can be found on the LDAP server. Leave empty to select "
"all users available using the specified connection."

View File

@ -32,9 +32,6 @@
case 'ldap':
$icon = 'sitemap';
break;
case 'livestatus':
$icon = 'flash';
break;
case 'ssh':
$icon = 'user';
break;

View File

@ -6,9 +6,9 @@ different files, when the information about a data source changes.
## Configuration <a id="resources-configuration"></a>
Each section in `config/resources.ini` represents a data source with the section name being the identifier used to
Each section in `resources.ini` represents a data source with the section name being the identifier used to
reference this specific data source. Depending on the data source type, the sections define different directives.
The available data source types are *db*, *ldap*, *ssh* and *livestatus* which will described in detail in the following
The available data source types are `db`, `ldap` and `ssh` which will described in detail in the following
paragraphs.
### Database <a id="resources-configuration-database"></a>

View File

@ -21,7 +21,7 @@ Parallels requires the additional provider plugin
The Icinga Web 2 project ships with a Vagrant virtual machine that integrates
the source code with various services and example data in a controlled
environment. This enables developers and users to test Livestatus,
environment. This enables developers and users to test
MySQL and PostgreSQL backends as well as the LDAP authentication. All you
have to do is install Vagrant and run:

View File

@ -7,7 +7,6 @@ use Icinga\Application\Config;
use Icinga\Util\ConfigAwareFactory;
use Icinga\Exception\ConfigurationError;
use Icinga\Data\Db\DbConnection;
use Icinga\Protocol\Livestatus\Connection as LivestatusConnection;
use Icinga\Protocol\Ldap\LdapConnection;
use Icinga\Protocol\File\FileReader;
@ -110,9 +109,6 @@ class ResourceFactory implements ConfigAwareFactory
$resource = new LdapConnection($config);
break;
case 'livestatus':
$resource = new LivestatusConnection($config->socket);
break;
case 'file':
$resource = new FileReader($config);
break;
@ -133,7 +129,7 @@ class ResourceFactory implements ConfigAwareFactory
* Create a resource from name
*
* @param string $resourceName
* @return DbConnection|LdapConnection|LivestatusConnection
* @return DbConnection|LdapConnection
*/
public static function create($resourceName)
{

View File

@ -1,445 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2013 Icinga Development Team | GPLv2+ */
namespace Icinga\Protocol\Livestatus;
use Icinga\Application\Benchmark;
use Icinga\Exception\ConfigurationError;
use Icinga\Exception\SystemPermissionException;
use Icinga\Exception\IcingaException;
use Exception;
use SplFixedArray;
/**
* Backend class managing handling MKI Livestatus connections
*
* Usage example:
*
* <code>
* $lconf = new Connection((object) array(
* 'hostname' => 'localhost',
* 'root_dn' => 'dc=monitoring,dc=...',
* 'bind_dn' => 'cn=Mangager,dc=monitoring,dc=...',
* 'bind_pw' => '***'
* ));
* </code>
*
* @copyright Copyright (c) 2013 Icinga-Web Team <info@icinga.com>
* @author Icinga-Web Team <info@icinga.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
*/
class Connection
{
const TYPE_UNIX = 1;
const TYPE_TCP = 2;
const FIELD_SEPARATOR = '`';
protected $bytesRead = 0;
protected $responseSize;
protected $status;
protected $headers;
// List of available Livestatus tables. Kept here as we otherwise get no
// useful error message
protected $available_tables = array(
'hosts', // hosts
'services', // services, joined with all data from hosts
'hostgroups', // hostgroups
'servicegroups', // servicegroups
'contactgroups', // contact groups
'servicesbygroup', // all services grouped by service groups
'servicesbyhostgroup', // all services grouped by host groups
'hostsbygroup', // all hosts grouped by host groups
'contacts', // contacts
'commands', // defined commands
'timeperiods', // time period definitions (currently only name
// and alias)
'downtimes', // all scheduled host and service downtimes,
// joined with data from hosts and services.
'comments', // all host and service comments
'log', // a transparent access to the nagios logfiles
// (include archived ones)ones
'status', // general performance and status information.
// This table contains exactly one dataset.
'columns', // a complete list of all tables and columns
// available via Livestatus, including
// descriptions!
'statehist', // 1.2.1i2 sla statistics for hosts and services,
// joined with data from hosts, services and log.
);
protected $socket_path;
protected $socket_host;
protected $socket_port;
protected $socket_type;
protected $connection;
/**
* Whether the given table name is valid
*
* @param string $name table name
*
* @return bool
*/
public function hasTable($name)
{
return in_array($name, $this->available_tables);
}
public function __construct($socket = '/var/lib/icinga/rw/live')
{
$this->assertPhpExtensionLoaded('sockets');
if ($socket[0] === '/') {
if (! is_writable($socket)) {
throw new SystemPermissionException(
'Cannot write to livestatus socket "%s"',
$socket
);
}
$this->socket_type = self::TYPE_UNIX;
$this->socket_path = $socket;
} else {
if (! preg_match('~^tcp://([^:]+):(\d+)~', $socket, $m)) {
throw new ConfigurationError(
'Invalid TCP socket syntax: "%s"',
$socket
);
}
// TODO: Better config syntax checks
$this->socket_host = $m[1];
$this->socket_port = (int) $m[2];
$this->socket_type = self::TYPE_TCP;
}
}
/**
* Count unlimited rows matching the query filter
*
* TODO: Currently hardcoded value, as the old variant was stupid
* Create a working variant doing this->execute(query->renderCount())...
*
* @param Query $query the query object
*
* @return int
*/
public function count(Query $query)
{
return 100;
$count = clone($query);
// WTF? $count->count();
Benchmark::measure('Sending Livestatus Count Query');
$this->execute($query);
$data = $this->fetchRowFromSocket();
Benchmark::measure('Got Livestatus count result');
return $data[0][0];
}
/**
* Fetch a single row
*
* TODO: Currently based on fetchAll, that's bullshit
*
* @param Query $query the query object
*
* @return object the first result row
*/
public function fetchRow(Query $query)
{
$all = $this->fetchAll($query);
return array_shift($all);
}
/**
* Fetch key/value pairs
*
* TODO: Currently slow, needs improvement
*
* @param Query $query the query object
*
* @return array
*/
public function fetchPairs(Query $query)
{
$res = array();
$all = $this->fetchAll($query);
foreach ($all as $row) {
// slow
$keys = array_keys((array) $row);
$res[$row->{$keys[0]}] = $row->{$keys[1]};
}
return $res;
}
/**
* Fetch all result rows
*
* @param Query $query the query object
*
* @return array
*/
public function fetchAll(Query $query)
{
Benchmark::measure('Sending Livestatus Query');
$this->execute($query);
Benchmark::measure('Got Livestatus Data');
if ($query->hasColumns()) {
$headers = $query->getColumnAliases();
} else {
// TODO: left this here, find out how to handle it better
die('F*** no data');
$headers = array_shift($data);
}
$result = array();
$filter = $query->filterIsSupported() ? null : $query->getFilter();
while ($row = $this->fetchRowFromSocket()) {
$r = new ResponseRow($row, $query);
$res = $query->resultRow($row);
if ($filter !== null && ! $filter->matches($res)) {
continue;
}
$result[] = $res;
}
if ($query->hasOrder()) {
usort($result, array($query, 'compare'));
}
if ($query->hasLimit()) {
$result = array_slice(
$result,
$query->getOffset(),
$query->getLimit()
);
}
Benchmark::measure('Data sorted, limits applied');
return $result;
}
protected function hasBeenExecuted()
{
return $this->status !== null;
}
protected function execute($query)
{
// Reset state
$this->status = null;
$this->responseSize = null;
$this->bytesRead = 0;
$raw = $query->toString();
Benchmark::measure($raw);
// "debug"
// echo $raw . "\n<br>";
$this->writeToSocket($raw);
$header = $this->readLineFromSocket();
if (! preg_match('~^(\d{3})\s\s*(\d+)$~', $header, $m)) {
$this->disconnect();
throw new Exception(
sprintf('Got invalid header. First 16 Bytes: %s', $header)
);
}
$this->status = (int) $m[1];
$this->bytesRead = 0;
$this->responseSize = (int) $m[2];
if ($this->status !== 200) {
// "debug"
//die(var_export($raw, 1));
throw new Exception(
sprintf(
'Error %d while querying livestatus: %s %s',
$this->status,
$raw,
$this->readLineFromSocket()
)
);
}
$this->discoverColumnHeaders($query);
}
protected function discoverColumnHeaders($query)
{
if ($query->hasColumns()) {
$this->headers = $query->getColumnAliases();
} else {
$this->headers = $this->splitLine($this->readLineFromSocket());
}
}
protected function splitLine(& $line)
{
if ($this->headers === null) {
$res = array();
} else {
$res = new SplFixedArray(count($this->headers));
$size = count($res);
}
$start = 0;
$col = 0;
while (false !== ($pos = strpos($line, self::FIELD_SEPARATOR, $start))) {
// TODO: safety measure for not killing the SPL. To be removed once code is clean
if ($col > $size -1) {
return $res; // ???
}
$res[$col] = substr($line, $start, $pos - $start);
$start = $pos + 1;
$col++;
}
// TODO: safety measure for not killing the SPL. To be removed once code is clean
if ($col > $size - 1) {
return $res;
}
$res[$col] = rtrim(substr($line, $start), "\r\n");
return $res;
}
public function fetchRowFromSocket()
{
$line = $this->readLineFromSocket();
if (! $line) {
return false;
}
return $this->splitLine($line);
}
protected function readLineFromSocket()
{
if ($this->bytesRead === $this->responseSize) {
return false;
}
$maxRowLength = 100 * 1024;
$row = socket_read($this->getConnection(), $maxRowLength, PHP_NORMAL_READ);
$this->bytesRead += strlen($row);
if ($row === false) {
$this->socketError('Failed to read next row from livestatus socket');
}
return $row;
}
/**
* Write given string to livestatus socket
*
* @param string $data Data string to write to the socket
*
* @return boolean
*/
protected function writeToSocket($data)
{
$res = @socket_write($this->getConnection(), $data);
if ($res === false) {
$this->socketError('Writing to livestatus socket failed');
}
return true;
}
/**
* Raise an exception showing given message string and last socket error
*
* TODO: Find a better exception type for such errors
*
* @throws IcingaException
*/
protected function socketError($msg)
{
throw new IcingaException(
$msg . ': ' . socket_strerror(socket_last_error($this->connection))
);
}
protected function assertPhpExtensionLoaded($name)
{
if (! extension_loaded($name)) {
throw new IcingaException(
'The extension "%s" is not loaded',
$name
);
}
}
protected function getConnection()
{
if ($this->connection === null) {
Benchmark::measure('Establishing livestatus connection...');
if ($this->socket_type === self::TYPE_TCP) {
$this->establishTcpConnection();
Benchmark::measure('...got TCP socket');
} else {
$this->establishSocketConnection();
Benchmark::measure('...got local socket');
}
}
return $this->connection;
}
/**
* Establish a TCP socket connection
*/
protected function establishTcpConnection()
{
$this->connection = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if (! @socket_connect($this->connection, $this->socket_host, $this->socket_port)) {
throw new IcingaException(
'Cannot connect to livestatus TCP socket "%s:%d": %s',
$this->socket_host,
$this->socket_port,
socket_strerror(socket_last_error($this->connection))
);
}
socket_set_option($this->connection, SOL_TCP, TCP_NODELAY, 1);
}
/**
* Establish a UNIX socket connection
*/
protected function establishSocketConnection()
{
$this->connection = socket_create(AF_UNIX, SOCK_STREAM, 0);
if (! socket_connect($this->connection, $this->socket_path)) {
throw new IcingaException(
'Cannot connect to livestatus local socket "%s"',
$this->socket_path
);
}
}
public function connect()
{
if (!$this->connection) {
$this->getConnection();
}
return $this;
}
/**
* Disconnect in case we are connected to a Livestatus socket
*
* @return $this
*/
public function disconnect()
{
if (is_resource($this->connection)
&& get_resource_type($this->connection) === 'Socket') {
Benchmark::measure('Disconnecting livestatus...');
socket_close($this->connection);
Benchmark::measure('...socket closed');
}
return $this;
}
/**
* Try to cleanly close the socket on shutdown
*/
public function __destruct()
{
$this->disconnect();
}
}

View File

@ -1,470 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2013 Icinga Development Team | GPLv2+ */
namespace Icinga\Protocol\Livestatus;
use Icinga\Data\SimpleQuery;
use Icinga\Exception\IcingaException;
use Icinga\Data\Filter\Filter;
use Icinga\Data\Filter\FilterChain;
use Icinga\Data\Filter\FilterExpression;
use Icinga\Data\Filter\FilterOr;
use Icinga\Data\Filter\FilterAnd;
use Icinga\Data\Filter\FilterNot;
use Exception;
class Query extends SimpleQuery
{
protected $customvars = array();
/**
* Columns in this array are always "combined" ones creating their value
* based on a filter expression. The result is always either "1" or "0"
*/
protected $filter_flags = array();
/**
* Columns that return arrays. Will be decoded.
*/
protected $arrayColumns = array(
'members' => true,
);
/**
* Columns to be fetched for sorting / filtering, will not be returned
*/
protected $extraFiltercolumns = array();
/**
* All available columns. To be overridden by specific query implementations
*/
protected $available_columns = array();
protected $count = false;
/**
* Headers for columns sent to Livestatus socket
*/
protected $preparedHeaders = array();
public function hasColumns()
{
return $this->columns !== null;
}
public function getColumns()
{
return $this->columns;
}
public function withHeaders(& $row)
{
return array_combine($this->preparedHeaders, $row->toArray());
}
/**
* Whether the named columns value is generated by a filter expression
*/
public function isFilterFlag($column)
{
return array_key_exists($column, $this->filter_flags);
}
// completes a given row
public function resultRow(& $row)
{
// $row -> raw SplArray
// $res -> object
// $cv ->
// $result -> object to be returned
$result = (object) array();
$res = $this->withHeaders($row);
$cv = array();
if (array_key_exists('custom_variables', $res)) {
foreach ($this->parseArray($res['custom_variables']) as $cvp) {
$cv[$cvp[0]] = $cvp[1];
}
}
$combined = array();
foreach ($this->columns as $alias => $col) {
if (is_int($alias)) {
$alias = $col;
}
if ($col[0] === '_') {
$result->$alias = array_key_exists($alias, $cv) ? $cv[$alias] : null;
} else {
$func = 'mungeResult_' . $col;
if (method_exists($this, $func)) {
$this->$func($res[$this->available_columns[$col]], $result);
} elseif (is_array($this->available_columns[$col])) {
$combined[$alias] = $col;
$result->$alias = null;
} else {
if (strpos($this->available_columns[$col], ' ') === false) {
$result->$alias = $res[$this->available_columns[$col]];
} else {
$result->$alias = $res[$alias];
}
}
}
}
// TODO: Quite some redundancy here :(
if (! $this->filterIsSupported()) {
foreach ($this->filter->listFilteredColumns() as $col) {
if ($this->isFilterFlag($col)) {
$result->$col = (string) (int) $this->filterStringToFilter(
$this->filter_flags[$col]
)->matches((object) $res);
} else {
$func = 'combineResult_' . $col;
if (method_exists($this, $func)) {
$result->$col = $this->$func($result, $res);
}
}
}
}
foreach ($combined as $alias => $col) {
if ($this->isFilterFlag($col)) {
$result->$alias = (string) (int) $this->filterStringToFilter(
$this->filter_flags[$col]
)->matches((object) $res);
continue;
}
$func = 'combineResult_' . $col;
if (method_exists($this, $func)) {
$result->$alias = $this->$func($result, $res);
} else {
$result->$alias = implode(' - ', $this->available_columns[$col]);
}
}
return $result;
}
/**
* Parse the given encoded array
*
* @param string $str the encoded array string
*
* @return array
*/
public function parseArray($str)
{
if (empty($str)) {
return array();
}
$result = array();
$entries = preg_split('/,/', $str);
foreach ($entries as $e) {
$result[] = preg_split('/;/', $e);
}
return $result;
}
public function getColumnAliases()
{
$this->columnsToString();
return $this->preparedHeaders;
// TODO: Remove once no longer needed:
$aliases = array();
$hasCustom = false;
foreach ($this->getColumns() as $key => $val) {
if ($val[0] === '_') {
$this->customvars[$val] = null;
if (! $hasCustom) {
$aliases[] = 'custom_variables';
$hasCustom = true;
}
continue;
}
if (is_int($key)) {
$aliases[] = $val;
} else {
$aliases[] = $key;
}
}
return $aliases;
}
/*
public function count()
{
$this->count = true;
return $this;
}
*/
/**
* Automagic string casting
*
* @return string
*/
public function __toString()
{
try {
return $this->toString();
} catch (Exception $e) {
trigger_error(
sprintf(
'%s in %s on line %d',
$e->getMessage(),
$e->getFile(),
$e->getLine()
),
E_USER_ERROR
);
}
}
/**
* Render query string
*
* @return string
*/
public function toString()
{
if ($this->table === null) {
throw new IcingaException('Table is required');
}
// Headers we always send
$default_headers = array(
// Our preferred output format is CSV as it allows us to fetch and
// process the result row by row
'OutputFormat: csv',
'ResponseHeader: fixed16',
// Tried to find a save list of separators, this might be subject to
// change and eventually be transforment into constants
'Separators: ' . implode(' ', array(ord("\n"), ord('`'), ord(','), ord(';'))),
// We always use the keepalive feature, connection teardown happens
// in the connection destructor
'KeepAlive: on'
);
$parts = array(
sprintf('GET %s', $this->table)
);
// Fetch all required columns
$parts[] = $this->columnsToString();
// In case we need to apply a userspace filter as of Livestatus lacking
// support for some of them we also need to fetch all filtered columns
if ($this->filterIsSupported() && $filter = $this->filterToString()) {
$parts[] = $filter;
}
// TODO: Old way of rendering a count query, this should definitively be
// improved
if ($this->count === true) {
$parts[] = 'Stats: state >= 0';
}
// TODO: Well... ordering is still missing
if (! $this->count && $this->hasLimit() && ! $this->hasOrder()) {
$parts[] = 'Limit: ' . ($this->getLimit() + $this->getOffset());
}
$lql = implode("\n", $parts)
. "\n"
. implode("\n", $default_headers)
. "\n\n";
return $lql;
}
/**
* Get all available columns
*
* @return array
*/
public function getAvailableColumns()
{
return $this->available_columns;
}
protected function columnsToString()
{
$columns = array();
$this->preparedHeaders = array();
$usedColumns = $this->columns;
if (! $this->filterIsSupported()) {
foreach ($this->filter->listFilteredColumns() as $col) {
if (! in_array($col, $usedColumns)) {
$usedColumns[] = $col;
}
}
}
foreach ($usedColumns as $col) {
// TODO: No alias if filter???
if (array_key_exists($col, $this->available_columns)) {
// Alias if such
$col = $this->available_columns[$col];
}
if ($col[0] === '_') {
$columns['custom_variables'] = true;
} elseif (is_array($col)) {
foreach ($col as $k) {
$columns[$k] = true;
}
} else {
$columns[$col] = true;
}
}
$this->preparedHeaders = array_keys($columns);
if ($this->count === false && $this->columns !== null) {
return 'Columns: ' . implode(' ', array_keys($columns));
} else {
return ''; // TODO: 'Stats: state >= 0'; when count
}
}
/**
* Whether Livestatus is able to apply the current filter
*
* TODO: find a better method name
* TODO: more granular checks, also render filter-flag columns with lql
*
* @return bool
*/
public function filterIsSupported()
{
foreach ($this->filter->listFilteredColumns() as $column) {
if (is_array($this->available_columns[$column])) {
// Combined column, hardly filterable. Is it? May work!
return false;
}
}
return true;
}
/**
* Create a Filter object for a given URL-like filter string. We allow
* for spaces as we do not search for custom string values here. This is
* internal voodoo.
*
* @param string $string Filter string
*
* @return Filter
*/
protected function filterStringToFilter($string)
{
return Filter::fromQueryString(str_replace(' ', '', $string));
}
/**
* Render the current filter to LQL
*
* @return string
*/
protected function filterToString()
{
return $this->renderFilter($this->filter);
}
/**
* Filter rendering
*
* Happens recursively, useful for filters and for Stats expressions
*
* @param Filter $filter The filter that should be rendered
* @param string $type Filter type. Usually "Filter" or "Stats"
* @param int $level Nesting level during recursion. Don't touch
* @param bool $keylookup Whether to resolve alias names
*
* @return string
*/
protected function renderFilter(Filter $filter, $type = 'Filter', $level = 0, $keylookup = true)
{
$str = '';
if ($filter instanceof FilterChain) {
if ($filter instanceof FilterAnd) {
$op = 'And';
} elseif ($filter instanceof FilterOr) {
$op = 'Or';
} elseif ($filter instanceof FilterNot) {
$op = 'Negate';
} else {
throw new IcingaException(
'Cannot render filter: %s',
$filter
);
}
$parts = array();
if (! $filter->isEmpty()) {
foreach ($filter->filters() as $f) {
$parts[] = $this->renderFilter($f, $type, $level + 1, $keylookup);
}
$str .= implode("\n", $parts);
if ($type === 'Filter') {
if (count($parts) > 1) {
$str .= "\n" . $op . ': ' . count($parts);
}
} else {
$str .= "\n" . $type . $op . ': ' . count($parts);
}
}
} else {
$str .= $type . ': ' . $this->renderFilterExpression($filter, $keylookup);
}
return $str;
}
/**
* Produce a safe regex string as required by LQL
*
* @param string $expression search expression
*
* @return string
*/
protected function safeRegex($expression)
{
return '^' . preg_replace('/\*/', '.*', $expression) . '$';
}
/**
* Render a single filter expression
*
* @param FilterExpression $filter the filter expression
* @param bool $keylookup whether to resolve alias names
*
* @return string
*/
public function renderFilterExpression(FilterExpression $filter, $keylookup = true)
{
if ($keylookup) {
$col = $this->available_columns[$filter->getColumn()];
} else {
$col = $filter->getColumn();
}
$isArray = array_key_exists($col, $this->arrayColumns);
$sign = $filter->getSign();
if ($isArray && $sign === '=') {
$sign = '>=';
}
$expression = $filter->getExpression();
if ($sign === '=' && strpos($expression, '*') !== false) {
return $col . ' ~~ ' . $this->safeRegex($expression);
} elseif ($sign === '!=' && strpos($expression, '*') !== false) {
return $col . ' !~~ ' . $this->safeRegex($expression);
} else {
return $col . ' ' . $sign . ' ' . $expression;
}
}
public function __destruct()
{
unset($this->connection);
}
}

View File

@ -1,19 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
namespace Icinga\Protocol\Livestatus;
use SplFixedArray;
class ResponseRow
{
protected $raw;
protected $query;
public function __construct(SplFixedArray $raw, Query $query)
{
$this->raw = $raw;
$this->query = $query;
}
}

View File

@ -200,10 +200,6 @@ class BackendConfigForm extends ConfigForm
if ($resourceType === null) {
$resourceType = key($resourceTypes);
} elseif ($resourceType === 'livestatus') {
throw new ConfigurationError(
'We\'ve disabled livestatus support for now because it\'s not feature complete yet'
);
}
$this->addElement(

View File

@ -34,7 +34,6 @@ class BackendPage extends Form
if (Platform::hasMysqlSupport() || Platform::hasPostgresqlSupport()) {
$resourceTypes['ido'] = 'IDO';
}
// $resourceTypes['livestatus'] = 'Livestatus';
$this->addElement(
'select',

View File

@ -1,83 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
namespace Icinga\Module\Monitoring\Forms\Setup;
use Icinga\Web\Form;
use Icinga\Forms\Config\Resource\LivestatusResourceForm;
class LivestatusResourcePage extends Form
{
public function init()
{
$this->setName('setup_monitoring_livestatus');
$this->setTitle($this->translate('Monitoring Livestatus Resource', 'setup.page.title'));
$this->addDescription($this->translate(
'Please fill out the connection details below to access the Livestatus'
. ' socket interface for your monitoring environment.'
));
}
public function createElements(array $formData)
{
$this->addElement(
'hidden',
'type',
array(
'required' => true,
'value' => 'livestatus'
)
);
if (isset($formData['skip_validation']) && $formData['skip_validation']) {
$this->addSkipValidationCheckbox();
} else {
$this->addElement(
'hidden',
'skip_validation',
array(
'required' => true,
'value' => 0
)
);
}
$livestatusResourceForm = new LivestatusResourceForm();
$this->addElements($livestatusResourceForm->createElements($formData)->getElements());
$this->getElement('name')->setValue('icinga_livestatus');
}
public function isValid($data)
{
if (false === parent::isValid($data)) {
return false;
}
if (false === isset($data['skip_validation']) || $data['skip_validation'] == 0) {
if (false === LivestatusResourceForm::isValidResource($this)) {
$this->addSkipValidationCheckbox();
return false;
}
}
return true;
}
/**
* Add a checkbox to the form by which the user can skip the connection validation
*/
protected function addSkipValidationCheckbox()
{
$this->addElement(
'checkbox',
'skip_validation',
array(
'required' => true,
'label' => $this->translate('Skip Validation'),
'description' => $this->translate(
'Check this to not to validate connectivity with the given Livestatus socket'
)
)
);
}
}

View File

@ -8,15 +8,15 @@ msgstr ""
"Project-Id-Version: Monitoring Module (2.0.0~alpha4)\n"
"Report-Msgid-Bugs-To: dev@icinga.com\n"
"POT-Creation-Date: 2014-12-03 09:10-0200\n"
"PO-Revision-Date: 2014-12-03 09:13-0300\n"
"Last-Translator: Carlos Cesario <carloscesario@gmail.com>\n"
"PO-Revision-Date: 2017-09-28 15:31+0200\n"
"Last-Translator: Michael Friedrich <michael.friedrich@icinga.com>\n"
"Language: pt_BR\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.5.4\n"
"X-Generator: Poedit 2.0.3\n"
"Language-Team: \n"
#: /usr/local/icingaweb/modules/monitoring/application/controllers/ChartController.php:278
msgid " Down Hosts (Handled)"
@ -1553,8 +1553,8 @@ msgstr ""
#: /usr/local/icingaweb/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php:73
msgid ""
"If you work with other administrators, you may find it useful to share "
"information about the host or service that is having problems. Make sure "
"you enter a brief description of what you are doing."
"information about the host or service that is having problems. Make sure you "
"enter a brief description of what you are doing."
msgstr ""
"Se você trabalha com outros administradores, você pode achar isso útil para "
"compartilhar informações sobre um host ou serviço que está tendo problemas. "
@ -1694,10 +1694,6 @@ msgstr "Listar todos"
msgid "List all selected objects"
msgstr "Listar todos objetos selecionados"
#: /usr/local/icingaweb/modules/monitoring/library/Monitoring/BackendStep.php:128
msgid "Livestatus Resource"
msgstr "Recurso livestatus"
#: /usr/local/icingaweb/modules/monitoring/application/views/scripts/config/index.phtml:58
msgid "Local"
msgstr "Local"

View File

@ -1,10 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
namespace Icinga\Module\Monitoring\Backend\Livestatus;
use Icinga\Module\Monitoring\Backend\MonitoringBackend;
class LivestatusBackend extends MonitoringBackend
{
}

View File

@ -1,45 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
namespace Icinga\Module\Monitoring\Backend\Livestatus\Query;
use Icinga\Protocol\Livestatus\Query;
// TODO: still VERRRRY ugly
class DowntimeQuery extends Query
{
protected $table = 'downtimes';
protected $filter_flags = array(
'downtime_is_flexible' => '! fixed',
'downtime_is_in_effect' => 'fixed | ! fixed', // just true
);
protected $available_columns = array(
'downtime_author' => 'author',
'downtime_comment' => 'comment',
'downtime_entry_time' => 'entry_time',
'downtime_is_fixed' => 'fixed',
'downtime_is_flexible' => array('fixed'),
'downtime_triggered_by_id' => 'triggered_by',
'downtime_scheduled_start' => 'start_time', // ??
'downtime_scheduled_end' => 'end_time', // ??
'downtime_start' => 'start_time',
'downtime_end' => 'end_time',
'downtime_duration' => 'duration',
'downtime_is_in_effect' => array('fixed'),
'downtime_internal_id' => 'id',
'downtime_host' => 'host_name', // #7278, #7279
'host' => 'host_name',
'downtime_service' => 'service_description',
'service' => 'service_description', // #7278, #7279
'downtime_objecttype' => array('is_service'),
'downtime_host_state' => 'host_state',
'downtime_service_state' => 'service_state'
);
public function combineResult_downtime_objecttype(& $row, & $res)
{
return $res['is_service'] ? 'service' : 'host';
}
}

View File

@ -1,19 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
namespace Icinga\Module\Monitoring\Backend\Livestatus\Query;
use Icinga\Protocol\Livestatus\Query;
class HostgroupQuery extends Query
{
protected $table = 'hostgroups';
protected $available_columns = array(
'hostgroups' => 'name',
'hostgroup_name' => 'name',
'hostgroup_alias' => 'alias',
'host' => 'members',
'host_name' => 'members',
);
}

View File

@ -1,36 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
namespace Icinga\Module\Monitoring\Backend\Livestatus\Query;
use Icinga\Protocol\Livestatus\Query;
// SHITTY IT IS
class ServicegroupQuery extends Query
{
protected $table = 'servicegroups';
protected $available_columns = array(
'servicegroup_name' => 'name',
'servicegroup_alias' => 'alias',
'host' => array('members'),
'host_name' => array('members'),
'service' => array('members'),
'service_host_name' => array('members'),
'service_description' => array('members'),
);
public function xxcombineResult_service_host_name(& $row, & $res)
{
return;
var_dump($res);
die('Here you go');
}
public function completeRow(& $row)
{
die('FU');
$row->severity = 12;
}
}

View File

@ -1,259 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2013 Icinga Development Team | GPLv2+ */
namespace Icinga\Module\Monitoring\Backend\Livestatus\Query;
use Icinga\Protocol\Livestatus\Query;
class StatusQuery extends Query
{
/**
* This mode represents whether we are in HostStatus or ServiceStatus
*
* Implemented for `distinct as workaround
*
* @TODO Subject to change, see #7344
*
* @var string
*/
protected $mode;
/**
* Sets the mode of the current query
*
* @TODO Subject to change, see #7344
*
* @param string $mode
*/
public function setMode($mode)
{
$this->mode = $mode;
}
protected $table = 'services';
protected $filter_flags = array(
'host_handled' => 'host_state > 0 & (host_acknowledged | host_in_downtime)',
'host_problem' => 'host_state > 0',
'service_problem' => 'service_state > 0',
'service_handled' => 'service_state > 0 & (host_state > 0 | service_acknowledged | service_in_downtime)',
'service_unhandled' => 'service_state > 0 & host_state = 0 & !service_acknowledged & !service_in_downtime',
);
protected $available_columns = array(
'host' => 'host_name',
'host_name' => 'host_name',
'host_display_name' => 'host_display_name',
'host_alias' => 'host_alias',
'host_address' => 'host_address',
'host_ipv4' => 'host_address', // TODO
'host_icon_image' => 'host_icon_image',
'host_contacts' => 'host_contacts',
'host_problem' => array('host_state'),
'host_handled' => array('host_state', 'host_acknowledged', 'host_scheduled_downtime_depth'),
'service_problem' => array('state', 'acknowledged', 'scheduled_downtime_depth'),
'service_handled' => array('host_state', 'state', 'acknowledged', 'scheduled_downtime_depth'),
'service_unhandled' => array('host_state', 'state', 'acknowledged', 'scheduled_downtime_depth'),
// 'host_unhandled_services' => 'services_with_state', // Needs handler
// 'host_unhandled_services' => 'host_services_with_state', -> bringt nix, ist [service, state, has_been_checked]
'host_unhandled_services' => 'state', // Needs handler
'host_severity' => array('host_state', 'host_acknowledged', 'host_scheduled_downtime_depth'),
'service_severity' => array('host_state', 'state', 'acknowledged', 'scheduled_downtime_depth'),
// TODO: Make these 1 if > 1
'host_in_downtime' => 'host_scheduled_downtime_depth',
'service_in_downtime' => 'scheduled_downtime_depth',
'host_check_latency' => 'host_latency',
'host_check_execution_time' => 'host_execution_time',
'host_long_output' => 'host_long_plugin_output',
'host_passive_checks_enabled_changed' => 'state',
'host_obsessing' => 'state',
'host_obsessing_changed' => 'state',
'host_notifications_enabled_changed' => 'state',
'host_event_handler_enabled_changed' => 'state',
'host_flap_detection_enabled_changed' => 'state',
'host_active_checks_enabled_changed' => 'state',
// TODO: Do we need two of them?
'host_current_check_attempt' => 'host_current_attempt',
'host_attempt' => 'host_current_attempt',
'host_modified_host_attributes' => 'host_modified_attributes',
'service_modified_service_attributes' => 'modified_attributes',
'service_notifications_enabled_changed' => 'modified_attributes_list',
'service_active_checks_enabled_changed' => 'modified_attributes_list',
'service_passive_checks_enabled_changed' => 'modified_attributes_list',
'service_flap_detection_enabled_changed' => 'modified_attributes_list',
'service_event_handler_enabled_changed' => 'modified_attributes_list',
'service_check_execution_time' => 'execution_time',
'service_check_latency' => 'latency',
'service_obsessing' => 'state',
'service_obsessing_changed' => 'state',
'service_hard_state' => 'state',
'service_attempt' => 'current_attempt',
'service_current_check_attempt' => 'current_attempt',
'host' => 'host_name',
'service_host_name' => 'host_name',
'service' => 'description',
'service_is_flapping' => 'is_flapping',
'service_long_output' => 'long_plugin_output',
'service_icon_image' => 'icon_image',
'service_action_url' => 'action_url',
'service_notes_url' => 'notes_url',
'host_max_check_attempts' => 'host_max_check_attempts',
'service_max_check_attempts' => 'max_check_attempts',
// Host comments
'host_last_comment' => 'comments_with_info',
'host_last_ack' => 'comments_with_info',
'host_last_downtime' => 'comments_with_info',
'host_check_command' => 'host_check_command',
// Host state
'host_state' => 'host_state',
'host_state_type' => 'host_state_type',
'host_output' => 'host_plugin_output',
'host_perfdata' => 'host_perf_data',
'host_acknowledged' => 'host_acknowledged',
'host_active_checks_enabled' => 'host_active_checks_enabled',
'host_passive_checks_enabled' => 'host_accept_passive_checks',
'host_last_state_change' => 'host_last_state_change',
'host_event_handler_enabled' => 'host_event_handler_enabled',
'host_flap_detection_enabled' => 'host_flap_detection_enabled',
'host_current_notification_number' => 'host_current_notification_number',
'host_percent_state_change' => 'host_percent_state_change',
'host_process_performance_data' => 'host_process_performance_data',
'host_event_handler_enabled' => 'host_event_handler_enabled',
'host_flap_detection_enabled' => 'host_flap_detection_enabled',
'service_percent_state_change' => 'percent_state_change',
'host_last_notification' => 'host_last_notification',
'host_next_check' => 'host_next_check',
'host_check_source' => 'state',
// Service config
'service_description' => 'description',
'service_display_name' => 'display_name',
// Service state
'service_state' => 'state',
'service_output' => 'plugin_output',
'service_state_type' => 'state_type',
'service_perfdata' => 'perf_data',
'service_acknowledged' => 'acknowledged',
'service_active_checks_enabled' => 'active_checks_enabled',
'service_passive_checks_enabled' => 'accept_passive_checks',
'service_last_check' => 'last_check',
'service_last_state_change' => 'last_state_change',
'service_notifications_enabled' => 'notifications_enabled',
'service_last_notification' => 'last_notification',
'service_next_check' => 'next_check',
'service_last_time_unknown' => 'last_time_unknown',
'service_event_handler_enabled' => 'event_handler_enabled',
// Service comments
'service_last_comment' => 'comments_with_info',
'service_last_ack' => 'comments_with_info',
'service_last_downtime' => 'comments_with_info',
'downtimes_with_info' => 'downtimes_with_info',
'service_check_command' => 'check_command',
'service_check_source' => 'state',
'service_current_notification_number' => 'current_notification_number',
'host_is_flapping' => 'host_is_flapping',
'host_last_check' => 'host_last_check',
'host_notifications_enabled' => 'host_notifications_enabled',
'host_action_url' => 'host_action_url',
'host_notes_url' => 'host_notes_url',
'host_last_hard_state' => 'host_last_hard_state',
'host_last_hard_state_change' => 'host_last_hard_state_change',
'host_last_time_up' => 'host_last_time_up',
'host_last_time_down' => 'host_last_time_down',
'host_last_time_unreachable' => 'host_last_time_unreachable',
'service_last_hard_state' => 'last_hard_state',
'service_last_hard_state_change' => 'last_hard_state_change',
'service_last_time_ok' => 'last_time_ok',
'service_last_time_warning' => 'last_time_warning',
'service_last_time_critical' => 'last_time_critical',
'service_flap_detection_enabled' => 'flap_detection_enabled',
'service_process_performance_data' => 'process_performance_data',
);
public function mungeResult_custom_variables($val, & $row)
{
$notseen = $this->customvars;
foreach ($val as $cv) {
$name = '_service_' . $cv[0];
$row->$name = $cv[1];
unset($notseen[$name]);
}
foreach ($notseen as $k => $v) {
$row->$k = $v;
}
}
public function mungeResult_service_last_comment($val, & $row)
{
$this->mungeResult_comments_with_info($val, $row);
}
public function mungeResult_service_last_ack($val, & $row)
{
$this->mungeResult_comments_with_info($val, $row);
}
public function mungeResult_service_last_downtime($val, & $row)
{
$this->mungeResult_comments_with_info($val, $row);
}
public function mungeResult_comments_with_info($val, & $row)
{
if (empty($val)) {
$row->service_last_comment = $row->service_last_ack
= $row->service_last_downtime = null;
} else {
$row->service_last_comment = $row->service_last_ack
= $row->service_last_downtime = preg_replace('/\n/', ' ', print_r($val, 1));
}
}
public function mungeResult_host_unhandled_services($val, & $row)
{
$cnt = 0;
foreach ($this->parseArray($val) as $service) {
if (! isset($service[1])) {
continue;
// TODO: More research is required here, on Icinga2 I got
// array(1) { [0]=> array(1) { [0]=> string(1) "2" } }
var_dump($this->parseArray($val));
}
if ($service[1] > 0) {
$cnt++;
}
}
$row->host_unhandled_services = $cnt;
}
}

View File

@ -1,64 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
namespace Icinga\Module\Monitoring\Backend\Livestatus\Query;
use Icinga\Protocol\Livestatus\Query;
use Icinga\Exception\ProgrammingError;
class StatusSummaryQuery extends Query
{
protected $table = 'services';
protected $available_columns = array(
'service_host_name' => 'host_name',
'services_total' => 'state != 9999',
'services_problem' => 'state > 0',
'services_problem_handled' => 'state > 0 & (scheduled_downtime_depth > 0 | acknowledged = 1 | host_state > 0)',
'services_problem_unhandled' => 'state > 0 & scheduled_downtime_depth = 0 & acknowledged = 0 & host_state = 0',
'services_ok' => 'state = 0',
'services_ok_not_checked' => 'state = 0 & accept_passive_checks = 0 & active_checks_enabled = 0',
'services_pending' => 'has_been_checked = 0',
'services_pending_not_checked' => 'has_been_checked = 0 & accept_passive_checks = 0 & active_checks_enabled = 0',
'services_warning' => 'state = 1',
'services_warning_handled' => 'state = 1 & (scheduled_downtime_depth > 0 | acknowledged = 1 | host_state > 0)',
'services_warning_unhandled' => 'state = 1 & scheduled_downtime_depth = 0 & acknowledged = 0 & host_state = 0',
'services_warning_passive' => 'state = 1 & accept_passive_checks = 1 & active_checks_enabled = 0',
'services_warning_not_checked' => 'state = 1 & accept_passive_checks = 0 & active_checks_enabled = 0',
'services_critical' => 'state = 2',
'services_critical_handled' => 'state = 2 & (scheduled_downtime_depth > 0 | acknowledged = 1 | host_state > 0)',
'services_critical_unhandled' => 'state = 2 & scheduled_downtime_depth = 0 & acknowledged = 0 & host_state = 0',
'services_critical_passive' => 'state = 2 & accept_passive_checks = 1 & active_checks_enabled = 0',
'services_critical_not_checked' => 'state = 2 & accept_passive_checks = 0 & active_checks_enabled = 0',
'services_unknown' => 'state = 3',
'services_unknown_handled' => 'state = 3 & (scheduled_downtime_depth > 0 | acknowledged = 1 | host_state > 0)',
'services_unknown_unhandled' => 'state = 3 & scheduled_downtime_depth = 0 & acknowledged = 0 & host_state = 0',
'services_unknown_passive' => 'state = 3 & accept_passive_checks = 1 & active_checks_enabled = 0',
'services_unknown_not_checked' => 'state = 3 & accept_passive_checks = 0 & active_checks_enabled = 0',
'services_active' => 'active_checks_enabled = 1',
'services_passive' => 'accept_passive_checks = 1 & active_checks_enabled = 0',
'services_not_checked' => 'active_checks_enabled = 0 & accept_passive_checks = 0',
);
protected function columnsToString()
{
$parts = array();
foreach ($this->columns as $col) {
if (! array_key_exists($col, $this->available_columns)) {
throw new ProgrammingError('No such column: %s', $col);
}
$filter = $this->filterStringToFilter($this->available_columns[$col]);
//Filter::fromQueryString(str_replace(' ', '', $this->available_columns[$col]));
$parts[] = $this->renderFilter($filter, 'Stats', 0, false);
}
$this->preparedHeaders = $this->columns;
return implode("\n", $parts);
}
protected function renderkkFilter($filter, $type = 'Filter', $level = 0, $keylookup = true)
{
return parent::renderFilter($filter, 'Stats', $level, $keylookup);
}
}

View File

@ -153,21 +153,6 @@ class BackendStep extends Step
$resourceHtml .= ''
. '</tbody>'
. '</table>';
} else { // $this->data['resourceConfig']['type'] === 'livestatus'
$resourceTitle = '<h3>' . mt('monitoring', 'Livestatus Resource') . '</h3>';
$resourceHtml = ''
. '<table>'
. '<tbody>'
. '<tr>'
. '<td><strong>' . t('Resource Name') . '</strong></td>'
. '<td>' . $this->data['resourceConfig']['name'] . '</td>'
. '</tr>'
. '<tr>'
. '<td><strong>' . t('Socket') . '</strong></td>'
. '<td>' . $this->data['resourceConfig']['socket'] . '</td>'
. '</tr>'
. '</tbody>'
. '</table>';
}
return $pageTitle . '<div class="topic">' . $backendDescription . $resourceTitle . $resourceHtml . '</div>';

View File

@ -15,7 +15,6 @@ use Icinga\Module\Monitoring\Forms\Setup\BackendPage;
use Icinga\Module\Monitoring\Forms\Setup\SecurityPage;
use Icinga\Module\Monitoring\Forms\Setup\TransportPage;
use Icinga\Module\Monitoring\Forms\Setup\IdoResourcePage;
use Icinga\Module\Monitoring\Forms\Setup\LivestatusResourcePage;
use Icinga\Module\Setup\Requirement\ClassRequirement;
use Icinga\Module\Setup\Requirement\PhpModuleRequirement;
@ -32,7 +31,6 @@ class MonitoringWizard extends Wizard implements SetupWizard
$this->addPage(new WelcomePage());
$this->addPage(new BackendPage());
$this->addPage(new IdoResourcePage());
$this->addPage(new LivestatusResourcePage());
$this->addPage(new TransportPage());
$this->addPage(new SecurityPage());
$this->addPage(new SummaryPage(array('name' => 'setup_monitoring_summary')));
@ -52,7 +50,7 @@ class MonitoringWizard extends Wizard implements SetupWizard
$page->setSummary($this->getSetup()->getSummary());
$page->setSubjectTitle(mt('monitoring', 'the monitoring module', 'setup.summary.subject'));
} elseif ($this->getDirection() === static::FORWARD
&& ($page->getName() === 'setup_monitoring_ido' || $page->getName() === 'setup_monitoring_livestatus')
&& ($page->getName() === 'setup_monitoring_ido')
) {
if ((($authDbResourceData = $this->getPageData('setup_auth_db_resource')) !== null
&& $authDbResourceData['name'] === $request->getPost('name'))
@ -85,9 +83,6 @@ class MonitoringWizard extends Wizard implements SetupWizard
if ($newPage->getName() === 'setup_monitoring_ido') {
$backendData = $this->getPageData('setup_monitoring_backend');
$skip = $backendData['type'] !== 'ido';
} elseif ($newPage->getName() === 'setup_monitoring_livestatus') {
$backendData = $this->getPageData('setup_monitoring_backend');
$skip = $backendData['type'] !== 'livestatus';
}
return $skip ? $this->skipPage($newPage) : $newPage;
@ -141,9 +136,7 @@ class MonitoringWizard extends Wizard implements SetupWizard
$setup->addStep(
new BackendStep(array(
'backendConfig' => $pageData['setup_monitoring_backend'],
'resourceConfig' => isset($pageData['setup_monitoring_ido'])
? array_diff_key($pageData['setup_monitoring_ido'], array('skip_validation' => null))
: array_diff_key($pageData['setup_monitoring_livestatus'], array('skip_validation' => null))
'resourceConfig' => array_diff_key($pageData['setup_monitoring_ido'], array('skip_validation' => null)) //TODO: Prefer a new backend once implemented.
))
);

View File

@ -140,9 +140,6 @@ class Host extends MonitoredObject
'host_state_type',
'instance_name'
);
if ($this->backend->getType() === 'livestatus') {
$columns[] = 'host_contacts';
}
return $this->backend->select()->from('hoststatus', $columns)
->where('host_name', $this->host);
}

View File

@ -315,11 +315,6 @@ abstract class MonitoredObject implements Filterable
*/
public function fetchComments()
{
if ($this->backend->is('livestatus')) {
$this->comments = array();
return $this;
}
$commentsView = $this->backend->select()->from('comment', array(
'author' => 'comment_author_name',
'comment' => 'comment_data',
@ -377,11 +372,6 @@ abstract class MonitoredObject implements Filterable
*/
public function fetchContactgroups()
{
if ($this->backend->is('livestatus')) {
$this->contactgroups = array();
return $this;
}
$contactsGroups = $this->backend->select()->from('contactgroup', array(
'contactgroup_name',
'contactgroup_alias'
@ -404,11 +394,6 @@ abstract class MonitoredObject implements Filterable
*/
public function fetchContacts()
{
if ($this->backend->is('livestatus')) {
$this->contacts = array();
return $this;
}
$contacts = $this->backend->select()->from('contact', array(
'contact_name',
'contact_alias',
@ -433,11 +418,6 @@ abstract class MonitoredObject implements Filterable
*/
public function fetchCustomvars()
{
if ($this->backend->is('livestatus')) {
$this->customvars = array();
return $this;
}
$blacklist = array();
$blacklistPattern = '';