diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index b0538c2..5a90d92 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -93,7 +93,8 @@ jobs: run: rm -rf ci-tools - name: Unit tests with coverage - run: '"$CACTI_PEST_BIN" --configuration=phpunit.xml --coverage-clover=build/coverage/clover.xml' + # PCOV otherwise selects lib/ and misses the procedural entry points. + run: 'php -d pcov.directory=. "$CACTI_PEST_BIN" --configuration=phpunit.xml --coverage-clover=build/coverage/clover.xml' # workflow_dispatch does not infer the branch, so the context is checked # before it reaches the scanner's arguments. diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bd44cf..67b634b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this plugin are recorded here. The format follows [Keep a ### Added +- SmokePing Operator realm and Operations page with current observations and personal acknowledgments. Existing administrators inherit Operator access; operators inherit monitoring access without configuration rights. + - A supported series count: 10,000 per installation at 20 pings and a 300 s step, measured on the release runner with Cacti's management pages compared against the same number of stock Cacti graphs (#42). - Smoke graphs are sized again about once a day from their last day of data, by the same rule as at creation. The reader sizes at most 25 graphs per poller cycle and skips a cycle that used up its budget (#80). - The smoke graph legend shows the median's standard deviation, am/s, and SmokePing's probe line, as SmokePing's does. The probe line comes from a port of each SmokePing probe's description, compared with SmokePing's own. Schema 5 stores the description (#81). diff --git a/README.md b/README.md index b0d9bd5..9524706 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ + +[English](README.md) | [简体中文](docs/i18n/zh-CN/README.md) | [हिन्दी](docs/i18n/hi-IN/README.md) | [Español (España)](docs/i18n/es-ES/README.md) | [Español (Latinoamérica)](docs/i18n/es-419/README.md) | [العربية](docs/i18n/ar-SA/README.md) + +

@@ -21,6 +25,28 @@ A Cacti 1.2 plugin that brings SmokePing latency and loss measurements into Cact > **Status: in development. Observe mode (phase 1) is implemented on `main` and released as the 1.0.0-rc.1 pre-release.** The plugin reads SmokePing's configuration and RRD files, shows their state, creates Cacti devices, data sources, and graphs for them, and feeds Thold and Maint. It writes nothing to SmokePing. Managed mode (the plugin writing SmokePing configuration) and remote collectors are later phases, not started, and are not in this release. Pilots on real installations and a closer match to SmokePing's graph legend are still open in milestone 4. See [docs/install.md](docs/install.md) to start. +## Access roles + +| Realm | Access | +| --- | --- | +| SmokePing View | Existing monitoring pages. | +| SmokePing Operator | Monitoring plus the Operations page and personal triage acknowledgments. | +| SmokePing Admin | Operator access plus the existing configuration and administrative actions. | + +After copying upgrade files, open the Plugins page as an administrator to register +the new realm. Assign the Operator realm explicitly under **Configuration > Users** or user groups. +Upgrades retain the existing View and Admin realm IDs and grants. Admin access +inherits Operator access, and Operator access inherits View access on each request; +this does not add stored grants to users or groups. Plugin settings also require +SmokePing Admin access in addition to Cacti's Settings permission. + +Cacti device permissions still limit the rows and actions available to each user; unmapped objects require an administrator. +Credentials, configuration, mapping, deletion and other administrative changes +remain in the administrative pages. Acknowledgments last only in the current +user's session, for at most one hour and only while the same observation remains +fresh. New or changed observations invalidate them. They never mark a failed +measurement healthy or suppress alerts. + ## Screenshots Imported from a live SmokePing 2.8.2 network into Cacti 1.2.31, last 12 hours. Each target's device has a smoke graph for the master and one for each slave (`lon1`, `sgp1`), filed under its SmokePing section in the graph tree. diff --git a/docs/PLAN.md b/docs/PLAN.md index 655737d..e106191 100644 --- a/docs/PLAN.md +++ b/docs/PLAN.md @@ -369,7 +369,7 @@ Plugin code is object-oriented wherever Cacti's plugin contract allows it. No ma - Classes live in `lib/*.php` under the `Somethingwithproof\Smokeping` namespace, one class per file, loaded by a small `spl_autoload_register()` loader registered only after the PHP version check. No Composer runtime dependency is added. Files stay at depth 2 or less because the gettext build and the POT check scan only `find . -maxdepth 2`. - Settings use the `config_settings` hook. Logging uses `cacti_log()` with a `SMOKEPING` tag. Forms rely on Cacti's csrf-magic. - Strings use the `smokeping` text domain in classes and shims, with a `locales/` directory and POT file. -- Realms: two, "SmokePing View" and "SmokePing Admin", each a list of page files registered with `api_plugin_register_realm()`. +- Realms: three, "SmokePing View", "SmokePing Operator" and "SmokePing Admin", each a list of page files registered with `api_plugin_register_realm()`. **Planned classes.** Names are illustrative; milestone 2 settles the final set. @@ -512,5 +512,5 @@ This repository holds the plan and the plugin code, and tracks its requirements - **Inventory script.** A short Perl CLI using `Smokeping::get_parser()`, as `smokeinfo` does, instead of a service. Superseded by decision 0009: a PHP parser, with the Perl script kept only as a test oracle. - **Managed probes narrowed** to ICMP and TCP because servcheck covers service checks. - **Reader uses Cacti's rrdtool pipe.** Cacti object row counts added to the performance section. -- **Cacti idioms made explicit:** hook list, `config_settings`, `cacti_log()`, csrf-magic, two realms, text domain, template XML import, `varchar` enums, explicit database connections for remote code. +- **Cacti idioms made explicit:** hook list, `config_settings`, `cacti_log()`, csrf-magic, three realms, text domain, template XML import, `varchar` enums, explicit database connections for remote code. - **Phases renumbered:** observe with alerting, managed, remote. Milestones and tests updated to match. diff --git a/docs/backup-restore.md b/docs/backup-restore.md index 39ef96a..7d20ffd 100644 --- a/docs/backup-restore.md +++ b/docs/backup-restore.md @@ -18,7 +18,7 @@ Take the database dump and the file copies at about the same time, so that the t ```sh # The Cacti database (use your own credentials file or option file, not a password on the command line) -mariadb-dump --single-transaction --defaults-extra-file=/root/.cacti-backup.cnf cacti > cacti.sql +mariadb-dump --defaults-extra-file=/root/.cacti-backup.cnf --single-transaction cacti > cacti.sql # SmokePing's configuration, with its included files tar -czf smokeping-config.tgz -C /etc/smokeping . @@ -80,7 +80,7 @@ The export holds the plugin's settings, targets, and mappings. It holds no data ## Uninstalling -Uninstalling writes a YAML export first (see the [install guide](install.md#upgrading-and-removing)) and never touches SmokePing's files, so an uninstall followed by a restore from that export works like the case above. +Uninstall attempts a YAML export (see the [install guide](install.md#upgrading-and-removing)), but a failed export does not stop it. **Before uninstalling, export the configuration yourself and verify that the backup is readable and complete.** Uninstall never touches SmokePing's files; restore from your verified export as in the case above. ## Verification diff --git a/docs/i18n/ar-SA/README.md b/docs/i18n/ar-SA/README.md new file mode 100644 index 0000000..de178d9 --- /dev/null +++ b/docs/i18n/ar-SA/README.md @@ -0,0 +1,142 @@ + + + +[English](../../../README.md) | [简体中文](../zh-CN/README.md) | [हिन्दी](../hi-IN/README.md) | [Español (España)](../es-ES/README.md) | [Español (Latinoamérica)](../es-419/README.md) | [العربية](README.md) + + +

+ + + إضافة SmokePing لـ Cacti: صبّار يرتدي شارة عليها رسم SmokePing + +

+ + +# إضافة SmokePing لـ Cacti + +[![CI](https://github.com/somethingwithproof/plugin_smokeping/actions/workflows/plugin-ci-workflow.yml/badge.svg)](https://github.com/somethingwithproof/plugin_smokeping/actions/workflows/plugin-ci-workflow.yml) +[![License: GPL-2.0-or-later](https://img.shields.io/badge/license-GPL--2.0--or--later-blue.svg)](../../../LICENSE) +![PHP >= 8.2](https://img.shields.io/badge/php-%3E%3D8.2-777bb4.svg) +![Cacti >= 1.2.31](https://img.shields.io/badge/cacti-%3E%3D1.2.31-2e7d32.svg) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=coverage)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +![SmokePing: read-only](https://img.shields.io/badge/smokeping-read--only-6b7280.svg) + +إضافة لـ Cacti 1.2 تدمج قياسات التأخير وفقدان الحزم من SmokePing كأجهزة ومصادر بيانات ورسوم عادية في Cacti. تظهر الرسوم الدخانية بجوار الجهاز المعني وتخضع لصلاحيات Cacti، ويمكن لـ Thold وMaint إصدار تنبيهات عنها وكبتها. هذا تنفيذ مستقل لـ Cacti، وليس جزءًا من [SmokePing](https://oss.oetiker.ch/smokeping/) ولا معتمدًا منه؛ ومؤلفاه الأصليان هما Tobias Oetiker وNiko Tyni. لا تضم الإضافة شيفرة SmokePing ولا تشغّلها: بل تقرأ إعداده وملفات RRD التي يكتبها، وترسم قوالبها السلاسل نفسها التي ترسمها رسوم SmokePing الأصلية. + +> **الحالة: قيد التطوير. وضع المراقبة (المرحلة 1) منفّذ في `main` ومنشور كإصدار تمهيدي 1.0.0-rc.1.** تقرأ الإضافة إعداد SmokePing وملفات RRD، وتعرض حالتها، وتنشئ لها أجهزة ومصادر بيانات ورسومًا في Cacti، وتزوّد Thold وMaint بالبيانات. ولا تكتب أي شيء في SmokePing. الوضع المُدار (كتابة الإضافة لإعداد SmokePing) والمجمّعات البعيدة مرحلتان لاحقتان لم تبدآ وغير مشمولتين هنا. ما تزال التجارب في تثبيتات فعلية وتحسين مطابقة مفتاح الرسم لرسوم SmokePing ضمن الأعمال المتبقية في المعلم 4. للبدء راجع [docs/install.md](docs/install.md). + + +## أدوار الوصول + +| نطاق الأذونات | الوصول | +| --- | --- | +| SmokePing View | صفحات المراقبة الحالية. | +| SmokePing Operator | المراقبة وصفحة العمليات والإقرارات الشخصية أثناء التحقيق. | +| SmokePing Admin | وصول المشغّل مع الإعدادات والإجراءات الإدارية الحالية. | + +بعد نسخ ملفات الترقية، افتح صفحة الإضافات بصفتك مسؤولًا لتسجيل نطاق الأذونات الجديد. امنح نطاق Operator صراحةً ضمن **الإعداد > المستخدمون** أو مجموعات المستخدمين. تحتفظ الترقيات بمعرّفات نطاقي View وAdmin ومنحهما الحالي. يرث Admin وصول Operator ويرث Operator وصول View في كل طلب؛ ولا يضيف ذلك منحًا مخزّنة للمستخدمين أو المجموعات. تتطلب إعدادات الإضافة أيضًا SmokePing Admin بالإضافة إلى إذن الإعدادات في Cacti. + +تظل أذونات أجهزة Cacti تقيّد الصفوف والإجراءات المتاحة لكل مستخدم؛ وتتطلب الكائنات غير المرتبطة مسؤولًا. تبقى بيانات الاعتماد والإعدادات والربط والحذف والتغييرات الإدارية الأخرى في الصفحات الإدارية. لا تستمر الإقرارات إلا في جلسة المستخدم الحالي، لمدة ساعة على الأكثر وفقط ما دامت الملاحظة نفسها حديثة. تُبطلها الملاحظات الجديدة أو المعدّلة. ولا تجعل قياسًا فاشلًا سليمًا أو تكبح التنبيهات مطلقًا. + + +## لقطات الشاشة + +استيراد من شبكة SmokePing 2.8.2 عاملة إلى Cacti 1.2.31، لآخر 12 ساعة. يضم جهاز كل هدف رسمًا دخانيًا للرئيسي ورسمًا لكل تابع (`lon1`، `sgp1`)، ضمن قسم SmokePing الخاص به في شجرة الرسوم. + +![شجرة Cacti لهدف Bangalore: الرسوم الدخانية للرئيسي والتابعين lon1 وsgp1](../../images/screenshot-tree-asia.png) + +![شجرة Cacti لهدف London: يعرض التابع lon1 في المنطقة نفسها تأخيرًا بالميكروثانية ودخانًا مرئيًا](../../images/screenshot-tree-europe.png) + + +## الدافع + +يقيس SmokePing توزيع التأخير وفقدان الحزم جيدًا؛ وتُظهر رسومه الدخانية تغيرات تخفيها رسوم المتوسطات. عند تشغيله بجوار Cacti تبقى ثلاث فجوات: + +- **تحكم منفصل في الوصول.** لا يعرف CGI الخاص بـ SmokePing مستخدمي Cacti أو مجموعاته أو صلاحيات أجهزته. +- **غياب سياق الجهاز.** توجد بيانات التأخير وعدّادات واجهات الجهاز نفسه في أداتين مختلفتين. +- **غياب التكامل مع تنبيهات Cacti.** يعمل Thold وMaint على مصادر بيانات Cacti وأجهزته، لذا تُضبط تنبيهات SmokePing وتُكبت على نحو منفصل. + +تسد الإضافة هذه الفجوات بتمثيل كل هدف SmokePing بكائنات Cacti تشير إلى ملفات SmokePing RRD القائمة، مع مجموعة صغيرة من قيم الملخص التي يجري استطلاعها. وهي تعيد استخدام رسوم Cacti وصلاحياته وThold وMaint. دعم مجمّعات Cacti البعيدة مخطط للمرحلة 3 وغير موجود في هذا الإصدار. + + +## النطاق والحالة + +| المرحلة | النطاق | المعالم | الحالة | +|---|---|---|---| +| 0، البحث | مصفوفة التوافق، تأكيد السلوك الأصلي، نموذج أولي لمطابقة الرسوم | [M1](https://github.com/somethingwithproof/plugin_smokeping/milestone/1) | النتائج في `docs/research`؛ بعض مسائل البحث ما تزال مفتوحة | +| 1، المراقبة | استيراد الجرد، أجهزة Cacti، الرسوم الدخانية والملخصة، تنبيهات Thold، كبت Maint، صفحة الصحة | [M2](https://github.com/somethingwithproof/plugin_smokeping/milestone/2)، [M3](https://github.com/somethingwithproof/plugin_smokeping/milestone/3)، [M4](https://github.com/somethingwithproof/plugin_smokeping/milestone/4) | منشورة كـ 1.0.0-rc.1؛ التجارب الميدانية متبقية | +| 2، الإدارة | نطاق أسماء إعداد يملكه Cacti، ملفات تعريف مجسّات ICMP وTCP، المراجعات، التحقق، إعادة التحميل، التراجع | [M5](https://github.com/somethingwithproof/plugin_smokeping/milestone/5) | مخططة، لم تبدأ | +| 3، التشغيل البعيد | SmokePing على مجمّعات Cacti البعيدة، والتابعون كمواقع قياس | [M6](https://github.com/somethingwithproof/plugin_smokeping/milestone/6) | مخططة، لم تبدأ | + +خارج النطاق: محرك تنبيهات خاص، محرك تقارير، خدمة خلفية أو بروتوكول شبكة مخصص، فحوص HTTP/DNS/الخدمات المُدارة (يتولاها servcheck)، والكتابة في ملفات SmokePing RRD. + + +## أهداف التوافق + +| المكوّن | الهدف | +|---|---| +| Cacti | 1.2.31 أو أحدث من سلسلة 1.2.x، دون ترقيعات للنواة | +| PHP | 8.2 أو أحدث؛ يظل `setup.php` قابلًا للتحليل في 8.0 كي يرفض بيئة غير مدعومة دون تعطيل واجهة Cacti | +| SmokePing | 2.9.0 و2.8.2 و2.7.3 (الأخير على Ubuntu 22.04 فقط حتى 2027-06-01) | +| Thold وMaint | لا حاجة إلى تغييرات | +| السلاسل | 10,000 لكل تثبيت مع 20 نبضة ping وخطوة 300 ثانية ([الأداء](docs/performance.md#supported-series-count)) | + + +## التوثيق + +| | | +|---|---| +| [التثبيت](docs/install.md) | المتطلبات، ربط دليل البيانات للقراءة فقط، التثبيت، الحاويات، الإصدارات المدعومة | +| [التشغيل](docs/operations.md) | معنى كل حالة وأدلتها، فحوص الصحة، السلوك عند تعطل المدخلات | +| [إضافة الأهداف إلى Cacti](docs/provisioning.md) | هدف واحد، أجهزة عديدة، إعادة الربط، الصلاحيات | +| [التنبيهات](docs/alerting.md) | قيم الملخص، مدد Thold، التقادم والبيانات المتأخرة، التداخل مع تنبيهات SmokePing، Maint | +| [صيغة الإعداد](docs/configuration-format.md) | تصدير YAML وXML واستيرادهما | +| [النسخ الاحتياطي والاستعادة](docs/backup-restore.md) | ما يجب نسخه وكيفية استئناف العمل بعد الاستعادة | +| [الأداء](docs/performance.md) | قياسات محلية وعلى مشغّل الإصدار مع 100 و1,000 و10,000 سلسلة؛ العدد المدعوم 10,000 لكل تثبيت | +| [تأهيل الأعطال](../../failure-qualification.md) | سيناريوهات الأعطال واختبار كل منها | +| [إجراء الإصدار](../../RELEASING.md) | طلب السحب والوسم الموقّع وسلوك سير العمل والتحقق من النتيجة | +| [أرشيف الإصدار](../../release.md) | الإصدار وسجل التغييرات والأرشيف المنشور | +| [الاختبار](../../testing.md) | مجموعات الاختبار وما ينفذه CI والمجموعة الحية مع SmokePing حقيقي | + + +## التصميم + +- [docs/PLAN.md](../../PLAN.md) هو الخطة الكاملة: المعمارية والحقائق الأصلية المعتمدة عليها (مع مصادرها) ونموذج الحالات وحدود الأمان وحسابات الأداء والاختبارات والمخاطر. +- يحفظ [docs/decisions/](../../decisions) سجلات القرارات المعمارية المتخذة. +- يربط [docs/REQUIREMENTS.md](../../REQUIREMENTS.md) معرّف كل متطلب بمسألته. + +```mermaid +flowchart LR + SP[SmokePing daemon] --> RRD[(RRD files)] + RRD -->|read-only| R[Reader on the adjacent Cacti poller] + RRD -->|read-only| G[Cacti graph templates] + R --> SS[Script server summary data sources] + SS -->|poller_output| T[Thold and Maint] + G --> P[Cacti graph permissions] +``` + + +## تتبّع العمل + +- تتبع **المعالم** معالم الخطة. لكل منها مشكلة ملحمية تسرد مشكلاتها الفرعية وأدلة اكتمالها. +- تُصنَّف **المشكلات** بالوسوم `type: requirement` و`type: research` و`type: decision` و`type: epic`. تتضمن مشكلات المتطلبات متطلبات مرقمة قابلة للاختبار (`REQ-AREA-NNN`) ومعايير قبول. +- تشمل **الوسوم** أيضًا `area:` و`phase:` و`priority:` و`status:`. راجع [CONTRIBUTING.md](../../../CONTRIBUTING.md#labels). +- تعرض [لوحة المشروع](https://github.com/users/somethingwithproof/projects/6) كل المشكلات عبر المعالم. + + +## المساهمة + +اقرأ [CONTRIBUTING.md](../../../CONTRIBUTING.md). تتطلب عمليات الإيداع إقرار DCO. تجري مناقشة التصميم في المشكلات؛ وتحمل القرارات المفتوحة وسم `type: decision`. + + +## الأمان + +أبلغ عن الثغرات على نحو خاص؛ راجع [SECURITY.md](../../../SECURITY.md). + + +## الترخيص + +رخصة GNU العمومية العامة v2.0، وهي رخصة Cacti وإضافاته نفسها. راجع [LICENSE](../../../LICENSE). diff --git a/docs/i18n/ar-SA/docs/alerting.md b/docs/i18n/ar-SA/docs/alerting.md new file mode 100644 index 0000000..bd624a5 --- /dev/null +++ b/docs/i18n/ar-SA/docs/alerting.md @@ -0,0 +1,63 @@ + + + +# التنبيه على بيانات SmokePing باستخدام Thold وMaint + +لا ترسل الإضافة تنبيهات. بل تزوّد Cacti بمصدر بيانات «SmokePing Summary» يُستطلع لكل موقع هدف، ويعمل عليه Thold وMaint كأي مصدر آخر ([ADR 0002](../../../decisions/0002-alert-through-cacti-data-sources.md)). ولا تحتاج أي منهما إلى تغيير. هذه الصفحة مرجع للمشغّل يوضح ما يبلّغ عنه المصدر وحدود هذا النهج. + + +## ما يبلّغ عنه مصدر البيانات + +يستطلع مجمّع Cacti كل مصدر ملخّص عبر خادم السكربتات. لا يقرأ السكربت سوى صف واحد من مخبأ القارئ: ولا يفتح ملف RRD أو يتصل بـ SmokePing أثناء استطلاع Cacti. + +| مصدر البيانات | المعنى | متى تكون قيمته `U` (مجهول) | +|---|---|---| +| `median` | وسيط زمن الذهاب والإياب لآخر جولة مكتملة، بالمللي ثانية | تجاوز عمر الجولة نبض SmokePing (ضعفي `step`)، أو كان RRD مفقودًا أو لم يُحدّث قط، أو لم يكن للجولة وسيط (فقدان كامل) | +| `loss_pct` | `loss / pings x 100` لآخر جولة مكتملة | تجاوز عمر الجولة النبض، أو كان RRD مفقودًا أو لم يُحدّث قط، أو لم تكتب الجولة قيمة فقدان | +| `age` | الثواني منذ آخر تحديث لـ RRD | ملف RRD غير موجود، أو لا يملك القارئ صف مخبأ له | + +لا تكون `median` و`loss_pct` مساويتين لـ `0` عند غياب البيانات. لذلك لا يبدو المجمّع المتوقف وكأنه بلا فقدان. تظل `age` رقمية ما دام RRD موجودًا، حتى بعد تحوّل القيمتين الأخريين إلى `U`، مما يتيح التنبيه على التقادم. يبلّغ الملف المنشأ الذي لم يُحدّث قط عن المدة منذ أول مرة رأت فيها الإضافة الهدف. + +الجولة التي يتراوح عمرها بين `step + freshness allowance` وضعفي `step` «متأخرة»: وتستمر الإضافة في الإبلاغ عن قيمها. الفقدان الكامل هو `loss_pct` بقيمة 100 و`median` بقيمة `U`. + +يجب أن يستطلع مصدر الملخص مجمّع Cacti الذي يشغّل القارئ (إعداد «SmokePing Poller»)، لأن المخبأ في قاعدة بيانات ذلك المجمّع. ترفض الإضافة إنشاء مصدر ملخص على جهاز مسند إلى مجمّع آخر وتحدد المجمّع الواجب استخدامه. + + +## العتبات + +أنشئ عتبات Thold على `loss_pct` و`median` و`age` من قوالب Thold أو على كل مصدر بيانات. قيم نموذجية: + +| التنبيه على | العتبة | ملاحظات | +|---|---|---| +| فقدان الحزم | حد أعلى لـ `loss_pct` بين 5 و10 | الفقدان الكامل يساوي 100 | +| التأخير | حد أعلى لـ `median` حسب حدّك بالمللي ثانية | لا تُصدر `U` تنبيه تأخير | +| توقف المجمّع أو بطؤه | حد أعلى لـ `age` يساوي ضعفي إلى ثلاثة أضعاف `step` | القيمة الوحيدة التي تبلّغ عن توقف المجمّع | + +لا تُفعّل عتبة `median` أو `loss_pct` عندما تكون القيمة `U`. استخدم `age` لحالة «توقف SmokePing عن القياس». + + +## الحدود + +تنشأ هذه من طريقة أخذ العينات في Cacti وSmokePing، لا من الإضافة، ولا تستطيع الإضافة إزالتها. + +**ينبغي أن تكون مدد Thold بطول `step` واحد على الأقل.** يستطلع Cacti بفاصل خاص به، ويقيس SmokePing بخطوة `step` خاصة به. عندما يكون فاصل Cacti أقصر من `step`، تُبلّغ الجولة نفسها أكثر من مرة. وعندما يكون أطول، تُتخطّى جولات. لذا لا تعادل عينة واحدة متجاوزة جولة واحدة متجاوزة، واضبط مدة تشغيل Thold على `step` واحد على الأقل (مع الخطوة الافتراضية 300 ثانية وفاصل المجمّع 300 ثانية، يكون التشغيل بعد استطلاعين). قد تنبّه مدة أقصر من `step` على جولة واحدة احتُسبت مرتين. + +**لا تعيد بيانات التابع المتأخرة تشغيل تنبيه أو إزالته أبدًا.** يخزّن تابع SmokePing النتائج التي تعذر تسليمها ويعيد إرسالها، ويطبقها الرئيسي حسب ترتيب الطوابع الزمنية، لذا قد تصل بيانات نافذة ماضية متأخرة. يقيّم Thold القيم عند استطلاعها. تحدّث الجولة المتأخرة ملف RRD والرسم، لكنها لا تغيّر قيمة سبق أن قيّمها Thold، فلا تُصدر تنبيهًا فائتًا ولا تزيل تنبيهًا مفتوحًا. ما دام التابع متأخرًا، تنمو `age` لذلك الموقع، فتُظهر التأخير. + +**لا ترى التنبيهات سوى الملخص.** يصف الوسيط والفقدان والعمر الجولة الأخيرة. الرسم الدخاني هو العرض المناسب للتحقيق في التوزيع. + +**تنبيهات SmokePing الخاصة منفصلة.** يواصل قسم `alerts` في إعداد SmokePing العمل. قد ينتج هدف ينبّه في SmokePing وThold إشعارين لمشكلة واحدة إذا تحققت شروط كليهما؛ ولا توقف الإضافة أيًا منهما. تسرد صفحة الصحة هذه الأهداف تحت `dual_alerting` استنادًا إلى قيمة `alerts` التي يقرؤها الجرد، مع توريثها كما يفعل SmokePing. + +**ملف Cacti RRD نسخة.** تُخزّن قيم الملخص في RRD الخاص بـ Cacti بالإضافة إلى SmokePing، ولذلك قد تظهر فروق الاحتفاظ أو الدمج بينهما في الرسوم. + + +## الصيانة + +يكبت جدول Maint من نوع «Cacti device» على جهاز الهدف إشعارات Thold لذلك الجهاز. يواصل Thold التقييم وتواصل الإضافة ملء مصدر الملخص، فلا توجد فجوات في الرسوم أو `age`. تستأنف الإشعارات عند انتهاء الجدول إذا ظلت العتبة متجاوزة، بعد بلوغ عدد التشغيل من جديد: لا يحتسب Thold التجاوزات أثناء صيانة الجهاز. + +لا يعرف Maint هدفًا منفردًا، بل أجهزة فقط. يُكتم الجهاز الذي يضم عدة أهداف لكل أهدافه. تتطلب جداول مستوى الهدف نوع جدول جديدًا في Maint، وهي ليست جزءًا من هذه الإضافة. + + +## التحقق + +يشغّل `tests/run-alert-e2e.sh` المسار الكامل في حاوية تضم Cacti 1.2.31 ونسختي `plugin_thold` و`plugin_maint` من مساحة عمل إضافات: يُلحق مجمّع اختباري جولات بملف RRD ذي بنية SmokePing، ويخزّنها القارئ، ويستطلع `poller.php` مصدر الملخص عبر خادم السكربتات، ثم يعمل عليه Thold وMaint. يتحقق من تشغيل عتبة `loss_pct` بعد عدد التشغيل وتعافيها، ومن كبت جدول جهاز Maint للإشعار مع استمرار استطلاع المصدر، ومن تشغيل التنبيه بعد انتهاء الصيانة، ومن تشغيل عتبة `age` عند توقف المجمّع الاختباري وتعافيها عند استئنافه. diff --git a/docs/i18n/ar-SA/docs/backup-restore.md b/docs/i18n/ar-SA/docs/backup-restore.md new file mode 100644 index 0000000..ca8e6b8 --- /dev/null +++ b/docs/i18n/ar-SA/docs/backup-restore.md @@ -0,0 +1,98 @@ + + + +# النسخ الاحتياطي والاستعادة + +يواصل Cacti وSmokePing المستعادان العمل عند استعادة ثلاثة أشياء معًا: قاعدة بيانات Cacti وإعداد SmokePing ودليل بياناته. توضح هذه الصفحة محتويات كل منها وكيفية نسخها وما يجب فعله بعد الاستعادة، وكيفية استعادة إعداد الإضافة الخاص من تصدير YAML عند فقدان قاعدة البيانات. + + +## ما يجب نسخه احتياطيًا + +| العنصر | المحتوى | سبب حاجة الإضافة إليه | +|---|---|---| +| قاعدة بيانات Cacti | جداول الإضافة (الأهداف والربط والكائنات المنشأة ومخبأ القارئ والصحة)، وأجهزة Cacti ومصادر بياناته ورسومه وإعدادات الإضافة | توجد هنا عمليات الربط ومسارات مصادر البيانات وتعريفات الرسوم | +| إعداد SmokePing: `/etc/smokeping/config` **وكل ملف يضمّه** (أسطر `@include`، و`config.d/*` على Debian وUbuntu، وملف `secrets`، و`smokemail`، و`basepage.html`) | شجرة الأهداف | يحلّلها الجرد. هوية الهدف مساره في هذه الشجرة، وملف RRD الخاص به هو `datadir/.rrd` | +| دليل بيانات SmokePing (`datadir`) | ملفات RRD | تقرؤها جميع الرسوم وقيم الملخص؛ وهي السجل التاريخي ولا يمكن إعادة بنائها | + +إعدادات الإضافة في قاعدة البيانات. التصدير الموضح [أدناه](#restore-from-the-yaml-export) نسخة نصية ثانية من إعداد الإضافة الخاص، وليس بديلًا لأي من العناصر الثلاثة. + + +## أخذ النسخ + +خذ تفريغ قاعدة البيانات ونسخ الملفات في وقت متقارب، كي تصف الأهداف في قاعدة البيانات والملفات على القرص الإعداد نفسه. + +```sh +# The Cacti database (use your own credentials file or option file, not a password on the command line) +mariadb-dump --defaults-extra-file=/root/.cacti-backup.cnf --single-transaction cacti > cacti.sql + +# SmokePing's configuration, with its included files +tar -czf smokeping-config.tgz -C /etc/smokeping . + +# SmokePing's data directory +tar -czf smokeping-datadir.tgz -C /var/lib/smokeping . + +# The plugin's own configuration, as YAML (optional second copy) +php /var/www/html/cacti/plugins/smokeping/cli/smokeping.php export --file=/var/backups/smokeping-config.yaml +``` + +استخدم `datadir` الخاص بتوزيعتك (`/var/lib/smokeping/rrd` على EL وFedora). يكتب SmokePing ملفات RRD باستمرار. قد تلتقط نسخة أثناء تشغيله ملفًا في منتصف تحديثه؛ للحصول على نسخة متسقة خذ لقطة لنظام الملفات أو وحدة التخزين، أو أوقف SmokePing أثناء النسخ (`systemctl stop smokeping`؛ الفجوة فجوة قياسات لا فقدانًا للتاريخ). قد يحتوي دليل البيانات على أدلة أخرى (`__cgi` على Debian، و`images` على Alpine)؛ ومن الآمن تضمينها أو استبعادها. + +لا تكتب الإضافة ملفات SmokePing مطلقًا، لذلك لا تتعارض استعادة دليل البيانات مع ما تحتفظ به الإضافة إلا عبر عمليات الربط الموضحة أدناه. + + +## الاستعادة + +1. ثبّت Cacti وPHP وSmokePing حسب [دليل التثبيت](install.md)، وثبّت إصدار الإضافة نفسه أو إصدارًا أحدث من أرشيف الإصدار. +2. استعد قاعدة بيانات Cacti. +3. استعد إعداد SmokePing ودليل بياناته إلى مسارات النسخة الاحتياطية، وشغّل SmokePing. +4. اربط دليل البيانات للقراءة فقط عند مسار ربط الإضافة ([دليل التثبيت، الخطوة 3](install.md#3-mount-the-data-directory-read-only-inside-cactis-rra-path)). +5. دع المجمّع يعمل، أو شغّل `php plugins/smokeping/poller_smokeping.php --force --inventory` مرة واحدة. + +لا حاجة إلى شيء آخر. إذا كانت ملفات الإضافة أحدث من قاعدة البيانات المستعادة، تُرحّل الإضافة جداولها عند تحميل الصفحة التالي أو دورة المجمّع التالية، ولا تسجل إصدارها إلا بعد نجاح كل خطوة. + +ما تستعيده هذه العملية وسبب نجاحها: + +- **يصل الربط إلى ملفات RRD نفسها.** مسار المصدر هو `/smokeping/.rrd` نسبةً إلى نقطة الربط، فلا يتغير بتغير المضيف أو دليل Cacti. هوية الهدف مساره في شجرة SmokePing لا معرّف قاعدة بيانات، والإعداد المستعاد يحمل الشجرة نفسها. +- **يستأنف القارئ.** يحتفظ مخبؤه بآخر جولة رآها لكل ملف؛ تقرأ الدورة التالية `lastupdate` لكل ملف وتستبدل الصف. تلتقط أول دورة جولة كتبها SmokePing أثناء توقف Cacti، وتحسب حداثة كل سلسلة من وقت الملف نفسه لا من آخر مرة فحصه القارئ. +- **تُعرض الرسوم.** فهي رسوم Cacti عادية على المصادر والملفات المستعادة. + +تحقق من النتيجة في **SmokePing Health**: يكون الربط والقارئ والجرد بحالة OK بعد دورة مجمّع واحدة، وتسرد صفحة SmokePing الأهداف المرتبطة بحداثة حالية. + + +### إذا عادت قاعدة البيانات أقدم من إعداد SmokePing + +لن يوجد في قاعدة البيانات المستعادة هدف أضيف إلى SmokePing بعد النسخ. يجده الجرد التالي ويسرده كغير مرتبط. يُعلّم الهدف المحذوف منذ ذلك الحين كمختفٍ، ويعيد المسؤول ربطه أو يؤرشفه كالمعتاد. لا يضيع شيء: الملفات في دليل البيانات، والربط بنقرة واحدة في **SmokePing Inventory**. + + +### إذا استُعيد دليل البيانات دون أحدث جولاته + +يواصل SmokePing الكتابة في الملفات المستعادة من آخر تحديث لها. الفجوة في الرسوم هي المدة بين النسخ والاستعادة. + + +## الاستعادة من تصدير YAML + +عند فقدان قاعدة بيانات Cacti وبقاء التصدير فقط، يمكن استعادة أهداف الإضافة وروابطها دونها، وإعادة إنشاء مصادر البيانات والرسوم: + +1. ثبّت Cacti والإضافة على المضيف الجديد، واستعد إعداد SmokePing ودليل بياناته واربطه كما سبق. اضبط المسارات في صفحة Settings (لا تُستورد؛ راجع [الصيغة](configuration-format.md)). +2. أعد إنشاء أجهزة Cacti **باسم المضيف والوصف نفسيهما**. يمكن أن تختلف المعرّفات. يعرّف التصدير كل جهاز مرتبط بهاتين القيمتين. +3. افحص التصدير وطبّقه: + + ```sh + php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml + php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml --apply --confirm= + ``` + + يسرد الفحص التغييرات المقترحة ويرفض ربطًا جهازه مفقود أو ملتبس. لا يُكتب شيء حتى الأمر الثاني، الذي يحتاج إلى معرّف الخطة المطبوع من الأول. +4. أعد إنشاء مصادر البيانات والرسوم لكل هدف مرتبط: `php plugins/smokeping/cli/smokeping.php provision --device=`. تشير إلى الملفات السابقة نفسها. + +يحفظ التصدير إعدادات الإضافة وأهدافها وروابطها، ولا يحفظ مصدر بيانات أو رسمًا أو مسار RRD، لذا تلزم الخطوة 4؛ أما الاستعادة من نسخة قاعدة بيانات فلا تحتاجها. + + +## إلغاء التثبيت + +يحاول إلغاء التثبيت تصدير YAML (راجع [دليل التثبيت](install.md#upgrading-and-removing))، لكنه لا يتوقف إذا فشل التصدير. **قبل إلغاء التثبيت، صدّر الإعداد بنفسك وتحقق من أن النسخة الاحتياطية قابلة للقراءة وكاملة.** لا يمس إلغاء التثبيت ملفات SmokePing مطلقًا؛ استعد من التصدير الذي تحققت منه كما في الحالة أعلاه. + + +## التحقق + +يشغّل `sh tests/run-restore-e2e.sh ` نوعي الاستعادة في حاويات وقواعد بيانات جديدة: يجهّز جهازًا ومصادر في تثبيت عامل، ويفرّغ قاعدة البيانات ويؤرشف إعداد SmokePing ودليل بياناته، ويستعيد الثلاثة في حاويات جديدة بينما يكتب SmokePing جولة جديدة، ويتحقق من تمكين الإضافة وأن ترقيتها لا تفعل شيئًا، ومن تطابق كل ربط وجهاز ومسار مصدر، ومن وصول كل مصدر تحت نقطة الربط إلى ملف يطابق مجموعه الاختباري النسخة، ومن عرض رسم، ومن احتواء مخبأ القارئ على الجولة الجديدة بعد دورة مجمّع واحدة. ثم يستعيد من تصدير YAML وحده إلى قاعدة جديدة ويتحقق من أن الربط يتبع اسم الجهاز وأن دورة الجرد تحفظه وأن التجهيز يعيد إنشاء المصادر على الملفات نفسها. diff --git a/docs/i18n/ar-SA/docs/configuration-format.md b/docs/i18n/ar-SA/docs/configuration-format.md new file mode 100644 index 0000000..1fecb8e --- /dev/null +++ b/docs/i18n/ar-SA/docs/configuration-format.md @@ -0,0 +1,121 @@ + + + +# صيغة ملف الإعداد + +تُصدّر إعدادات الإضافة الخاصة وتُستورد بصيغة ملف واحدة ذات تمثيلين: YAML (الافتراضي) وXML. تعرّف هذه الصفحة إصدار المخطط 1. أسباب التصميم في [القرار 0008](../../../decisions/0008-yaml-and-xml-configuration-files.md). + +يحفظ الملف إعدادات الإضافة وأهداف SmokePing التي قرأتها (الأهداف المرصودة) وجهاز Cacti المرتبط بكل هدف. لا يحفظ مصدر بيانات أو رسمًا أو مسار RRD أو بيانات اعتماد. قوالب الرسوم والبيانات والمضيفين في Cacti شيء مختلف وتظل بصيغة Cacti XML. + + +## الأوامر + +```sh +php plugins/smokeping/cli/smokeping.php export # YAML to standard output +php plugins/smokeping/cli/smokeping.php export --format=xml --file=/var/backups/smokeping-config.xml +php plugins/smokeping/cli/smokeping.php import --file=smokeping-config.yaml # check only +php plugins/smokeping/cli/smokeping.php import --file=smokeping-config.yaml --apply --confirm= +``` + +ينشئ `export --file` ملفًا جديدًا لا يقرؤه إلا مالكه ويرفض الكتابة فوق ملف موجود. يقرأ `import` دون `--apply` الملف ويفحصه ويطبع كل تغيير مقترح ومعرّف خطة ولا يكتب شيئًا. يحتاج `--apply` إلى `--confirm` مع ذلك المعرّف؛ ويطبق في معاملة واحدة ويرفض إن تغير الملف أو التثبيت منذ الفحص. رمز الخروج: 0 اكتمل، 1 رُفض أو فشل، 2 أخطاء في الملف أو الخطة. + +توجد الإجراءات نفسها في **Management > SmokePing Configuration** (نطاق SmokePing Admin): نزّل تصديرًا، ثم اختر ملفًا للفحص وراجع التغييرات المدرجة وطبّقها. + +لا يفعل الاستيراد سوى الإضافة والتحديث. لا يحذف هدفًا، ولا ينقل ربطًا إلى جهاز آخر (أعد الربط في صفحة Inventory)، ولا ينشئ مصدر بيانات أو رسمًا أو ملف RRD، ولا يقرأ دليل بيانات SmokePing أو يكتب فيه. يكتب إلغاء التثبيت تصدير YAML للإعداد إلى **Backup Directory**، أو إلى `cache/smokeping/` في دليل Cacti إذا كان الإعداد فارغًا. للملف اسم عشوائي ووضع `0600`، ويحتوي الدليل الافتراضي على `.htaccess` يمنع كل الوصول و`index.php` لا يقدم شيئًا. إذا لم يوجد Backup Directory أو لم يكن قابلًا للكتابة، فلا يُكتب تصدير (ولا ترجع الإضافة إلى الافتراضي)، ويستمر إلغاء التثبيت ويبلّغ بمكان الملف أو بعدم كتابة ملف. اختر دليلًا خارج جذر الويب. + + +## إصدار المخطط 1 + +```yaml +schema_version: 1 # required; a higher number is refused + +settings: # optional; any subset of the settings below + smokeping_poller_id: 1 + smokeping_reader_budget: 120 + smokeping_inventory_interval: 300 + smokeping_freshness_allowance: 60 + smokeping_uninstall_keep_tables: false + +reference_settings: # optional; shown for reference, never imported + smokeping_config_file: /etc/smokeping/config + smokeping_backup_dir: '' + smokeping_datadir: /var/lib/smokeping + smokeping_mount_path: /var/www/html/cacti/rra/smokeping # omitted from exports while it is the default + +targets: # optional + - path: Europe/Paris # required; the SmokePing tree path + poller_id: 1 # default 1; must exist + host: paris.example.net + probe: FPing + menu: Paris # optional text + title: 'Paris: gateway' # optional text + slaves: # optional list of slave names + - site-b + nomasterpoll: false + step: 300 # 0 to 604800 + pings: 20 # 0 to 10000 + mode: observed # only observed + admin_state: enabled # enabled, disabled, or archived + present: true # honored for a new target only + +mappings: # optional + - target: Europe/Paris # a target in this file or already in the installation + poller_id: 1 + device: + hostname: paris-gw.example.net # the Cacti device's host name (not case sensitive) + description: Paris gateway # and its description (exact) +``` + +الهوية. يُعرّف الهدف بـ `poller_id` و`path`. يُعرّف الجهاز بـ `hostname` و`description`؛ ويرفض الفحص الربط إذا لم يوجد جهاز بهذه الثنائية أو وجد أكثر من جهاز. يحذف الاستيراد الفراغات المحيطة بالنص لأن الإضافة تقرأ كل قيمة مخزنة بعد حذفها. + +المفاتيح المحجوزة. `managed_targets` و`probe_profiles` محجوزان لإصدار لاحق يضيف الوضع المُدار. يرفضهما الإصدار 1 بخطأ يسمّي المفتاح، كي لا يُطبق ملف لذلك الإصدار جزئيًا. يوسّع إصدار لاحق المخطط بهما؛ ولا يرفع `schema_version` إلا إذا غيّر معنى مفتاح موجود هنا. + +التحديثات. لهدف موجود، لا يغيّر الاستيراد إلا `host` و`probe` و`menu` و`title` و`slaves` و`nomasterpoll` و`step` و`pings` و`admin_state`. يظل إعداد SmokePing مصدر الحقول الستة الأولى؛ يعيدها الجرد التالي، لذا استخدم الاستيراد لاستعادة `admin_state` وتهيئة تثبيت جديد، لا لتحرير الأهداف. + +يجب أن تكون قيم الإعدادات من النوع المذكور. لا يجوز أن يحتوي النص على محارف تحكم. + +إعدادات مرجعية فقط. لا يكتب الاستيراد أبدًا إعدادًا يسمّي ملفًا أو دليلًا (كل ما تحت `reference_settings` أعلاه): يجب ألا يستطيع ملف تغيير أماكن قراءة الإضافة أو كتابتها. يحددها المخطط بنوعها، ويرفض الملف الذي يضع أحدها تحت `settings`. تحت `reference_settings` تُفحص صيغتها (مسار مطلق، أو فارغ حيث يُسمح)، وتُقارن بالتثبيت، وتُدرج في الخطة كـ `not applied, change on the Settings page` عند الاختلاف. غيّرها في صفحة Settings. تسرد ملفات 1.0.0-rc.1 المصدّرة أيضًا `smokeping_perl_binary` و`smokeping_lib_dir` هناك؛ لم تعد هذه الإعدادات موجودة ويتجاوزها الاستيراد. + + +## XML + +```xml + + + + 1 + false + + + /var/lib/smokeping + + + + site-b + + + + + + + + +``` + +يطابق XML مفاتيح YAML أعلاه واحدًا لواحد. القيم المنطقية `true` أو `false`. يرفض القارئ أي إعلان DOCTYPE أو كيان، ولا يحمّل موارد خارجية، ولا يقبل إلا هذه العناصر. + + +## مجموعة YAML الفرعية + +يقبل القارئ الخرائط والقوائم الكتلية، والقيم المفردة العادية والمحاطة باقتباس مفرد أو مزدوج، والتعليقات، والكتل الحرفية `|` و`|-`، مع `---` واحد اختياري في البداية. تقبل القيم مزدوجة الاقتباس تسلسلات الهروب `\\ \" \/ \n \t \r \0 \b \f \e \xHH \uHHHH`؛ وتضاعف القيم مفردة الاقتباس علامة الاقتباس (`''`). تُغلق القيمة المقتبسة في سطرها نفسه. + +يرفض مع رقم السطر: المراسي (`&x`)، والأسماء المستعارة (`*x`)، والوسوم (`!x`)، والمجموعات الانسيابية (`[a, b]`، `{a: b}`)، والكتل المطوية (`>`)، والمستندات المتعددة، والتوجيهات، ومفاتيح الدمج (`<<`)، والمفاتيح المعقدة (`?`)، والمفاتيح المكررة، وعلامات الجدولة للمسافة البادئة، والقيم العادية متعددة الأسطر، والتداخل الأعمق من 8 مستويات. ويرفض قيمة عادية يقرؤها إصدار YAML آخر كغير نص: `yes` و`no` و`on` و`off` و`y` و`n`، والأعداد ذات الصفر الأولي، والكسور العشرية، والسداسي عشري، والتواريخ، والأوقات مثل `1:30`. ضعها بين اقتباسين (`'yes'`). تحتفظ `true` و`false` و`null` و`~` والأعداد الصحيحة العادية بمعناها. + +يقتبس المصدّر كل سلسلة قد يسيء قارئ تحليلها، بما فيها ما يحتوي نقطتين أو `#`، أو فراغًا أوليًا أو نهائيًا، أو محرفًا أول يعامله YAML كمؤشر. + + +## الحدود + +تُحدد الملفات بـ 8 MiB و8 مستويات تداخل في الصيغتين، والسطر بـ 16 KiB. يُفحص الحجم قبل قراءة الملف. diff --git a/docs/i18n/ar-SA/docs/install.md b/docs/i18n/ar-SA/docs/install.md new file mode 100644 index 0000000..cc1f905 --- /dev/null +++ b/docs/i18n/ar-SA/docs/install.md @@ -0,0 +1,214 @@ + + + +# تثبيت إضافة SmokePing + +ينقل الدليل مضيف Cacti 1.2 وتثبيت SmokePing من البداية إلى الرسوم في Cacti. يغطي تثبيت الإضافة والوصول للقراءة فقط إلى دليل البيانات (أكثر الأجزاء عرضة للخطأ)، والتحقق والحاويات والدعم. العمل اليومي في [التشغيل](operations.md)، والتنبيهات في [التنبيهات](alerting.md)، والنسخ في [النسخ والاستعادة](backup-restore.md). + + +## ما هو مدعوم + +| المكوّن | المدعوم | المختبَر هنا | +|---|---|---| +| Cacti | 1.2.31 وفرع 1.2.x الحالي (يغير 1.2.32 فحص مسارات المصادر؛ راجع الربط) | إصدار 1.2.31 ونسخة تطوير 1.2.32 | +| PHP | 8.2 أو أحدث. يُرفض التثبيت على 8.0 و8.1 ويواصل Cacti العمل | 8.2.35 للتكامل والاختبارات الشاملة؛ فحص صياغة نقاط الدخول على 8.0 | +| SmokePing | 2.9.0 و2.8.2 و2.7.3 (Ubuntu 22.04 فقط حتى 2027-06-01) | الثلاثة لمحلل الإعداد، بالمقارنة مع الأصلي في 2.7.3 (Ubuntu 22.04) و2.8.2 (Debian 13) و2.9.0 (Fedora 45)؛ والثلاثة لدقة الرسوم | +| rrdtool | إصدار Cacti؛ يشغّل القارئ `path_rrdtool` | 1.7.2 | +| Thold وMaint | دون تغيير | نسخ مساحة عمل الإضافات | +| عدد السلاسل | 10,000 لكل تثبيت، 20 نبضة وخطوة 300 ثانية، أربع vCPU مخصصة و8 GB ([الأداء](performance.md#supported-series-count)) | 100 و1,000 و10,000 على مشغّل الإصدار | + +«السلسلة» هدف في موقع قياس واحد (الرئيسي أو تابع). يتبع دعم التوزيعات فترات الدعم الكامل للمورّدين؛ راجع [المصفوفة](../../../research/distribution-matrix/README.md). توفر Debian 13 وUbuntu 22.04 إلى 26.10 وEL 9 وFedora 43 إلى 45 وAlpine 3.22 إلى 3.24 حزم SmokePing. **لا توجد حزمة SmokePing في EL 10 وopenSUSE Leap 16**؛ تعمل الإضافة هناك بقدر عمل تثبيت SmokePing من المصدر، وهو خارج هذا الدليل. + + +## كيف تتكامل الأجزاء + +يكتب SmokePing ملفات RRD، ويرسمها Cacti وتقرأ الإضافة أحدث قيمها، ولا يكتبها أي منهما. يرفض Cacti 1.2.32 والأحدث مسار مصدر خارج RRA، لذا تشير الإضافة إلى دليل SmokePing عبر **ربط للقراءة فقط داخل مسار RRA في Cacti**، افتراضيًا `/smokeping` ([القرار 0007](../../../decisions/0007-read-only-mount-under-rra-path.md)). الربط هو الحماية الرئيسية أيضًا: لا يستطيع تنظيف Cacti الحذف أو إعادة التسمية عبره. + +يجب أن يقرأ مجمّع Cacti الذي يشغّل القارئ شيئين على مضيف SmokePing: + +1. الإعداد (`/etc/smokeping/config`) وملفاته المضمّنة، بمحلل PHP الخاص بالإضافة. يجب أن تبقى المضمّنة في دليل الإعداد أو تحته؛ تُرفض غيرها. لا تشغّل الإضافة Perl ولا تحتاج مكتبته الخاصة بـ SmokePing. +2. دليل البيانات عبر الربط. + +عند اختلاف المضيفين، شارك البيانات للقراءة فقط (NFS) واربطها على مضيف مجمّع SmokePing؛ راجع [التشغيل](operations.md#topologies). SmokePing على مجمّع Cacti بعيد مرحلة لاحقة غير مدعومة هنا. + + +## 1. تثبيت SmokePing (إن لم يكن مثبتًا) + +على Debian 13 وUbuntu: + + +```sh +apt-get update +DEBIAN_FRONTEND=noninteractive apt-get install -y smokeping +``` + +على EL 9 (الحزمة في EPEL وتحتاج CodeReady Builder): + + +```sh +dnf install -y epel-release +dnf config-manager --set-enabled crb +dnf install -y smokeping +``` + +اضبط SmokePing كالمعتاد وشغّله بـ `systemctl enable --now smokeping`. دليل البيانات `/var/lib/smokeping` على Debian وUbuntu وAlpine، و`/var/lib/smokeping/rrd` على EL وFedora. أدناه `DATADIR` هو ذلك الدليل (`datadir` في `*** Database ***`)، و`RRA` مسار Cacti (Console > Configuration > Settings > Paths، «RRA Path»؛ `/var/www/html/cacti/rra` في الأمثلة). + +**محتويات أخرى للدليل.** تحفظ حزمة Debian مخابئ التابعين في `DATADIR/__cgi/
/` (قيمة `dyndir`) ولا تنشئ أدلة الأقسام بنفسها، لذا يترك تابع لم يبلّغ بعد ذلك الدليل فارغًا أو مفقودًا. يحفظ Alpine مخبأ الصور في `DATADIR/images`، ومخابئ الفرز في `DATADIR/__sortercache`. تتجاهل الإضافة الجميع: لا تسرد دليل البيانات قط، وتقرأ فقط RRD المذكورة في الإعداد (`
/.rrd` و`~.rrd` لكل تابع). فلا تُقرأ هذه الأدلة أو RRD بلا هدف مالك (مثل `Local/LocalMachine.rrd`) ولا تُسرد ولا تُبلّغ كخطأ. تحقق ذلك على رئيسي Debian 13 وتابعين ([الاختبار](../../../testing.md#the-live-suite)). + + +## 2. السماح لمجمّع Cacti بقراءة SmokePing + +في التوزيعات ذات الحزم، RRD مقروءة للجميع وكل الأدلة فوقها قابلة للاجتياز للجميع، فلا يحتاج مستخدم المجمّع **عضوية مجموعة**. الإعداد مقروء للجميع على Debian وUbuntu وAlpine، و`0640 root:apache` على EL وFedora حيث لا يقرؤه إلا `apache` وroot. + +افحص القراءة كمستخدم المجمّع (`www-data` على Debian/Ubuntu، و`apache` على EL/Fedora): + + +```sh +runuser -u "$POLLER_USER" -- test -r "$DATADIR" && echo "datadir readable" +runuser -u "$POLLER_USER" -- test -r /etc/smokeping/config && echo "config readable" +runuser -u "$POLLER_USER" -- ls "$DATADIR" > /dev/null && echo "datadir listable" +``` + +يجب أن يطبع كل سطر، وهذا ما يحدث مع صلاحيات الحزم؛ لا حاجة لمجموعة أو إعداد آخر على مضيف SmokePing. يفشل فقط مع صلاحيات أشد (مثل `datadir` بوضع `0750 smokeping:smokeping`) أو مستخدم غير `apache` على EL/Fedora حيث الإعداد `0640 root:apache`. امنح ذلك المستخدم وحده القراءة، مثل ACL (`setfacl -R -m u:$POLLER_USER:rX` على دليل الإعداد و`DATADIR`)، ولا تجعل ملفات SmokePing قابلة للكتابة لمستخدم Cacti. + + +## 3. ربط دليل البيانات للقراءة فقط داخل RRA + +اختر إحدى الطريقتين. تنشئان ربطًا محليًا يحتاج root مرة واحدة. + + +### الخيار A: سطر `/etc/fstab` + + +```sh +mkdir -p "$RRA/smokeping" +echo "$DATADIR $RRA/smokeping none bind,ro 0 0" >> /etc/fstab +mount "$RRA/smokeping" +``` + +يسري فورًا وعند كل إقلاع. إن اختبرت بـ `mount --bind` فأضف إعادة ربط لأن `util-linux` القديم يتجاهل `ro` في الربط الأول: `mount -o remount,bind,ro "$RRA/smokeping"`. + + +### الخيار B: وحدة systemd `.mount` + +يجب أن يكون اسم الملف مسار نقطة الربط مع تحويل `/` إلى `-`؛ دع systemd يحسبه: + + +```sh +unit=$(systemd-escape --path --suffix=mount "$RRA/smokeping") +cat > "/etc/systemd/system/$unit" < +### التحقق من الربط + + +```sh +findmnt -no TARGET,SOURCE,OPTIONS "$RRA/smokeping" +findmnt -no OPTIONS "$RRA/smokeping" | tr ',' '\n' | grep -x ro +touch "$RRA/smokeping/.cacti-write-test" && echo "WRITABLE: fix the mount before continuing" || echo "read-only, as required" +ls "$RRA/smokeping" | head +``` + +يجب ظهور `ro` وفشل `touch` برسالة `Read-only file system` (حتى كـ root)، وأن تعرض القائمة أقسام SmokePing. تعيد Health الفحص من `/proc/self/mountinfo` وتعد الربط القابل للكتابة أو المفقود أو الرابط الرمزي في المسار **خطأً**. الرابط الرمزي ليس بديلًا: يرفض Cacti 1.2.32 والأحدث مسارات تمر به. + + +## 4. تثبيت الإضافة + +من أرشيف إصدار (راجع [التغليف](../../../release.md)): + +```sh +tar -xzf smokeping-0.2.0.tar.gz -C /var/www/html/cacti/plugins +chown -R root:root /var/www/html/cacti/plugins/smokeping +cd /var/www/html/cacti +sudo -u www-data php cli/plugin_manage.php --plugin=smokeping --install --enable --allperms +``` + +يجب تسمية الدليل `smokeping`. شغّل الأمر الأخير كمستخدم يملك ملفات Cacti (`apache` على EL). يمنح `--allperms` مسؤول وحدة التحكم النطاقات الثلاثة؛ يحصل الآخرون على **SmokePing View** أو **SmokePing Operator** أو **SmokePing Admin** عبر User Management. يشمل Operator وصول View ويشمل Admin وصول Operator. تثبّت الإضافة الجداول وقوالب الرسوم والمضيفين؛ عند فشل استيراد القوالب تذكر ذلك في Health وتواصل العمل، ويعيد **Retry Template Import** المحاولة بعد إصلاح السبب. + +يُرفض التثبيت على PHP أقدم من 8.2 برسالة تحدد المطلوب، ولا يتأثر باقي Cacti. + + +## 5. الإعداد والتأكيد + +افتح **Console > Configuration > Settings > SmokePing** وافحص: + +| الإعداد | المعنى | +|---|---| +| SmokePing Poller | مجمّع Cacti على مضيف SmokePing أو يشاركه نظام الملفات. هو وحده يقرأ البيانات. | +| SmokePing Configuration File | `/etc/smokeping/config` ما لم تنقله | +| SmokePing Data Directory | `DATADIR` كما يراه SmokePing | +| Cacti Mount of the Data Directory | نقطة الخطوة 3؛ الافتراضي `/smokeping` | +| Loss Colors | Automatic، إلا إذا تعذر على القارئ رؤية `Smokeping.pm` وكان الإصدار 2.7: اختر SmokePing 2.7. راجع [الألوان](provisioning.md#loss-colors) | + +افتح **SmokePing Health** على خادم المجمّع. يقرأ صف الإعداد الملف فورًا ويعرض عدد الأهداف أو أول خطأ بملفه وسطره. بعد الدورة التالية يجب أن تكون كل الصفوف OK: PHP والإعداد والقارئ والجرد والربط والقوالب. لتشغيل الجرد والقارئ فورًا: + +```sh +sudo -u www-data php plugins/smokeping/poller_smokeping.php --force --inventory +``` + +يسرد **SmokePing Inventory** الآن جميع الأهداف. لا رسوم بعد؛ راجع [التجهيز](provisioning.md) لإضافتها إلى Cacti. + + +## اللغات + +تضم الإضافة الإسبانية لإسبانيا (`es-ES`) والفرنسية (`fr-FR`) والألمانية (`de-DE`) والصينية المبسطة (`zh-CN`) والهندية (`hi-IN`) والعربية (`ar-SA`) واليابانية (`ja-JP`). يعرضها Cacti بعد تفعيل Language Support (Configuration > Settings > General > Language Support) واختيار المستخدم اللغة. تضم أيضًا إسبانية أمريكا اللاتينية (`es-419`)، لكن Cacti 1.2 لا يوفر هذه المحلية للاختيار؛ لن تعمل حتى يضيفها Cacti، وإلى ذلك الحين اختر الإسبانية (`es-ES`). + + +## الحاويات + +شغّل القارئ حيث يرى العنصرين في أول الدليل. + +- **Cacti في حاوية وSmokePing على المضيف.** اربط البيانات للقراءة فقط عند RRA والإعداد أيضًا للقراءة فقط: + + ```sh + docker run -d --name cacti \ + -v /var/lib/smokeping:/var/www/html/cacti/rra/smokeping:ro \ + -v /etc/smokeping:/etc/smokeping:ro \ + my-cacti-image + ``` + + استبدل الجانب الأيسر لربط البيانات بـ `DATADIR` للمضيف. لا تحتاج الصورة شيئًا من SmokePing، لا Perl ولا حزمة `smokeping`. يجب أن يكون PHP 8.2 أو أحدث. تفحص Health `:ro`؛ غيابه خطأ. +- **Docker Compose.** نفسه كمدخلات `volumes:` مع `read_only: true` و`type: bind`: + + ```yaml + services: + cacti: + volumes: + - type: bind + source: /var/lib/smokeping + target: /var/www/html/cacti/rra/smokeping + read_only: true + ``` + +- **Kubernetes.** وحدة تخزين مع `readOnly: true` في `volumeMounts`، خلفها hostPath أو NFS أو CSI يكتب فيه pod SmokePing. +- **SmokePing في حاوية.** ضع `datadir` على وحدة مشتركة مع مضيف Cacti واربطها للقراءة فقط كما سبق. لا تحتاج الإضافة الدخول إلى حاوية SmokePing. + + +## منظف RRD في Cacti يسرد ملفات SmokePing + +يمر المنظف (**Utilities > RRD Cleaner**) بكل RRA، فيسرد RRD الخاصة بـ SmokePing بلا مصدر Cacti، ومنها `target~slave.rrd` للتابع، كغير مستخدمة ويعرض حذفها. لا تحددها. يفشل الحذف أو الأرشفة عبر الربط للقراءة فقط، ويسجل Cacti تحذيرًا ويحذف مدخل الطابور، فتبقى الملفات، لكن التحذيرات ضوضاء وقد يفقد الربط القابل للكتابة البيانات. تزيل الإضافة المداخل التي تتعرف عليها قبل التطهير (تمسح الطابور أول كل دورة)، فتقل التحذيرات. لا قائمة استثناء للمنظف، فاقرأ قائمته قبل التحديد. + + +## الترقية والإزالة + +استبدل دليل الإضافة بالإصدار الجديد وافتح Plugins أو انتظر الدورة التالية؛ ترحّل الجداول والقوالب ولا تسجل الإصدار إلا بعد نجاح كل خطوة، فتُستكمل الترقية المنقطعة في التالية. يوقف تعطيل الإضافة مهامها ويترك ملفات SmokePing. **قبل إلغاء التثبيت، صدّر الإعداد بنفسك وتحقق من أن النسخة الاحتياطية قابلة للقراءة وكاملة.** يحاول إلغاء التثبيت تصدير إعداد الإضافة بصيغة YAML إلى Backup Directory أو `cache/smokeping/` في Cacti (اسم عشوائي، وضع `0600`، والمسار معروض عند النجاح). إذا فشل التصدير، يُسجّل تحذير ويُعرض، لكن إلغاء التثبيت يستمر. تُحذف جداول الإضافة ما لم يُضبط **Keep Plugin Tables on Uninstall**، ولا تُمس ملفات SmokePing أو إعداداته مطلقًا. diff --git a/docs/i18n/ar-SA/docs/operations.md b/docs/i18n/ar-SA/docs/operations.md new file mode 100644 index 0000000..4b816b6 --- /dev/null +++ b/docs/i18n/ar-SA/docs/operations.md @@ -0,0 +1,107 @@ + + + +# تشغيل إضافة SmokePing + +كيفية قراءة ما تعرضه الإضافة ومعنى كل حالة وأدلتها، وما يجب فحصه عند ظهور خلل، وسلوكها عند فشل المدخلات. التثبيت في [التثبيت](install.md)، والتنبيهات في [التنبيهات](alerting.md)، والنسخ في [النسخ والاستعادة](backup-restore.md). + +راجع [أدوار الوصول](../README.md#access-roles) لصلاحيات View وOperator وAdmin وسلوك الفرز الشخصي. + + +## الصفحات + +| الصفحة | النطاق | ما تعرضه | +|---|---|---| +| **SmokePing** (تبويب علوي) | View | أحدث حالة لأهداف الأجهزة المسموح لك برؤيتها، صف لكل هدف وموقع | +| **SmokePing Inventory** | Admin | جميع أهداف إعداد SmokePing، مرتبطة أم لا، ومقترحات إعادة الربط المفتوحة | +| **SmokePing Health** | Admin | الفحوص أدناه وزر إعادة محاولة استيراد القوالب | +| **SmokePing Configuration** | Admin | تصدير إعداد الإضافة واستيراده ([الصيغة](configuration-format.md)) | +| **Import SmokePing Configuration** (تحت Import/Export) | Admin | استيراد إعداد SmokePing موجود إلى أجهزة ورسوم وشجرة رسوم ([الطريقة](provisioning.md#a-whole-smokeping-configuration)) | + +الرسوم الدخانية والملخصة رسوم Cacti عادية، فتحكمها صلاحيات الرسوم والأجهزة في Cacti. + + +## معنى كل حالة + +يجمع كل صف أبعادًا مستقلة. لا تُدمج أبدًا في لون واحد، لأن توقف المجمّع والفقدان الكامل للحزم يتطلبان استجابتين مختلفتين. + +| البُعد | الحالات | الدليل | +|---|---|---| +| الحداثة | `current`، `delayed`، `stale`، `never` | عمر آخر تحديث RRD (بـ `rrdtool lastupdate`) مقابل `step` للهدف. Current: ضمن `step` واحد زائد سماح الحداثة (60 ثانية افتراضيًا). Delayed: أقدم وحتى ضعفي `step`، وهو نبض SmokePing. Stale: بعد النبض حين تصبح القيم مجهولة. Never: الملف مفقود أو لم يُحدّث منذ إنشائه | +| التنفيذ | `completed`، `probe_error`، `unknown` | تكتمل الجولة عندما تكتب فقدانًا رقميًا. البيانات المتقادمة أو غير المرصودة لا تخبر عن الجولة الأخيرة، فتكون `unknown`. لا تُضبط `probe_error` أبدًا: المجس الفاشل يكتب قيم هدف لا يجيب نفسها ([البحث](../../../research/probe-failures.md)) | +| الوضع | `within_policy`، `degraded`، `complete_loss`، `unknown` | من آخر جولة مكتملة. الفقدان الكامل هو تساوي `loss` و`pings` دون وسيط. أي فقدان أقل تدهور. لا يظهر المجمّع المتوقف كفقدان؛ يتقادم ويصبح الوضع `unknown` | +| الإداري | `enabled`، `disabled`، `archived` | سجل الهدف في الإضافة. لا يُقرأ الهدف المعطّل أو المؤرشف | +| الصيانة | في الصيانة أو خارجها | خطاف Maint المسمى `is_device_in_maintenance` لجهاز الهدف، في عمود Maintenance بصفحة الأهداف. دون Maint أو عند تعطيله، تظهر كل الأجهزة خارج الصيانة | +| وقت القياس | ثوانٍ منذ آخر تحديث | طابع RRD الزمني نفسه. تحديث الصفحة لا يُحتسب قياسًا | + +تأتي حداثة كل موقع من ملفه (`target~slave.rrd` للتابع)، لذا يظهر التابع المتأخر متقادمًا حتى إن كان الرئيسي حديثًا. + +يعرض عمود الفقدان `lost/pings` للجولة الأخيرة، والوسيط بالمللي ثانية؛ `U` تعني مجهولًا لا صفرًا. + + +## فحوص الصحة + +| الفحص | معنى OK | عند عدم كونه OK | +|---|---|---| +| `php_binary` | ملف PHP التنفيذي المحدد في Cacti موجود وقابل للتنفيذ | لا يبدأ القارئ: أصلح إعداد «PHP Binary Path» في Cacti | +| `reader` | انتهت الدورة الأخيرة ضمن ثلاثة فواصل مجمّع وضمن ميزانيتها الزمنية | تحذير: القارئ متأخر أو تجاوز الميزانية. مع كثرة السلاسل ارفع الميزانية أو افحص التخزين؛ راجع [الأداء](performance.md) | +| `inventory` | حلّل آخر جرد إعداد SmokePing | خطأ: رسالة محلل SmokePing مع الملف والسطر. يبقى الجرد السابق مستخدمًا | +| `mount`، `read-only`، `writable` | مسار الربط داخل RRA ويُوصل إليه دون رابط رمزي، ومربوط للقراءة فقط وغير قابل للكتابة | خطأ. راجع [دليل التثبيت](install.md#3-mount-the-data-directory-read-only-inside-cactis-rra-path) | +| `visibility` | ملفات الجرد مرئية عبر الربط | تحذير يذكر عدد المفقود | +| `templates` | قوالب SmokePing مستوردة | خطأ مع السبب؛ أصلحه واستخدم **Retry Template Import** | +| `device_pollers` | كل جهاز ذي مصادر ملخص يستطلعه مجمّع القارئ | خطأ يسمّي الأجهزة: لا بيانات لملخصاتها وتنبيهاتها حتى يستطلعها ذلك المجمّع | +| `loss_colors` | ألوان Loss Colors المختارة: ألوان إصدار SmokePing المكتشف أو المحددة. بعد تغييرها ينقل المجمّع الرئيسي الرسوم في الدورات التالية، 200 في الدورة؛ ينقلها `upgrade-graphs` فورًا. يعدّ الصف الرسوم الباقية على الألوان الأخرى ويحذر من النقل الفاشل | مجهول إذا لم يجد القارئ إصدارًا والإعداد Automatic: تستخدم الرسوم ألوان 2.8 والأحدث. تحذير إذا خالف الإعداد الإصدار المكتشف. راجع [ألوان الفقدان](provisioning.md#loss-colors) | +| `dual_alerting` | لا هدف يجمع قيمة SmokePing `alerts` وعتبة Thold مفعّلة على مصدر ملخصه | تحذير يسمّي حتى 10 أهداف: المشكلة المطابقة للشرطين تُشعر مرتين. لا يقارن الفحص الشروط؛ مثلًا قد تعمل عتبة Thold `age` دون تنبيه فقدان SmokePing. قارن قبل إزالة تنبيه SmokePing أو تعطيل العتبة. OK إذا لم يكن Thold مثبتًا | + + +## حالات شائعة + +- **كل شيء `stale`.** توقف SmokePing عن الكتابة أو تقادم الربط. افحص `systemctl status smokeping` ثم قارن `rrdtool lastupdate` عبر الربط بالملف نفسه على مضيف SmokePing. قد يتأخر NFS للقراءة فقط بمدة مخبأ السمات. +- **تابع واحد `stale` والرئيسي `current`.** توقف التابع عن التسليم. يطبق الرئيسي النتائج المتأخرة عند وصولها فيملأ الرسم الماضي؛ لا يعيد Thold تقييمها ([التنبيهات](alerting.md)). +- **هدف يعرض `never`.** ملف RRD غير موجود بعد (ينشئه SmokePing في أول جولة بعد إعادة التحميل)، أو لا يظهره الربط. افحص `visibility`. +- **رسم فارغ بعد ترقية Cacti إلى 1.2.32.** يستبدل Cacti مسار مصدر خارج RRA بمساره المولّد. تحقق من موقع الربط حسب الإضافة ومن عدم وجود روابط رمزية. +- **إعادة تسمية قسم SmokePing.** يبدأ SmokePing ملفًا جديدًا للمسار الجديد. يقترح الجرد إعادة الربط ولا يغير شيئًا حتى يؤكد المسؤول ([التجهيز](provisioning.md#re-linking-a-renamed-target)). + + +## البنى + +1. **SmokePing على مضيف مجمّع Cacti.** يقرأ مستخدم المجمّع دليل البيانات عبر الربط المحلي. هذه حالة دليل التثبيت. +2. **مشاركة دليل بيانات SmokePing مع مضيف Cacti.** اربطه للقراءة فقط عبر NFS عند مسار RRA على المضيف الذي يشغّل مجمّع SmokePing. تقارن صفحة الصحة آخر تحديث بالساعة، فيظهر الربط المتأخر `delayed` أو `stale`. تُعرض الرسوم الدخانية على خادم واجهة الويب، لذا يحتاج المشاركة أيضًا؛ إن كانت للمجمّع وحده تعمل الملخصات والتنبيهات لكن الرسوم الدخانية فارغة. +3. **SmokePing على مجمّع بيانات Cacti بعيد** مرحلة لاحقة غير مدعومة في هذا الإصدار. + +المجمّع المحدد في **SmokePing Poller** وحده يقرأ بيانات SmokePing. يجب أن يستطلع أجهزة مصادر الملخص. + + +## عند فشل المدخلات + +هذه السلوكيات التي أُهّل الإصدار مقابلها ([تأهيل الأعطال](../../../failure-qualification.md))؛ لا يفقد أي منها بيانات. + +| العطل | السلوك الموثق | +|---|---| +| إعداد SmokePing غير قابل للقراءة أو معطوب | يفشل الجرد برسالة المحلل في Health؛ يبقى السابق ولا يُحذف شيء | +| مجس لا يعمل مع استمرار SmokePing: خروج التنفيذي بخطأ، أو عنوان المصدر ليس على المضيف، أو رفض fping لمعامل، أو تعطيل IPv6 لـ FPing6 | يكتب SmokePing فقدانًا كاملًا لكل أهداف المجس، مثل أهداف لا تجيب. تظهر القياسات `complete_loss`. إذا حدث لكل أهداف مجس معًا، ابحث في سجل SmokePing عن خطئه | +| فشل مجس يكتشفه SmokePing: ملف تنفيذي مفقود أو معامل خارج النطاق أو غياب مقبس raw لـ fping | يخرج SmokePing عند البدء أو أول جولة. تصبح كل الأهداف `delayed` ثم `stale` كما عند توقفه | +| تعذر حل أسماء مضيفي الأهداف (فشل DNS) | تفشل المجسّات وتكتب فقدانًا؛ تقرأ الإضافة ما كُتب. تظهر `degraded` أو `complete_loss` لا تقادمًا. لا تجري الإضافة استعلامات أسماء | +| توقف SmokePing أو مجمّعه | الحداثة `delayed` ثم `stale`؛ تصبح `median` و`loss_pct` مجهولتين وتواصل `age` النمو. لا فقدان صفري أبدًا | +| فرق الساعة بين Cacti وSmokePing | تقارن الحداثة وقت RRD بساعة Cacti، فيزحزح الفرق كل الأعمار. المضيف المتقدم يضع أوقاتًا مستقبلية تظهر `current`، ويظل المجمّع المتوقف `current` حتى انقضاء الفرق. المتأخر يجعل كل سلسلة أقدم بالفرق و`stale` عندما يتجاوز ضعفي `step`. أبق المضيفين على NTP | +| RRD غير مقروء أو تالف | يسجل القارئ تحذيرًا للملف ويتابع البقية. السلسلة غير المقروءة قط مجهولة (`U`). المقروءة سابقًا تحتفظ بآخر مخبأ يتقادم عبر `delayed` و`stale` إلى مجهول؛ لا يصبح الملف التالف فقدانًا صفريًا | +| امتلاء تخزين Cacti | يكتب القارئ مخبأ قاعدة البيانات فقط. عند رفض الكتابة يخرج طبيعيًا وتبقى كل الصفوف كاملة كما كانت؛ تخزن الدورة التالية بعد التعافي الجولات الجديدة. تفشل RRD الخاصة بملخصات Cacti كأي مصدر آخر | +| قتل القارئ أثناء دورة | يُكتب كل صف كاملًا، فتبقى قراءات كاملة. يكتشف Cacti العملية الميتة وتبدأ التالية فورًا وتكمل كل السلاسل | +| بدء قارئ ثانٍ | يسمح جدول عمليات Cacti بقارئ لكل مجمّع. يخرج المكرر فورًا برمز 0 ويسجل ملاحظة (مستوى Medium) دون إزعاج الأول | +| بدء الصيانة وانتهاؤها | يكبت Maint إشعارات الجهاز؛ يواصل Thold التقييم ويستمر استطلاع مصدر الملخص | +| انقطاع ترقية الإضافة | لا يتغير الإصدار المسجل إلا بعد نجاح كل خطوة؛ يكمل تحميل الصفحة أو دورة المجمّع التالية الترقية | + + +## الاستيراد والتصدير + +راجع [صيغة الإعداد](configuration-format.md). الصيغة المختصرة: + +```sh +php plugins/smokeping/cli/smokeping.php export --file=/var/backups/smokeping-config.yaml +php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml +``` + + +## السجلات + +تكتب الإضافة في سجل Cacti بوسم `SMOKEPING`. يعرض `grep SMOKEPING log/cacti.log` إحصاءات القارئ (`SMOKEPING STATS`) وفشل الجرد واستيراد القوالب وكل استيراد إعداد طُبّق. diff --git a/docs/i18n/ar-SA/docs/performance.md b/docs/i18n/ar-SA/docs/performance.md new file mode 100644 index 0000000..a4b1845 --- /dev/null +++ b/docs/i18n/ar-SA/docs/performance.md @@ -0,0 +1,101 @@ + + + +# الأداء + +تُذكر السعة بالسلاسل: هدف واحد في موقع قياس واحد (الرئيسي أو تابع). توضح الصفحة كلفة الإضافة عند 100 و1,000 و10,000 سلسلة، وبيئة القياس، والأرقام المتبقية. معرّفات المتطلبات من [#42](https://github.com/somethingwithproof/plugin_smokeping/issues/42). + + +## العمل لكل طلب ودورة + +- **لا يشغّل أي طلب صفحة مجسًا، ولا يقرأ RRD، ولا ينتظر مجمّعًا بعيدًا (REQ-PERF-003).** تقرأ صفحة النظرة العامة صفوف مخبأ القارئ من قاعدة البيانات. يعرضها `tests/bin/perf-page.php` ومسار الربط يشير إلى دليل غير موجود، وتُعرض بالطريقة نفسها. الرسوم رسوم Cacti وتقرأ ملفاتها ككل رسوم Cacti. +- **تقرأ عملية قارئ واحدة لكل مجمّع كل سلسلة مرة في الدورة** عبر أنبوب `rrdtool` واحد، بميزانية زمنية (120 ثانية افتراضيًا). تتوقف الدورة عند بلوغ الميزانية وتستأنف التالية بالسلسلة التي انتظرت أطول مدة. قراءة ملف هي استدعاء `lastupdate` يقرأ رأسه، فلا تعتمد على حجم RRD. +- **يقرأ كل مصدر ملخص صف مخبأ واحدًا** ولا يمس RRD مطلقًا. +- **تعرض شاشة تأكيد الإضافة الجماعية الحمل قبل إنشاء أي شيء (REQ-PERF-004)**: عدد سلاسل الأهداف المطابقة، وحزم المجس وتحديثات RRD في الثانية التي سيتحملها SmokePing، وعدد صفوف مصادر Cacti وعناصر الرسوم. الحساب في `lib/LoadEstimate.php`. + + +## الحساب + +عند 10,000 سلسلة و20 نبضة ping كل 300 ثانية: نحو 667 حزمة/ثانية وسطياً، و33 تحديث RRD لـ SmokePing/ثانية، و33 قراءة `lastupdate`/ثانية إذا فحص القارئ كل سلسلة في كل خطوة. كائنات Cacti هي 260,000 صف `data_template_rrd` (23 لمصدر الدخان و3 للملخص لكل سلسلة)، و550,000 صف عنصر رسم (50 للدخان و5 للملخص لكل سلسلة)، مع 10,000 مصدر ملخص يستطلعها خادم السكربتات. استخدمت دورة الإصدار أدناه القوالب قبل [#81](https://github.com/somethingwithproof/plugin_smokeping/issues/81) وعدّت صفوفها بدقة: 47 لكل رسم دخاني و520,000 إجمالًا. أضافت #81 الانحراف المعياري وam/s وبنود خط المجس. تحسب شاشة التأكيد الأرقام نفسها، ويتحقق `tests/Unit/LoadEstimateTest.php` منها مقابل القوالب الموزعة. + + +## قياسات أولية محلية + +قيس على حاسوب محمول واحد، في حاويات Docker، بسكربتات الإضافة (`sh tests/run-perf.sh `): **قياس أولي محلي لهذه الشيفرة، وليس رقم إصدار.** الجهاز: Apple silicon وaarch64، مع 14 CPU و15.7 GiB متاحة لـ Docker، وMariaDB 10.11 وPHP 8.2 في حاويات على المضيف نفسه، وRRD على ربط Docker. السلاسل: 20 نبضة و300 ثانية للخطوة، وملفات RRD اختبارية بحجم 193 KB لكل منها (ملفات SmokePing الأصلية عدة ميغابايت؛ يقرأ `lastupdate` الرأس، فلا يغير الحجم القراءة). + +| السلاسل | القارئ، المرور الكامل الأول | القارئ، ملفات دون تغيير | السلاسل في دورة افتراضية واحدة (120 ثانية) | عرض النظرة العامة (CLI، قاعدة البيانات فقط) | ذروة ذاكرة الصفحة | HTML الصفحة | +|---|---|---|---|---|---|---| +| 100 | 0.2 s | أقل من 0.1 ثانية | 100 / 100 | 0.002 s | 8 MB | 0.02 MB | +| 1,000 | 1.2 s | 1.1 s | 1,000 / 1,000 | 0.012 s | 12 MB | 0.17 MB | +| 10,000 | 12.3 s | 11.6 s | 10,000 / 10,000 | 0.119 s | 58 MB | 1.68 MB | + +يُظهر الجدول كلفة قارئ تقارب 1.2 ms لكل سلسلة هنا وتنمو خطيًا، لذا تستخدم 10,000 سلسلة نحو عُشر الميزانية الافتراضية على قرص محلي. تسرد النظرة العامة كل السلاسل المرتبطة في صفحة واحدة (نحو 10,000 صف و1.7 MB من HTML عند 10,000)، وزمن قاعدة البيانات وPHP صغير. تستبعد الأرقام المتصفح وخادم الويب وإطار صفحة Cacti وNFS وSmokePing يكتب الملفات في الوقت نفسه. + +لم يُقَس هنا: صفحات إدارة Cacti مع تجهيز الكائنات (راجع قياسات الإصدار)، وربط NFS للقراءة فقط، وخدمة SmokePing فعلية تكتب 33 ملفًا/ثانية أثناء عمل القارئ. + + +## قياسات الإصدار + +قيس في 2026-11-15 على droplet واحد في DigitalOcean: `c-4` في sfo3، و4 وحدات vCPU مخصصة (Intel Xeon Platinum 8280)، و8 GB وUbuntu 24.04، مع Cacti 1.2.31 وPHP 8.5.12 وRRDtool 1.7.2 وMariaDB 10.11.19 في حاويات على المضيف نفسه. السلاسل 20 نبضة بخطوة 300 ثانية، وكل هدف على جهازه الخاص، وRRD اختبارية على ربط للقراءة فقط. + + +### القارئ وصفحة النظرة العامة + +`sh tests/run-perf.sh `: + +| السلاسل | القارئ، المرور الكامل الأول | القارئ، ملفات دون تغيير | السلاسل في دورة افتراضية واحدة (120 ثانية) | عرض النظرة العامة (CLI، قاعدة البيانات فقط) | ذروة ذاكرة الصفحة | HTML الصفحة | +|---|---|---|---|---|---|---| +| 100 | 0.2 s | أقل من 0.1 ثانية | 100 / 100 | 0.004 s | 8 MB | 0.02 MB | +| 1,000 | 1.9 s | 2 s | 1,000 / 1,000 | 0.028 s | 12 MB | 0.17 MB | +| 10,000 | 20.6 s | 19.9 s | 10,000 / 10,000 | 0.244 s | 58 MB | 1.68 MB | + +يكلف القارئ نحو 2 ms لكل سلسلة على هذا المضيف، لذا تستخدم 10,000 سلسلة نحو سُدس الميزانية الافتراضية. + + +### صفحات Cacti والمجمّع مع جميع الكائنات + +ينشئ `sh tests/run-perf-objects.sh ` الأهداف وأجهزتها، ويقيس زمن الصفحات، ويجهّز كائنات الملخص والدخان لكل هدف عبر الإضافة، ويقيس الصفحات مجددًا، ثم يشغّل دورتَي مجمّع، كل منهما بعد انتهاء قارئ الدورة السابقة. يمنح `PERF_OBJECTS=stock` كل جهاز رسمين من قوالب Local Linux Machine الخاصة بـ Cacti بدلًا من ذلك («Unix - Load Average» و«Linux - Memory Usage»): العدد نفسه لكل سلسلة، للمقارنة في REQ-PERF-002. أزمنة الصفحات هي p50/p95 عبر HTTP بالمللي ثانية، 20 طلبًا بعد طلب إحماء، بتسجيل دخول المسؤول وخادم PHP المدمج. «الأجهزة فقط» هي الأجهزة نفسها قبل وجود رسوم. + +| السلاسل | الكائنات | قائمة الأجهزة | قائمة المصادر | قائمة الرسوم | نظرة عامة للإضافة | +|---|---|---|---|---|---| +| 100 | الأجهزة فقط | 28/31 | 25/35 | 35/37 | 38/40 | +| 100 | رسوم قياسية | 28/39 | 48/56 | 33/48 | 29/39 | +| 100 | كائنات الإضافة | 28/39 | 51/53 | 33/34 | 28/29 | +| 1,000 | الأجهزة فقط | 30/42 | 25/26 | 26/36 | 59/64 | +| 1,000 | رسوم قياسية | 32/33 | 50/51 | 39/40 | 65/66 | +| 1,000 | كائنات الإضافة | 42/44 | 54/77 | 39/40 | 58/68 | +| 10,000 | الأجهزة فقط | 50/57 | 28/37 | 28/30 | 301/319 | +| 10,000 | رسوم قياسية | 66/69 | 50/75 | 107/111 | 331/338 | +| 10,000 | كائنات الإضافة | 65/68 | 54/78 | 105/119 | 318/340 | + +| السلاسل | تجهيز كائنات الإضافة | الدورة الأولى للمجمّع (تنشئ RRD) | دورة المجمّع المستقرة | القارئ | +|---|---|---|---|---| +| 100 | 31 s | 2.0 s | 1.6 s | 0.2 s | +| 1,000 | 324 s | 6.5 s | 5.1 s | 1.6 s | +| 10,000 | 3,284 s | 57.1 s | 43.5 s | 21.5 s | + +عند 10,000 سلسلة، كائنات الإضافة 260,000 صف `data_template_rrd` و520,000 صف عنصر رسم و10,000 عنصر مجمّع؛ والرسوم القياسية 50,000 و240,000. دورة المجمّع عملية cmd.php واحدة تستطلع 10,000 مصدر ملخص؛ يعمل القارئ بجوارها ويبدأه `poller_bottom`. يبقيان أقل بكثير من فاصل 300 ثانية. التجهيز إضافة جماعية لمسؤول واحد: نحو 0.33 ثانية لكل سلسلة، أي قرابة ساعة لـ 10,000. استغرقت دورة سابقة للسكربت نفسه على droplet نفسه 6,141 ثانية لـ 10,000 (0.61 لكل سلسلة)، لذا خطط لساعة إلى ساعتين. + + +### مقارنة بالمتطلبات + +- **REQ-PERF-001 (النظرة العامة أقل من ثانيتين عند 10,000): محقق.** p95 يساوي 0.34 ثانية عبر HTTP. +- **REQ-PERF-002 (صفحات الإدارة ضمن الأساس زائد 20 بالمئة عند 10,000): محقق** مقابل أساس الرسوم القياسية. عند 10,000، p95 للإضافة أقل 1 بالمئة في قائمة الأجهزة، وأعلى 4 بالمئة في المصادر و7 بالمئة في الرسوم. عند 1,000، p95 لقائمة المصادر أعلى 51 بالمئة (77 مقابل 51 ms)، بينما تختلف القيم الوسيطة 8 بالمئة في الدورتين: الفرق في أبطأ الطلبات لا الطلب المعتاد. مقارنة بالأجهزة وحدها بلا رسوم، تصبح كل صفحة أبطأ مع أي 20,000 رسم، قياسي أو من الإضافة. +- **REQ-PERF-003 (لا مجس، وقراءات RRD محدودة، ولا انتظار بعيد لكل طلب): محقق** (راجع القسم الأول). +- **REQ-PERF-004 (عرض الحمل قبل الإضافة الجماعية): محقق.** يطابق التقدير الصفوف المعدودة في الدورة. + + +## عدد السلاسل المدعوم + +**10,000 سلسلة لكل تثبيت Cacti**، عند 20 نبضة وخطوة 300 ثانية، على عتاد مثل مشغّل الإصدار: أربع وحدات vCPU مخصصة و8 GB وقاعدة البيانات على المضيف نفسه. عند هذا العدد يستخدم القارئ سُدس ميزانيته الافتراضية، ودورة المجمّع سُبع الفاصل، وتبقى صفحات الإدارة ضمن 7 بالمئة من العدد نفسه من رسوم Cacti القياسية. لم يُقَس ما يتجاوز 10,000. + + +## إعادة القياس + +```sh +sh tests/run-perf.sh # 100, 1,000, and 10,000 series +sh tests/run-perf.sh 1000 # one size +sh tests/run-perf-objects.sh # Cacti's pages and the poller with every object +``` + +تهيئ كل دورة الأهداف بـ `tests/bin/perf-seed.php`، وتنشئ RRD بـ `tests/bin/make-fixture-rrds.php`، وتقرؤها بـ `poller_smokeping.php --force`، وتعرض الصفحة بـ `tests/bin/perf-page.php`. diff --git a/docs/i18n/ar-SA/docs/provisioning.md b/docs/i18n/ar-SA/docs/provisioning.md new file mode 100644 index 0000000..c101f56 --- /dev/null +++ b/docs/i18n/ar-SA/docs/provisioning.md @@ -0,0 +1,115 @@ + + + +# إضافة أهداف SmokePing إلى Cacti + +يرى المسؤولون كل هدف يجده الجرد في **SmokePing Inventory**، ولا يراه غيرهم حتى يُربط بجهاز Cacti. لا يُنشأ شيء دون تأكيد مسؤول. لا تكتب الإضافة ملفات SmokePing مطلقًا. + + +## هدف واحد + +للهدف الموجود غير المرتبط رابط **Add to Cacti** في الجرد. تقدم شاشة التأكيد خيارين: + +- **إنشاء جهاز جديد** من قالب «SmokePing Target». يستخدم مضيف الهدف، ويعطّل فحص التوفر (SmokePing يقيسه أصلًا)، ويُسند إلى مجمّع القارئ. +- **ربطه بجهاز موجود.** تسرد القائمة الأجهزة التي يمكنك تعديلها. + +في الحالتين يحصل الهدف على مصدر ورسم ملخص للتنبيه (راجع [التنبيهات](alerting.md))، ورسم دخاني لكل موقع عندما يمكن رسم بياناته. لا يحصل على رسم دخاني، وتذكر الصفحة السبب، إذا لم تكن `pings` تساوي 10 أو 20 أو 30، أو كان Cacti يخزن RRD على RRDproxy، أو لم يظهر الملف عبر الربط للقراءة فقط. يحتفظ الهدف ببيانات الملخص. + +يستطلع مصدر الملخص مجمّع القارئ. إذا كان الجهاز الموجود يستطلعه مجمّع آخر، لا تنشئ الإضافة المصدر وتحدد المجمّع المطلوب. تسرد الصحة الأجهزة المنقولة لاحقًا إلى مجمّع آخر. + + +## أجهزة عديدة + +حدد أجهزة في القائمة واختر **Add SmokePing Targets**. يسرد التأكيد لكل جهاز الأهداف غير المرتبطة التي يساوي `host` فيها اسم مضيف الجهاز (دون حساسية للحروف)، والمجموع. تضيفها المتابعة. يُبلّغ عن الأجهزة بلا تطابق وتُترك، ولا يُنشأ جهاز. استغرق مئة جهاز بطلب واحد نحو 24 ثانية في حاوية محلية؛ يتوقف الاختيار الطويل عن بدء أجهزة جديدة قبيل حد الطلب، وتُكمل إعادة الإجراء العمل لتجاوز الأجهزة المضافة. + + +## إعداد SmokePing كامل + +يجلب **Console > Import/Export > Import SmokePing Configuration** تثبيت SmokePing موجودًا إلى Cacti بخطوة واحدة. يحتاج نطاق SmokePing Admin وصلاحيات تغطي كل الأجهزة؛ والنسخ إلى شجرة رسوم يحتاج نطاق Trees أيضًا. + +اختر المدخل: + +- **الملف المضبوط** (الافتراضي): إعداد SmokePing Configuration File، يُقرأ على الخادم مع كل الملفات المضمّنة. يجب أن يبقى الملف المضمّن في الدليل نفسه أو تحته. +- **ملف مرفوع** لا يتجاوز 4 MiB. يُقرأ منفردًا، لذا يُرفض `@include` مع رقم السطر. تُرسم أهدافه من RRD التي يراها مجمّع القارئ، ويعلّم الجرد التالي هدفًا لا يملكه SmokePing لذلك المجمّع كمفقود. + +ثم الخيارات: + +| الخيار | الافتراضي | المعنى | +|---|---|---| +| الأجهزة | واحد لكل مضيف SmokePing | تشترك أهداف المضيف نفسه بجهاز. واحد لكل هدف يمنحه جهازًا باسم عنوانه. | +| قالب الجهاز | SmokePing Target | قالب الأجهزة المنشأة بالاستيراد. | +| المجمّع | مجمّع القارئ | يجب أن يشغّل القارئ؛ يُرفض غيره لأن مصادر الملخص لن تحصل على بيانات. | +| الموقع | لا شيء | موقع الأجهزة الجديدة. | +| شجرة الرسوم | دون نسخ | شجرة موجودة أو جديدة بالاسم. يصبح كل قسم فرعًا، وكل جهاز مدخل مضيف تحت فرع أهدافه. | + +يقرأ **Preview** الإعداد دون كتابة. يعرض الأقسام مع مربعات اختيار (اختر ثم **Update Preview** لاستيراد تلك الأهداف فقط)، والأجهزة المنشأة أو المعاد استخدامها، والرسوم المنشأة، وأهداف الملخص فقط وأسبابها (نبضات غير 10/20/30 أو RRDproxy)، وفروع الشجرة ومداخلها، والحمل المقدّر كما في الإجراء الجماعي. يُعاد استخدام جهاز على المجمّع المختار يحمل اسم مضيف الهدف (وعنوانه كوصف عند جهاز لكل هدف)؛ عند تطابق جهازين تُتجاوز تلك الأهداف وتُسرد لتربطها في SmokePing Inventory. يطبق **Import** الخطة المعاينة بالضبط عبر دوال الأجهزة والرسوم والشجرات في Cacti. إن تغير الإعداد أو Cacti بعد المعاينة، لا يُكتب شيء وتعيد المعاينة. + +لا ينشئ تكرار الاستيراد شيئًا جديدًا: تحتفظ الأهداف المرتبطة بأجهزتها وتُستخدم الرسوم ومداخل الشجرة القائمة، وتذكر النتيجة كل هدف كموجود في Cacti. لا يكتب الاستيراد ملفات SmokePing أو الربط. + +الاستيراد نفسه من سطر الأوامر وبالخيارات نفسها: + +```sh +php plugins/smokeping/cli/smokeping.php import-smokeping --dry-run --tree-name=SmokePing +php plugins/smokeping/cli/smokeping.php import-smokeping --apply --confirm=PLAN --tree-name=SmokePing +``` + +يقرأ `--file=PATH` ملفًا آخر منفردًا كملف مرفوع. تضبط `--sections=Europe,Lab/Core` و`--device-per=target` و`--device-template=ID` و`--poller=ID` و`--site=ID` و`--tree=ID` بقية الخيارات. تطبع المحاكاة الخطة ومعرّفها؛ يحتاج `--apply` ذلك المعرّف ويجب أن يظل مطابقًا. + + +## مقياس الرسم + +يضبط SmokePing حجم كل رسم من بياناته عند كل عرض. لرسم Cacti حد أعلى واحد لكل المدد، لذا تطبق الإضافة قاعدة رسوم SmokePing التفصيلية (`findmax` في `Smokeping.pm`) على اليوم الماضي: 1.2 ضعف أكبر وسيط لذلك اليوم في ملف الرسم. يستخدم Navigator Graph في SmokePing 1.5 ضعفًا؛ لا تملك الإضافة متصفحًا. تضبط الرسم عند إنشائه ثم نحو مرة يوميًا. إذا لم يوجد وسيط في اليوم الماضي يبقى الحد الحالي؛ يحتفظ الجديد بحد القالب 0.05 ثانية (50 ms). + +الضبط اليومي مفعّل افتراضيًا ولا إعداد له. بعد كل قراءة يضبط القارئ رسوم أهداف مجمّعه التي مضى يوم أو أكثر على ضبطها، الأقدم انتظارًا أولًا، بحد 25 لكل دورة. يقرأ RRD واحدًا لكل رسم دون مجس. يتجاوز الدورة إن استنفدت القراءة الميزانية. دورة كل خمس دقائق تغطي 7,200 رسم يوميًا؛ مع أكثر يُضبط كل رسم بتواتر أقل قليلًا من اليومي. + +تسجل الإضافة الحد الذي وضعته لكل رسم. الحد المختلف عن السجل مُعدّ يدويًا بصفحة الرسم ولا تغيره أبدًا. لإعادة التحكم اضبطه إلى آخر قيمة وضعتها الإضافة، التي يطبعها `size-graphs` لكل رسم ذي حد يدوي. + +لضبط جميع الرسوم الآن: + +```sh +php plugins/smokeping/cli/smokeping.php size-graphs +``` + +يطبع الحد الجديد أو الاحتفاظ بالحد الحالي أو اليدوي. يتبع قاعدة الحدود اليدوية اليومية نفسها. يحتاج مسار rrdtool في Cacti (Configuration > Settings > Paths)؛ دونه تبقى الحدود. + +عند الترقية من 1.0.0-rc.1 لا سجل لمن وضع الحدود القائمة، فتتبنى الإضافة حد كل رسم وتضبطه في دوره اليومي التالي. قبل ذلك كان `size-graphs` يستبدل الحدود اليدوية أيضًا. يُعد الحد يدويًا فقط ما دام يختلف عن المسجل، وبعد الترقية المسجل هو المتبنّى. للاحتفاظ بحد يدوي أعد ضبطه بعد أن يستبدله الضبط اليومي. إن لم يجد الضبط وسيطًا يحتفظ بالمتبنّى، فلا يغير ضبط القيمة نفسها مجددًا شيئًا وقد يستبدلها ضبط لاحق. + + +## مفتاح الرسم وترقيات القوالب + +يتبع مفتاح الرسم SmokePing: متوسط الوسيط وأقصاه وأدناه وآخره، وانحرافه المعياري وam/s (المتوسط على الانحراف المعياري)، ثم قيم الفقدان وألوانه وسطر المجس مثل `probe: 20 ICMP Echo Pings (56 Bytes) every 300s`. يأتي السطر من مجس الهدف وحجم الحزمة والنبضات والخطوة المقروءة من الإعداد. يكتبه المجمّع الرئيسي على كل رسم ويعيده عند تغير المجس أو إعادة ضبطه باستيراد قالب. يظهر اسم المجس لهدف مخزن قبل أن يقرأ الجرد تفاصيله. + +عند وصول قوالب جديدة بترقية، تحتفظ الرسوم السابقة بعناصرها القديمة القابلة للعرض حتى تنقلها الإضافة. يعالج المجمّع الرئيسي 200 رسم في الدورة مع حفظ العنوان والحد الأعلى. لمعالجة الجميع الآن: + +```sh +php plugins/smokeping/cli/smokeping.php upgrade-graphs +``` + +تضبط الترقية العناصر حسب القالب، فتستبدل تعديلات عناصر رسوم الإضافة اليدوية. بعدها تتحقق من التطابق التام ووجود كل VDEF مستخدم. يحتفظ الرسم الفاشل بعناصره وإصداره القديمين ويسميه سجل Cacti. لا يعيد المجمّع المحاولة. يعيد `upgrade-graphs` محاولة كل فاشل في كل تشغيل ويخرج برمز 1 إذا بقي فشل. + + +## ألوان الفقدان + +يلون SmokePing 2.7 الفقدان بسبعة مستويات ثابتة؛ تستخدم 2.8 والأحدث نسبة النبضات وتضيف الفقدان الكامل. توزع الإضافة قوالب لكليهما على المصادر نفسها، وتطابق رسوم SmokePing الأصلية ([دقة الرسوم](../../../research/graph-fidelity.md)). يختار **Loss Colors**: + +- **Automatic** (الافتراضي) يتبع الإصدار الذي يجده القارئ في `Smokeping.pm` بجوار SmokePing (`/usr/share/perl5` أو `/usr/share/smokeping` أو `/opt/smokeping/lib` أو `/usr/local/smokeping/lib`)، ويسجله كل جرد. دون 2.8 يستخدم ألوان 2.7. إن لم يجد إصدارًا، مثل حاوية أخرى، يستخدم 2.8 والأحدث. +- **SmokePing 2.8 and later** أو **SmokePing 2.7** يثبت الألوان مهما وجد القارئ. + +يعرض صف `loss_colors` في الصحة الألوان وسببها. عند تغيرها بإعداد أو ترقية SmokePing، ينقل المجمّع الرئيسي الرسوم إلى القوالب الأخرى، 200 في الدورة، مع حفظ العنوان والحد والبيانات. ينقلها `upgrade-graphs` دفعة واحدة. يحتفظ الفاشل بألوانه وتُعاد محاولته في التشغيل التالي كما سبق. + + +## إعادة ربط هدف أُعيدت تسميته + +يسمي SmokePing الملف بحسب موضع الهدف في شجرة الإعداد، لذا تبدأ إعادة تسمية عقدة أو نقلها ملفًا جديدًا فارغًا. إذا رأى الاستيراد اختفاء مسار وظهور آخر بالمضيف والمجس نفسيهما، يسجل مقترحًا دون تغيير. يفتح **Review** في الجرد التأكيد. تنقل إعادة الربط الرسم الدخاني ومصدر الملخص وربط الجهاز إلى الهدف الجديد، وتبقي تاريخ الملف القديم مقروءًا في رسم مؤرشف. يغلق **Dismiss Proposal** المقترح دون تغيير. + + +## الصلاحيات + +للإضافة ثلاثة نطاقات. يتيح **SmokePing View** فتح الصفحة التي لا تسرد إلا أهداف الأجهزة المسموح للمستخدم برؤيتها، واتباع الرابط من رسوم الجهاز. يضيف **SmokePing Operator** صفحة Operations وإقرارات شخصية بالملاحظات الحالية؛ ولا يغيّر الصحة المقاسة ولا يكبت التنبيهات. يتضمن **SmokePing Admin** وصول Operator ويفتح الجرد والصحة والإجراءات أعلاه. يرى المسؤول المحدود بصلاحيات أجهزة الأهداف غير المرتبطة وأهداف أجهزته المسموحة. + +الرسوم والمصادر كائنات Cacti عادية، فتقرر صلاحياته من يراها. طريقة الصلاحيات الافتراضية متساهلة: لا يُحصر المستخدم ببعض الأجهزة إلا عندما ترفض سياسات الجهاز والرسم وقالب الرسم جميعًا. تسري التغييرات في طلب المستخدم التالي. + + +## حذف جهاز + +يحذف حذف الجهاز المرتبط ربطه وسجلات الإضافة لمصادره، ويترك الهدف في الجرد غير مرتبط. لا تُمس ملفات SmokePing: راجع [ADR 0007](../../../decisions/0007-read-only-mount-under-rra-path.md). diff --git a/docs/i18n/es-419/README.md b/docs/i18n/es-419/README.md new file mode 100644 index 0000000..993b29b --- /dev/null +++ b/docs/i18n/es-419/README.md @@ -0,0 +1,142 @@ + + + +[English](../../../README.md) | [简体中文](../zh-CN/README.md) | [हिन्दी](../hi-IN/README.md) | [Español (España)](../es-ES/README.md) | [Español (Latinoamérica)](README.md) | [العربية](../ar-SA/README.md) + + +

+ + + Complemento SmokePing para Cacti: un cactus con una insignia y un gráfico SmokePing + +

+ + +# Complemento SmokePing para Cacti + +[![CI](https://github.com/somethingwithproof/plugin_smokeping/actions/workflows/plugin-ci-workflow.yml/badge.svg)](https://github.com/somethingwithproof/plugin_smokeping/actions/workflows/plugin-ci-workflow.yml) +[![License: GPL-2.0-or-later](https://img.shields.io/badge/license-GPL--2.0--or--later-blue.svg)](../../../LICENSE) +![PHP >= 8.2](https://img.shields.io/badge/php-%3E%3D8.2-777bb4.svg) +![Cacti >= 1.2.31](https://img.shields.io/badge/cacti-%3E%3D1.2.31-2e7d32.svg) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=coverage)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +![SmokePing: read-only](https://img.shields.io/badge/smokeping-read--only-6b7280.svg) + +Un complemento para Cacti 1.2 que incorpora las mediciones de latencia y pérdida de SmokePing como dispositivos, fuentes de datos y gráficos normales de Cacti. Los gráficos de humo aparecen junto al dispositivo al que pertenecen, bajo los permisos de Cacti, y Thold y Maint pueden alertar sobre ellos y suprimirlos. Es una implementación independiente para Cacti, no forma parte de [SmokePing](https://oss.oetiker.ch/smokeping/) ni está respaldada por él; sus autores originales son Tobias Oetiker y Niko Tyni. El complemento no incluye ni ejecuta código SmokePing: lee su configuración y sus archivos RRD, y sus plantillas dibujan las mismas series que los gráficos originales de SmokePing. + +> **Estado: en desarrollo. El modo de observación (fase 1) está implementado en `main` y publicado como versión preliminar 1.0.0-rc.1.** El complemento lee la configuración y los archivos RRD de SmokePing, muestra su estado, crea dispositivos, fuentes y gráficos Cacti para ellos, y alimenta Thold y Maint. No escribe nada en SmokePing. El modo gestionado (escritura de configuración SmokePing por el complemento) y los recolectores remotos son fases posteriores, no iniciadas y no incluidas aquí. Las pruebas piloto en instalaciones reales y un ajuste mayor de la leyenda de los gráficos de SmokePing siguen pendientes en el hito 4. Consulte [docs/install.md](docs/install.md) para empezar. + + +## Roles de acceso + +| Permiso | Acceso | +| --- | --- | +| SmokePing View | Páginas de supervisión existentes. | +| SmokePing Operator | Supervisión, página de operaciones y acuses personales de investigación. | +| SmokePing Admin | Acceso de operador más configuración y acciones administrativas existentes. | + +Después de copiar los archivos de actualización, abra la página Complementos como administrador para registrar el nuevo permiso. Asigne expresamente Operator en **Configuración > Usuarios** o en los grupos de usuarios. Las actualizaciones conservan los identificadores y las concesiones de View y Admin. En cada petición, Admin hereda el acceso Operator y Operator hereda View; esto no añade concesiones almacenadas a usuarios ni grupos. Los ajustes del complemento también requieren SmokePing Admin, además del permiso Ajustes de Cacti. + +Los permisos de dispositivos de Cacti siguen limitando las filas y acciones disponibles para cada usuario; los objetos sin asociación requieren un administrador. Credenciales, configuración, asociaciones, eliminación y otros cambios administrativos permanecen en las páginas administrativas. Los acuses solo duran en la sesión del usuario actual, como máximo una hora y mientras la misma observación siga vigente. Las observaciones nuevas o modificadas los invalidan. Nunca marcan como correcta una medición fallida ni suprimen alertas. + + +## Capturas de pantalla + +Importado desde una red SmokePing 2.8.2 en funcionamiento a Cacti 1.2.31, últimas 12 horas. El dispositivo de cada objetivo tiene un gráfico de humo del maestro y uno por esclavo (`lon1`, `sgp1`), archivados bajo su sección SmokePing en el árbol de gráficos. + +![Árbol Cacti del objetivo Bangalore: gráficos de humo del maestro y los esclavos lon1 y sgp1](../../images/screenshot-tree-asia.png) + +![Árbol Cacti del objetivo Londres: el esclavo lon1 de la misma región muestra latencia de microsegundos y humo visible](../../images/screenshot-tree-europe.png) + + +## Motivo + +SmokePing mide bien la distribución de latencia y la pérdida de paquetes; sus gráficos de humo muestran variaciones que oculta un gráfico de medias. Al ejecutarlo junto a Cacti quedan tres carencias: + +- **Control de acceso separado.** El CGI de SmokePing no conoce usuarios, grupos ni permisos de dispositivos Cacti. +- **Sin contexto de dispositivo.** La latencia y los contadores de interfaces del mismo dispositivo residen en herramientas distintas. +- **Sin integración con las alertas de Cacti.** Thold y Maint trabajan sobre dispositivos y fuentes Cacti, por lo que las alertas SmokePing se configuran y suprimen aparte. + +El complemento cubre esas carencias representando cada objetivo SmokePing mediante objetos Cacti que apuntan a sus archivos RRD existentes, más un pequeño conjunto de valores resumen sondeados. Reutiliza los gráficos, permisos, Thold y Maint de Cacti. El soporte de recolectores remotos está previsto para la fase 3 y no está en esta versión. + + +## Alcance y estado + +| Fase | Alcance | Hitos | Estado | +|---|---|---|---| +| 0, investigación | Matriz de compatibilidad, confirmación del comportamiento original, prototipo de fidelidad de gráficos | [M1](https://github.com/somethingwithproof/plugin_smokeping/milestone/1) | Resultados en `docs/research`; algunas investigaciones siguen abiertas | +| 1, observación | Importación de inventario, dispositivos Cacti, gráficos de humo y resumen, alertas Thold, supresión Maint, página de estado | [M2](https://github.com/somethingwithproof/plugin_smokeping/milestone/2), [M3](https://github.com/somethingwithproof/plugin_smokeping/milestone/3), [M4](https://github.com/somethingwithproof/plugin_smokeping/milestone/4) | Publicado como 1.0.0-rc.1; pilotos pendientes | +| 2, gestionado | Espacio de configuración propiedad de Cacti, perfiles de sondas ICMP y TCP, revisiones, validación, recarga y reversión | [M5](https://github.com/somethingwithproof/plugin_smokeping/milestone/5) | Previsto, no iniciado | +| 3, remoto | SmokePing en recolectores remotos Cacti, esclavos como ubicaciones de medición | [M6](https://github.com/somethingwithproof/plugin_smokeping/milestone/6) | Previsto, no iniciado | + +Fuera de alcance: motor propio de alertas, motor de informes, servicio o protocolo de red personalizado, comprobaciones gestionadas HTTP/DNS/servicios (las cubre servcheck), y escritura en archivos RRD de SmokePing. + + +## Objetivos de compatibilidad + +| Componente | Objetivo | +|---|---| +| Cacti | 1.2.31 o posterior de 1.2.x, sin parches del núcleo | +| PHP | 8.2 o posterior; `setup.php` sigue siendo interpretable en 8.0 para rechazar un entorno incompatible sin romper la interfaz Cacti | +| SmokePing | 2.9.0, 2.8.2 y 2.7.3 (solo Ubuntu 22.04, hasta 2027-06-01) | +| Thold, Maint | No requieren cambios | +| Series | 10.000 por instalación con 20 pings y paso de 300 s ([rendimiento](docs/performance.md#supported-series-count)) | + + +## Documentación + +| | | +|---|---| +| [Instalar](docs/install.md) | Requisitos, montaje de solo lectura del directorio de datos, instalación, contenedores, versiones admitidas | +| [Operar](docs/operations.md) | Significado y evidencias de cada estado, comprobaciones de salud, comportamiento ante fallos de entradas | +| [Añadir objetivos a Cacti](docs/provisioning.md) | Un objetivo, muchos dispositivos, reasociación, permisos | +| [Alertas](docs/alerting.md) | Valores resumen, duraciones Thold, obsolescencia, datos tardíos, solapamiento con alertas SmokePing, Maint | +| [Formato de configuración](docs/configuration-format.md) | Exportación e importación YAML y XML | +| [Copia y restauración](docs/backup-restore.md) | Qué respaldar y cómo se reanuda tras una restauración | +| [Rendimiento](docs/performance.md) | Mediciones locales y del ejecutor de publicaciones con 100, 1.000 y 10.000 series, y el número admitido: 10.000 por instalación | +| [Calificación de fallos](../../failure-qualification.md) | Escenarios de fallo y pruebas de cada uno | +| [Publicar](../../RELEASING.md) | Procedimiento de publicación: solicitud de cambios, etiqueta firmada, flujo de trabajo y comprobación del resultado | +| [Archivo de publicación](../../release.md) | Versión, historial de cambios y archivo distribuido | +| [Pruebas](../../testing.md) | Suites, ejecución de CI y suite en vivo contra un SmokePing real | + + +## Diseño + +- [docs/PLAN.md](../../PLAN.md) es el plan completo: arquitectura, hechos originales de los que depende (con fuentes), modelo de estados, límites de seguridad, cálculos de rendimiento, pruebas y riesgos. +- [docs/decisions/](../../decisions) contiene registros de decisiones de arquitectura ya tomadas. +- [docs/REQUIREMENTS.md](../../REQUIREMENTS.md) relaciona cada requisito con su incidencia. + +```mermaid +flowchart LR + SP[SmokePing daemon] --> RRD[(RRD files)] + RRD -->|read-only| R[Reader on the adjacent Cacti poller] + RRD -->|read-only| G[Cacti graph templates] + R --> SS[Script server summary data sources] + SS -->|poller_output| T[Thold and Maint] + G --> P[Cacti graph permissions] +``` + + +## Seguimiento del trabajo + +- Los **hitos** siguen los del plan. Cada uno tiene una incidencia épica con sus subincidencias y pruebas de finalización. +- Las **incidencias** se clasifican mediante `type: requirement`, `type: research`, `type: decision` y `type: epic`. Los requisitos indican condiciones numeradas y comprobables (`REQ-AREA-NNN`) y criterios de aceptación. +- Las **etiquetas** incluyen también `area:`, `phase:`, `priority:` y `status:`. Consulte [CONTRIBUTING.md](../../../CONTRIBUTING.md#labels). +- El [tablero del proyecto](https://github.com/users/somethingwithproof/projects/6) muestra todas las incidencias de los distintos hitos. + + +## Contribuir + +Lea [CONTRIBUTING.md](../../../CONTRIBUTING.md). Los commits requieren la firma DCO. El diseño se debate en las incidencias; las decisiones abiertas llevan la etiqueta `type: decision`. + + +## Seguridad + +Comunique las vulnerabilidades de forma privada; consulte [SECURITY.md](../../../SECURITY.md). + + +## Licencia + +Licencia Pública General GNU v2.0, la misma que Cacti y sus complementos. Consulte [LICENSE](../../../LICENSE). diff --git a/docs/i18n/es-419/docs/alerting.md b/docs/i18n/es-419/docs/alerting.md new file mode 100644 index 0000000..fb4489f --- /dev/null +++ b/docs/i18n/es-419/docs/alerting.md @@ -0,0 +1,63 @@ + + + +# Alertas sobre datos SmokePing con Thold y Maint + +El complemento no envía alertas. Proporciona a Cacti una fuente de datos «SmokePing Summary» sondeada para cada ubicación de un objetivo, y Thold y Maint trabajan sobre ella como sobre cualquier otra fuente ([ADR 0002](../../../decisions/0002-alert-through-cacti-data-sources.md)). Ninguno de los dos requiere cambios. Esta página es la referencia para operadores sobre los valores que comunica esa fuente y los límites del enfoque. + + +## Qué comunica la fuente de datos + +El sondeador de Cacti consulta cada fuente resumen mediante el servidor de scripts. El script solo lee una fila de la caché del lector: nunca abre un archivo RRD ni contacta con SmokePing durante el sondeo Cacti. + +| Fuente de datos | Significado | Cuándo vale `U` (desconocido) | +|---|---|---| +| `median` | Mediana del tiempo de ida y vuelta de la última ronda completada, en milisegundos | La ronda supera el heartbeat de SmokePing (dos veces `step`), falta el RRD o nunca se actualizó, o la ronda no tenía mediana (pérdida completa) | +| `loss_pct` | `loss / pings x 100` de la última ronda completada | La ronda supera el heartbeat, falta el RRD o nunca se actualizó, o la ronda no escribió un valor de pérdida | +| `age` | Segundos desde la última actualización del RRD | El RRD no existe o el lector no tiene una fila de caché para él | + +`median` y `loss_pct` nunca son `0` por falta de datos. Por tanto, un recolector detenido no indica pérdida cero. `age` sigue siendo numérico mientras exista el RRD, incluso después de que los otros dos pasen a `U`, de modo que la obsolescencia pueda generar una alerta. Un archivo creado pero nunca actualizado comunica el tiempo desde que el complemento vio por primera vez el objetivo. + +Una ronda con antigüedad entre `step + freshness allowance` y dos veces `step` está «retrasada»: sus valores se siguen comunicando. La pérdida completa es `loss_pct` 100 con `median` `U`. + +La fuente resumen debe sondearse desde el sondeador Cacti que ejecuta el lector (ajuste «SmokePing Poller»), porque la caché reside en la base de datos de ese sondeador. El complemento rechaza la creación de una fuente resumen en un dispositivo asignado a otro sondeador e indica cuál usar. + + +## Umbrales + +Cree umbrales Thold para `loss_pct`, `median` y `age`, desde plantillas Thold o en cada fuente de datos. Valores habituales: + +| Alertar por | Umbral | Notas | +|---|---|---| +| Pérdida de paquetes | `loss_pct` alto en 5 a 10 | La pérdida completa es 100 | +| Latencia | `median` alto en su límite en ms | `U` no genera alerta de latencia | +| Recolector detenido o lento | `age` alto en 2 a 3 veces `step` | Único valor que informa de un recolector detenido | + +Un umbral de `median` o `loss_pct` no se activa cuando el valor es `U`. Use `age` para «SmokePing dejó de medir». + + +## Límites + +Provienen del muestreo de Cacti y SmokePing, no del complemento, y este no puede eliminarlos. + +**Las duraciones Thold deben ser al menos un `step`.** Cacti sondea con su propio intervalo y SmokePing mide con su propio `step`. Cuando el intervalo Cacti es menor que `step`, se comunica la misma ronda varias veces. Cuando es mayor, se omiten rondas. Así, una muestra fuera de umbral no equivale a una ronda fuera de umbral; establezca la duración de activación Thold en al menos un `step` (con paso predeterminado de 300 segundos e intervalo de sondeo de 300 segundos, una activación de 2 sondeos). Una duración menor que `step` puede alertar por una sola ronda contada dos veces. + +**Los datos tardíos de esclavos nunca reactivan ni resuelven una alerta.** Un esclavo SmokePing guarda en caché los resultados que no pudo entregar y los reenvía; el maestro los aplica en orden temporal, por lo que pueden llegar tarde datos de una ventana pasada. Thold evalúa los valores cuando se sondean. Una ronda tardía actualiza el RRD y el gráfico, pero no cambia un valor ya evaluado por Thold: no genera una alerta perdida ni resuelve una abierta. Mientras un esclavo va retrasado, crece el `age` de esa ubicación, haciendo visible la demora. + +**Las alertas solo ven el resumen.** Mediana, pérdida y antigüedad describen la última ronda. El gráfico de humo sirve para investigar la distribución. + +**Las alertas propias de SmokePing son independientes.** La sección `alerts` de su configuración sigue funcionando. Un objetivo con alertas tanto en SmokePing como en Thold puede generar dos notificaciones por un problema si cumple ambas condiciones; el complemento no desactiva ninguna. La página de estado enumera estos objetivos bajo `dual_alerting`, a partir del valor `alerts` que lee el inventario, heredado igual que en SmokePing. + +**El RRD Cacti es una copia.** Los valores resumen se guardan en el RRD de Cacti además del de SmokePing, por lo que una diferencia de retención o consolidación puede reflejarse en los gráficos. + + +## Mantenimiento + +Una programación Maint de tipo «Cacti device» en el dispositivo del objetivo suprime las notificaciones Thold para ese dispositivo. Thold sigue evaluando y el complemento sigue llenando la fuente resumen, sin huecos en gráficos ni `age`. Si el umbral sigue superado al terminar la programación, las notificaciones se reanudan después de alcanzar de nuevo el número de activaciones: Thold no cuenta las infracciones durante el mantenimiento del dispositivo. + +Maint solo conoce dispositivos, no objetivos individuales. Un dispositivo con varios objetivos queda silenciado para todos. Las programaciones por objetivo requerirían un nuevo tipo de programación Maint y no forman parte de este complemento. + + +## Verificación + +`tests/run-alert-e2e.sh` ejecuta todo el recorrido en un contenedor con Cacti 1.2.31 y copias de `plugin_thold` y `plugin_maint` de un espacio de trabajo de complementos: un recolector de prueba añade rondas a un RRD con estructura SmokePing, el lector las guarda en caché, `poller.php` sondea la fuente resumen mediante el servidor de scripts, y Thold y Maint actúan sobre ella. Comprueba que un umbral `loss_pct` se active después del número configurado y se recupere, que una programación Maint por dispositivo suprima la notificación mientras continúa el sondeo, que la alerta se active al terminar el mantenimiento, y que un umbral `age` se active cuando el recolector de prueba se detiene y se recupere cuando vuelve a funcionar. diff --git a/docs/i18n/es-419/docs/backup-restore.md b/docs/i18n/es-419/docs/backup-restore.md new file mode 100644 index 0000000..35541e9 --- /dev/null +++ b/docs/i18n/es-419/docs/backup-restore.md @@ -0,0 +1,98 @@ + + + +# Copia de seguridad y restauración + +Una pareja Cacti y SmokePing restaurada sigue funcionando cuando se restauran juntas tres cosas: la base de datos Cacti, la configuración SmokePing y su directorio de datos. Esta página explica qué contiene cada una, cómo respaldarlas, qué hacer después de restaurar y cómo recuperar la configuración propia del complemento desde su exportación YAML si se pierde la base de datos. + + +## Qué respaldar + +| Elemento | Contenido | Por qué lo necesita el complemento | +|---|---|---| +| Base de datos Cacti | Tablas del complemento (objetivos, asociaciones, objetos creados, caché del lector, estado), dispositivos Cacti, fuentes de datos, gráficos y ajustes del complemento | Aquí residen las asociaciones, rutas de fuentes de datos y definiciones de gráficos | +| Configuración SmokePing: `/etc/smokeping/config` **y todos los archivos incluidos** (líneas `@include`, `config.d/*` en Debian y Ubuntu, archivo `secrets`, `smokemail`, `basepage.html`) | Árbol de objetivos | El inventario lo analiza. La identidad del objetivo es su ruta en este árbol y su archivo RRD es `datadir/.rrd` | +| Directorio de datos SmokePing (`datadir`) | Archivos RRD | Todos los gráficos y valores resumen los leen; son el historial. No se pueden reconstruir | + +Los ajustes del complemento están en la base de datos. La exportación descrita [más abajo](#restore-from-the-yaml-export) es una segunda copia, en texto, de la configuración propia del complemento; no sustituye a ninguno de los tres elementos. + + +## Realizar las copias + +Haga el volcado de la base de datos y las copias de archivos aproximadamente al mismo tiempo, para que los objetivos de la base de datos y los archivos en disco describan la misma configuración. + +```sh +# The Cacti database (use your own credentials file or option file, not a password on the command line) +mariadb-dump --defaults-extra-file=/root/.cacti-backup.cnf --single-transaction cacti > cacti.sql + +# SmokePing's configuration, with its included files +tar -czf smokeping-config.tgz -C /etc/smokeping . + +# SmokePing's data directory +tar -czf smokeping-datadir.tgz -C /var/lib/smokeping . + +# The plugin's own configuration, as YAML (optional second copy) +php /var/www/html/cacti/plugins/smokeping/cli/smokeping.php export --file=/var/backups/smokeping-config.yaml +``` + +Use el `datadir` de su distribución (`/var/lib/smokeping/rrd` en EL y Fedora). SmokePing escribe los RRD continuamente. Una copia mientras funciona puede capturar un archivo a mitad de actualización; para que sea coherente, tome una instantánea del sistema de archivos o volumen, o detenga SmokePing durante la copia (`systemctl stop smokeping`; el intervalo es una ausencia de mediciones, no una pérdida del historial). El directorio de datos puede contener otros directorios (`__cgi` en Debian, `images` en Alpine); es seguro incluirlos u omitirlos. + +El complemento nunca escribe en archivos SmokePing, por lo que restaurar el directorio de datos solo puede discrepar con lo que conserva el complemento a través de las asociaciones descritas abajo. + + +## Restaurar + +1. Instale Cacti, PHP y SmokePing como indica la [guía de instalación](install.md), y la misma versión del complemento o una más reciente desde el archivo de publicación. +2. Restaure la base de datos Cacti. +3. Restaure la configuración y el directorio de datos SmokePing en las rutas de la copia e inicie SmokePing. +4. Monte el directorio de datos en modo de solo lectura en la ruta de montaje del complemento ([guía de instalación, paso 3](install.md#3-mount-the-data-directory-read-only-inside-cactis-rra-path)). +5. Deje actuar al sondeador o ejecute una vez `php plugins/smokeping/poller_smokeping.php --force --inventory`. + +No hace falta nada más. Si los archivos del complemento son más recientes que la base de datos restaurada, migra sus tablas en la siguiente carga de página o ciclo del sondeador, y registra su versión solo cuando todos los pasos terminan correctamente. + +Qué restaura esto y por qué funciona: + +- **Las asociaciones resuelven los mismos RRD.** La ruta de una fuente es `/smokeping/.rrd`, relativa al montaje, y no cambia al cambiar el servidor o el directorio Cacti. La identidad de un objetivo es su ruta en el árbol SmokePing, no un ID de base de datos; la configuración restaurada conserva ese árbol. +- **El lector continúa.** Su caché conserva la última ronda vista por archivo; la siguiente ejecución lee el `lastupdate` de cada archivo y sustituye la fila. La primera ejecución recoge una ronda escrita por SmokePing mientras Cacti estuvo caído, y la frescura de cada serie se calcula desde la hora del archivo, no desde la última lectura. +- **Los gráficos se dibujan.** Son gráficos Cacti normales sobre las fuentes y archivos restaurados. + +Compruebe **SmokePing Health**: montaje, lector e inventario están OK tras un ciclo del sondeador, y la página SmokePing enumera los objetivos asociados con frescura actual. + + +### Si la base de datos restaurada es más antigua que la configuración SmokePing + +Un objetivo añadido a SmokePing después de la copia no está en la base de datos restaurada. El siguiente inventario lo encuentra y lo muestra sin asociar. Un objetivo eliminado desde entonces se marca como desaparecido y un administrador lo reasocia o archiva como siempre. No se pierde nada: los archivos siguen en el directorio de datos y la asociación se hace con un clic en **SmokePing Inventory**. + + +### Si el directorio de datos se restaura sin sus rondas más recientes + +SmokePing continúa escribiendo en los archivos restaurados desde su última actualización. El hueco en los gráficos corresponde al intervalo entre la copia y la restauración. + + +## Restaurar desde la exportación YAML + +Si se pierde la base de datos Cacti y solo queda la exportación, es posible recuperar los objetivos y asociaciones del complemento sin ella y volver a crear fuentes y gráficos: + +1. Instale Cacti y el complemento en el nuevo servidor, restaure la configuración y directorio de datos SmokePing y monte este último como antes. Configure las rutas en Settings (no se importan; consulte el [formato](configuration-format.md)). +2. Vuelva a crear los dispositivos Cacti con el **mismo nombre de host y descripción**. Sus IDs pueden cambiar. La exportación identifica cada dispositivo asociado por esos dos valores. +3. Compruebe y aplique la exportación: + + ```sh + php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml + php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml --apply --confirm= + ``` + + La comprobación enumera los cambios propuestos y rechaza una asociación cuyo dispositivo falte o sea ambiguo. No se escribe nada hasta el segundo comando, que necesita el ID de plan mostrado por el primero. +4. Para cada objetivo asociado, vuelva a crear fuentes y gráficos: `php plugins/smokeping/cli/smokeping.php provision --device=`. Apuntan a los mismos archivos de antes. + +La exportación contiene ajustes, objetivos y asociaciones del complemento. No contiene fuentes, gráficos ni rutas RRD, por lo que hace falta el paso 4; la restauración desde una copia de base de datos no lo necesita. + + +## Desinstalar + +La desinstalación intenta exportar a YAML (consulte la [guía de instalación](install.md#upgrading-and-removing)), pero no se detiene si falla la exportación. **Antes de desinstalar, exporte la configuración usted mismo y verifique que el respaldo sea legible y esté completo.** La desinstalación nunca toca los archivos SmokePing; restaure desde la exportación verificada como en el caso anterior. + + +## Verificación + +`sh tests/run-restore-e2e.sh ` ejecuta ambas restauraciones en contenedores y bases de datos nuevos: prepara un dispositivo y fuentes en una instalación funcional, vuelca la base de datos y archiva la configuración y datos SmokePing, restaura los tres en contenedores nuevos mientras SmokePing escribe una nueva ronda, y comprueba que el complemento esté habilitado y su actualización no haga cambios, que cada asociación, dispositivo y ruta de fuente sea igual, que cada fuente resuelva bajo el montaje a un archivo cuya suma coincida con la copia, que un gráfico se dibuje y que, un ciclo después, la caché del lector contenga la nueva ronda. Después restaura solo la exportación YAML en una base nueva y comprueba que la asociación siga el nombre del dispositivo, que un inventario la mantenga y que el aprovisionamiento recree las fuentes sobre los mismos archivos. diff --git a/docs/i18n/es-419/docs/configuration-format.md b/docs/i18n/es-419/docs/configuration-format.md new file mode 100644 index 0000000..55c7244 --- /dev/null +++ b/docs/i18n/es-419/docs/configuration-format.md @@ -0,0 +1,121 @@ + + + +# Formato del archivo de configuración + +La configuración propia del complemento se exporta e importa en un único formato con dos representaciones: YAML (predeterminada) y XML. Esta página define la versión 1 del esquema. Los motivos del diseño están en la [decisión 0008](../../../decisions/0008-yaml-and-xml-configuration-files.md). + +El archivo contiene los ajustes del complemento, los objetivos SmokePing que ha leído (objetivos observados) y el dispositivo Cacti asociado a cada objetivo. No contiene fuentes de datos, gráficos, rutas RRD ni credenciales. Las plantillas de gráficos, datos y hosts de Cacti son algo distinto y siguen en XML Cacti. + + +## Comandos + +```sh +php plugins/smokeping/cli/smokeping.php export # YAML to standard output +php plugins/smokeping/cli/smokeping.php export --format=xml --file=/var/backups/smokeping-config.xml +php plugins/smokeping/cli/smokeping.php import --file=smokeping-config.yaml # check only +php plugins/smokeping/cli/smokeping.php import --file=smokeping-config.yaml --apply --confirm= +``` + +`export --file` crea un archivo nuevo legible solo por su propietario y rechaza sobrescribir uno existente. `import` sin `--apply` lee y comprueba el archivo, muestra todos los cambios propuestos y un ID de plan, y no escribe nada. `--apply` necesita `--confirm` con ese ID; aplica en una sola transacción y rechaza si el archivo o la instalación cambiaron desde la comprobación. Estado de salida: 0 completado, 1 rechazado o fallido, 2 errores en el archivo o plan. + +Las mismas acciones están en **Management > SmokePing Configuration** (ámbito SmokePing Admin): descargue una exportación, elija un archivo para comprobar, revise los cambios enumerados y aplique. + +La importación solo añade y actualiza. Nunca elimina objetivos, mueve asociaciones a otro dispositivo (reasocie en Inventory), crea fuentes, gráficos o archivos RRD, ni lee o escribe en el directorio de datos SmokePing. La desinstalación escribe una exportación YAML en el ajuste **Backup Directory** o, si está vacío, en `cache/smokeping/` dentro del directorio Cacti. El archivo tiene un nombre aleatorio y permisos `0600`; el directorio predeterminado contiene un `.htaccess` que deniega todo y un `index.php` que no sirve nada. Si Backup Directory no existe o no es escribible, no se exporta (no se recurre al directorio predeterminado), y la desinstalación continúa indicando dónde se escribió el archivo o que no se escribió ninguno. Elija un directorio fuera de la raíz web. + + +## Versión 1 del esquema + +```yaml +schema_version: 1 # required; a higher number is refused + +settings: # optional; any subset of the settings below + smokeping_poller_id: 1 + smokeping_reader_budget: 120 + smokeping_inventory_interval: 300 + smokeping_freshness_allowance: 60 + smokeping_uninstall_keep_tables: false + +reference_settings: # optional; shown for reference, never imported + smokeping_config_file: /etc/smokeping/config + smokeping_backup_dir: '' + smokeping_datadir: /var/lib/smokeping + smokeping_mount_path: /var/www/html/cacti/rra/smokeping # omitted from exports while it is the default + +targets: # optional + - path: Europe/Paris # required; the SmokePing tree path + poller_id: 1 # default 1; must exist + host: paris.example.net + probe: FPing + menu: Paris # optional text + title: 'Paris: gateway' # optional text + slaves: # optional list of slave names + - site-b + nomasterpoll: false + step: 300 # 0 to 604800 + pings: 20 # 0 to 10000 + mode: observed # only observed + admin_state: enabled # enabled, disabled, or archived + present: true # honored for a new target only + +mappings: # optional + - target: Europe/Paris # a target in this file or already in the installation + poller_id: 1 + device: + hostname: paris-gw.example.net # the Cacti device's host name (not case sensitive) + description: Paris gateway # and its description (exact) +``` + +Identidad. Un objetivo se identifica por `poller_id` y `path`. Un dispositivo por `hostname` y `description`; la comprobación rechaza asociaciones cuando ningún dispositivo, o más de uno, tiene esa pareja. La importación recorta espacios al principio y al final del texto porque el complemento lee todos los valores almacenados de ese modo. + +Claves reservadas. `managed_targets` y `probe_profiles` se reservan para una futura versión con modo gestionado. La versión 1 las rechaza con un error que nombra la clave, para que nunca se aplique parcialmente un archivo escrito para esa versión. Una versión posterior ampliará el esquema con ellas; solo aumenta `schema_version` si cambia el significado de una clave ya existente aquí. + +Actualizaciones. Para un objetivo ya presente, una importación solo cambia `host`, `probe`, `menu`, `title`, `slaves`, `nomasterpoll`, `step`, `pings` y `admin_state`. La configuración SmokePing sigue siendo la fuente de los seis primeros campos: el siguiente inventario los restaura. Use la importación para restaurar `admin_state` y preparar una instalación nueva, no para editar objetivos. + +Los valores de ajustes deben tener el tipo indicado. El texto no puede contener caracteres de control. + +Ajustes solo de referencia. Un ajuste que nombra un archivo o directorio (todos los de `reference_settings` arriba) nunca se escribe mediante importación: un archivo no debe poder cambiar dónde lee o escribe el complemento. El esquema los marca por tipo y rechaza un archivo que los ponga en `settings`. En `reference_settings` se comprueba su forma (ruta absoluta o vacío donde se permita), se comparan con la instalación y, si difieren, el plan muestra `not applied, change on the Settings page`. Cámbielos en Settings. Los archivos exportados por 1.0.0-rc.1 también enumeran ahí `smokeping_perl_binary` y `smokeping_lib_dir`; estos ajustes ya no existen y la importación los omite. + + +## XML + +```xml + + + + 1 + false + + + /var/lib/smokeping + + + + site-b + + + + + + + + +``` + +XML se corresponde uno a uno con las claves YAML anteriores. Los booleanos son `true` o `false`. El lector rechaza cualquier declaración DOCTYPE o de entidad, no carga recursos externos y solo acepta estos elementos. + + +## Subconjunto YAML + +El lector acepta mapas y listas en bloque, escalares simples y entre comillas simples o dobles, comentarios y bloques literales `|` y `|-`, con un único `---` inicial opcional. Los escalares entre comillas dobles admiten escapes `\\ \" \/ \n \t \r \0 \b \f \e \xHH \uHHHH`; los de comillas simples duplican la comilla (`''`). Un escalar entrecomillado se cierra en su propia línea. + +Rechaza, indicando la línea: anclas (`&x`), alias (`*x`), etiquetas (`!x`), colecciones en flujo (`[a, b]`, `{a: b}`), bloques plegados (`>`), múltiples documentos, directivas, claves de fusión (`<<`), claves complejas (`?`), claves duplicadas, tabulaciones de sangría, escalares simples multilínea y anidamiento superior a 8 niveles. Rechaza un escalar simple que otra versión YAML interpreta como algo distinto de texto: `yes`, `no`, `on`, `off`, `y`, `n`, números con cero inicial, decimales, hexadecimales, fechas y horas como `1:30`. Póngalos entre comillas (`'yes'`). `true`, `false`, `null`, `~` y los números enteros simples conservan su significado. + +El exportador entrecomilla toda cadena que un lector pudiera interpretar mal, incluidas aquellas con dos puntos o `#`, espacio inicial o final, o un primer carácter que YAML trate como indicador. + + +## Límites + +En ambos formatos, los archivos se limitan a 8 MiB y 8 niveles de anidamiento, y cada línea a 16 KiB. El tamaño se comprueba antes de leer el archivo. diff --git a/docs/i18n/es-419/docs/install.md b/docs/i18n/es-419/docs/install.md new file mode 100644 index 0000000..bd8f220 --- /dev/null +++ b/docs/i18n/es-419/docs/install.md @@ -0,0 +1,214 @@ + + + +# Instalar el complemento SmokePing + +Esta guía lleva un servidor Cacti 1.2 y una instalación SmokePing desde cero hasta gráficos en Cacti. Cubre el complemento, el acceso de solo lectura al directorio de datos (la parte que más suele fallar), su verificación, contenedores y soporte. La operación diaria está en [operaciones](operations.md), las alertas en [alertas](alerting.md) y las copias en [copia y restauración](backup-restore.md). + + +## Qué está admitido + +| Componente | Admitido | Probado aquí | +|---|---|---| +| Cacti | 1.2.31 y rama 1.2.x actual (1.2.32 cambia la comprobación de rutas de fuentes; véase el montaje) | Versión 1.2.31 y copia de desarrollo 1.2.32 | +| PHP | 8.2 o posterior. En 8.0 y 8.1 rechaza instalarse y Cacti sigue funcionando | 8.2.35 para integración y extremo a extremo; sintaxis de puntos de entrada en 8.0 | +| SmokePing | 2.9.0, 2.8.2 y 2.7.3 (solo Ubuntu 22.04, hasta 2027-06-01) | Los tres para el analizador, comparados con el original en 2.7.3 (Ubuntu 22.04), 2.8.2 (Debian 13) y 2.9.0 (Fedora 45); los tres para fidelidad de gráficos | +| rrdtool | La versión de Cacti; el lector ejecuta `path_rrdtool` | 1.7.2 | +| Thold, Maint | Sin cambios necesarios | Versiones del espacio de trabajo de complementos | +| Series | 10.000 por instalación con 20 pings y paso de 300 s, cuatro vCPU dedicadas y 8 GB ([rendimiento](performance.md#supported-series-count)) | 100, 1.000 y 10.000 en el ejecutor de publicaciones | + +Una «serie» es un objetivo en una ubicación (maestro o esclavo). El soporte de distribuciones sigue sus periodos de soporte completo; véase la [matriz](../../../research/distribution-matrix/README.md). Debian 13, Ubuntu 22.04 a 26.10, EL 9, Fedora 43 a 45 y Alpine 3.22 a 3.24 empaquetan SmokePing. **EL 10 y openSUSE Leap 16 no tienen paquete SmokePing**; allí solo funciona en la medida en que funcione una instalación desde código fuente, que no cubre esta guía. + + +## Cómo encajan las partes + +SmokePing escribe RRD. Cacti los grafica y el complemento lee sus últimos valores; ninguno los escribe. Cacti 1.2.32 y posteriores rechazan rutas fuera de RRA, por lo que se accede al directorio SmokePing mediante un **montaje de solo lectura dentro de la ruta RRA de Cacti**, por defecto `/smokeping` ([decisión 0007](../../../decisions/0007-read-only-mount-under-rra-path.md)). Este montaje protege también los archivos: la limpieza Cacti no puede eliminarlos ni renombrarlos a través de él. + +El sondeador Cacti del lector debe poder leer dos cosas del servidor SmokePing: + +1. La configuración (`/etc/smokeping/config`) y archivos incluidos, mediante el analizador PHP propio del complemento. Los incluidos deben estar en su directorio o debajo; se rechaza cualquier otro. No ejecuta Perl ni necesita la biblioteca Perl de SmokePing. +2. El directorio de datos mediante el montaje. + +Si están en servidores distintos, comparta los datos en solo lectura (NFS) y móntelos donde corre el sondeador SmokePing; véase [operaciones](operations.md#topologies). SmokePing en un recolector remoto Cacti es una fase posterior no admitida aquí. + + +## 1. Instalar SmokePing (si falta) + +En Debian 13 y Ubuntu: + + +```sh +apt-get update +DEBIAN_FRONTEND=noninteractive apt-get install -y smokeping +``` + +En EL 9 (el paquete está en EPEL y necesita CodeReady Builder): + + +```sh +dnf install -y epel-release +dnf config-manager --set-enabled crb +dnf install -y smokeping +``` + +Configure SmokePing como de costumbre e inícielo con `systemctl enable --now smokeping`. El directorio de datos es `/var/lib/smokeping` en Debian, Ubuntu y Alpine y `/var/lib/smokeping/rrd` en EL y Fedora. Aquí `DATADIR` es ese directorio (`datadir` de `*** Database ***`) y `RRA` es la ruta RRA Cacti (Console > Configuration > Settings > Paths, «RRA Path»; `/var/www/html/cacti/rra` en ejemplos). + +**Otros contenidos del directorio.** Debian conserva cachés de esclavos en `DATADIR/__cgi/
/` (`dyndir` de SmokePing) y no crea las secciones por sí mismo, por lo que un esclavo que no ha informado deja `__cgi/
/` vacío o ausente; Alpine conserva imágenes en `DATADIR/images` y las cachés de ordenación de SmokePing en `DATADIR/__sortercache`. El complemento ignora todo ello: nunca enumera el directorio y solo lee los RRD indicados por la configuración (`
/.rrd` y `~.rrd` por esclavo). Ni esos directorios ni un RRD sin objetivo (como `Local/LocalMachine.rrd`) se leen, enumeran o notifican como error. Se comprobó con un maestro Debian 13 y dos esclavos ([pruebas](../../../testing.md#the-live-suite)). + + +## 2. Permitir al sondeador Cacti leer SmokePing + +En las distribuciones empaquetadas, cualquiera puede leer los RRD y atravesar sus directorios superiores: el usuario del sondeador **no necesita pertenecer a ningún grupo**. La configuración es legible por todos en Debian, Ubuntu y Alpine y `0640 root:apache` en EL y Fedora, donde solo `apache` y root la leen. + +Compruebe como usuario del sondeador (`www-data` en Debian/Ubuntu, `apache` en EL/Fedora): + + +```sh +runuser -u "$POLLER_USER" -- test -r "$DATADIR" && echo "datadir readable" +runuser -u "$POLLER_USER" -- test -r /etc/smokeping/config && echo "config readable" +runuser -u "$POLLER_USER" -- ls "$DATADIR" > /dev/null && echo "datadir listable" +``` + +Cada línea debe imprimir, como ocurre con permisos de paquete: no hacen falta grupos ni otros ajustes en SmokePing. Solo falla con permisos más estrictos (por ejemplo `datadir` como `0750 smokeping:smokeping`) o usuario distinto de `apache` en EL/Fedora, cuya configuración es `0640 root:apache`. Dé acceso de lectura solo a ese usuario, por ejemplo mediante ACL (`setfacl -R -m u:$POLLER_USER:rX` en el directorio de configuración y `DATADIR`), y nunca permita que el usuario Cacti escriba archivos SmokePing. + + +## 3. Montar los datos en solo lectura dentro de RRA + +Elija una de las dos formas. Ambas crean un montaje enlazado que necesita root una vez. + + +### Opción A: línea en `/etc/fstab` + + +```sh +mkdir -p "$RRA/smokeping" +echo "$DATADIR $RRA/smokeping none bind,ro 0 0" >> /etc/fstab +mount "$RRA/smokeping" +``` + +Se aplica de inmediato y en cada arranque. Si prueba con `mount --bind`, añada un remontaje porque `util-linux` antiguo ignora `ro` en el primer enlace: `mount -o remount,bind,ro "$RRA/smokeping"`. + + +### Opción B: unidad systemd `.mount` + +Su nombre debe ser la ruta del montaje con `/` convertido en `-`; deje que systemd lo calcule: + + +```sh +unit=$(systemd-escape --path --suffix=mount "$RRA/smokeping") +cat > "/etc/systemd/system/$unit" < +### Verificar el montaje + + +```sh +findmnt -no TARGET,SOURCE,OPTIONS "$RRA/smokeping" +findmnt -no OPTIONS "$RRA/smokeping" | tr ',' '\n' | grep -x ro +touch "$RRA/smokeping/.cacti-write-test" && echo "WRITABLE: fix the mount before continuing" || echo "read-only, as required" +ls "$RRA/smokeping" | head +``` + +Debe aparecer `ro`, `touch` debe fallar con `Read-only file system` (incluso como root) y la lista mostrar secciones SmokePing. Health repite la comprobación desde `/proc/self/mountinfo` y notifica como **error** un montaje escribible, ausente o un enlace simbólico en la ruta. Un enlace simbólico no sustituye al montaje: Cacti 1.2.32 y posteriores rechazan rutas que lo atraviesen. + + +## 4. Instalar el complemento + +Desde un archivo de publicación (véase [empaquetado](../../../release.md)): + +```sh +tar -xzf smokeping-0.2.0.tar.gz -C /var/www/html/cacti/plugins +chown -R root:root /var/www/html/cacti/plugins/smokeping +cd /var/www/html/cacti +sudo -u www-data php cli/plugin_manage.php --plugin=smokeping --install --enable --allperms +``` + +El directorio debe llamarse `smokeping`. Ejecute el último comando como propietario de los archivos Cacti (`apache` en EL). `--allperms` concede al administrador de consola los tres ámbitos; otros usuarios reciben **SmokePing View**, **SmokePing Operator** o **SmokePing Admin** desde User Management. Operator incluye acceso View, y Admin incluye acceso Operator. El complemento instala tablas y plantillas de gráficos y hosts; si falla importar plantillas, lo muestra en Health y sigue funcionando. **Retry Template Import** permite repetir después de corregir la causa. + +PHP anterior a 8.2 rechaza instalar con un mensaje que indica la versión requerida; el resto de Cacti no se ve afectado. + + +## 5. Configurar y confirmar + +Abra **Console > Configuration > Settings > SmokePing** y compruebe: + +| Ajuste | Significado | +|---|---| +| SmokePing Poller | Sondeador Cacti en el servidor SmokePing o que comparte su sistema de archivos. Solo él lee los datos. | +| SmokePing Configuration File | `/etc/smokeping/config`, salvo que lo haya movido | +| SmokePing Data Directory | `DATADIR`, como lo ve SmokePing | +| Cacti Mount of the Data Directory | Montaje del paso 3; predeterminado `/smokeping` | +| Loss Colors | Automatic, salvo SmokePing 2.7 cuyo `Smokeping.pm` no sea visible al lector: entonces SmokePing 2.7. Véase [colores](provisioning.md#loss-colors) | + +Abra **SmokePing Health** en el servidor del sondeador. La fila de configuración lee inmediatamente el archivo y muestra el número de objetivos o el primer error con archivo y línea. Tras el próximo ciclo, todas las filas deberían ser OK: PHP, configuración, lector, inventario, montaje y plantillas. Para ejecutar lector e inventario sin esperar: + +```sh +sudo -u www-data php plugins/smokeping/poller_smokeping.php --force --inventory +``` + +**SmokePing Inventory** enumera ya todos los objetivos. Aún no hay gráficos; consulte [aprovisionamiento](provisioning.md). + + +## Idiomas + +El complemento incluye español de España (`es-ES`), francés (`fr-FR`), alemán (`de-DE`), chino simplificado (`zh-CN`), hindi (`hi-IN`), árabe (`ar-SA`) y japonés (`ja-JP`). Cacti los muestra al activar idiomas (Configuration > Settings > General > Language Support) y elegir uno el usuario. También incluye español latinoamericano (`es-419`), pero Cacti 1.2 no ofrece esa configuración regional: solo surtirá efecto cuando Cacti la añada; mientras tanto, elija español (`es-ES`). + + +## Contenedores + +Ejecute el lector donde vea ambas cosas indicadas al principio. + +- **Cacti en contenedor, SmokePing en el servidor.** Monte los datos en solo lectura en RRA y también la configuración en solo lectura: + + ```sh + docker run -d --name cacti \ + -v /var/lib/smokeping:/var/www/html/cacti/rra/smokeping:ro \ + -v /etc/smokeping:/etc/smokeping:ro \ + my-cacti-image + ``` + + Sustituya el lado izquierdo del montaje de datos por el `DATADIR` del servidor. La imagen no necesita nada de SmokePing: ni Perl ni el paquete `smokeping`. PHP del contenedor debe ser 8.2 o posterior. Health comprueba `:ro`; sin él informa de error. +- **Docker Compose.** Lo mismo, como entradas `volumes:` con `read_only: true` y `type: bind`: + + ```yaml + services: + cacti: + volumes: + - type: bind + source: /var/lib/smokeping + target: /var/www/html/cacti/rra/smokeping + read_only: true + ``` + +- **Kubernetes.** Volumen con `readOnly: true` en `volumeMounts`, respaldado por hostPath o volumen NFS/CSI donde escribe el pod SmokePing. +- **SmokePing en contenedor.** Ponga su `datadir` en un volumen compartido con el servidor Cacti y móntelo en solo lectura como antes. El complemento nunca necesita entrar al contenedor SmokePing. + + +## El limpiador RRD Cacti enumera archivos SmokePing + +El limpiador (**Utilities > RRD Cleaner**) recorre todo RRA, por lo que enumera como no usados los RRD SmokePing sin fuente Cacti, incluidos `target~slave.rrd`, y ofrece borrarlos. No los seleccione. Borrar o archivar mediante el montaje de solo lectura falla, Cacti registra una advertencia y elimina la entrada de la cola: los archivos sobreviven, pero las advertencias molestan y un montaje escribible perdería datos. El complemento elimina de la cola las entradas reconocibles antes de purgar (al comienzo de cada sondeo), reduciendo advertencias. El limpiador no tiene exclusiones; revise la lista antes de seleccionar. + + +## Actualizar y quitar + +Sustituya el directorio por la nueva publicación y abra Plugins o espere al sondeo; migra tablas y plantillas y registra la versión solo al completar todos los pasos, por lo que la siguiente ejecución termina una actualización interrumpida. Deshabilitar detiene los trabajos y deja los archivos SmokePing intactos. **Antes de desinstalar, exporte la configuración usted mismo y verifique que el respaldo sea legible y esté completo.** La desinstalación intenta exportar la configuración del complemento a YAML en Backup Directory o `cache/smokeping/` de Cacti (nombre aleatorio, modo `0600`, ruta mostrada si tiene éxito). Si la exportación falla, se registra y muestra una advertencia, pero la desinstalación continúa. Elimina las tablas salvo que esté activo **Keep Plugin Tables on Uninstall**, y nunca toca los archivos ni la configuración de SmokePing. diff --git a/docs/i18n/es-419/docs/operations.md b/docs/i18n/es-419/docs/operations.md new file mode 100644 index 0000000..3969128 --- /dev/null +++ b/docs/i18n/es-419/docs/operations.md @@ -0,0 +1,107 @@ + + + +# Operar el complemento SmokePing + +Cómo interpretar lo que muestra el complemento, el significado y las evidencias de cada estado, qué comprobar ante problemas y cómo responde a fallos de sus entradas. La instalación está en [instalar](install.md), las alertas en [alertas](alerting.md) y las copias en [copia y restauración](backup-restore.md). + +Consulte [Roles de acceso](../README.md#access-roles) para los permisos View, Operator y Admin y el comportamiento de clasificación personal. + + +## Páginas + +| Página | Ámbito | Contenido | +|---|---|---| +| **SmokePing** (pestaña superior) | View | Último estado de los objetivos asociados a dispositivos que puede ver, una fila por objetivo y ubicación | +| **SmokePing Inventory** | Admin | Todos los objetivos de la configuración SmokePing, asociados o no, y propuestas abiertas de reasociación | +| **SmokePing Health** | Admin | Las comprobaciones siguientes y un botón para reintentar importar plantillas | +| **SmokePing Configuration** | Admin | Exportación e importación de configuración del complemento ([formato](configuration-format.md)) | +| **Import SmokePing Configuration** (en Import/Export) | Admin | Importación de una configuración SmokePing existente a dispositivos, gráficos y un árbol de gráficos ([procedimiento](provisioning.md#a-whole-smokeping-configuration)) | + +Los gráficos de humo y resumen son gráficos Cacti normales, sujetos a sus permisos de gráficos y dispositivos. + + +## Significado de los estados + +Cada fila de SmokePing combina dimensiones independientes. Nunca se fusionan en un color único, porque un recolector detenido y la pérdida completa de paquetes requieren respuestas distintas. + +| Dimensión | Estados | Evidencia | +|---|---|---| +| Frescura | `current`, `delayed`, `stale`, `never` | Antigüedad de la última actualización RRD (leída con `rrdtool lastupdate`) frente al `step` del objetivo. Current: dentro de un `step` más la tolerancia de frescura (60 s predeterminados). Delayed: mayor antigüedad, hasta dos veces `step`, el heartbeat de SmokePing. Stale: más allá del heartbeat, cuando los valores son desconocidos. Never: falta el archivo o nunca se actualizó desde su creación | +| Ejecución | `completed`, `probe_error`, `unknown` | Una ronda se completó si escribió una pérdida numérica. Los datos obsoletos o nunca observados no informan de la última ronda, por lo que son `unknown`. Nunca se establece `probe_error`: una sonda fallida escribe lo mismo que un objetivo sin respuesta ([investigación](../../../research/probe-failures.md)) | +| Condición | `within_policy`, `degraded`, `complete_loss`, `unknown` | De la última ronda completada. Pérdida completa es `loss` igual a `pings` sin mediana. Cualquier pérdida inferior es degradación. Un recolector detenido nunca aparece como pérdida: queda obsoleto y la condición es `unknown` | +| Administrativa | `enabled`, `disabled`, `archived` | Registro del objetivo en el complemento. No se lee un objetivo deshabilitado o archivado | +| Mantenimiento | en mantenimiento o no | Hook `is_device_in_maintenance` de Maint para el dispositivo del objetivo, mostrado en la columna Maintenance de la página de objetivos. Sin Maint, o deshabilitado, todos los dispositivos aparecen sin mantenimiento | +| Hora de medición | segundos desde la última actualización | Marca temporal del propio RRD. Actualizar la página nunca cuenta como medición | + +La frescura de cada ubicación procede de su propio archivo (`target~slave.rrd` para esclavos), de modo que un esclavo retrasado queda obsoleto aunque el maestro esté al día. + +La columna de pérdida muestra `lost/pings` de la última ronda y la mediana está en milisegundos; `U` significa desconocido, no cero. + + +## Comprobaciones de salud + +| Comprobación | Qué significa OK | Cuando no es OK | +|---|---|---| +| `php_binary` | El binario PHP indicado en Cacti existe y es ejecutable | El lector no puede arrancar: corrija «PHP Binary Path» en Cacti | +| `reader` | La última ejecución terminó dentro de tres intervalos de sondeo y de su presupuesto temporal | Advertencia: lector retrasado o presupuesto excedido. Con muchas series, aumente el presupuesto o revise el almacenamiento; consulte [rendimiento](performance.md) | +| `inventory` | El último inventario analizó la configuración SmokePing | Error: mensaje del analizador SmokePing con archivo y línea. Se conserva el inventario anterior | +| `mount`, `read-only`, `writable` | La ruta de montaje está dentro de RRA, se alcanza sin enlaces simbólicos, está montada en solo lectura y no es escribible | Error. Consulte la [guía de instalación](install.md#3-mount-the-data-directory-read-only-inside-cactis-rra-path) | +| `visibility` | Los archivos enumerados por el inventario son visibles por el montaje | Advertencia con el número de ausentes | +| `templates` | Las plantillas SmokePing están importadas | Error con la causa; corríjala y use **Retry Template Import** | +| `device_pollers` | Todos los dispositivos con fuentes resumen son sondeados por el sondeador del lector | Error que nombra los dispositivos: sus valores y alertas carecen de datos hasta usar ese sondeador | +| `loss_colors` | Colores seleccionados por Loss Colors: los de la versión SmokePing encontrada o los indicados. Tras cambiar, el sondeador principal migra gráficos en ciclos siguientes, 200 por ciclo; `upgrade-graphs` los migra de inmediato. La fila cuenta los gráficos aún con otros colores y avisa de migraciones fallidas | Desconocido si el lector no encontró versión y el ajuste es Automatic: se usan colores de 2.8 y posteriores. Advertencia si difiere de la versión encontrada. Consulte [colores de pérdida](provisioning.md#loss-colors) | +| `dual_alerting` | Ningún objetivo tiene a la vez un valor `alerts` SmokePing y un umbral Thold habilitado en su fuente resumen | Advertencia con hasta 10 objetivos: un problema que cumpla ambas condiciones notifica dos veces. No se comparan condiciones; por ejemplo, un umbral Thold `age` puede activarse sin alerta de pérdida SmokePing. Compárelas antes de quitar la alerta SmokePing o deshabilitar el umbral. OK si no está instalado Thold | + + +## Situaciones habituales + +- **Todo está `stale`.** SmokePing dejó de escribir o el montaje está obsoleto. Compruebe `systemctl status smokeping` y compare `rrdtool lastupdate` a través del montaje con el mismo archivo en el servidor SmokePing. NFS de solo lectura puede retrasarse por su caché de atributos. +- **Un esclavo está `stale` y el maestro `current`.** El esclavo dejó de entregar datos. El maestro aplica los resultados tardíos al recibirlos y rellena el gráfico; Thold no los reevalúa ([alertas](alerting.md)). +- **Un objetivo dice `never`.** El RRD aún no existe (SmokePing lo crea en la primera ronda tras recargar) o el montaje no lo muestra. Revise `visibility`. +- **Un gráfico queda vacío tras actualizar Cacti a 1.2.32.** Cacti sustituye una ruta de fuente fuera de RRA por su ruta generada. Verifique el montaje donde indica el complemento y que no haya enlaces simbólicos. +- **Se renombra una sección SmokePing.** SmokePing inicia un archivo nuevo para una ruta nueva. El inventario propone reasociar y no cambia nada hasta la confirmación de un administrador ([aprovisionamiento](provisioning.md#re-linking-a-renamed-target)). + + +## Topologías + +1. **SmokePing en el servidor del sondeador Cacti.** El usuario del sondeador lee el directorio de datos mediante el montaje enlazado. Es el caso de la guía de instalación. +2. **Directorio SmokePing compartido con el servidor Cacti.** Móntelo en solo lectura por NFS en la ruta RRA del servidor que ejecuta el sondeador SmokePing. Salud compara la última actualización con el reloj; un montaje retrasado aparece como `delayed` o `stale`. Los gráficos de humo se dibujan en el servidor que sirve la interfaz web, que también necesita el recurso compartido; si solo lo tiene el sondeador, los resúmenes y alertas funcionan, pero los gráficos de humo quedan vacíos. +3. **SmokePing en un recolector remoto Cacti** pertenece a una fase posterior y no se admite en esta versión. + +Solo el sondeador indicado en **SmokePing Poller** lee los datos SmokePing. Los dispositivos con fuentes resumen deben usarlo. + + +## Ante fallos de entradas + +Estos comportamientos están cubiertos por la calificación de la versión ([calificación de fallos](../../../failure-qualification.md)); ninguno pierde datos. + +| Fallo | Comportamiento documentado | +|---|---| +| Configuración SmokePing ilegible o rota | Falla el inventario con el mensaje del analizador en Health; se mantiene el anterior sin eliminar nada | +| Una sonda no puede funcionar mientras SmokePing continúa: binario con error de salida, dirección origen ausente del servidor, parámetro rechazado por fping o IPv6 desactivado para FPing6 | SmokePing escribe pérdida completa para todos los objetivos de esa sonda, igual que para objetivos sin respuesta. Las mediciones muestran `complete_loss`. Si todos fallan a la vez, busque el error de la sonda en el registro SmokePing | +| Fallo de sonda detectado por SmokePing: binario ausente, parámetro fuera de rango, sin socket raw para fping | SmokePing termina al arrancar o en la primera ronda. Todos los objetivos pasan a `delayed` y después `stale`, como al detenerse SmokePing | +| No se resuelven nombres de objetivos (fallo DNS) | Las sondas fallan y escriben pérdida; el complemento lee lo escrito. Las mediciones muestran `degraded` o `complete_loss`, no obsolescencia. El complemento no hace consultas DNS | +| SmokePing o su recolector se detiene | Frescura pasa a `delayed` y luego `stale`; `median` y `loss_pct` pasan a desconocidos, `age` sigue creciendo. Nunca pérdida cero | +| Desfase de relojes entre Cacti y SmokePing | Frescura compara la hora propia del RRD con el reloj Cacti; el desfase altera todas las edades. SmokePing adelantado marca rondas futuras que aparecen `current`, y un recolector detenido sigue `current` hasta que transcurra el desfase. SmokePing atrasado hace parecer más antiguas todas las series y `stale` cuando supera dos veces `step`. Mantenga ambos servidores con NTP | +| RRD ilegible o corrupto | El lector registra una advertencia para ese archivo y sigue con los demás. Una serie nunca leída es desconocida (`U`). Una leída antes conserva la última lectura en caché, que envejece por `delayed` y `stale` hasta desconocida; un archivo dañado nunca se convierte en pérdida cero | +| Almacenamiento lleno en Cacti | El lector solo escribe su caché de base de datos. Si se rechaza una escritura, termina normalmente y todas las filas quedan completas como estaban; el siguiente ciclo tras recuperar espacio guarda las nuevas rondas. Los RRD Cacti de resumen fallan como cualquier otro origen | +| Lector terminado a mitad de ejecución | Cada fila se escribe completa, de modo que quedan lecturas completas. Cacti detecta el proceso muerto y la siguiente ejecución empieza inmediatamente y completa todas las series | +| Segundo arranque del lector | La tabla de procesos Cacti permite un lector por sondeador. El duplicado sale inmediatamente con 0 y registra una nota (nivel Medium); no perturba al primero | +| Inicio y fin de mantenimiento | Maint suprime notificaciones del dispositivo; Thold sigue evaluando y la fuente resumen se sigue sondeando | +| Actualización interrumpida del complemento | La versión registrada solo cambia al completar todos los pasos; la siguiente página o ciclo termina la actualización | + + +## Importar y exportar + +Consulte el [formato de configuración](configuration-format.md). Forma breve: + +```sh +php plugins/smokeping/cli/smokeping.php export --file=/var/backups/smokeping-config.yaml +php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml +``` + + +## Registros + +El complemento escribe en el registro Cacti con la etiqueta `SMOKEPING`. `grep SMOKEPING log/cacti.log` muestra estadísticas del lector (`SMOKEPING STATS`), fallos de inventario e importación de plantillas y toda importación de configuración aplicada. diff --git a/docs/i18n/es-419/docs/performance.md b/docs/i18n/es-419/docs/performance.md new file mode 100644 index 0000000..99d638f --- /dev/null +++ b/docs/i18n/es-419/docs/performance.md @@ -0,0 +1,101 @@ + + + +# Rendimiento + +La capacidad se expresa en series: un objetivo en una ubicación de medición (maestro o esclavo). Esta página indica el coste del complemento con 100, 1.000 y 10.000 series, el entorno medido y los datos aún pendientes. Los IDs de requisitos proceden de [#42](https://github.com/somethingwithproof/plugin_smokeping/issues/42). + + +## Trabajo por petición y por ciclo + +- **Ninguna petición de página ejecuta una sonda, lee un RRD ni espera a un recolector remoto (REQ-PERF-003).** La vista general lee las filas de caché del lector en la base de datos. `tests/bin/perf-page.php` la dibuja con la ruta de montaje apuntando a un directorio inexistente y el resultado es igual. Los gráficos son gráficos Cacti y leen sus archivos como cualquier gráfico Cacti. +- **Un proceso lector por sondeador lee cada serie una vez por ciclo**, mediante una única tubería `rrdtool`, con un presupuesto temporal (120 s predeterminados). Si lo alcanza, se detiene y la siguiente ejecución continúa con las series que más esperaron. Leer un archivo es una llamada `lastupdate` que lee la cabecera; no depende del tamaño del RRD. +- **Cada fuente resumen lee una fila de caché**, sin tocar nunca un RRD. +- **La pantalla de confirmación de una adición masiva muestra la carga antes de crear nada (REQ-PERF-004)**: para los objetivos coincidentes, el número de series, paquetes de sonda por segundo y actualizaciones RRD por segundo que soportará SmokePing, así como filas de fuentes de datos Cacti y elementos de gráficos. El cálculo está en `lib/LoadEstimate.php`. + + +## Cálculos + +Con 10.000 series, 20 pings cada 300 segundos: unos 667 paquetes por segundo de media, unas 33 actualizaciones RRD SmokePing por segundo y unas 33 lecturas `lastupdate` por segundo si el lector comprueba cada serie en cada paso. Los objetos Cacti son 260.000 filas `data_template_rrd` (23 para la fuente de humo y 3 para el resumen, por serie) y 550.000 filas de elementos de gráficos (50 para humo y 5 para resumen, por serie), con 10.000 fuentes resumen sondeadas por el servidor de scripts. La prueba de publicación siguiente usó plantillas anteriores a [#81](https://github.com/somethingwithproof/plugin_smokeping/issues/81) y contó exactamente sus filas: 47 por gráfico de humo, 520.000 en total. #81 añadió desviación estándar, am/s y líneas de sonda. La confirmación calcula los mismos números y `tests/Unit/LoadEstimateTest.php` los contrasta con las plantillas distribuidas. + + +## Mediciones locales preliminares + +Medido en un portátil, en contenedores Docker, con scripts propios (`sh tests/run-perf.sh `): **medición local preliminar de este código, no cifra de publicación.** Equipo: Apple silicon, aarch64, 14 CPU y 15,7 GiB disponibles para Docker, MariaDB 10.11 y PHP 8.2 en contenedores del mismo servidor, RRD en un montaje enlazado Docker. Series: 20 pings, paso de 300 s, RRD de prueba de 193 KB cada uno (los originales SmokePing ocupan varios megabytes; `lastupdate` lee la cabecera, por lo que el tamaño no cambia la lectura). + +| Series | Lector, primera pasada completa | Lector, archivos sin cambios | Series cubiertas en un ciclo predeterminado (120 s) | Vista general (CLI, solo base de datos) | Memoria máxima de página | HTML de página | +|---|---|---|---|---|---|---| +| 100 | 0.2 s | menos de 0.1 s | 100 de 100 | 0.002 s | 8 MB | 0.02 MB | +| 1,000 | 1.2 s | 1.1 s | 1,000 de 1,000 | 0.012 s | 12 MB | 0.17 MB | +| 10,000 | 12.3 s | 11.6 s | 10,000 de 10,000 | 0.119 s | 58 MB | 1.68 MB | + +La tabla muestra un coste lector de unos 1,2 ms por serie en este entorno, con crecimiento lineal: 10.000 series consumen alrededor de una décima parte del presupuesto predeterminado en disco local. La vista general enumera todas las series asociadas en una página (unas 10.000 filas y 1,7 MB de HTML con 10.000), con poco tiempo de base de datos y PHP. Las cifras excluyen navegador, servidor web, marco de página Cacti, NFS y un SmokePing escribiendo simultáneamente. + +No medido aquí: páginas de gestión Cacti con objetos aprovisionados (véanse las mediciones de publicación), montaje NFS de solo lectura y demonio SmokePing real escribiendo 33 archivos por segundo mientras lee el lector. + + +## Mediciones de publicación + +Medido el 2026-11-15 en un droplet DigitalOcean: `c-4` en sfo3, 4 vCPU dedicadas (Intel Xeon Platinum 8280), 8 GB, Ubuntu 24.04, con Cacti 1.2.31, PHP 8.5.12, RRDtool 1.7.2 y MariaDB 10.11.19 en contenedores del mismo servidor. Las series tienen 20 pings y paso de 300 s, cada objetivo en su propio dispositivo, con RRD de prueba en un montaje enlazado de solo lectura. + + +### Lector y vista general + +`sh tests/run-perf.sh `: + +| Series | Lector, primera pasada completa | Lector, archivos sin cambios | Series cubiertas en un ciclo predeterminado (120 s) | Vista general (CLI, solo base de datos) | Memoria máxima de página | HTML de página | +|---|---|---|---|---|---|---| +| 100 | 0.2 s | menos de 0.1 s | 100 de 100 | 0.004 s | 8 MB | 0.02 MB | +| 1,000 | 1.9 s | 2 s | 1,000 de 1,000 | 0.028 s | 12 MB | 0.17 MB | +| 10,000 | 20.6 s | 19.9 s | 10,000 de 10,000 | 0.244 s | 58 MB | 1.68 MB | + +El lector cuesta unos 2 ms por serie en este servidor: 10.000 series consumen alrededor de una sexta parte del presupuesto predeterminado. + + +### Páginas Cacti y sondeador con todos los objetos + +`sh tests/run-perf-objects.sh ` crea objetivos y dispositivos, mide las páginas, aprovisiona todos los objetos resumen y de humo mediante el complemento, vuelve a medir las páginas y ejecuta dos ciclos de sondeo, cada uno después de terminar el lector del anterior. `PERF_OBJECTS=stock` asigna en su lugar dos gráficos de las plantillas Local Linux Machine de Cacti a cada dispositivo («Unix - Load Average» y «Linux - Memory Usage»): el mismo número de gráficos por serie, para comparar REQ-PERF-002. Los tiempos de página son p50/p95 sobre HTTP en milisegundos, 20 peticiones tras una de calentamiento, con sesión de administrador y servidor integrado de PHP. «Solo dispositivos» son los mismos dispositivos antes de tener gráficos. + +| Series | Objetos | Lista de dispositivos | Lista de fuentes | Lista de gráficos | Vista general del complemento | +|---|---|---|---|---|---| +| 100 | solo dispositivos | 28/31 | 25/35 | 35/37 | 38/40 | +| 100 | gráficos estándar | 28/39 | 48/56 | 33/48 | 29/39 | +| 100 | objetos del complemento | 28/39 | 51/53 | 33/34 | 28/29 | +| 1,000 | solo dispositivos | 30/42 | 25/26 | 26/36 | 59/64 | +| 1,000 | gráficos estándar | 32/33 | 50/51 | 39/40 | 65/66 | +| 1,000 | objetos del complemento | 42/44 | 54/77 | 39/40 | 58/68 | +| 10,000 | solo dispositivos | 50/57 | 28/37 | 28/30 | 301/319 | +| 10,000 | gráficos estándar | 66/69 | 50/75 | 107/111 | 331/338 | +| 10,000 | objetos del complemento | 65/68 | 54/78 | 105/119 | 318/340 | + +| Series | Aprovisionamiento de objetos del complemento | Primer ciclo de sondeo (crea RRD) | Ciclo de sondeo estable | Lector | +|---|---|---|---|---| +| 100 | 31 s | 2.0 s | 1.6 s | 0.2 s | +| 1,000 | 324 s | 6.5 s | 5.1 s | 1.6 s | +| 10,000 | 3,284 s | 57.1 s | 43.5 s | 21.5 s | + +Con 10.000 series, los objetos del complemento son 260.000 filas `data_template_rrd`, 520.000 filas de elementos gráficos y 10.000 elementos del sondeador; los gráficos estándar tienen 50.000 y 240.000 filas. El ciclo de sondeo es un proceso cmd.php que consulta las 10.000 fuentes resumen; el lector corre en paralelo, iniciado por `poller_bottom`. Ambos quedan muy por debajo del intervalo de 300 s. El aprovisionamiento es una adición masiva de un administrador: unos 0,33 s por serie, casi una hora para 10.000. Una ejecución anterior del mismo script en el mismo droplet tardó 6.141 s para 10.000 (0,61 s por serie); reserve entre una y dos horas. + + +### Frente a los requisitos + +- **REQ-PERF-001 (vista general en menos de dos segundos con 10.000): cumplido.** p95 de 0,34 s sobre HTTP. +- **REQ-PERF-002 (páginas de gestión dentro del valor base más 20 % con 10.000): cumplido** frente a los gráficos estándar. Con 10.000 series, el p95 del complemento es un 1 % menor en dispositivos, un 4 % mayor en fuentes y un 7 % mayor en gráficos. Con 1.000, el p95 de fuentes supera el estándar un 51 % (77 frente a 51 ms), pero las medianas difieren un 8 %, en ambas ejecuciones: son las peticiones más lentas, no la típica. Frente a solo dispositivos, sin gráficos, cualquier conjunto de 20.000 gráficos, estándar o del complemento, ralentiza todas las páginas. +- **REQ-PERF-003 (sin sondas, lecturas RRD acotadas, sin espera remota por petición): cumplido** (véase el primer apartado). +- **REQ-PERF-004 (carga visible antes de adición masiva): cumplido.** La estimación coincide con las filas contadas. + + +## Número de series admitido + +**10.000 series por instalación Cacti**, con 20 pings y paso de 300 s, en hardware como el ejecutor de publicaciones: cuatro vCPU dedicadas y 8 GB, con la base de datos en el mismo servidor. A ese nivel, el lector consume una sexta parte del presupuesto predeterminado y el ciclo de sondeo una séptima parte del intervalo; las páginas de gestión se mantienen dentro del 7 % del mismo número de gráficos estándar. No se ha medido por encima de 10.000. + + +## Reproducir + +```sh +sh tests/run-perf.sh # 100, 1,000, and 10,000 series +sh tests/run-perf.sh 1000 # one size +sh tests/run-perf-objects.sh # Cacti's pages and the poller with every object +``` + +Cada ejecución prepara objetivos con `tests/bin/perf-seed.php`, crea RRD con `tests/bin/make-fixture-rrds.php`, los lee con `poller_smokeping.php --force` y dibuja la página con `tests/bin/perf-page.php`. diff --git a/docs/i18n/es-419/docs/provisioning.md b/docs/i18n/es-419/docs/provisioning.md new file mode 100644 index 0000000..409a754 --- /dev/null +++ b/docs/i18n/es-419/docs/provisioning.md @@ -0,0 +1,115 @@ + + + +# Añadir objetivos SmokePing a Cacti + +Cada objetivo descubierto por el inventario es visible para administradores en **SmokePing Inventory** e invisible para los demás hasta asociarlo a un dispositivo Cacti. No se crea nada sin confirmación de un administrador. El complemento nunca escribe archivos SmokePing. + + +## Un objetivo + +En SmokePing Inventory, un objetivo presente sin asociar tiene el enlace **Add to Cacti**. La confirmación ofrece dos opciones: + +- **Crear un dispositivo nuevo** desde la plantilla «SmokePing Target». Usa el host del objetivo, desactiva la comprobación de disponibilidad (SmokePing ya lo mide) y se asigna al sondeador del lector. +- **Asociarlo a un dispositivo existente.** La lista muestra dispositivos que puede modificar. + +En ambos casos recibe una fuente y gráfico resumen para alertas (véase [alertas](alerting.md)) y, si los datos SmokePing pueden representarse, un gráfico de humo por ubicación. No recibe gráfico de humo, y la página explica por qué, si `pings` no es 10, 20 o 30, si Cacti almacena RRD en RRDproxy o si el archivo no es visible mediante el montaje de solo lectura. Conserva sus datos resumen. + +La fuente resumen la sondea el sondeador que ejecuta el lector. Si un dispositivo existente usa otro sondeador, el complemento no crea la fuente e indica cuál usar. Salud enumera dispositivos cambiados a otro sondeador posteriormente. + + +## Muchos dispositivos + +En la lista de dispositivos, seleccione varios y elija **Add SmokePing Targets**. La confirmación enumera, por dispositivo, los objetivos sin asociar cuyo `host` SmokePing coincide con su nombre de host (sin distinguir mayúsculas), y el total de coincidencias. Continuar los añade. Los dispositivos sin coincidencia se indican y quedan intactos; no se crea ningún dispositivo. Cien dispositivos en una petición tardaron unos 24 segundos en un contenedor local; una selección muy larga deja de iniciar nuevos dispositivos poco antes del límite de petición. Repetir termina el trabajo porque se omiten los ya añadidos. + + +## Una configuración SmokePing completa + +**Console > Import/Export > Import SmokePing Configuration** incorpora una instalación SmokePing existente a Cacti en un paso. Requiere el ámbito SmokePing Admin y permisos que cubran todos los dispositivos; reflejarla en un árbol requiere también Trees. + +Elija la entrada: + +- **El archivo configurado** (predeterminado): el ajuste SmokePing Configuration File, leído en el servidor con todos sus archivos incluidos. Cada inclusión debe permanecer en ese directorio o debajo. +- **Un archivo cargado**, de hasta 4 MiB. Se lee de forma independiente, por lo que `@include` se rechaza con su número de línea. Los objetivos se representan desde los RRD visibles al sondeador del lector; el próximo inventario marca ausentes los que no existan en el SmokePing de ese sondeador. + +Después, las opciones: + +| Opción | Predeterminado | Significado | +|---|---|---| +| Dispositivos | Uno por host SmokePing | Los objetivos que sondean el mismo host comparten dispositivo. Uno por objetivo da a cada uno un dispositivo con su título como nombre. | +| Plantilla de dispositivo | SmokePing Target | Plantilla de los dispositivos creados. | +| Sondeador | El del lector | Debe ejecutar el lector; se rechaza cualquier otro porque sus fuentes resumen no obtendrían datos. | +| Sitio | Ninguno | Sitio de los dispositivos nuevos. | +| Árbol de gráficos | No reflejar | Árbol existente o nuevo por nombre. Cada sección SmokePing forma una rama, cada dispositivo una entrada de host bajo la rama de sus objetivos. | + +**Preview** lee sin escribir nada. Muestra secciones con casillas (selecciónelas y pulse **Update Preview** para importar solo esos objetivos), dispositivos que crear o reutilizar, gráficos que crear, objetivos solo con resumen y su motivo (`pings` distinto de 10, 20 o 30, o RRDproxy), ramas y entradas del árbol y carga estimada, igual que la acción masiva. Se reutiliza un dispositivo si, en el sondeador elegido, tiene el host del objetivo (y, con uno por objetivo, su título como descripción); si coinciden dos, se omiten y enumeran esos objetivos para asociarlos en SmokePing Inventory. **Import** aplica exactamente el plan mostrado con las funciones Cacti de dispositivos, gráficos y árboles. Si cambió la configuración o Cacti desde la vista previa, no escribe nada y debe repetirla. + +Importar otra vez no crea nada nuevo: los objetivos asociados conservan dispositivos, se reutilizan gráficos y entradas del árbol, y cada objetivo se indica como ya existente en Cacti. Nunca se escribe en archivos SmokePing ni en el montaje. + +La misma importación por consola, con iguales opciones: + +```sh +php plugins/smokeping/cli/smokeping.php import-smokeping --dry-run --tree-name=SmokePing +php plugins/smokeping/cli/smokeping.php import-smokeping --apply --confirm=PLAN --tree-name=SmokePing +``` + +`--file=PATH` lee otro archivo de forma independiente, como una carga. `--sections=Europe,Lab/Core`, `--device-per=target`, `--device-template=ID`, `--poller=ID`, `--site=ID` y `--tree=ID` establecen las otras opciones. La simulación muestra el plan y su ID; `--apply` necesita ese ID y aún debe coincidir. + + +## Escala de gráficos + +SmokePing dimensiona cada gráfico desde sus datos en cada renderizado. Cacti tiene un único límite superior para todos los periodos, por lo que el complemento aplica al último día la regla de los gráficos detallados de SmokePing (`findmax` en `Smokeping.pm`): 1,2 veces la mayor mediana del último día en el archivo del gráfico. El Navigator Graph de SmokePing usa 1,5; el complemento no tiene navegador. Dimensiona al crear y después aproximadamente a diario. Si no hay mediana en el último día, conserva el límite; uno nuevo conserva el límite de plantilla de 0,05 s (50 ms). + +El ajuste diario está activo de forma predeterminada y no tiene opción de configuración. Después de cada lectura, el lector dimensiona los gráficos de objetivos de su sondeador cuyo último ajuste fue hace un día o más, primero los que más esperan, hasta 25 por ciclo. Lee un RRD por gráfico y no ejecuta sondas. Omite el ciclo si la lectura agotó el presupuesto. Con un ciclo cada cinco minutos cubre 7.200 gráficos diarios; con más, cada gráfico se ajusta algo menos que diariamente. + +El complemento registra el límite que puso en cada gráfico. Un límite diferente fue configurado manualmente en la página del gráfico y nunca lo cambia. Para devolver el control, restablezca el último límite del complemento, que `size-graphs` muestra para cada gráfico con límite manual. + +Para dimensionar todos ahora: + +```sh +php plugins/smokeping/cli/smokeping.php size-graphs +``` + +Muestra el nuevo límite o si conservó el existente o el manual. Respeta las mismas reglas de límites manuales que el ajuste diario. Necesita la ruta rrdtool de Cacti (Configuration > Settings > Paths); sin ella conserva los límites. + +Al actualizar desde 1.0.0-rc.1 no hay registro de quién fijó los límites existentes: el complemento adopta el actual como propio y ajusta el gráfico en su próximo turno diario. Antes, `size-graphs` también sustituía los límites manuales. Un límite solo cuenta como manual mientras difiere del registrado, y tras actualizar el registrado es el adoptado. Para conservar uno manual, vuelva a fijarlo después de que el ajuste diario lo sustituya. Si ese ajuste no encuentra mediana, conserva el adoptado, de modo que volver a poner el mismo valor no cambia nada y un ajuste posterior aún podrá sustituirlo. + + +## Leyenda y actualización de plantillas + +La leyenda sigue la de SmokePing: promedio, máximo, mínimo y último valor de la mediana, desviación estándar y am/s (promedio dividido por desviación estándar), después pérdidas y colores y la línea de sonda, como `probe: 20 ICMP Echo Pings (56 Bytes) every 300s`. La línea procede de sonda, tamaño de paquete, pings y paso leídos del objetivo en la configuración. El sondeador principal la escribe en cada gráfico y vuelve a hacerlo si cambia la sonda o una importación de plantillas la restablece. Un objetivo guardado antes de leer la sonda muestra su nombre. + +Si una actualización trae plantillas nuevas, los gráficos anteriores conservan sus elementos, que siguen dibujándose, hasta que el complemento los migra. El sondeador principal migra 200 por ciclo, conservando título y límite superior. Para todos ahora: + +```sh +php plugins/smokeping/cli/smokeping.php upgrade-graphs +``` + +La actualización establece los elementos según la plantilla, sustituyendo cambios manuales de elementos de gráficos del complemento. Después comprueba que coincidan exactamente y existan todos sus VDEF. Si falla, conserva elementos y versión anteriores, y el registro Cacti nombra el gráfico. El sondeador no reintenta. `upgrade-graphs` reintenta cada fallido en cada ejecución y sale con 1 si alguno sigue fallando. + + +## Colores de pérdida + +SmokePing 2.7 colorea la pérdida con siete niveles fijos; desde 2.8 usa proporciones de pings y añade pérdida completa. El complemento distribuye plantillas para ambos sobre las mismas fuentes y ambas coinciden con los gráficos originales ([fidelidad](../../../research/graph-fidelity.md)). **Loss Colors** en los ajustes elige: + +- **Automatic** (predeterminado) sigue la versión que el lector encuentra en `Smokeping.pm` junto a SmokePing (`/usr/share/perl5`, `/usr/share/smokeping`, `/opt/smokeping/lib` o `/usr/local/smokeping/lib`), registrada en cada inventario. Por debajo de 2.8 usa colores 2.7. Si no encuentra versión, por ejemplo en otro contenedor, usa 2.8 y posteriores. +- **SmokePing 2.8 and later** o **SmokePing 2.7** fija los colores independientemente de lo encontrado. + +La fila `loss_colors` de Salud muestra los colores y el motivo. Al cambiar por ajuste o actualización de SmokePing, el sondeador principal migra los gráficos a otras plantillas, 200 por ciclo, conservando título, límite y datos. `upgrade-graphs` los migra todos de inmediato. Un gráfico fallido conserva colores y se reintenta en el próximo `upgrade-graphs`, como antes. + + +## Reasociar un objetivo renombrado + +SmokePing nombra el archivo según su lugar en el árbol, por lo que renombrar o mover un nodo inicia un archivo vacío. Si una importación ve desaparecer una ruta y aparecer otra con igual host y sonda, registra una propuesta sin cambios. **Review** en Inventory abre la confirmación. Reasociar mueve el gráfico de humo, la fuente resumen y la asociación de dispositivo al nuevo objetivo, y mantiene legible el historial antiguo en un gráfico archivado. **Dismiss Proposal** cierra sin cambios. + + +## Permisos + +El complemento tiene tres ámbitos. **SmokePing View** permite abrir la página, que solo enumera objetivos asociados a dispositivos visibles al usuario, y seguir el enlace desde los gráficos del dispositivo. **SmokePing Operator** añade la página Operations y reconocimientos personales de observaciones actuales; no cambia la salud medida ni suprime alertas. **SmokePing Admin** incluye acceso Operator y abre inventario, salud y las acciones anteriores. Un administrador con permisos limitados ve objetivos sin asociar y objetivos de dispositivos que puede ver. + +Gráficos y fuentes son objetos Cacti normales: sus permisos de gráficos y dispositivos deciden quién los ve. El método predeterminado Cacti es permisivo: solo se limita a ciertos dispositivos cuando las políticas de dispositivo, gráfico y plantilla de gráfico deniegan todas. Los cambios se aplican en la siguiente petición del usuario. + + +## Eliminar un dispositivo + +Eliminar un dispositivo asociado borra su asociación y registros del complemento sobre sus fuentes, dejando el objetivo en inventario sin asociar. No toca archivos SmokePing: véase [ADR 0007](../../../decisions/0007-read-only-mount-under-rra-path.md). diff --git a/docs/i18n/es-ES/README.md b/docs/i18n/es-ES/README.md new file mode 100644 index 0000000..5c2f623 --- /dev/null +++ b/docs/i18n/es-ES/README.md @@ -0,0 +1,142 @@ + + + +[English](../../../README.md) | [简体中文](../zh-CN/README.md) | [हिन्दी](../hi-IN/README.md) | [Español (España)](README.md) | [Español (Latinoamérica)](../es-419/README.md) | [العربية](../ar-SA/README.md) + + +

+ + + Complemento SmokePing para Cacti: un cactus con una insignia y un gráfico SmokePing + +

+ + +# Complemento SmokePing para Cacti + +[![CI](https://github.com/somethingwithproof/plugin_smokeping/actions/workflows/plugin-ci-workflow.yml/badge.svg)](https://github.com/somethingwithproof/plugin_smokeping/actions/workflows/plugin-ci-workflow.yml) +[![License: GPL-2.0-or-later](https://img.shields.io/badge/license-GPL--2.0--or--later-blue.svg)](../../../LICENSE) +![PHP >= 8.2](https://img.shields.io/badge/php-%3E%3D8.2-777bb4.svg) +![Cacti >= 1.2.31](https://img.shields.io/badge/cacti-%3E%3D1.2.31-2e7d32.svg) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=coverage)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +![SmokePing: read-only](https://img.shields.io/badge/smokeping-read--only-6b7280.svg) + +Un complemento para Cacti 1.2 que incorpora las mediciones de latencia y pérdida de SmokePing como dispositivos, fuentes de datos y gráficos normales de Cacti. Los gráficos de humo aparecen junto al dispositivo al que pertenecen, bajo los permisos de Cacti, y Thold y Maint pueden alertar sobre ellos y suprimirlos. Es una implementación independiente para Cacti, no forma parte de [SmokePing](https://oss.oetiker.ch/smokeping/) ni está respaldada por él; sus autores originales son Tobias Oetiker y Niko Tyni. El complemento no incluye ni ejecuta código SmokePing: lee su configuración y sus archivos RRD, y sus plantillas dibujan las mismas series que los gráficos originales de SmokePing. + +> **Estado: en desarrollo. El modo de observación (fase 1) está implementado en `main` y publicado como versión preliminar 1.0.0-rc.1.** El complemento lee la configuración y los archivos RRD de SmokePing, muestra su estado, crea dispositivos, fuentes y gráficos Cacti para ellos, y alimenta Thold y Maint. No escribe nada en SmokePing. El modo gestionado (escritura de configuración SmokePing por el complemento) y los recolectores remotos son fases posteriores, no iniciadas y no incluidas aquí. Las pruebas piloto en instalaciones reales y un ajuste mayor de la leyenda de los gráficos de SmokePing siguen pendientes en el hito 4. Consulte [docs/install.md](docs/install.md) para empezar. + + +## Roles de acceso + +| Permiso | Acceso | +| --- | --- | +| SmokePing View | Páginas de supervisión existentes. | +| SmokePing Operator | Supervisión, página de operaciones y acuses personales de investigación. | +| SmokePing Admin | Acceso de operador más configuración y acciones administrativas existentes. | + +Después de copiar los archivos de actualización, abra la página Complementos como administrador para registrar el nuevo permiso. Asigne expresamente Operator en **Configuración > Usuarios** o en los grupos de usuarios. Las actualizaciones conservan los identificadores y las concesiones de View y Admin. En cada petición, Admin hereda el acceso Operator y Operator hereda View; esto no añade concesiones almacenadas a usuarios ni grupos. Los ajustes del complemento también requieren SmokePing Admin, además del permiso Ajustes de Cacti. + +Los permisos de dispositivos de Cacti siguen limitando las filas y acciones disponibles para cada usuario; los objetos sin asociación requieren un administrador. Credenciales, configuración, asociaciones, eliminación y otros cambios administrativos permanecen en las páginas administrativas. Los acuses solo duran en la sesión del usuario actual, como máximo una hora y mientras la misma observación siga vigente. Las observaciones nuevas o modificadas los invalidan. Nunca marcan como correcta una medición fallida ni suprimen alertas. + + +## Capturas de pantalla + +Importado desde una red SmokePing 2.8.2 en funcionamiento a Cacti 1.2.31, últimas 12 horas. El dispositivo de cada objetivo tiene un gráfico de humo del maestro y uno por esclavo (`lon1`, `sgp1`), archivados bajo su sección SmokePing en el árbol de gráficos. + +![Árbol Cacti del objetivo Bangalore: gráficos de humo del maestro y los esclavos lon1 y sgp1](../../images/screenshot-tree-asia.png) + +![Árbol Cacti del objetivo Londres: el esclavo lon1 de la misma región muestra latencia de microsegundos y humo visible](../../images/screenshot-tree-europe.png) + + +## Motivo + +SmokePing mide bien la distribución de latencia y la pérdida de paquetes; sus gráficos de humo muestran variaciones que oculta un gráfico de medias. Al ejecutarlo junto a Cacti quedan tres carencias: + +- **Control de acceso separado.** El CGI de SmokePing no conoce usuarios, grupos ni permisos de dispositivos Cacti. +- **Sin contexto de dispositivo.** La latencia y los contadores de interfaces del mismo dispositivo residen en herramientas distintas. +- **Sin integración con las alertas de Cacti.** Thold y Maint trabajan sobre dispositivos y fuentes Cacti, por lo que las alertas SmokePing se configuran y suprimen aparte. + +El complemento cubre esas carencias representando cada objetivo SmokePing mediante objetos Cacti que apuntan a sus archivos RRD existentes, más un pequeño conjunto de valores resumen sondeados. Reutiliza los gráficos, permisos, Thold y Maint de Cacti. El soporte de recolectores remotos está previsto para la fase 3 y no está en esta versión. + + +## Alcance y estado + +| Fase | Alcance | Hitos | Estado | +|---|---|---|---| +| 0, investigación | Matriz de compatibilidad, confirmación del comportamiento original, prototipo de fidelidad de gráficos | [M1](https://github.com/somethingwithproof/plugin_smokeping/milestone/1) | Resultados en `docs/research`; algunas investigaciones siguen abiertas | +| 1, observación | Importación de inventario, dispositivos Cacti, gráficos de humo y resumen, alertas Thold, supresión Maint, página de estado | [M2](https://github.com/somethingwithproof/plugin_smokeping/milestone/2), [M3](https://github.com/somethingwithproof/plugin_smokeping/milestone/3), [M4](https://github.com/somethingwithproof/plugin_smokeping/milestone/4) | Publicado como 1.0.0-rc.1; pilotos pendientes | +| 2, gestionado | Espacio de configuración propiedad de Cacti, perfiles de sondas ICMP y TCP, revisiones, validación, recarga y reversión | [M5](https://github.com/somethingwithproof/plugin_smokeping/milestone/5) | Previsto, no iniciado | +| 3, remoto | SmokePing en recolectores remotos Cacti, esclavos como ubicaciones de medición | [M6](https://github.com/somethingwithproof/plugin_smokeping/milestone/6) | Previsto, no iniciado | + +Fuera de alcance: motor propio de alertas, motor de informes, servicio o protocolo de red personalizado, comprobaciones gestionadas HTTP/DNS/servicios (las cubre servcheck), y escritura en archivos RRD de SmokePing. + + +## Objetivos de compatibilidad + +| Componente | Objetivo | +|---|---| +| Cacti | 1.2.31 o posterior de 1.2.x, sin parches del núcleo | +| PHP | 8.2 o posterior; `setup.php` sigue siendo interpretable en 8.0 para rechazar un entorno incompatible sin romper la interfaz Cacti | +| SmokePing | 2.9.0, 2.8.2 y 2.7.3 (solo Ubuntu 22.04, hasta 2027-06-01) | +| Thold, Maint | No requieren cambios | +| Series | 10.000 por instalación con 20 pings y paso de 300 s ([rendimiento](docs/performance.md#supported-series-count)) | + + +## Documentación + +| | | +|---|---| +| [Instalar](docs/install.md) | Requisitos, montaje de solo lectura del directorio de datos, instalación, contenedores, versiones admitidas | +| [Operar](docs/operations.md) | Significado y evidencias de cada estado, comprobaciones de salud, comportamiento ante fallos de entradas | +| [Añadir objetivos a Cacti](docs/provisioning.md) | Un objetivo, muchos dispositivos, reasociación, permisos | +| [Alertas](docs/alerting.md) | Valores resumen, duraciones Thold, obsolescencia, datos tardíos, solapamiento con alertas SmokePing, Maint | +| [Formato de configuración](docs/configuration-format.md) | Exportación e importación YAML y XML | +| [Copia y restauración](docs/backup-restore.md) | Qué respaldar y cómo se reanuda tras una restauración | +| [Rendimiento](docs/performance.md) | Mediciones locales y del ejecutor de publicaciones con 100, 1.000 y 10.000 series, y el número admitido: 10.000 por instalación | +| [Calificación de fallos](../../failure-qualification.md) | Escenarios de fallo y pruebas de cada uno | +| [Publicar](../../RELEASING.md) | Procedimiento de publicación: solicitud de cambios, etiqueta firmada, flujo de trabajo y comprobación del resultado | +| [Archivo de publicación](../../release.md) | Versión, historial de cambios y archivo distribuido | +| [Pruebas](../../testing.md) | Suites, ejecución de CI y suite en vivo contra un SmokePing real | + + +## Diseño + +- [docs/PLAN.md](../../PLAN.md) es el plan completo: arquitectura, hechos originales de los que depende (con fuentes), modelo de estados, límites de seguridad, cálculos de rendimiento, pruebas y riesgos. +- [docs/decisions/](../../decisions) contiene registros de decisiones de arquitectura ya tomadas. +- [docs/REQUIREMENTS.md](../../REQUIREMENTS.md) relaciona cada requisito con su incidencia. + +```mermaid +flowchart LR + SP[SmokePing daemon] --> RRD[(RRD files)] + RRD -->|read-only| R[Reader on the adjacent Cacti poller] + RRD -->|read-only| G[Cacti graph templates] + R --> SS[Script server summary data sources] + SS -->|poller_output| T[Thold and Maint] + G --> P[Cacti graph permissions] +``` + + +## Seguimiento del trabajo + +- Los **hitos** siguen los del plan. Cada uno tiene una incidencia épica con sus subincidencias y pruebas de finalización. +- Las **incidencias** se clasifican mediante `type: requirement`, `type: research`, `type: decision` y `type: epic`. Los requisitos indican condiciones numeradas y comprobables (`REQ-AREA-NNN`) y criterios de aceptación. +- Las **etiquetas** incluyen también `area:`, `phase:`, `priority:` y `status:`. Consulte [CONTRIBUTING.md](../../../CONTRIBUTING.md#labels). +- El [tablero del proyecto](https://github.com/users/somethingwithproof/projects/6) muestra todas las incidencias de los distintos hitos. + + +## Contribuir + +Lea [CONTRIBUTING.md](../../../CONTRIBUTING.md). Los commits requieren la firma DCO. El diseño se debate en las incidencias; las decisiones abiertas llevan la etiqueta `type: decision`. + + +## Seguridad + +Comunique las vulnerabilidades de forma privada; consulte [SECURITY.md](../../../SECURITY.md). + + +## Licencia + +Licencia Pública General GNU v2.0, la misma que Cacti y sus complementos. Consulte [LICENSE](../../../LICENSE). diff --git a/docs/i18n/es-ES/docs/alerting.md b/docs/i18n/es-ES/docs/alerting.md new file mode 100644 index 0000000..fb4489f --- /dev/null +++ b/docs/i18n/es-ES/docs/alerting.md @@ -0,0 +1,63 @@ + + + +# Alertas sobre datos SmokePing con Thold y Maint + +El complemento no envía alertas. Proporciona a Cacti una fuente de datos «SmokePing Summary» sondeada para cada ubicación de un objetivo, y Thold y Maint trabajan sobre ella como sobre cualquier otra fuente ([ADR 0002](../../../decisions/0002-alert-through-cacti-data-sources.md)). Ninguno de los dos requiere cambios. Esta página es la referencia para operadores sobre los valores que comunica esa fuente y los límites del enfoque. + + +## Qué comunica la fuente de datos + +El sondeador de Cacti consulta cada fuente resumen mediante el servidor de scripts. El script solo lee una fila de la caché del lector: nunca abre un archivo RRD ni contacta con SmokePing durante el sondeo Cacti. + +| Fuente de datos | Significado | Cuándo vale `U` (desconocido) | +|---|---|---| +| `median` | Mediana del tiempo de ida y vuelta de la última ronda completada, en milisegundos | La ronda supera el heartbeat de SmokePing (dos veces `step`), falta el RRD o nunca se actualizó, o la ronda no tenía mediana (pérdida completa) | +| `loss_pct` | `loss / pings x 100` de la última ronda completada | La ronda supera el heartbeat, falta el RRD o nunca se actualizó, o la ronda no escribió un valor de pérdida | +| `age` | Segundos desde la última actualización del RRD | El RRD no existe o el lector no tiene una fila de caché para él | + +`median` y `loss_pct` nunca son `0` por falta de datos. Por tanto, un recolector detenido no indica pérdida cero. `age` sigue siendo numérico mientras exista el RRD, incluso después de que los otros dos pasen a `U`, de modo que la obsolescencia pueda generar una alerta. Un archivo creado pero nunca actualizado comunica el tiempo desde que el complemento vio por primera vez el objetivo. + +Una ronda con antigüedad entre `step + freshness allowance` y dos veces `step` está «retrasada»: sus valores se siguen comunicando. La pérdida completa es `loss_pct` 100 con `median` `U`. + +La fuente resumen debe sondearse desde el sondeador Cacti que ejecuta el lector (ajuste «SmokePing Poller»), porque la caché reside en la base de datos de ese sondeador. El complemento rechaza la creación de una fuente resumen en un dispositivo asignado a otro sondeador e indica cuál usar. + + +## Umbrales + +Cree umbrales Thold para `loss_pct`, `median` y `age`, desde plantillas Thold o en cada fuente de datos. Valores habituales: + +| Alertar por | Umbral | Notas | +|---|---|---| +| Pérdida de paquetes | `loss_pct` alto en 5 a 10 | La pérdida completa es 100 | +| Latencia | `median` alto en su límite en ms | `U` no genera alerta de latencia | +| Recolector detenido o lento | `age` alto en 2 a 3 veces `step` | Único valor que informa de un recolector detenido | + +Un umbral de `median` o `loss_pct` no se activa cuando el valor es `U`. Use `age` para «SmokePing dejó de medir». + + +## Límites + +Provienen del muestreo de Cacti y SmokePing, no del complemento, y este no puede eliminarlos. + +**Las duraciones Thold deben ser al menos un `step`.** Cacti sondea con su propio intervalo y SmokePing mide con su propio `step`. Cuando el intervalo Cacti es menor que `step`, se comunica la misma ronda varias veces. Cuando es mayor, se omiten rondas. Así, una muestra fuera de umbral no equivale a una ronda fuera de umbral; establezca la duración de activación Thold en al menos un `step` (con paso predeterminado de 300 segundos e intervalo de sondeo de 300 segundos, una activación de 2 sondeos). Una duración menor que `step` puede alertar por una sola ronda contada dos veces. + +**Los datos tardíos de esclavos nunca reactivan ni resuelven una alerta.** Un esclavo SmokePing guarda en caché los resultados que no pudo entregar y los reenvía; el maestro los aplica en orden temporal, por lo que pueden llegar tarde datos de una ventana pasada. Thold evalúa los valores cuando se sondean. Una ronda tardía actualiza el RRD y el gráfico, pero no cambia un valor ya evaluado por Thold: no genera una alerta perdida ni resuelve una abierta. Mientras un esclavo va retrasado, crece el `age` de esa ubicación, haciendo visible la demora. + +**Las alertas solo ven el resumen.** Mediana, pérdida y antigüedad describen la última ronda. El gráfico de humo sirve para investigar la distribución. + +**Las alertas propias de SmokePing son independientes.** La sección `alerts` de su configuración sigue funcionando. Un objetivo con alertas tanto en SmokePing como en Thold puede generar dos notificaciones por un problema si cumple ambas condiciones; el complemento no desactiva ninguna. La página de estado enumera estos objetivos bajo `dual_alerting`, a partir del valor `alerts` que lee el inventario, heredado igual que en SmokePing. + +**El RRD Cacti es una copia.** Los valores resumen se guardan en el RRD de Cacti además del de SmokePing, por lo que una diferencia de retención o consolidación puede reflejarse en los gráficos. + + +## Mantenimiento + +Una programación Maint de tipo «Cacti device» en el dispositivo del objetivo suprime las notificaciones Thold para ese dispositivo. Thold sigue evaluando y el complemento sigue llenando la fuente resumen, sin huecos en gráficos ni `age`. Si el umbral sigue superado al terminar la programación, las notificaciones se reanudan después de alcanzar de nuevo el número de activaciones: Thold no cuenta las infracciones durante el mantenimiento del dispositivo. + +Maint solo conoce dispositivos, no objetivos individuales. Un dispositivo con varios objetivos queda silenciado para todos. Las programaciones por objetivo requerirían un nuevo tipo de programación Maint y no forman parte de este complemento. + + +## Verificación + +`tests/run-alert-e2e.sh` ejecuta todo el recorrido en un contenedor con Cacti 1.2.31 y copias de `plugin_thold` y `plugin_maint` de un espacio de trabajo de complementos: un recolector de prueba añade rondas a un RRD con estructura SmokePing, el lector las guarda en caché, `poller.php` sondea la fuente resumen mediante el servidor de scripts, y Thold y Maint actúan sobre ella. Comprueba que un umbral `loss_pct` se active después del número configurado y se recupere, que una programación Maint por dispositivo suprima la notificación mientras continúa el sondeo, que la alerta se active al terminar el mantenimiento, y que un umbral `age` se active cuando el recolector de prueba se detiene y se recupere cuando vuelve a funcionar. diff --git a/docs/i18n/es-ES/docs/backup-restore.md b/docs/i18n/es-ES/docs/backup-restore.md new file mode 100644 index 0000000..27c6420 --- /dev/null +++ b/docs/i18n/es-ES/docs/backup-restore.md @@ -0,0 +1,98 @@ + + + +# Copia de seguridad y restauración + +Una pareja Cacti y SmokePing restaurada sigue funcionando cuando se restauran juntas tres cosas: la base de datos Cacti, la configuración SmokePing y su directorio de datos. Esta página explica qué contiene cada una, cómo respaldarlas, qué hacer después de restaurar y cómo recuperar la configuración propia del complemento desde su exportación YAML si se pierde la base de datos. + + +## Qué respaldar + +| Elemento | Contenido | Por qué lo necesita el complemento | +|---|---|---| +| Base de datos Cacti | Tablas del complemento (objetivos, asociaciones, objetos creados, caché del lector, estado), dispositivos Cacti, fuentes de datos, gráficos y ajustes del complemento | Aquí residen las asociaciones, rutas de fuentes de datos y definiciones de gráficos | +| Configuración SmokePing: `/etc/smokeping/config` **y todos los archivos incluidos** (líneas `@include`, `config.d/*` en Debian y Ubuntu, archivo `secrets`, `smokemail`, `basepage.html`) | Árbol de objetivos | El inventario lo analiza. La identidad del objetivo es su ruta en este árbol y su archivo RRD es `datadir/.rrd` | +| Directorio de datos SmokePing (`datadir`) | Archivos RRD | Todos los gráficos y valores resumen los leen; son el historial. No se pueden reconstruir | + +Los ajustes del complemento están en la base de datos. La exportación descrita [más abajo](#restore-from-the-yaml-export) es una segunda copia, en texto, de la configuración propia del complemento; no sustituye a ninguno de los tres elementos. + + +## Realizar las copias + +Haga el volcado de la base de datos y las copias de archivos aproximadamente al mismo tiempo, para que los objetivos de la base de datos y los archivos en disco describan la misma configuración. + +```sh +# The Cacti database (use your own credentials file or option file, not a password on the command line) +mariadb-dump --defaults-extra-file=/root/.cacti-backup.cnf --single-transaction cacti > cacti.sql + +# SmokePing's configuration, with its included files +tar -czf smokeping-config.tgz -C /etc/smokeping . + +# SmokePing's data directory +tar -czf smokeping-datadir.tgz -C /var/lib/smokeping . + +# The plugin's own configuration, as YAML (optional second copy) +php /var/www/html/cacti/plugins/smokeping/cli/smokeping.php export --file=/var/backups/smokeping-config.yaml +``` + +Use el `datadir` de su distribución (`/var/lib/smokeping/rrd` en EL y Fedora). SmokePing escribe los RRD continuamente. Una copia mientras funciona puede capturar un archivo a mitad de actualización; para que sea coherente, tome una instantánea del sistema de archivos o volumen, o detenga SmokePing durante la copia (`systemctl stop smokeping`; el intervalo es una ausencia de mediciones, no una pérdida del historial). El directorio de datos puede contener otros directorios (`__cgi` en Debian, `images` en Alpine); es seguro incluirlos u omitirlos. + +El complemento nunca escribe en archivos SmokePing, por lo que restaurar el directorio de datos solo puede discrepar con lo que conserva el complemento a través de las asociaciones descritas abajo. + + +## Restaurar + +1. Instale Cacti, PHP y SmokePing como indica la [guía de instalación](install.md), y la misma versión del complemento o una más reciente desde el archivo de publicación. +2. Restaure la base de datos Cacti. +3. Restaure la configuración y el directorio de datos SmokePing en las rutas de la copia e inicie SmokePing. +4. Monte el directorio de datos en modo de solo lectura en la ruta de montaje del complemento ([guía de instalación, paso 3](install.md#3-mount-the-data-directory-read-only-inside-cactis-rra-path)). +5. Deje actuar al sondeador o ejecute una vez `php plugins/smokeping/poller_smokeping.php --force --inventory`. + +No hace falta nada más. Si los archivos del complemento son más recientes que la base de datos restaurada, migra sus tablas en la siguiente carga de página o ciclo del sondeador, y registra su versión solo cuando todos los pasos terminan correctamente. + +Qué restaura esto y por qué funciona: + +- **Las asociaciones resuelven los mismos RRD.** La ruta de una fuente es `/smokeping/.rrd`, relativa al montaje, y no cambia al cambiar el servidor o el directorio Cacti. La identidad de un objetivo es su ruta en el árbol SmokePing, no un ID de base de datos; la configuración restaurada conserva ese árbol. +- **El lector continúa.** Su caché conserva la última ronda vista por archivo; la siguiente ejecución lee el `lastupdate` de cada archivo y sustituye la fila. La primera ejecución recoge una ronda escrita por SmokePing mientras Cacti estuvo caído, y la frescura de cada serie se calcula desde la hora del archivo, no desde la última lectura. +- **Los gráficos se dibujan.** Son gráficos Cacti normales sobre las fuentes y archivos restaurados. + +Compruebe **SmokePing Health**: montaje, lector e inventario están OK tras un ciclo del sondeador, y la página SmokePing enumera los objetivos asociados con frescura actual. + + +### Si la base de datos restaurada es más antigua que la configuración SmokePing + +Un objetivo añadido a SmokePing después de la copia no está en la base de datos restaurada. El siguiente inventario lo encuentra y lo muestra sin asociar. Un objetivo eliminado desde entonces se marca como desaparecido y un administrador lo reasocia o archiva como siempre. No se pierde nada: los archivos siguen en el directorio de datos y la asociación se hace con un clic en **SmokePing Inventory**. + + +### Si el directorio de datos se restaura sin sus rondas más recientes + +SmokePing continúa escribiendo en los archivos restaurados desde su última actualización. El hueco en los gráficos corresponde al intervalo entre la copia y la restauración. + + +## Restaurar desde la exportación YAML + +Si se pierde la base de datos Cacti y solo queda la exportación, es posible recuperar los objetivos y asociaciones del complemento sin ella y volver a crear fuentes y gráficos: + +1. Instale Cacti y el complemento en el nuevo servidor, restaure la configuración y directorio de datos SmokePing y monte este último como antes. Configure las rutas en Settings (no se importan; consulte el [formato](configuration-format.md)). +2. Vuelva a crear los dispositivos Cacti con el **mismo nombre de host y descripción**. Sus IDs pueden cambiar. La exportación identifica cada dispositivo asociado por esos dos valores. +3. Compruebe y aplique la exportación: + + ```sh + php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml + php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml --apply --confirm= + ``` + + La comprobación enumera los cambios propuestos y rechaza una asociación cuyo dispositivo falte o sea ambiguo. No se escribe nada hasta el segundo comando, que necesita el ID de plan mostrado por el primero. +4. Para cada objetivo asociado, vuelva a crear fuentes y gráficos: `php plugins/smokeping/cli/smokeping.php provision --device=`. Apuntan a los mismos archivos de antes. + +La exportación contiene ajustes, objetivos y asociaciones del complemento. No contiene fuentes, gráficos ni rutas RRD, por lo que hace falta el paso 4; la restauración desde una copia de base de datos no lo necesita. + + +## Desinstalar + +La desinstalación intenta exportar a YAML (consulte la [guía de instalación](install.md#upgrading-and-removing)), pero no se detiene si falla la exportación. **Antes de desinstalar, exporte la configuración usted mismo y compruebe que la copia de seguridad sea legible y esté completa.** La desinstalación nunca toca los archivos SmokePing; restaure desde la exportación verificada como en el caso anterior. + + +## Verificación + +`sh tests/run-restore-e2e.sh ` ejecuta ambas restauraciones en contenedores y bases de datos nuevos: prepara un dispositivo y fuentes en una instalación funcional, vuelca la base de datos y archiva la configuración y datos SmokePing, restaura los tres en contenedores nuevos mientras SmokePing escribe una nueva ronda, y comprueba que el complemento esté habilitado y su actualización no haga cambios, que cada asociación, dispositivo y ruta de fuente sea igual, que cada fuente resuelva bajo el montaje a un archivo cuya suma coincida con la copia, que un gráfico se dibuje y que, un ciclo después, la caché del lector contenga la nueva ronda. Después restaura solo la exportación YAML en una base nueva y comprueba que la asociación siga el nombre del dispositivo, que un inventario la mantenga y que el aprovisionamiento recree las fuentes sobre los mismos archivos. diff --git a/docs/i18n/es-ES/docs/configuration-format.md b/docs/i18n/es-ES/docs/configuration-format.md new file mode 100644 index 0000000..55c7244 --- /dev/null +++ b/docs/i18n/es-ES/docs/configuration-format.md @@ -0,0 +1,121 @@ + + + +# Formato del archivo de configuración + +La configuración propia del complemento se exporta e importa en un único formato con dos representaciones: YAML (predeterminada) y XML. Esta página define la versión 1 del esquema. Los motivos del diseño están en la [decisión 0008](../../../decisions/0008-yaml-and-xml-configuration-files.md). + +El archivo contiene los ajustes del complemento, los objetivos SmokePing que ha leído (objetivos observados) y el dispositivo Cacti asociado a cada objetivo. No contiene fuentes de datos, gráficos, rutas RRD ni credenciales. Las plantillas de gráficos, datos y hosts de Cacti son algo distinto y siguen en XML Cacti. + + +## Comandos + +```sh +php plugins/smokeping/cli/smokeping.php export # YAML to standard output +php plugins/smokeping/cli/smokeping.php export --format=xml --file=/var/backups/smokeping-config.xml +php plugins/smokeping/cli/smokeping.php import --file=smokeping-config.yaml # check only +php plugins/smokeping/cli/smokeping.php import --file=smokeping-config.yaml --apply --confirm= +``` + +`export --file` crea un archivo nuevo legible solo por su propietario y rechaza sobrescribir uno existente. `import` sin `--apply` lee y comprueba el archivo, muestra todos los cambios propuestos y un ID de plan, y no escribe nada. `--apply` necesita `--confirm` con ese ID; aplica en una sola transacción y rechaza si el archivo o la instalación cambiaron desde la comprobación. Estado de salida: 0 completado, 1 rechazado o fallido, 2 errores en el archivo o plan. + +Las mismas acciones están en **Management > SmokePing Configuration** (ámbito SmokePing Admin): descargue una exportación, elija un archivo para comprobar, revise los cambios enumerados y aplique. + +La importación solo añade y actualiza. Nunca elimina objetivos, mueve asociaciones a otro dispositivo (reasocie en Inventory), crea fuentes, gráficos o archivos RRD, ni lee o escribe en el directorio de datos SmokePing. La desinstalación escribe una exportación YAML en el ajuste **Backup Directory** o, si está vacío, en `cache/smokeping/` dentro del directorio Cacti. El archivo tiene un nombre aleatorio y permisos `0600`; el directorio predeterminado contiene un `.htaccess` que deniega todo y un `index.php` que no sirve nada. Si Backup Directory no existe o no es escribible, no se exporta (no se recurre al directorio predeterminado), y la desinstalación continúa indicando dónde se escribió el archivo o que no se escribió ninguno. Elija un directorio fuera de la raíz web. + + +## Versión 1 del esquema + +```yaml +schema_version: 1 # required; a higher number is refused + +settings: # optional; any subset of the settings below + smokeping_poller_id: 1 + smokeping_reader_budget: 120 + smokeping_inventory_interval: 300 + smokeping_freshness_allowance: 60 + smokeping_uninstall_keep_tables: false + +reference_settings: # optional; shown for reference, never imported + smokeping_config_file: /etc/smokeping/config + smokeping_backup_dir: '' + smokeping_datadir: /var/lib/smokeping + smokeping_mount_path: /var/www/html/cacti/rra/smokeping # omitted from exports while it is the default + +targets: # optional + - path: Europe/Paris # required; the SmokePing tree path + poller_id: 1 # default 1; must exist + host: paris.example.net + probe: FPing + menu: Paris # optional text + title: 'Paris: gateway' # optional text + slaves: # optional list of slave names + - site-b + nomasterpoll: false + step: 300 # 0 to 604800 + pings: 20 # 0 to 10000 + mode: observed # only observed + admin_state: enabled # enabled, disabled, or archived + present: true # honored for a new target only + +mappings: # optional + - target: Europe/Paris # a target in this file or already in the installation + poller_id: 1 + device: + hostname: paris-gw.example.net # the Cacti device's host name (not case sensitive) + description: Paris gateway # and its description (exact) +``` + +Identidad. Un objetivo se identifica por `poller_id` y `path`. Un dispositivo por `hostname` y `description`; la comprobación rechaza asociaciones cuando ningún dispositivo, o más de uno, tiene esa pareja. La importación recorta espacios al principio y al final del texto porque el complemento lee todos los valores almacenados de ese modo. + +Claves reservadas. `managed_targets` y `probe_profiles` se reservan para una futura versión con modo gestionado. La versión 1 las rechaza con un error que nombra la clave, para que nunca se aplique parcialmente un archivo escrito para esa versión. Una versión posterior ampliará el esquema con ellas; solo aumenta `schema_version` si cambia el significado de una clave ya existente aquí. + +Actualizaciones. Para un objetivo ya presente, una importación solo cambia `host`, `probe`, `menu`, `title`, `slaves`, `nomasterpoll`, `step`, `pings` y `admin_state`. La configuración SmokePing sigue siendo la fuente de los seis primeros campos: el siguiente inventario los restaura. Use la importación para restaurar `admin_state` y preparar una instalación nueva, no para editar objetivos. + +Los valores de ajustes deben tener el tipo indicado. El texto no puede contener caracteres de control. + +Ajustes solo de referencia. Un ajuste que nombra un archivo o directorio (todos los de `reference_settings` arriba) nunca se escribe mediante importación: un archivo no debe poder cambiar dónde lee o escribe el complemento. El esquema los marca por tipo y rechaza un archivo que los ponga en `settings`. En `reference_settings` se comprueba su forma (ruta absoluta o vacío donde se permita), se comparan con la instalación y, si difieren, el plan muestra `not applied, change on the Settings page`. Cámbielos en Settings. Los archivos exportados por 1.0.0-rc.1 también enumeran ahí `smokeping_perl_binary` y `smokeping_lib_dir`; estos ajustes ya no existen y la importación los omite. + + +## XML + +```xml + + + + 1 + false + + + /var/lib/smokeping + + + + site-b + + + + + + + + +``` + +XML se corresponde uno a uno con las claves YAML anteriores. Los booleanos son `true` o `false`. El lector rechaza cualquier declaración DOCTYPE o de entidad, no carga recursos externos y solo acepta estos elementos. + + +## Subconjunto YAML + +El lector acepta mapas y listas en bloque, escalares simples y entre comillas simples o dobles, comentarios y bloques literales `|` y `|-`, con un único `---` inicial opcional. Los escalares entre comillas dobles admiten escapes `\\ \" \/ \n \t \r \0 \b \f \e \xHH \uHHHH`; los de comillas simples duplican la comilla (`''`). Un escalar entrecomillado se cierra en su propia línea. + +Rechaza, indicando la línea: anclas (`&x`), alias (`*x`), etiquetas (`!x`), colecciones en flujo (`[a, b]`, `{a: b}`), bloques plegados (`>`), múltiples documentos, directivas, claves de fusión (`<<`), claves complejas (`?`), claves duplicadas, tabulaciones de sangría, escalares simples multilínea y anidamiento superior a 8 niveles. Rechaza un escalar simple que otra versión YAML interpreta como algo distinto de texto: `yes`, `no`, `on`, `off`, `y`, `n`, números con cero inicial, decimales, hexadecimales, fechas y horas como `1:30`. Póngalos entre comillas (`'yes'`). `true`, `false`, `null`, `~` y los números enteros simples conservan su significado. + +El exportador entrecomilla toda cadena que un lector pudiera interpretar mal, incluidas aquellas con dos puntos o `#`, espacio inicial o final, o un primer carácter que YAML trate como indicador. + + +## Límites + +En ambos formatos, los archivos se limitan a 8 MiB y 8 niveles de anidamiento, y cada línea a 16 KiB. El tamaño se comprueba antes de leer el archivo. diff --git a/docs/i18n/es-ES/docs/install.md b/docs/i18n/es-ES/docs/install.md new file mode 100644 index 0000000..d7a45dd --- /dev/null +++ b/docs/i18n/es-ES/docs/install.md @@ -0,0 +1,214 @@ + + + +# Instalar el complemento SmokePing + +Esta guía lleva un servidor Cacti 1.2 y una instalación SmokePing desde cero hasta gráficos en Cacti. Cubre el complemento, el acceso de solo lectura al directorio de datos (la parte que más suele fallar), su verificación, contenedores y soporte. La operación diaria está en [operaciones](operations.md), las alertas en [alertas](alerting.md) y las copias en [copia y restauración](backup-restore.md). + + +## Qué está admitido + +| Componente | Admitido | Probado aquí | +|---|---|---| +| Cacti | 1.2.31 y rama 1.2.x actual (1.2.32 cambia la comprobación de rutas de fuentes; véase el montaje) | Versión 1.2.31 y copia de desarrollo 1.2.32 | +| PHP | 8.2 o posterior. En 8.0 y 8.1 rechaza instalarse y Cacti sigue funcionando | 8.2.35 para integración y extremo a extremo; sintaxis de puntos de entrada en 8.0 | +| SmokePing | 2.9.0, 2.8.2 y 2.7.3 (solo Ubuntu 22.04, hasta 2027-06-01) | Los tres para el analizador, comparados con el original en 2.7.3 (Ubuntu 22.04), 2.8.2 (Debian 13) y 2.9.0 (Fedora 45); los tres para fidelidad de gráficos | +| rrdtool | La versión de Cacti; el lector ejecuta `path_rrdtool` | 1.7.2 | +| Thold, Maint | Sin cambios necesarios | Versiones del espacio de trabajo de complementos | +| Series | 10.000 por instalación con 20 pings y paso de 300 s, cuatro vCPU dedicadas y 8 GB ([rendimiento](performance.md#supported-series-count)) | 100, 1.000 y 10.000 en el ejecutor de publicaciones | + +Una «serie» es un objetivo en una ubicación (maestro o esclavo). El soporte de distribuciones sigue sus periodos de soporte completo; véase la [matriz](../../../research/distribution-matrix/README.md). Debian 13, Ubuntu 22.04 a 26.10, EL 9, Fedora 43 a 45 y Alpine 3.22 a 3.24 empaquetan SmokePing. **EL 10 y openSUSE Leap 16 no tienen paquete SmokePing**; allí solo funciona en la medida en que funcione una instalación desde código fuente, que no cubre esta guía. + + +## Cómo encajan las partes + +SmokePing escribe RRD. Cacti los grafica y el complemento lee sus últimos valores; ninguno los escribe. Cacti 1.2.32 y posteriores rechazan rutas fuera de RRA, por lo que se accede al directorio SmokePing mediante un **montaje de solo lectura dentro de la ruta RRA de Cacti**, por defecto `/smokeping` ([decisión 0007](../../../decisions/0007-read-only-mount-under-rra-path.md)). Este montaje protege también los archivos: la limpieza Cacti no puede eliminarlos ni renombrarlos a través de él. + +El sondeador Cacti del lector debe poder leer dos cosas del servidor SmokePing: + +1. La configuración (`/etc/smokeping/config`) y archivos incluidos, mediante el analizador PHP propio del complemento. Los incluidos deben estar en su directorio o debajo; se rechaza cualquier otro. No ejecuta Perl ni necesita la biblioteca Perl de SmokePing. +2. El directorio de datos mediante el montaje. + +Si están en servidores distintos, comparta los datos en solo lectura (NFS) y móntelos donde corre el sondeador SmokePing; véase [operaciones](operations.md#topologies). SmokePing en un recolector remoto Cacti es una fase posterior no admitida aquí. + + +## 1. Instalar SmokePing (si falta) + +En Debian 13 y Ubuntu: + + +```sh +apt-get update +DEBIAN_FRONTEND=noninteractive apt-get install -y smokeping +``` + +En EL 9 (el paquete está en EPEL y necesita CodeReady Builder): + + +```sh +dnf install -y epel-release +dnf config-manager --set-enabled crb +dnf install -y smokeping +``` + +Configure SmokePing como de costumbre e inícielo con `systemctl enable --now smokeping`. El directorio de datos es `/var/lib/smokeping` en Debian, Ubuntu y Alpine y `/var/lib/smokeping/rrd` en EL y Fedora. Aquí `DATADIR` es ese directorio (`datadir` de `*** Database ***`) y `RRA` es la ruta RRA Cacti (Console > Configuration > Settings > Paths, «RRA Path»; `/var/www/html/cacti/rra` en ejemplos). + +**Otros contenidos del directorio.** Debian conserva cachés de esclavos en `DATADIR/__cgi/
/` (`dyndir` de SmokePing) y no crea las secciones por sí mismo, por lo que un esclavo que no ha informado deja `__cgi/
/` vacío o ausente; Alpine conserva imágenes en `DATADIR/images` y las cachés de ordenación de SmokePing en `DATADIR/__sortercache`. El complemento ignora todo ello: nunca enumera el directorio y solo lee los RRD indicados por la configuración (`
/.rrd` y `~.rrd` por esclavo). Ni esos directorios ni un RRD sin objetivo (como `Local/LocalMachine.rrd`) se leen, enumeran o notifican como error. Se comprobó con un maestro Debian 13 y dos esclavos ([pruebas](../../../testing.md#the-live-suite)). + + +## 2. Permitir al sondeador Cacti leer SmokePing + +En las distribuciones empaquetadas, cualquiera puede leer los RRD y atravesar sus directorios superiores: el usuario del sondeador **no necesita pertenecer a ningún grupo**. La configuración es legible por todos en Debian, Ubuntu y Alpine y `0640 root:apache` en EL y Fedora, donde solo `apache` y root la leen. + +Compruebe como usuario del sondeador (`www-data` en Debian/Ubuntu, `apache` en EL/Fedora): + + +```sh +runuser -u "$POLLER_USER" -- test -r "$DATADIR" && echo "datadir readable" +runuser -u "$POLLER_USER" -- test -r /etc/smokeping/config && echo "config readable" +runuser -u "$POLLER_USER" -- ls "$DATADIR" > /dev/null && echo "datadir listable" +``` + +Cada línea debe imprimir, como ocurre con permisos de paquete: no hacen falta grupos ni otros ajustes en SmokePing. Solo falla con permisos más estrictos (por ejemplo `datadir` como `0750 smokeping:smokeping`) o usuario distinto de `apache` en EL/Fedora, cuya configuración es `0640 root:apache`. Dé acceso de lectura solo a ese usuario, por ejemplo mediante ACL (`setfacl -R -m u:$POLLER_USER:rX` en el directorio de configuración y `DATADIR`), y nunca permita que el usuario Cacti escriba archivos SmokePing. + + +## 3. Montar los datos en solo lectura dentro de RRA + +Elija una de las dos formas. Ambas crean un montaje enlazado que necesita root una vez. + + +### Opción A: línea en `/etc/fstab` + + +```sh +mkdir -p "$RRA/smokeping" +echo "$DATADIR $RRA/smokeping none bind,ro 0 0" >> /etc/fstab +mount "$RRA/smokeping" +``` + +Se aplica de inmediato y en cada arranque. Si prueba con `mount --bind`, añada un remontaje porque `util-linux` antiguo ignora `ro` en el primer enlace: `mount -o remount,bind,ro "$RRA/smokeping"`. + + +### Opción B: unidad systemd `.mount` + +Su nombre debe ser la ruta del montaje con `/` convertido en `-`; deje que systemd lo calcule: + + +```sh +unit=$(systemd-escape --path --suffix=mount "$RRA/smokeping") +cat > "/etc/systemd/system/$unit" < +### Verificar el montaje + + +```sh +findmnt -no TARGET,SOURCE,OPTIONS "$RRA/smokeping" +findmnt -no OPTIONS "$RRA/smokeping" | tr ',' '\n' | grep -x ro +touch "$RRA/smokeping/.cacti-write-test" && echo "WRITABLE: fix the mount before continuing" || echo "read-only, as required" +ls "$RRA/smokeping" | head +``` + +Debe aparecer `ro`, `touch` debe fallar con `Read-only file system` (incluso como root) y la lista mostrar secciones SmokePing. Health repite la comprobación desde `/proc/self/mountinfo` y notifica como **error** un montaje escribible, ausente o un enlace simbólico en la ruta. Un enlace simbólico no sustituye al montaje: Cacti 1.2.32 y posteriores rechazan rutas que lo atraviesen. + + +## 4. Instalar el complemento + +Desde un archivo de publicación (véase [empaquetado](../../../release.md)): + +```sh +tar -xzf smokeping-0.2.0.tar.gz -C /var/www/html/cacti/plugins +chown -R root:root /var/www/html/cacti/plugins/smokeping +cd /var/www/html/cacti +sudo -u www-data php cli/plugin_manage.php --plugin=smokeping --install --enable --allperms +``` + +El directorio debe llamarse `smokeping`. Ejecute el último comando como propietario de los archivos Cacti (`apache` en EL). `--allperms` concede al administrador de consola los tres ámbitos; otros usuarios reciben **SmokePing View**, **SmokePing Operator** o **SmokePing Admin** desde User Management. Operator incluye acceso View, y Admin incluye acceso Operator. El complemento instala tablas y plantillas de gráficos y hosts; si falla importar plantillas, lo muestra en Health y sigue funcionando. **Retry Template Import** permite repetir después de corregir la causa. + +PHP anterior a 8.2 rechaza instalar con un mensaje que indica la versión requerida; el resto de Cacti no se ve afectado. + + +## 5. Configurar y confirmar + +Abra **Console > Configuration > Settings > SmokePing** y compruebe: + +| Ajuste | Significado | +|---|---| +| SmokePing Poller | Sondeador Cacti en el servidor SmokePing o que comparte su sistema de archivos. Solo él lee los datos. | +| SmokePing Configuration File | `/etc/smokeping/config`, salvo que lo haya movido | +| SmokePing Data Directory | `DATADIR`, como lo ve SmokePing | +| Cacti Mount of the Data Directory | Montaje del paso 3; predeterminado `/smokeping` | +| Loss Colors | Automatic, salvo SmokePing 2.7 cuyo `Smokeping.pm` no sea visible al lector: entonces SmokePing 2.7. Véase [colores](provisioning.md#loss-colors) | + +Abra **SmokePing Health** en el servidor del sondeador. La fila de configuración lee inmediatamente el archivo y muestra el número de objetivos o el primer error con archivo y línea. Tras el próximo ciclo, todas las filas deberían ser OK: PHP, configuración, lector, inventario, montaje y plantillas. Para ejecutar lector e inventario sin esperar: + +```sh +sudo -u www-data php plugins/smokeping/poller_smokeping.php --force --inventory +``` + +**SmokePing Inventory** enumera ya todos los objetivos. Aún no hay gráficos; consulte [aprovisionamiento](provisioning.md). + + +## Idiomas + +El complemento incluye español de España (`es-ES`), francés (`fr-FR`), alemán (`de-DE`), chino simplificado (`zh-CN`), hindi (`hi-IN`), árabe (`ar-SA`) y japonés (`ja-JP`). Cacti los muestra al activar idiomas (Configuration > Settings > General > Language Support) y elegir uno el usuario. También incluye español latinoamericano (`es-419`), pero Cacti 1.2 no ofrece esa configuración regional: solo surtirá efecto cuando Cacti la añada; mientras tanto, elija español (`es-ES`). + + +## Contenedores + +Ejecute el lector donde vea ambas cosas indicadas al principio. + +- **Cacti en contenedor, SmokePing en el servidor.** Monte los datos en solo lectura en RRA y también la configuración en solo lectura: + + ```sh + docker run -d --name cacti \ + -v /var/lib/smokeping:/var/www/html/cacti/rra/smokeping:ro \ + -v /etc/smokeping:/etc/smokeping:ro \ + my-cacti-image + ``` + + Sustituya el lado izquierdo del montaje de datos por el `DATADIR` del servidor. La imagen no necesita nada de SmokePing: ni Perl ni el paquete `smokeping`. PHP del contenedor debe ser 8.2 o posterior. Health comprueba `:ro`; sin él informa de error. +- **Docker Compose.** Lo mismo, como entradas `volumes:` con `read_only: true` y `type: bind`: + + ```yaml + services: + cacti: + volumes: + - type: bind + source: /var/lib/smokeping + target: /var/www/html/cacti/rra/smokeping + read_only: true + ``` + +- **Kubernetes.** Volumen con `readOnly: true` en `volumeMounts`, respaldado por hostPath o volumen NFS/CSI donde escribe el pod SmokePing. +- **SmokePing en contenedor.** Ponga su `datadir` en un volumen compartido con el servidor Cacti y móntelo en solo lectura como antes. El complemento nunca necesita entrar al contenedor SmokePing. + + +## El limpiador RRD Cacti enumera archivos SmokePing + +El limpiador (**Utilities > RRD Cleaner**) recorre todo RRA, por lo que enumera como no usados los RRD SmokePing sin fuente Cacti, incluidos `target~slave.rrd`, y ofrece borrarlos. No los seleccione. Borrar o archivar mediante el montaje de solo lectura falla, Cacti registra una advertencia y elimina la entrada de la cola: los archivos sobreviven, pero las advertencias molestan y un montaje escribible perdería datos. El complemento elimina de la cola las entradas reconocibles antes de purgar (al comienzo de cada sondeo), reduciendo advertencias. El limpiador no tiene exclusiones; revise la lista antes de seleccionar. + + +## Actualizar y quitar + +Sustituya el directorio por la nueva publicación y abra Plugins o espere al sondeo; migra tablas y plantillas y registra la versión solo al completar todos los pasos, por lo que la siguiente ejecución termina una actualización interrumpida. Deshabilitar detiene los trabajos y deja los archivos SmokePing intactos. **Antes de desinstalar, exporte la configuración usted mismo y compruebe que la copia de seguridad sea legible y esté completa.** La desinstalación intenta exportar la configuración del complemento a YAML en Backup Directory o `cache/smokeping/` de Cacti (nombre aleatorio, modo `0600`, ruta mostrada si tiene éxito). Si la exportación falla, se registra y muestra una advertencia, pero la desinstalación continúa. Elimina las tablas salvo que esté activo **Keep Plugin Tables on Uninstall**, y nunca toca los archivos ni la configuración de SmokePing. diff --git a/docs/i18n/es-ES/docs/operations.md b/docs/i18n/es-ES/docs/operations.md new file mode 100644 index 0000000..3969128 --- /dev/null +++ b/docs/i18n/es-ES/docs/operations.md @@ -0,0 +1,107 @@ + + + +# Operar el complemento SmokePing + +Cómo interpretar lo que muestra el complemento, el significado y las evidencias de cada estado, qué comprobar ante problemas y cómo responde a fallos de sus entradas. La instalación está en [instalar](install.md), las alertas en [alertas](alerting.md) y las copias en [copia y restauración](backup-restore.md). + +Consulte [Roles de acceso](../README.md#access-roles) para los permisos View, Operator y Admin y el comportamiento de clasificación personal. + + +## Páginas + +| Página | Ámbito | Contenido | +|---|---|---| +| **SmokePing** (pestaña superior) | View | Último estado de los objetivos asociados a dispositivos que puede ver, una fila por objetivo y ubicación | +| **SmokePing Inventory** | Admin | Todos los objetivos de la configuración SmokePing, asociados o no, y propuestas abiertas de reasociación | +| **SmokePing Health** | Admin | Las comprobaciones siguientes y un botón para reintentar importar plantillas | +| **SmokePing Configuration** | Admin | Exportación e importación de configuración del complemento ([formato](configuration-format.md)) | +| **Import SmokePing Configuration** (en Import/Export) | Admin | Importación de una configuración SmokePing existente a dispositivos, gráficos y un árbol de gráficos ([procedimiento](provisioning.md#a-whole-smokeping-configuration)) | + +Los gráficos de humo y resumen son gráficos Cacti normales, sujetos a sus permisos de gráficos y dispositivos. + + +## Significado de los estados + +Cada fila de SmokePing combina dimensiones independientes. Nunca se fusionan en un color único, porque un recolector detenido y la pérdida completa de paquetes requieren respuestas distintas. + +| Dimensión | Estados | Evidencia | +|---|---|---| +| Frescura | `current`, `delayed`, `stale`, `never` | Antigüedad de la última actualización RRD (leída con `rrdtool lastupdate`) frente al `step` del objetivo. Current: dentro de un `step` más la tolerancia de frescura (60 s predeterminados). Delayed: mayor antigüedad, hasta dos veces `step`, el heartbeat de SmokePing. Stale: más allá del heartbeat, cuando los valores son desconocidos. Never: falta el archivo o nunca se actualizó desde su creación | +| Ejecución | `completed`, `probe_error`, `unknown` | Una ronda se completó si escribió una pérdida numérica. Los datos obsoletos o nunca observados no informan de la última ronda, por lo que son `unknown`. Nunca se establece `probe_error`: una sonda fallida escribe lo mismo que un objetivo sin respuesta ([investigación](../../../research/probe-failures.md)) | +| Condición | `within_policy`, `degraded`, `complete_loss`, `unknown` | De la última ronda completada. Pérdida completa es `loss` igual a `pings` sin mediana. Cualquier pérdida inferior es degradación. Un recolector detenido nunca aparece como pérdida: queda obsoleto y la condición es `unknown` | +| Administrativa | `enabled`, `disabled`, `archived` | Registro del objetivo en el complemento. No se lee un objetivo deshabilitado o archivado | +| Mantenimiento | en mantenimiento o no | Hook `is_device_in_maintenance` de Maint para el dispositivo del objetivo, mostrado en la columna Maintenance de la página de objetivos. Sin Maint, o deshabilitado, todos los dispositivos aparecen sin mantenimiento | +| Hora de medición | segundos desde la última actualización | Marca temporal del propio RRD. Actualizar la página nunca cuenta como medición | + +La frescura de cada ubicación procede de su propio archivo (`target~slave.rrd` para esclavos), de modo que un esclavo retrasado queda obsoleto aunque el maestro esté al día. + +La columna de pérdida muestra `lost/pings` de la última ronda y la mediana está en milisegundos; `U` significa desconocido, no cero. + + +## Comprobaciones de salud + +| Comprobación | Qué significa OK | Cuando no es OK | +|---|---|---| +| `php_binary` | El binario PHP indicado en Cacti existe y es ejecutable | El lector no puede arrancar: corrija «PHP Binary Path» en Cacti | +| `reader` | La última ejecución terminó dentro de tres intervalos de sondeo y de su presupuesto temporal | Advertencia: lector retrasado o presupuesto excedido. Con muchas series, aumente el presupuesto o revise el almacenamiento; consulte [rendimiento](performance.md) | +| `inventory` | El último inventario analizó la configuración SmokePing | Error: mensaje del analizador SmokePing con archivo y línea. Se conserva el inventario anterior | +| `mount`, `read-only`, `writable` | La ruta de montaje está dentro de RRA, se alcanza sin enlaces simbólicos, está montada en solo lectura y no es escribible | Error. Consulte la [guía de instalación](install.md#3-mount-the-data-directory-read-only-inside-cactis-rra-path) | +| `visibility` | Los archivos enumerados por el inventario son visibles por el montaje | Advertencia con el número de ausentes | +| `templates` | Las plantillas SmokePing están importadas | Error con la causa; corríjala y use **Retry Template Import** | +| `device_pollers` | Todos los dispositivos con fuentes resumen son sondeados por el sondeador del lector | Error que nombra los dispositivos: sus valores y alertas carecen de datos hasta usar ese sondeador | +| `loss_colors` | Colores seleccionados por Loss Colors: los de la versión SmokePing encontrada o los indicados. Tras cambiar, el sondeador principal migra gráficos en ciclos siguientes, 200 por ciclo; `upgrade-graphs` los migra de inmediato. La fila cuenta los gráficos aún con otros colores y avisa de migraciones fallidas | Desconocido si el lector no encontró versión y el ajuste es Automatic: se usan colores de 2.8 y posteriores. Advertencia si difiere de la versión encontrada. Consulte [colores de pérdida](provisioning.md#loss-colors) | +| `dual_alerting` | Ningún objetivo tiene a la vez un valor `alerts` SmokePing y un umbral Thold habilitado en su fuente resumen | Advertencia con hasta 10 objetivos: un problema que cumpla ambas condiciones notifica dos veces. No se comparan condiciones; por ejemplo, un umbral Thold `age` puede activarse sin alerta de pérdida SmokePing. Compárelas antes de quitar la alerta SmokePing o deshabilitar el umbral. OK si no está instalado Thold | + + +## Situaciones habituales + +- **Todo está `stale`.** SmokePing dejó de escribir o el montaje está obsoleto. Compruebe `systemctl status smokeping` y compare `rrdtool lastupdate` a través del montaje con el mismo archivo en el servidor SmokePing. NFS de solo lectura puede retrasarse por su caché de atributos. +- **Un esclavo está `stale` y el maestro `current`.** El esclavo dejó de entregar datos. El maestro aplica los resultados tardíos al recibirlos y rellena el gráfico; Thold no los reevalúa ([alertas](alerting.md)). +- **Un objetivo dice `never`.** El RRD aún no existe (SmokePing lo crea en la primera ronda tras recargar) o el montaje no lo muestra. Revise `visibility`. +- **Un gráfico queda vacío tras actualizar Cacti a 1.2.32.** Cacti sustituye una ruta de fuente fuera de RRA por su ruta generada. Verifique el montaje donde indica el complemento y que no haya enlaces simbólicos. +- **Se renombra una sección SmokePing.** SmokePing inicia un archivo nuevo para una ruta nueva. El inventario propone reasociar y no cambia nada hasta la confirmación de un administrador ([aprovisionamiento](provisioning.md#re-linking-a-renamed-target)). + + +## Topologías + +1. **SmokePing en el servidor del sondeador Cacti.** El usuario del sondeador lee el directorio de datos mediante el montaje enlazado. Es el caso de la guía de instalación. +2. **Directorio SmokePing compartido con el servidor Cacti.** Móntelo en solo lectura por NFS en la ruta RRA del servidor que ejecuta el sondeador SmokePing. Salud compara la última actualización con el reloj; un montaje retrasado aparece como `delayed` o `stale`. Los gráficos de humo se dibujan en el servidor que sirve la interfaz web, que también necesita el recurso compartido; si solo lo tiene el sondeador, los resúmenes y alertas funcionan, pero los gráficos de humo quedan vacíos. +3. **SmokePing en un recolector remoto Cacti** pertenece a una fase posterior y no se admite en esta versión. + +Solo el sondeador indicado en **SmokePing Poller** lee los datos SmokePing. Los dispositivos con fuentes resumen deben usarlo. + + +## Ante fallos de entradas + +Estos comportamientos están cubiertos por la calificación de la versión ([calificación de fallos](../../../failure-qualification.md)); ninguno pierde datos. + +| Fallo | Comportamiento documentado | +|---|---| +| Configuración SmokePing ilegible o rota | Falla el inventario con el mensaje del analizador en Health; se mantiene el anterior sin eliminar nada | +| Una sonda no puede funcionar mientras SmokePing continúa: binario con error de salida, dirección origen ausente del servidor, parámetro rechazado por fping o IPv6 desactivado para FPing6 | SmokePing escribe pérdida completa para todos los objetivos de esa sonda, igual que para objetivos sin respuesta. Las mediciones muestran `complete_loss`. Si todos fallan a la vez, busque el error de la sonda en el registro SmokePing | +| Fallo de sonda detectado por SmokePing: binario ausente, parámetro fuera de rango, sin socket raw para fping | SmokePing termina al arrancar o en la primera ronda. Todos los objetivos pasan a `delayed` y después `stale`, como al detenerse SmokePing | +| No se resuelven nombres de objetivos (fallo DNS) | Las sondas fallan y escriben pérdida; el complemento lee lo escrito. Las mediciones muestran `degraded` o `complete_loss`, no obsolescencia. El complemento no hace consultas DNS | +| SmokePing o su recolector se detiene | Frescura pasa a `delayed` y luego `stale`; `median` y `loss_pct` pasan a desconocidos, `age` sigue creciendo. Nunca pérdida cero | +| Desfase de relojes entre Cacti y SmokePing | Frescura compara la hora propia del RRD con el reloj Cacti; el desfase altera todas las edades. SmokePing adelantado marca rondas futuras que aparecen `current`, y un recolector detenido sigue `current` hasta que transcurra el desfase. SmokePing atrasado hace parecer más antiguas todas las series y `stale` cuando supera dos veces `step`. Mantenga ambos servidores con NTP | +| RRD ilegible o corrupto | El lector registra una advertencia para ese archivo y sigue con los demás. Una serie nunca leída es desconocida (`U`). Una leída antes conserva la última lectura en caché, que envejece por `delayed` y `stale` hasta desconocida; un archivo dañado nunca se convierte en pérdida cero | +| Almacenamiento lleno en Cacti | El lector solo escribe su caché de base de datos. Si se rechaza una escritura, termina normalmente y todas las filas quedan completas como estaban; el siguiente ciclo tras recuperar espacio guarda las nuevas rondas. Los RRD Cacti de resumen fallan como cualquier otro origen | +| Lector terminado a mitad de ejecución | Cada fila se escribe completa, de modo que quedan lecturas completas. Cacti detecta el proceso muerto y la siguiente ejecución empieza inmediatamente y completa todas las series | +| Segundo arranque del lector | La tabla de procesos Cacti permite un lector por sondeador. El duplicado sale inmediatamente con 0 y registra una nota (nivel Medium); no perturba al primero | +| Inicio y fin de mantenimiento | Maint suprime notificaciones del dispositivo; Thold sigue evaluando y la fuente resumen se sigue sondeando | +| Actualización interrumpida del complemento | La versión registrada solo cambia al completar todos los pasos; la siguiente página o ciclo termina la actualización | + + +## Importar y exportar + +Consulte el [formato de configuración](configuration-format.md). Forma breve: + +```sh +php plugins/smokeping/cli/smokeping.php export --file=/var/backups/smokeping-config.yaml +php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml +``` + + +## Registros + +El complemento escribe en el registro Cacti con la etiqueta `SMOKEPING`. `grep SMOKEPING log/cacti.log` muestra estadísticas del lector (`SMOKEPING STATS`), fallos de inventario e importación de plantillas y toda importación de configuración aplicada. diff --git a/docs/i18n/es-ES/docs/performance.md b/docs/i18n/es-ES/docs/performance.md new file mode 100644 index 0000000..99d638f --- /dev/null +++ b/docs/i18n/es-ES/docs/performance.md @@ -0,0 +1,101 @@ + + + +# Rendimiento + +La capacidad se expresa en series: un objetivo en una ubicación de medición (maestro o esclavo). Esta página indica el coste del complemento con 100, 1.000 y 10.000 series, el entorno medido y los datos aún pendientes. Los IDs de requisitos proceden de [#42](https://github.com/somethingwithproof/plugin_smokeping/issues/42). + + +## Trabajo por petición y por ciclo + +- **Ninguna petición de página ejecuta una sonda, lee un RRD ni espera a un recolector remoto (REQ-PERF-003).** La vista general lee las filas de caché del lector en la base de datos. `tests/bin/perf-page.php` la dibuja con la ruta de montaje apuntando a un directorio inexistente y el resultado es igual. Los gráficos son gráficos Cacti y leen sus archivos como cualquier gráfico Cacti. +- **Un proceso lector por sondeador lee cada serie una vez por ciclo**, mediante una única tubería `rrdtool`, con un presupuesto temporal (120 s predeterminados). Si lo alcanza, se detiene y la siguiente ejecución continúa con las series que más esperaron. Leer un archivo es una llamada `lastupdate` que lee la cabecera; no depende del tamaño del RRD. +- **Cada fuente resumen lee una fila de caché**, sin tocar nunca un RRD. +- **La pantalla de confirmación de una adición masiva muestra la carga antes de crear nada (REQ-PERF-004)**: para los objetivos coincidentes, el número de series, paquetes de sonda por segundo y actualizaciones RRD por segundo que soportará SmokePing, así como filas de fuentes de datos Cacti y elementos de gráficos. El cálculo está en `lib/LoadEstimate.php`. + + +## Cálculos + +Con 10.000 series, 20 pings cada 300 segundos: unos 667 paquetes por segundo de media, unas 33 actualizaciones RRD SmokePing por segundo y unas 33 lecturas `lastupdate` por segundo si el lector comprueba cada serie en cada paso. Los objetos Cacti son 260.000 filas `data_template_rrd` (23 para la fuente de humo y 3 para el resumen, por serie) y 550.000 filas de elementos de gráficos (50 para humo y 5 para resumen, por serie), con 10.000 fuentes resumen sondeadas por el servidor de scripts. La prueba de publicación siguiente usó plantillas anteriores a [#81](https://github.com/somethingwithproof/plugin_smokeping/issues/81) y contó exactamente sus filas: 47 por gráfico de humo, 520.000 en total. #81 añadió desviación estándar, am/s y líneas de sonda. La confirmación calcula los mismos números y `tests/Unit/LoadEstimateTest.php` los contrasta con las plantillas distribuidas. + + +## Mediciones locales preliminares + +Medido en un portátil, en contenedores Docker, con scripts propios (`sh tests/run-perf.sh `): **medición local preliminar de este código, no cifra de publicación.** Equipo: Apple silicon, aarch64, 14 CPU y 15,7 GiB disponibles para Docker, MariaDB 10.11 y PHP 8.2 en contenedores del mismo servidor, RRD en un montaje enlazado Docker. Series: 20 pings, paso de 300 s, RRD de prueba de 193 KB cada uno (los originales SmokePing ocupan varios megabytes; `lastupdate` lee la cabecera, por lo que el tamaño no cambia la lectura). + +| Series | Lector, primera pasada completa | Lector, archivos sin cambios | Series cubiertas en un ciclo predeterminado (120 s) | Vista general (CLI, solo base de datos) | Memoria máxima de página | HTML de página | +|---|---|---|---|---|---|---| +| 100 | 0.2 s | menos de 0.1 s | 100 de 100 | 0.002 s | 8 MB | 0.02 MB | +| 1,000 | 1.2 s | 1.1 s | 1,000 de 1,000 | 0.012 s | 12 MB | 0.17 MB | +| 10,000 | 12.3 s | 11.6 s | 10,000 de 10,000 | 0.119 s | 58 MB | 1.68 MB | + +La tabla muestra un coste lector de unos 1,2 ms por serie en este entorno, con crecimiento lineal: 10.000 series consumen alrededor de una décima parte del presupuesto predeterminado en disco local. La vista general enumera todas las series asociadas en una página (unas 10.000 filas y 1,7 MB de HTML con 10.000), con poco tiempo de base de datos y PHP. Las cifras excluyen navegador, servidor web, marco de página Cacti, NFS y un SmokePing escribiendo simultáneamente. + +No medido aquí: páginas de gestión Cacti con objetos aprovisionados (véanse las mediciones de publicación), montaje NFS de solo lectura y demonio SmokePing real escribiendo 33 archivos por segundo mientras lee el lector. + + +## Mediciones de publicación + +Medido el 2026-11-15 en un droplet DigitalOcean: `c-4` en sfo3, 4 vCPU dedicadas (Intel Xeon Platinum 8280), 8 GB, Ubuntu 24.04, con Cacti 1.2.31, PHP 8.5.12, RRDtool 1.7.2 y MariaDB 10.11.19 en contenedores del mismo servidor. Las series tienen 20 pings y paso de 300 s, cada objetivo en su propio dispositivo, con RRD de prueba en un montaje enlazado de solo lectura. + + +### Lector y vista general + +`sh tests/run-perf.sh `: + +| Series | Lector, primera pasada completa | Lector, archivos sin cambios | Series cubiertas en un ciclo predeterminado (120 s) | Vista general (CLI, solo base de datos) | Memoria máxima de página | HTML de página | +|---|---|---|---|---|---|---| +| 100 | 0.2 s | menos de 0.1 s | 100 de 100 | 0.004 s | 8 MB | 0.02 MB | +| 1,000 | 1.9 s | 2 s | 1,000 de 1,000 | 0.028 s | 12 MB | 0.17 MB | +| 10,000 | 20.6 s | 19.9 s | 10,000 de 10,000 | 0.244 s | 58 MB | 1.68 MB | + +El lector cuesta unos 2 ms por serie en este servidor: 10.000 series consumen alrededor de una sexta parte del presupuesto predeterminado. + + +### Páginas Cacti y sondeador con todos los objetos + +`sh tests/run-perf-objects.sh ` crea objetivos y dispositivos, mide las páginas, aprovisiona todos los objetos resumen y de humo mediante el complemento, vuelve a medir las páginas y ejecuta dos ciclos de sondeo, cada uno después de terminar el lector del anterior. `PERF_OBJECTS=stock` asigna en su lugar dos gráficos de las plantillas Local Linux Machine de Cacti a cada dispositivo («Unix - Load Average» y «Linux - Memory Usage»): el mismo número de gráficos por serie, para comparar REQ-PERF-002. Los tiempos de página son p50/p95 sobre HTTP en milisegundos, 20 peticiones tras una de calentamiento, con sesión de administrador y servidor integrado de PHP. «Solo dispositivos» son los mismos dispositivos antes de tener gráficos. + +| Series | Objetos | Lista de dispositivos | Lista de fuentes | Lista de gráficos | Vista general del complemento | +|---|---|---|---|---|---| +| 100 | solo dispositivos | 28/31 | 25/35 | 35/37 | 38/40 | +| 100 | gráficos estándar | 28/39 | 48/56 | 33/48 | 29/39 | +| 100 | objetos del complemento | 28/39 | 51/53 | 33/34 | 28/29 | +| 1,000 | solo dispositivos | 30/42 | 25/26 | 26/36 | 59/64 | +| 1,000 | gráficos estándar | 32/33 | 50/51 | 39/40 | 65/66 | +| 1,000 | objetos del complemento | 42/44 | 54/77 | 39/40 | 58/68 | +| 10,000 | solo dispositivos | 50/57 | 28/37 | 28/30 | 301/319 | +| 10,000 | gráficos estándar | 66/69 | 50/75 | 107/111 | 331/338 | +| 10,000 | objetos del complemento | 65/68 | 54/78 | 105/119 | 318/340 | + +| Series | Aprovisionamiento de objetos del complemento | Primer ciclo de sondeo (crea RRD) | Ciclo de sondeo estable | Lector | +|---|---|---|---|---| +| 100 | 31 s | 2.0 s | 1.6 s | 0.2 s | +| 1,000 | 324 s | 6.5 s | 5.1 s | 1.6 s | +| 10,000 | 3,284 s | 57.1 s | 43.5 s | 21.5 s | + +Con 10.000 series, los objetos del complemento son 260.000 filas `data_template_rrd`, 520.000 filas de elementos gráficos y 10.000 elementos del sondeador; los gráficos estándar tienen 50.000 y 240.000 filas. El ciclo de sondeo es un proceso cmd.php que consulta las 10.000 fuentes resumen; el lector corre en paralelo, iniciado por `poller_bottom`. Ambos quedan muy por debajo del intervalo de 300 s. El aprovisionamiento es una adición masiva de un administrador: unos 0,33 s por serie, casi una hora para 10.000. Una ejecución anterior del mismo script en el mismo droplet tardó 6.141 s para 10.000 (0,61 s por serie); reserve entre una y dos horas. + + +### Frente a los requisitos + +- **REQ-PERF-001 (vista general en menos de dos segundos con 10.000): cumplido.** p95 de 0,34 s sobre HTTP. +- **REQ-PERF-002 (páginas de gestión dentro del valor base más 20 % con 10.000): cumplido** frente a los gráficos estándar. Con 10.000 series, el p95 del complemento es un 1 % menor en dispositivos, un 4 % mayor en fuentes y un 7 % mayor en gráficos. Con 1.000, el p95 de fuentes supera el estándar un 51 % (77 frente a 51 ms), pero las medianas difieren un 8 %, en ambas ejecuciones: son las peticiones más lentas, no la típica. Frente a solo dispositivos, sin gráficos, cualquier conjunto de 20.000 gráficos, estándar o del complemento, ralentiza todas las páginas. +- **REQ-PERF-003 (sin sondas, lecturas RRD acotadas, sin espera remota por petición): cumplido** (véase el primer apartado). +- **REQ-PERF-004 (carga visible antes de adición masiva): cumplido.** La estimación coincide con las filas contadas. + + +## Número de series admitido + +**10.000 series por instalación Cacti**, con 20 pings y paso de 300 s, en hardware como el ejecutor de publicaciones: cuatro vCPU dedicadas y 8 GB, con la base de datos en el mismo servidor. A ese nivel, el lector consume una sexta parte del presupuesto predeterminado y el ciclo de sondeo una séptima parte del intervalo; las páginas de gestión se mantienen dentro del 7 % del mismo número de gráficos estándar. No se ha medido por encima de 10.000. + + +## Reproducir + +```sh +sh tests/run-perf.sh # 100, 1,000, and 10,000 series +sh tests/run-perf.sh 1000 # one size +sh tests/run-perf-objects.sh # Cacti's pages and the poller with every object +``` + +Cada ejecución prepara objetivos con `tests/bin/perf-seed.php`, crea RRD con `tests/bin/make-fixture-rrds.php`, los lee con `poller_smokeping.php --force` y dibuja la página con `tests/bin/perf-page.php`. diff --git a/docs/i18n/es-ES/docs/provisioning.md b/docs/i18n/es-ES/docs/provisioning.md new file mode 100644 index 0000000..409a754 --- /dev/null +++ b/docs/i18n/es-ES/docs/provisioning.md @@ -0,0 +1,115 @@ + + + +# Añadir objetivos SmokePing a Cacti + +Cada objetivo descubierto por el inventario es visible para administradores en **SmokePing Inventory** e invisible para los demás hasta asociarlo a un dispositivo Cacti. No se crea nada sin confirmación de un administrador. El complemento nunca escribe archivos SmokePing. + + +## Un objetivo + +En SmokePing Inventory, un objetivo presente sin asociar tiene el enlace **Add to Cacti**. La confirmación ofrece dos opciones: + +- **Crear un dispositivo nuevo** desde la plantilla «SmokePing Target». Usa el host del objetivo, desactiva la comprobación de disponibilidad (SmokePing ya lo mide) y se asigna al sondeador del lector. +- **Asociarlo a un dispositivo existente.** La lista muestra dispositivos que puede modificar. + +En ambos casos recibe una fuente y gráfico resumen para alertas (véase [alertas](alerting.md)) y, si los datos SmokePing pueden representarse, un gráfico de humo por ubicación. No recibe gráfico de humo, y la página explica por qué, si `pings` no es 10, 20 o 30, si Cacti almacena RRD en RRDproxy o si el archivo no es visible mediante el montaje de solo lectura. Conserva sus datos resumen. + +La fuente resumen la sondea el sondeador que ejecuta el lector. Si un dispositivo existente usa otro sondeador, el complemento no crea la fuente e indica cuál usar. Salud enumera dispositivos cambiados a otro sondeador posteriormente. + + +## Muchos dispositivos + +En la lista de dispositivos, seleccione varios y elija **Add SmokePing Targets**. La confirmación enumera, por dispositivo, los objetivos sin asociar cuyo `host` SmokePing coincide con su nombre de host (sin distinguir mayúsculas), y el total de coincidencias. Continuar los añade. Los dispositivos sin coincidencia se indican y quedan intactos; no se crea ningún dispositivo. Cien dispositivos en una petición tardaron unos 24 segundos en un contenedor local; una selección muy larga deja de iniciar nuevos dispositivos poco antes del límite de petición. Repetir termina el trabajo porque se omiten los ya añadidos. + + +## Una configuración SmokePing completa + +**Console > Import/Export > Import SmokePing Configuration** incorpora una instalación SmokePing existente a Cacti en un paso. Requiere el ámbito SmokePing Admin y permisos que cubran todos los dispositivos; reflejarla en un árbol requiere también Trees. + +Elija la entrada: + +- **El archivo configurado** (predeterminado): el ajuste SmokePing Configuration File, leído en el servidor con todos sus archivos incluidos. Cada inclusión debe permanecer en ese directorio o debajo. +- **Un archivo cargado**, de hasta 4 MiB. Se lee de forma independiente, por lo que `@include` se rechaza con su número de línea. Los objetivos se representan desde los RRD visibles al sondeador del lector; el próximo inventario marca ausentes los que no existan en el SmokePing de ese sondeador. + +Después, las opciones: + +| Opción | Predeterminado | Significado | +|---|---|---| +| Dispositivos | Uno por host SmokePing | Los objetivos que sondean el mismo host comparten dispositivo. Uno por objetivo da a cada uno un dispositivo con su título como nombre. | +| Plantilla de dispositivo | SmokePing Target | Plantilla de los dispositivos creados. | +| Sondeador | El del lector | Debe ejecutar el lector; se rechaza cualquier otro porque sus fuentes resumen no obtendrían datos. | +| Sitio | Ninguno | Sitio de los dispositivos nuevos. | +| Árbol de gráficos | No reflejar | Árbol existente o nuevo por nombre. Cada sección SmokePing forma una rama, cada dispositivo una entrada de host bajo la rama de sus objetivos. | + +**Preview** lee sin escribir nada. Muestra secciones con casillas (selecciónelas y pulse **Update Preview** para importar solo esos objetivos), dispositivos que crear o reutilizar, gráficos que crear, objetivos solo con resumen y su motivo (`pings` distinto de 10, 20 o 30, o RRDproxy), ramas y entradas del árbol y carga estimada, igual que la acción masiva. Se reutiliza un dispositivo si, en el sondeador elegido, tiene el host del objetivo (y, con uno por objetivo, su título como descripción); si coinciden dos, se omiten y enumeran esos objetivos para asociarlos en SmokePing Inventory. **Import** aplica exactamente el plan mostrado con las funciones Cacti de dispositivos, gráficos y árboles. Si cambió la configuración o Cacti desde la vista previa, no escribe nada y debe repetirla. + +Importar otra vez no crea nada nuevo: los objetivos asociados conservan dispositivos, se reutilizan gráficos y entradas del árbol, y cada objetivo se indica como ya existente en Cacti. Nunca se escribe en archivos SmokePing ni en el montaje. + +La misma importación por consola, con iguales opciones: + +```sh +php plugins/smokeping/cli/smokeping.php import-smokeping --dry-run --tree-name=SmokePing +php plugins/smokeping/cli/smokeping.php import-smokeping --apply --confirm=PLAN --tree-name=SmokePing +``` + +`--file=PATH` lee otro archivo de forma independiente, como una carga. `--sections=Europe,Lab/Core`, `--device-per=target`, `--device-template=ID`, `--poller=ID`, `--site=ID` y `--tree=ID` establecen las otras opciones. La simulación muestra el plan y su ID; `--apply` necesita ese ID y aún debe coincidir. + + +## Escala de gráficos + +SmokePing dimensiona cada gráfico desde sus datos en cada renderizado. Cacti tiene un único límite superior para todos los periodos, por lo que el complemento aplica al último día la regla de los gráficos detallados de SmokePing (`findmax` en `Smokeping.pm`): 1,2 veces la mayor mediana del último día en el archivo del gráfico. El Navigator Graph de SmokePing usa 1,5; el complemento no tiene navegador. Dimensiona al crear y después aproximadamente a diario. Si no hay mediana en el último día, conserva el límite; uno nuevo conserva el límite de plantilla de 0,05 s (50 ms). + +El ajuste diario está activo de forma predeterminada y no tiene opción de configuración. Después de cada lectura, el lector dimensiona los gráficos de objetivos de su sondeador cuyo último ajuste fue hace un día o más, primero los que más esperan, hasta 25 por ciclo. Lee un RRD por gráfico y no ejecuta sondas. Omite el ciclo si la lectura agotó el presupuesto. Con un ciclo cada cinco minutos cubre 7.200 gráficos diarios; con más, cada gráfico se ajusta algo menos que diariamente. + +El complemento registra el límite que puso en cada gráfico. Un límite diferente fue configurado manualmente en la página del gráfico y nunca lo cambia. Para devolver el control, restablezca el último límite del complemento, que `size-graphs` muestra para cada gráfico con límite manual. + +Para dimensionar todos ahora: + +```sh +php plugins/smokeping/cli/smokeping.php size-graphs +``` + +Muestra el nuevo límite o si conservó el existente o el manual. Respeta las mismas reglas de límites manuales que el ajuste diario. Necesita la ruta rrdtool de Cacti (Configuration > Settings > Paths); sin ella conserva los límites. + +Al actualizar desde 1.0.0-rc.1 no hay registro de quién fijó los límites existentes: el complemento adopta el actual como propio y ajusta el gráfico en su próximo turno diario. Antes, `size-graphs` también sustituía los límites manuales. Un límite solo cuenta como manual mientras difiere del registrado, y tras actualizar el registrado es el adoptado. Para conservar uno manual, vuelva a fijarlo después de que el ajuste diario lo sustituya. Si ese ajuste no encuentra mediana, conserva el adoptado, de modo que volver a poner el mismo valor no cambia nada y un ajuste posterior aún podrá sustituirlo. + + +## Leyenda y actualización de plantillas + +La leyenda sigue la de SmokePing: promedio, máximo, mínimo y último valor de la mediana, desviación estándar y am/s (promedio dividido por desviación estándar), después pérdidas y colores y la línea de sonda, como `probe: 20 ICMP Echo Pings (56 Bytes) every 300s`. La línea procede de sonda, tamaño de paquete, pings y paso leídos del objetivo en la configuración. El sondeador principal la escribe en cada gráfico y vuelve a hacerlo si cambia la sonda o una importación de plantillas la restablece. Un objetivo guardado antes de leer la sonda muestra su nombre. + +Si una actualización trae plantillas nuevas, los gráficos anteriores conservan sus elementos, que siguen dibujándose, hasta que el complemento los migra. El sondeador principal migra 200 por ciclo, conservando título y límite superior. Para todos ahora: + +```sh +php plugins/smokeping/cli/smokeping.php upgrade-graphs +``` + +La actualización establece los elementos según la plantilla, sustituyendo cambios manuales de elementos de gráficos del complemento. Después comprueba que coincidan exactamente y existan todos sus VDEF. Si falla, conserva elementos y versión anteriores, y el registro Cacti nombra el gráfico. El sondeador no reintenta. `upgrade-graphs` reintenta cada fallido en cada ejecución y sale con 1 si alguno sigue fallando. + + +## Colores de pérdida + +SmokePing 2.7 colorea la pérdida con siete niveles fijos; desde 2.8 usa proporciones de pings y añade pérdida completa. El complemento distribuye plantillas para ambos sobre las mismas fuentes y ambas coinciden con los gráficos originales ([fidelidad](../../../research/graph-fidelity.md)). **Loss Colors** en los ajustes elige: + +- **Automatic** (predeterminado) sigue la versión que el lector encuentra en `Smokeping.pm` junto a SmokePing (`/usr/share/perl5`, `/usr/share/smokeping`, `/opt/smokeping/lib` o `/usr/local/smokeping/lib`), registrada en cada inventario. Por debajo de 2.8 usa colores 2.7. Si no encuentra versión, por ejemplo en otro contenedor, usa 2.8 y posteriores. +- **SmokePing 2.8 and later** o **SmokePing 2.7** fija los colores independientemente de lo encontrado. + +La fila `loss_colors` de Salud muestra los colores y el motivo. Al cambiar por ajuste o actualización de SmokePing, el sondeador principal migra los gráficos a otras plantillas, 200 por ciclo, conservando título, límite y datos. `upgrade-graphs` los migra todos de inmediato. Un gráfico fallido conserva colores y se reintenta en el próximo `upgrade-graphs`, como antes. + + +## Reasociar un objetivo renombrado + +SmokePing nombra el archivo según su lugar en el árbol, por lo que renombrar o mover un nodo inicia un archivo vacío. Si una importación ve desaparecer una ruta y aparecer otra con igual host y sonda, registra una propuesta sin cambios. **Review** en Inventory abre la confirmación. Reasociar mueve el gráfico de humo, la fuente resumen y la asociación de dispositivo al nuevo objetivo, y mantiene legible el historial antiguo en un gráfico archivado. **Dismiss Proposal** cierra sin cambios. + + +## Permisos + +El complemento tiene tres ámbitos. **SmokePing View** permite abrir la página, que solo enumera objetivos asociados a dispositivos visibles al usuario, y seguir el enlace desde los gráficos del dispositivo. **SmokePing Operator** añade la página Operations y reconocimientos personales de observaciones actuales; no cambia la salud medida ni suprime alertas. **SmokePing Admin** incluye acceso Operator y abre inventario, salud y las acciones anteriores. Un administrador con permisos limitados ve objetivos sin asociar y objetivos de dispositivos que puede ver. + +Gráficos y fuentes son objetos Cacti normales: sus permisos de gráficos y dispositivos deciden quién los ve. El método predeterminado Cacti es permisivo: solo se limita a ciertos dispositivos cuando las políticas de dispositivo, gráfico y plantilla de gráfico deniegan todas. Los cambios se aplican en la siguiente petición del usuario. + + +## Eliminar un dispositivo + +Eliminar un dispositivo asociado borra su asociación y registros del complemento sobre sus fuentes, dejando el objetivo en inventario sin asociar. No toca archivos SmokePing: véase [ADR 0007](../../../decisions/0007-read-only-mount-under-rra-path.md). diff --git a/docs/i18n/hi-IN/README.md b/docs/i18n/hi-IN/README.md new file mode 100644 index 0000000..ad7bb1f --- /dev/null +++ b/docs/i18n/hi-IN/README.md @@ -0,0 +1,142 @@ + + + +[English](../../../README.md) | [简体中文](../zh-CN/README.md) | [हिन्दी](README.md) | [Español (España)](../es-ES/README.md) | [Español (Latinoamérica)](../es-419/README.md) | [العربية](../ar-SA/README.md) + + +

+ + + SmokePing Cacti प्लगइन: SmokePing ग्राफ़ वाला बैज पहने एक कैक्टस + +

+ + +# Cacti के लिए SmokePing प्लगइन + +[![CI](https://github.com/somethingwithproof/plugin_smokeping/actions/workflows/plugin-ci-workflow.yml/badge.svg)](https://github.com/somethingwithproof/plugin_smokeping/actions/workflows/plugin-ci-workflow.yml) +[![License: GPL-2.0-or-later](https://img.shields.io/badge/license-GPL--2.0--or--later-blue.svg)](../../../LICENSE) +![PHP >= 8.2](https://img.shields.io/badge/php-%3E%3D8.2-777bb4.svg) +![Cacti >= 1.2.31](https://img.shields.io/badge/cacti-%3E%3D1.2.31-2e7d32.svg) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=coverage)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +![SmokePing: read-only](https://img.shields.io/badge/smokeping-read--only-6b7280.svg) + +Cacti 1.2 का एक प्लगइन जो SmokePing के विलंब और पैकेट हानि मापों को सामान्य Cacti उपकरणों, डेटा स्रोतों और ग्राफ़ों के रूप में लाता है। स्मोक ग्राफ़ संबंधित उपकरण के साथ, Cacti अनुमतियों के अधीन दिखते हैं और Thold तथा Maint उनके अलर्ट दे और दबा सकते हैं। यह Cacti के लिए स्वतंत्र कार्यान्वयन है; यह [SmokePing](https://oss.oetiker.ch/smokeping/) का हिस्सा या उसके द्वारा समर्थित नहीं है, जिसके मूल लेखक Tobias Oetiker और Niko Tyni हैं। प्लगइन में SmokePing कोड शामिल नहीं है और वह उसे चलाता भी नहीं: यह उसकी कॉन्फ़िगरेशन और RRD फ़ाइलें पढ़ता है तथा इसके ग्राफ़ टेम्पलेट मूल SmokePing ग्राफ़ों जैसी ही शृंखलाएँ बनाते हैं। + +> **स्थिति: विकासाधीन। अवलोकन मोड (चरण 1) `main` में लागू है और 1.0.0-rc.1 पूर्व-रिलीज़ में प्रकाशित है।** प्लगइन SmokePing कॉन्फ़िगरेशन और RRD फ़ाइलें पढ़ता है, उनकी स्थिति दिखाता है, उनके लिए Cacti उपकरण, डेटा स्रोत और ग्राफ़ बनाता है तथा Thold और Maint को डेटा देता है। यह SmokePing में कुछ नहीं लिखता। प्रबंधित मोड (प्लगइन द्वारा SmokePing कॉन्फ़िगरेशन लिखना) और दूरस्थ संग्रहकर्ता बाद के चरण हैं, शुरू नहीं हुए हैं और यहाँ शामिल नहीं हैं। वास्तविक इंस्टॉलेशन पर पायलट तथा SmokePing ग्राफ़ों के संकेतक विवरण से बेहतर मेल अभी माइलस्टोन 4 में शेष हैं। शुरू करने के लिए [docs/install.md](docs/install.md) देखें। + + +## पहुँच भूमिकाएँ + +| अनुमति क्षेत्र | पहुँच | +| --- | --- | +| SmokePing View | मौजूदा निगरानी पृष्ठ। | +| SmokePing Operator | निगरानी के साथ संचालन पृष्ठ और व्यक्तिगत जाँच पुष्टि। | +| SmokePing Admin | ऑपरेटर पहुँच के साथ मौजूदा कॉन्फ़िगरेशन और प्रशासनिक कार्रवाइयाँ। | + +अपग्रेड फ़ाइलें कॉपी करने के बाद नया अनुमति क्षेत्र दर्ज करने के लिए व्यवस्थापक के रूप में प्लगइन पृष्ठ खोलें। **कॉन्फ़िगरेशन > उपयोगकर्ता** या उपयोगकर्ता समूहों में Operator अनुमति स्पष्ट रूप से दें। अपग्रेड मौजूदा View और Admin क्षेत्र के ID और अनुदान सुरक्षित रखते हैं। हर अनुरोध में Admin को Operator और Operator को View पहुँच विरासत में मिलती है; इससे उपयोगकर्ता या समूह में संग्रहीत अनुदान नहीं जुड़ते। प्लगइन सेटिंग के लिए Cacti की Settings अनुमति के अतिरिक्त SmokePing Admin भी आवश्यक है। + +Cacti डिवाइस अनुमतियाँ अब भी हर उपयोगकर्ता के लिए उपलब्ध पंक्तियाँ और कार्रवाइयाँ सीमित करती हैं; अनमैप ऑब्जेक्ट के लिए व्यवस्थापक चाहिए। क्रेडेंशियल, कॉन्फ़िगरेशन, मैपिंग, हटाना और अन्य प्रशासनिक बदलाव प्रशासनिक पृष्ठों में ही रहते हैं। पुष्टि केवल वर्तमान उपयोगकर्ता के सत्र में, अधिकतम एक घंटे तक और उसी अवलोकन के ताज़ा रहने तक रहती है। नए या बदले अवलोकन उसे अमान्य कर देते हैं। यह कभी विफल माप को स्वस्थ नहीं बताती या अलर्ट नहीं दबाती। + + +## स्क्रीनशॉट + +चालू SmokePing 2.8.2 नेटवर्क से Cacti 1.2.31 में आयात, पिछले 12 घंटे। हर लक्ष्य के उपकरण में मास्टर का एक स्मोक ग्राफ़ और हर स्लेव (`lon1`, `sgp1`) का एक ग्राफ़ होता है, जो ग्राफ़ ट्री में उसके SmokePing अनुभाग में रखे जाते हैं। + +![Bangalore लक्ष्य का Cacti ट्री: मास्टर तथा lon1 और sgp1 स्लेव के स्मोक ग्राफ़](../../images/screenshot-tree-asia.png) + +![London लक्ष्य का Cacti ट्री: उसी क्षेत्र का lon1 स्लेव माइक्रोसेकंड विलंब और दिखने वाला स्मोक दर्शाता है](../../images/screenshot-tree-europe.png) + + +## क्यों + +SmokePing विलंब वितरण और पैकेट हानि अच्छी तरह मापता है; इसके स्मोक ग्राफ़ वे बदलाव दिखाते हैं जिन्हें औसत वाला ग्राफ़ छिपाता है। Cacti के साथ चलाने पर तीन कमियाँ रहती हैं: + +- **अलग पहुँच नियंत्रण।** SmokePing CGI को Cacti उपयोगकर्ताओं, समूहों और उपकरण अनुमतियों की जानकारी नहीं होती। +- **उपकरण संदर्भ नहीं।** एक उपकरण का विलंब और इंटरफ़ेस काउंटर अलग-अलग औज़ारों में रहते हैं। +- **Cacti अलर्ट से एकीकरण नहीं।** Thold और Maint Cacti डेटा स्रोतों और उपकरणों पर काम करते हैं, इसलिए SmokePing अलर्ट अलग से कॉन्फ़िगर और दबाए जाते हैं। + +प्लगइन हर SmokePing लक्ष्य को मौजूदा SmokePing RRD फ़ाइलों की ओर संकेत करने वाले Cacti ऑब्जेक्ट और कुछ पोल किए गए सारांश मानों से दर्शाकर ये कमियाँ पूरी करता है। यह Cacti के ग्राफ़, अनुमतियाँ, Thold और Maint का पुनः उपयोग करता है। Cacti दूरस्थ डेटा संग्रहकर्ताओं का समर्थन चरण 3 में नियोजित है और इस संस्करण में नहीं है। + + +## दायरा और स्थिति + +| चरण | दायरा | माइलस्टोन | स्थिति | +|---|---|---|---| +| 0, शोध | संगतता तालिका, मूल व्यवहार की पुष्टि, ग्राफ़ समानता प्रोटोटाइप | [M1](https://github.com/somethingwithproof/plugin_smokeping/milestone/1) | परिणाम `docs/research` में; कुछ शोध मुद्दे खुले हैं | +| 1, अवलोकन | इन्वेंटरी आयात, Cacti उपकरण, स्मोक और सारांश ग्राफ़, Thold अलर्ट, Maint दमन, स्वास्थ्य पृष्ठ | [M2](https://github.com/somethingwithproof/plugin_smokeping/milestone/2), [M3](https://github.com/somethingwithproof/plugin_smokeping/milestone/3), [M4](https://github.com/somethingwithproof/plugin_smokeping/milestone/4) | 1.0.0-rc.1 में प्रकाशित; पायलट शेष | +| 2, प्रबंधित | Cacti के स्वामित्व वाला कॉन्फ़िगरेशन नामस्थान, ICMP और TCP प्रोब प्रोफ़ाइल, संशोधन, सत्यापन, रीलोड, रोलबैक | [M5](https://github.com/somethingwithproof/plugin_smokeping/milestone/5) | नियोजित, शुरू नहीं | +| 3, दूरस्थ | Cacti दूरस्थ संग्रहकर्ताओं पर SmokePing, मापन स्थानों के रूप में स्लेव | [M6](https://github.com/somethingwithproof/plugin_smokeping/milestone/6) | नियोजित, शुरू नहीं | + +दायरे से बाहर: अपना अलर्ट इंजन, रिपोर्टिंग इंजन, कस्टम डेमन या नेटवर्क प्रोटोकॉल, प्रबंधित HTTP/DNS/सेवा जाँच (servcheck इन्हें संभालता है), और SmokePing RRD फ़ाइलों में लिखना। + + +## संगतता लक्ष्य + +| घटक | लक्ष्य | +|---|---| +| Cacti | 1.2.x में 1.2.31 या बाद का, कोर पैच के बिना | +| PHP | 8.2 या बाद का; `setup.php` को 8.0 भी पार्स कर सकता है, ताकि असमर्थित रनटाइम Cacti UI तोड़े बिना अस्वीकार हो | +| SmokePing | 2.9.0, 2.8.2, और 2.7.3 (केवल Ubuntu 22.04, 2027-06-01 तक) | +| Thold, Maint | कोई बदलाव आवश्यक नहीं | +| शृंखलाएँ | प्रति इंस्टॉलेशन 10,000, 20 पिंग और 300 सेकंड चरण के साथ ([प्रदर्शन](docs/performance.md#supported-series-count)) | + + +## दस्तावेज़ + +| | | +|---|---| +| [स्थापना](docs/install.md) | आवश्यकताएँ, डेटा डायरेक्टरी का केवल-पठन माउंट, स्थापना, कंटेनर, समर्थित संस्करण | +| [संचालन](docs/operations.md) | हर स्थिति का अर्थ और प्रमाण, स्वास्थ्य जाँच, इनपुट विफलता का व्यवहार | +| [Cacti में लक्ष्य जोड़ना](docs/provisioning.md) | एक लक्ष्य, कई उपकरण, पुनः संबद्ध करना, अनुमतियाँ | +| [अलर्ट](docs/alerting.md) | सारांश मान, Thold अवधि, पुराने और देर से आए डेटा, SmokePing अलर्ट का दोहराव, Maint | +| [कॉन्फ़िगरेशन प्रारूप](docs/configuration-format.md) | YAML और XML निर्यात तथा आयात | +| [बैकअप और बहाली](docs/backup-restore.md) | क्या बैकअप लें और बहाली के बाद काम कैसे जारी होता है | +| [प्रदर्शन](docs/performance.md) | 100, 1,000 और 10,000 शृंखलाओं पर स्थानीय तथा रिलीज़ रनर माप; प्रति इंस्टॉलेशन 10,000 समर्थित | +| [विफलता परीक्षण](../../failure-qualification.md) | विफलता परिदृश्य और हर एक का परीक्षण | +| [रिलीज़ प्रक्रिया](../../RELEASING.md) | पुल अनुरोध, हस्ताक्षरित टैग, वर्कफ़्लो और परिणाम जाँचने की प्रक्रिया | +| [रिलीज़ आर्काइव](../../release.md) | संस्करण, परिवर्तन सूची और वितरित आर्काइव | +| [परीक्षण](../../testing.md) | सूट, CI में चलने वाले परीक्षण, वास्तविक SmokePing पर लाइव सूट | + + +## डिज़ाइन + +- [docs/PLAN.md](../../PLAN.md) पूरी योजना है: वास्तुकला, निर्भर मूल तथ्य (स्रोत सहित), स्थिति मॉडल, सुरक्षा सीमाएँ, प्रदर्शन गणना, परीक्षण और जोखिम। +- [docs/decisions/](../../decisions) में लिए जा चुके वास्तुकला निर्णयों के अभिलेख हैं। +- [docs/REQUIREMENTS.md](../../REQUIREMENTS.md) हर आवश्यकता ID को उसके मुद्दे से जोड़ता है। + +```mermaid +flowchart LR + SP[SmokePing daemon] --> RRD[(RRD files)] + RRD -->|read-only| R[Reader on the adjacent Cacti poller] + RRD -->|read-only| G[Cacti graph templates] + R --> SS[Script server summary data sources] + SS -->|poller_output| T[Thold and Maint] + G --> P[Cacti graph permissions] +``` + + +## काम का अनुश्रवण + +- **माइलस्टोन** प्लान का अनुसरण करते हैं। हर माइलस्टोन की एक एपिक इश्यू में उप-इश्यू और समापन प्रमाण हैं। +- **इश्यू** लेबल से वर्गीकृत हैं: `type: requirement`, `type: research`, `type: decision`, `type: epic`। आवश्यकता इश्यू में क्रमांकित, परीक्षण योग्य आवश्यकताएँ (`REQ-AREA-NNN`) और स्वीकृति मानदंड हैं। +- **लेबल** में `area:`, `phase:`, `priority:` और `status:` भी हैं। [CONTRIBUTING.md](../../../CONTRIBUTING.md#labels) देखें। +- [परियोजना बोर्ड](https://github.com/users/somethingwithproof/projects/6) सभी माइलस्टोन की इश्यू दिखाता है। + + +## योगदान + +[CONTRIBUTING.md](../../../CONTRIBUTING.md) पढ़ें। कमिट में DCO sign-off आवश्यक है। डिज़ाइन चर्चा इश्यू में होती है; खुले निर्णयों पर `type: decision` लेबल है। + + +## सुरक्षा + +कमज़ोरियाँ निजी रूप से रिपोर्ट करें; [SECURITY.md](../../../SECURITY.md) देखें। + + +## लाइसेंस + +GNU General Public License v2.0, वही लाइसेंस जो Cacti और उसके प्लगइन का है। [LICENSE](../../../LICENSE) देखें। diff --git a/docs/i18n/hi-IN/docs/alerting.md b/docs/i18n/hi-IN/docs/alerting.md new file mode 100644 index 0000000..0a0af46 --- /dev/null +++ b/docs/i18n/hi-IN/docs/alerting.md @@ -0,0 +1,63 @@ + + + +# Thold और Maint से SmokePing डेटा पर अलर्ट + +प्लगइन अलर्ट नहीं भेजता। यह हर लक्ष्य स्थान के लिए Cacti को पोल किया जाने वाला «SmokePing Summary» डेटा स्रोत देता है, और Thold तथा Maint उस पर किसी भी दूसरे स्रोत की तरह काम करते हैं ([ADR 0002](../../../decisions/0002-alert-through-cacti-data-sources.md))। दोनों प्लगइन में बदलाव की जरूरत नहीं। यह पृष्ठ ऑपरेटरों को बताता है कि स्रोत क्या रिपोर्ट करता है और इस तरीके की सीमाएँ कहाँ हैं। + + +## डेटा स्रोत क्या रिपोर्ट करता है + +हर सारांश स्रोत को Cacti पोलर स्क्रिप्ट सर्वर के जरिए पोल करता है। स्क्रिप्ट केवल रीडर कैश की एक पंक्ति पढ़ती है: Cacti पोलिंग के दौरान यह कभी RRD फ़ाइल नहीं खोलती या SmokePing से संपर्क नहीं करती। + +| डेटा स्रोत | अर्थ | कब `U` (अज्ञात) होता है | +|---|---|---| +| `median` | पिछले पूर्ण चक्र का मध्यिका आने-जाने का समय, मिलीसेकंड में | चक्र SmokePing heartbeat (`step` का दोगुना) से पुराना है, RRD नहीं है या कभी अपडेट नहीं हुआ, या चक्र में मध्यिका नहीं थी (पूर्ण हानि) | +| `loss_pct` | पिछले पूर्ण चक्र के लिए `loss / pings x 100` | चक्र heartbeat से पुराना है, RRD नहीं है या कभी अपडेट नहीं हुआ, या चक्र में हानि मान नहीं लिखा गया | +| `age` | RRD के अंतिम अपडेट से बीते सेकंड | RRD मौजूद नहीं है, या रीडर के पास उसकी कैश पंक्ति नहीं है | + +डेटा अनुपस्थित होने पर `median` और `loss_pct` कभी `0` नहीं होते। इसलिए बंद संग्रहकर्ता को शून्य हानि नहीं माना जाता। RRD मौजूद रहने तक `age` संख्यात्मक रहता है, अन्य दोनों के `U` हो जाने के बाद भी, ताकि पुराने डेटा पर अलर्ट हो सके। बनी हुई लेकिन कभी अपडेट न की गई फ़ाइल के लिए प्लगइन द्वारा लक्ष्य पहली बार देखे जाने से बीता समय मिलता है। + +`step + freshness allowance` से लेकर `step` के दोगुने तक पुराना चक्र «विलंबित» है: उसके मान अभी भी रिपोर्ट होते हैं। पूर्ण हानि में `loss_pct` 100 और `median` `U` होता है। + +सारांश स्रोत को उसी Cacti पोलर से पोल करना चाहिए जो रीडर चलाता है («SmokePing Poller» सेटिंग), क्योंकि कैश उसी पोलर के डेटाबेस में रहता है। दूसरे पोलर को सौंपे उपकरण पर सारांश स्रोत बनाने से प्लगइन इनकार करता है और उचित पोलर बताता है। + + +## थ्रेशोल्ड + +Thold टेम्पलेट से या हर डेटा स्रोत पर `loss_pct`, `median` और `age` के Thold थ्रेशोल्ड बनाएँ। सामान्य मान: + +| किसका अलर्ट | थ्रेशोल्ड | टिप्पणियाँ | +|---|---|---| +| पैकेट हानि | `loss_pct` उच्च सीमा 5 से 10 | पूर्ण हानि 100 है | +| विलंब | `median` उच्च सीमा आपकी ms सीमा पर | `U` से विलंब अलर्ट नहीं आता | +| संग्रहकर्ता बंद या धीमा | `age` उच्च सीमा `step` के 2 से 3 गुने पर | बंद संग्रहकर्ता रिपोर्ट करने वाला एकमात्र मान | + +मान `U` हो तो `median` या `loss_pct` थ्रेशोल्ड नहीं चलता। «SmokePing ने मापन बंद कर दिया» के लिए `age` इस्तेमाल करें। + + +## सीमाएँ + +ये Cacti और SmokePing की सैंपलिंग से आती हैं, प्लगइन से नहीं, और प्लगइन इन्हें हटा नहीं सकता। + +**Thold अवधि कम से कम एक `step` होनी चाहिए।** Cacti अपने अंतराल पर पोल करता है और SmokePing अपने `step` पर मापता है। Cacti अंतराल `step` से छोटा हो तो एक ही चक्र कई बार रिपोर्ट होता है। बड़ा हो तो चक्र छूटते हैं। इसलिए सीमा से बाहर एक सैंपल का अर्थ सीमा से बाहर एक चक्र नहीं है; Thold ट्रिगर अवधि कम से कम एक `step` रखें (डिफ़ॉल्ट 300 सेकंड चरण और 300 सेकंड पोलर अंतराल पर, 2 पोल का ट्रिगर)। `step` से छोटी अवधि एक चक्र को दो बार गिनकर अलर्ट दे सकती है। + +**स्लेव का देर से आया डेटा कभी अलर्ट दोबारा नहीं चलाता या बंद नहीं करता।** SmokePing स्लेव वे परिणाम कैश करके दोबारा भेजता है जिन्हें वह पहुँचा नहीं सका, और मास्टर उन्हें टाइमस्टैम्प क्रम में लागू करता है; इसलिए पिछले समयखंड का डेटा देर से आ सकता है। Thold पोल करते समय मानों का मूल्यांकन करता है। देर से आया चक्र RRD और ग्राफ़ अपडेट करता है, लेकिन Thold द्वारा पहले जाँचा मान नहीं बदलता; इसलिए छूटा अलर्ट नहीं आएगा और खुला अलर्ट बंद नहीं होगा। स्लेव पीछे चल रहा हो तो उस स्थान का `age` बढ़ता है और विलंब दिखता है। + +**अलर्ट केवल सारांश देखते हैं।** मध्यिका, हानि और आयु अंतिम चक्र का वर्णन करते हैं। वितरण जाँचने के लिए स्मोक ग्राफ़ देखें। + +**SmokePing के अपने अलर्ट अलग हैं।** SmokePing कॉन्फ़िगरेशन का `alerts` अनुभाग काम करता रहता है। SmokePing और Thold दोनों में अलर्ट वाला लक्ष्य, दोनों की शर्तें पूरी होने पर, एक समस्या के लिए दो सूचनाएँ भेज सकता है; प्लगइन किसी को बंद नहीं करता। स्वास्थ्य पृष्ठ ऐसे लक्ष्य `dual_alerting` में दिखाता है, इन्वेंटरी द्वारा पढ़े `alerts` मान से, जिसे SmokePing की तरह ही विरासत में लिया जाता है। + +**Cacti RRD एक प्रति है।** सारांश मान SmokePing के RRD के साथ Cacti के अपने RRD में भी रहते हैं, इसलिए दोनों के प्रतिधारण या समेकन में अंतर ग्राफ़ों में दिख सकता है। + + +## रखरखाव + +लक्ष्य उपकरण पर «Cacti device» प्रकार का Maint शेड्यूल उस उपकरण की Thold सूचनाएँ दबाता है। Thold मूल्यांकन करता रहता है और प्लगइन सारांश स्रोत भरता रहता है, इसलिए ग्राफ़ और `age` में अंतराल नहीं आता। शेड्यूल समाप्त होने पर सीमा अभी भी पार हो तो ट्रिगर गिनती दोबारा पूरी होने के बाद सूचनाएँ फिर शुरू होती हैं: रखरखाव के दौरान Thold उल्लंघन नहीं गिनता। + +Maint केवल उपकरण समझता है, अलग लक्ष्य नहीं। कई लक्ष्य रखने वाला उपकरण उन सभी के लिए मौन हो जाता है। लक्ष्य-स्तरीय शेड्यूल के लिए नया Maint शेड्यूल प्रकार चाहिए और वह इस प्लगइन का हिस्सा नहीं है। + + +## सत्यापन + +`tests/run-alert-e2e.sh` Cacti 1.2.31 और प्लगइन कार्यक्षेत्र की `plugin_thold` व `plugin_maint` प्रतियों वाले कंटेनर में पूरा मार्ग चलाता है: परीक्षण संग्रहकर्ता SmokePing संरचना वाले RRD में चक्र जोड़ता है, रीडर उन्हें कैश करता है, `poller.php` स्क्रिप्ट सर्वर से सारांश स्रोत पोल करता है, और Thold व Maint उस पर काम करते हैं। यह जाँचता है कि `loss_pct` थ्रेशोल्ड ट्रिगर गिनती के बाद चलता और ठीक होता है, Maint उपकरण शेड्यूल सूचना दबाता है जबकि पोलिंग जारी रहती है, रखरखाव समाप्त होने पर अलर्ट चलता है, और परीक्षण संग्रहकर्ता रुकने पर `age` थ्रेशोल्ड चलता तथा फिर शुरू होने पर ठीक होता है। diff --git a/docs/i18n/hi-IN/docs/backup-restore.md b/docs/i18n/hi-IN/docs/backup-restore.md new file mode 100644 index 0000000..38439c3 --- /dev/null +++ b/docs/i18n/hi-IN/docs/backup-restore.md @@ -0,0 +1,98 @@ + + + +# बैकअप और बहाली + +बहाल किया गया Cacti और SmokePing संयोजन तब काम करता रहता है जब तीन चीजें साथ बहाल हों: Cacti डेटाबेस, SmokePing कॉन्फ़िगरेशन और SmokePing डेटा डायरेक्टरी। यह पृष्ठ बताता है कि इनमें क्या है, बैकअप कैसे लें, बहाली के बाद क्या करें और डेटाबेस खोने पर प्लगइन की अपनी कॉन्फ़िगरेशन YAML निर्यात से कैसे बहाल करें। + + +## किसका बैकअप लें + +| वस्तु | सामग्री | प्लगइन को क्यों चाहिए | +|---|---|---| +| Cacti डेटाबेस | प्लगइन तालिकाएँ (लक्ष्य, मैपिंग, बनाए ऑब्जेक्ट, रीडर कैश, स्वास्थ्य), Cacti उपकरण, डेटा स्रोत, ग्राफ़ और प्लगइन सेटिंग | मैपिंग, स्रोत पथ और ग्राफ़ परिभाषाएँ यहाँ रहती हैं | +| SmokePing कॉन्फ़िगरेशन: `/etc/smokeping/config` **और उसमें शामिल हर फ़ाइल** (`@include` पंक्तियाँ, Debian और Ubuntu पर `config.d/*`, `secrets` फ़ाइल, `smokemail`, `basepage.html`) | लक्ष्य ट्री | इन्वेंटरी इसे पार्स करती है। लक्ष्य की पहचान इस ट्री में उसका पथ है और उसकी RRD फ़ाइल `datadir/.rrd` है | +| SmokePing डेटा डायरेक्टरी (`datadir`) | RRD फ़ाइलें | हर ग्राफ़ और सारांश मान इन्हें पढ़ता है; यही इतिहास हैं। इन्हें फिर नहीं बनाया जा सकता | + +प्लगइन सेटिंग डेटाबेस में हैं। [नीचे](#restore-from-the-yaml-export) बताया निर्यात प्लगइन की अपनी कॉन्फ़िगरेशन की दूसरी, पाठ प्रति है; यह इन तीनों में से किसी का विकल्प नहीं है। + + +## बैकअप लेना + +डेटाबेस डंप और फ़ाइल प्रतियाँ लगभग एक साथ लें, ताकि डेटाबेस के लक्ष्य और डिस्क की फ़ाइलें एक ही कॉन्फ़िगरेशन दर्शाएँ। + +```sh +# The Cacti database (use your own credentials file or option file, not a password on the command line) +mariadb-dump --defaults-extra-file=/root/.cacti-backup.cnf --single-transaction cacti > cacti.sql + +# SmokePing's configuration, with its included files +tar -czf smokeping-config.tgz -C /etc/smokeping . + +# SmokePing's data directory +tar -czf smokeping-datadir.tgz -C /var/lib/smokeping . + +# The plugin's own configuration, as YAML (optional second copy) +php /var/www/html/cacti/plugins/smokeping/cli/smokeping.php export --file=/var/backups/smokeping-config.yaml +``` + +अपने वितरण का `datadir` इस्तेमाल करें (EL और Fedora पर `/var/lib/smokeping/rrd`)। SmokePing RRD फ़ाइलों में लगातार लिखता है। चलते समय ली गई प्रति में फ़ाइल आंशिक अपडेट के बीच हो सकती है; संगत प्रति के लिए फ़ाइल सिस्टम या वॉल्यूम स्नैपशॉट लें, या प्रति बनाते समय SmokePing रोकें (`systemctl stop smokeping`; इससे मापों में अंतराल आता है, इतिहास नहीं खोता)। डेटा डायरेक्टरी में अन्य डायरेक्टरियाँ हो सकती हैं (Debian पर `__cgi`, Alpine पर `images`); इन्हें शामिल करना या छोड़ना दोनों सुरक्षित हैं। + +प्लगइन SmokePing की फ़ाइलों में कभी नहीं लिखता, इसलिए डेटा डायरेक्टरी की बहाली का प्लगइन के डेटा से अंतर केवल नीचे की मैपिंग के कारण हो सकता है। + + +## बहाली + +1. [स्थापना मार्गदर्शिका](install.md) के अनुसार Cacti, PHP और SmokePing स्थापित करें और रिलीज़ आर्काइव से वही या नया प्लगइन संस्करण लें। +2. Cacti डेटाबेस बहाल करें। +3. SmokePing कॉन्फ़िगरेशन और डेटा डायरेक्टरी को बैकअप वाले पथों पर बहाल करें और SmokePing शुरू करें। +4. डेटा डायरेक्टरी को प्लगइन के माउंट पथ पर केवल-पठन माउंट करें ([स्थापना मार्गदर्शिका, चरण 3](install.md#3-mount-the-data-directory-read-only-inside-cactis-rra-path))। +5. पोलर को चलने दें या एक बार `php plugins/smokeping/poller_smokeping.php --force --inventory` चलाएँ। + +और कुछ जरूरी नहीं। प्लगइन फ़ाइलें बहाल डेटाबेस से नई हों तो अगले पृष्ठ लोड या पोलर चक्र पर वह अपनी तालिकाएँ माइग्रेट करता है और सभी चरण सफल होने पर ही संस्करण दर्ज करता है। + +इससे क्या बहाल होता है और क्यों काम करता है: + +- **मैपिंग उन्हीं RRD फ़ाइलों तक पहुँचती है।** स्रोत पथ `/smokeping/.rrd` माउंट के सापेक्ष है, इसलिए होस्ट या Cacti डायरेक्टरी बदलने पर नहीं बदलता। लक्ष्य की पहचान SmokePing ट्री का पथ है, डेटाबेस ID नहीं; बहाल कॉन्फ़िगरेशन में वही ट्री है। +- **रीडर फिर चलता है।** कैश में हर फ़ाइल का अंतिम देखा चक्र रहता है; अगली बार हर फ़ाइल का `lastupdate` पढ़कर पंक्ति बदलता है। Cacti बंद रहने पर SmokePing द्वारा लिखा चक्र पहली बार में मिल जाता है और हर शृंखला की ताज़गी फ़ाइल के अपने समय से निकलती है, रीडर के अंतिम देखने के समय से नहीं। +- **ग्राफ़ बनते हैं।** ये बहाल स्रोतों और फ़ाइलों पर सामान्य Cacti ग्राफ़ हैं। + +**SmokePing Health** पर परिणाम देखें: एक पोलर चक्र बाद माउंट, रीडर और इन्वेंटरी OK हैं और SmokePing पृष्ठ मैप किए लक्ष्य वर्तमान ताज़गी के साथ दिखाता है। + + +### डेटाबेस SmokePing कॉन्फ़िगरेशन से पुराना बहाल हो तो + +डेटाबेस बैकअप के बाद SmokePing में जोड़ा लक्ष्य बहाल डेटाबेस में नहीं होगा। अगली इन्वेंटरी उसे ढूँढ़कर बिना मैपिंग दिखाती है। तब से हटाया लक्ष्य गायब चिह्नित होता है और व्यवस्थापक सामान्य रूप से फिर जोड़ता या संग्रहित करता है। कुछ खोता नहीं: फ़ाइलें डेटा डायरेक्टरी में हैं और **SmokePing Inventory** पर एक क्लिक से मैपिंग हो जाती है। + + +### डेटा डायरेक्टरी नवीनतम चक्रों के बिना बहाल हो तो + +SmokePing बहाल फ़ाइलों के अंतिम अपडेट से उनमें लिखना जारी रखता है। ग्राफ़ का अंतराल बैकअप और बहाली के बीच का अंतराल है। + + +## YAML निर्यात से बहाल करना + +Cacti डेटाबेस खो जाए और केवल निर्यात बचे तो प्लगइन के लक्ष्य और मैपिंग उसके बिना वापस लाए जा सकते हैं तथा स्रोत और ग्राफ़ फिर बनाए जा सकते हैं: + +1. नए होस्ट पर Cacti और प्लगइन स्थापित करें, SmokePing कॉन्फ़िगरेशन और डेटा डायरेक्टरी बहाल करके ऊपर की तरह माउंट करें। Settings पृष्ठ पर पथ सेट करें (वे आयात नहीं होते; [प्रारूप](configuration-format.md) देखें)। +2. **पहले जैसे होस्ट नाम और विवरण** के साथ Cacti उपकरण फिर बनाएँ। ID अलग हो सकते हैं। निर्यात हर मैप किए उपकरण को इन दो मानों से पहचानता है। +3. निर्यात जाँचें और लागू करें: + + ```sh + php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml + php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml --apply --confirm= + ``` + + जाँच प्रस्तावित बदलाव दिखाती है और अनुपस्थित या अस्पष्ट उपकरण की मैपिंग अस्वीकार करती है। दूसरे कमांड तक कुछ नहीं लिखा जाता; उसे पहले द्वारा दिया योजना ID चाहिए। +4. हर मैप किए लक्ष्य के स्रोत और ग्राफ़ फिर बनाएँ: `php plugins/smokeping/cli/smokeping.php provision --device=`। वे पहले वाली फ़ाइलों की ओर संकेत करते हैं। + +निर्यात में प्लगइन सेटिंग, लक्ष्य और मैपिंग हैं। स्रोत, ग्राफ़ या RRD पथ नहीं हैं, इसलिए चरण 4 जरूरी है; डेटाबेस बैकअप से बहाली में इसकी जरूरत नहीं। + + +## अनइंस्टॉल करना + +अनइंस्टॉल YAML निर्यात का प्रयास करता है ([स्थापना मार्गदर्शिका](install.md#upgrading-and-removing) देखें), लेकिन निर्यात विफल होने पर भी रुकता नहीं। **अनइंस्टॉल से पहले स्वयं कॉन्फ़िगरेशन निर्यात करें और सत्यापित करें कि बैकअप पढ़ने योग्य और पूर्ण है।** अनइंस्टॉल SmokePing फ़ाइलें कभी नहीं छूता; ऊपर बताए तरीके से अपने सत्यापित निर्यात से बहाली करें। + + +## सत्यापन + +`sh tests/run-restore-e2e.sh ` दोनों बहालियाँ नए कंटेनरों और डेटाबेसों में चलाता है: चालू इंस्टॉलेशन पर उपकरण और स्रोत तैयार करता है, डेटाबेस डंप तथा SmokePing कॉन्फ़िगरेशन और डेटा आर्काइव बनाता है, SmokePing के नया चक्र लिखते समय तीनों को नए कंटेनरों में बहाल करता है, और जाँचता है कि प्लगइन सक्षम है व अपग्रेड कोई बदलाव नहीं करता, हर मैपिंग, उपकरण और स्रोत पथ समान है, हर स्रोत माउंट के अंदर बैकअप से समान चेकसम वाली फ़ाइल तक पहुँचता है, ग्राफ़ बनता है और एक पोलर चक्र बाद रीडर कैश में नया चक्र है। फिर केवल YAML निर्यात से नए डेटाबेस पर बहाली करता है और जाँचता है कि मैपिंग उपकरण नाम का अनुसरण करे, इन्वेंटरी उसे बनाए रखे और प्रोविज़निंग उन्हीं फ़ाइलों पर स्रोत फिर बनाए। diff --git a/docs/i18n/hi-IN/docs/configuration-format.md b/docs/i18n/hi-IN/docs/configuration-format.md new file mode 100644 index 0000000..ba62c3c --- /dev/null +++ b/docs/i18n/hi-IN/docs/configuration-format.md @@ -0,0 +1,121 @@ + + + +# कॉन्फ़िगरेशन फ़ाइल प्रारूप + +प्लगइन की अपनी कॉन्फ़िगरेशन एक फ़ाइल प्रारूप में आयात और निर्यात होती है, जिसके दो रूप हैं: YAML (डिफ़ॉल्ट) और XML। यह पृष्ठ स्कीमा संस्करण 1 परिभाषित करता है। डिज़ाइन के कारण [निर्णय 0008](../../../decisions/0008-yaml-and-xml-configuration-files.md) में हैं। + +फ़ाइल में प्लगइन सेटिंग, प्लगइन द्वारा पढ़े गए SmokePing लक्ष्य (अवलोकित लक्ष्य), और हर लक्ष्य का मैप किया Cacti उपकरण होता है। डेटा स्रोत, ग्राफ़, RRD पथ या क्रेडेंशियल नहीं होते। Cacti ग्राफ़, डेटा और होस्ट टेम्पलेट अलग हैं और Cacti XML ही रहते हैं। + + +## कमांड + +```sh +php plugins/smokeping/cli/smokeping.php export # YAML to standard output +php plugins/smokeping/cli/smokeping.php export --format=xml --file=/var/backups/smokeping-config.xml +php plugins/smokeping/cli/smokeping.php import --file=smokeping-config.yaml # check only +php plugins/smokeping/cli/smokeping.php import --file=smokeping-config.yaml --apply --confirm= +``` + +`export --file` केवल मालिक के पढ़ने योग्य नई फ़ाइल बनाता है और मौजूदा फ़ाइल बदलने से इनकार करता है। `--apply` के बिना `import` फ़ाइल पढ़ता और जाँचता है, हर प्रस्तावित बदलाव और योजना ID दिखाता है, कुछ नहीं लिखता। `--apply` के लिए उसी ID वाला `--confirm` चाहिए; यह एक ट्रांज़ैक्शन में लागू होता है और जाँच के बाद फ़ाइल या इंस्टॉलेशन बदल गया हो तो इनकार करता है। निकास स्थिति: 0 पूर्ण, 1 अस्वीकार या विफल, 2 फ़ाइल या योजना में त्रुटियाँ। + +यही क्रियाएँ **Management > SmokePing Configuration** (SmokePing Admin क्षेत्र) में हैं: निर्यात डाउनलोड करें, जाँच के लिए फ़ाइल चुनें, सूचीबद्ध बदलाव देखें और लागू करें। + +आयात केवल जोड़ता और अपडेट करता है। यह कभी लक्ष्य नहीं हटाता, मैपिंग दूसरे उपकरण पर नहीं ले जाता (Inventory पृष्ठ पर फिर जोड़ें), स्रोत, ग्राफ़ या RRD फ़ाइल नहीं बनाता और SmokePing डेटा डायरेक्टरी को पढ़ता या लिखता नहीं। अनइंस्टॉल कॉन्फ़िगरेशन का YAML निर्यात **Backup Directory** सेटिंग में, या खाली होने पर Cacti डायरेक्टरी के `cache/smokeping/` में लिखता है। फ़ाइल का नाम यादृच्छिक और मोड `0600` है; डिफ़ॉल्ट डायरेक्टरी में सबको रोकने वाला `.htaccess` और कुछ न परोसने वाला `index.php` है। Backup Directory मौजूद न हो या लिखने योग्य न हो तो निर्यात नहीं लिखा जाता (प्लगइन डिफ़ॉल्ट पर नहीं लौटता); अनइंस्टॉल आगे बढ़कर बताता है कि फ़ाइल कहाँ गई या कोई फ़ाइल नहीं लिखी गई। वेब रूट के बाहर डायरेक्टरी चुनें। + + +## स्कीमा संस्करण 1 + +```yaml +schema_version: 1 # required; a higher number is refused + +settings: # optional; any subset of the settings below + smokeping_poller_id: 1 + smokeping_reader_budget: 120 + smokeping_inventory_interval: 300 + smokeping_freshness_allowance: 60 + smokeping_uninstall_keep_tables: false + +reference_settings: # optional; shown for reference, never imported + smokeping_config_file: /etc/smokeping/config + smokeping_backup_dir: '' + smokeping_datadir: /var/lib/smokeping + smokeping_mount_path: /var/www/html/cacti/rra/smokeping # omitted from exports while it is the default + +targets: # optional + - path: Europe/Paris # required; the SmokePing tree path + poller_id: 1 # default 1; must exist + host: paris.example.net + probe: FPing + menu: Paris # optional text + title: 'Paris: gateway' # optional text + slaves: # optional list of slave names + - site-b + nomasterpoll: false + step: 300 # 0 to 604800 + pings: 20 # 0 to 10000 + mode: observed # only observed + admin_state: enabled # enabled, disabled, or archived + present: true # honored for a new target only + +mappings: # optional + - target: Europe/Paris # a target in this file or already in the installation + poller_id: 1 + device: + hostname: paris-gw.example.net # the Cacti device's host name (not case sensitive) + description: Paris gateway # and its description (exact) +``` + +पहचान। लक्ष्य `poller_id` और `path` से पहचाना जाता है। उपकरण `hostname` और `description` से; यह जोड़ी किसी उपकरण में न मिले या एक से अधिक में मिले तो जाँच मैपिंग अस्वीकार करती है। आयात पाठ के आस-पास की रिक्त जगह हटाता है क्योंकि प्लगइन हर संग्रहित मान ऐसे ही पढ़ता है। + +आरक्षित कुंजियाँ। `managed_targets` और `probe_profiles` भविष्य के प्रबंधित मोड संस्करण के लिए आरक्षित हैं। संस्करण 1 कुंजी का नाम बताने वाली त्रुटि से इन्हें अस्वीकार करता है ताकि उस संस्करण की फ़ाइल कभी आधी लागू न हो। आगे का संस्करण इन्हें स्कीमा में जोड़ेगा; `schema_version` तभी बढ़ेगा जब यहाँ मौजूद किसी कुंजी का अर्थ बदले। + +अपडेट। पहले से मौजूद लक्ष्य के लिए आयात केवल `host`, `probe`, `menu`, `title`, `slaves`, `nomasterpoll`, `step`, `pings` और `admin_state` बदलता है। पहले छह फ़ील्ड का स्रोत SmokePing कॉन्फ़िगरेशन ही रहता है: अगली इन्वेंटरी उन्हें वापस लाती है। इसलिए आयात `admin_state` बहाल करने और नया इंस्टॉलेशन तैयार करने के लिए इस्तेमाल करें, लक्ष्य संपादित करने के लिए नहीं। + +सेटिंग मान बताए गए प्रकार के होने चाहिए। पाठ में नियंत्रण वर्ण नहीं हो सकते। + +केवल संदर्भ सेटिंग। फ़ाइल या डायरेक्टरी बताने वाली सेटिंग (ऊपर `reference_settings` की सभी) आयात से कभी नहीं लिखी जाती: फ़ाइल को प्लगइन की पढ़ने-लिखने की जगह बदलने नहीं देना चाहिए। स्कीमा इन्हें प्रकार से चिह्नित करता है; ऐसी सेटिंग `settings` में रखने वाली फ़ाइल अस्वीकार होती है। `reference_settings` में उनका रूप जाँचा जाता है (पूर्ण पथ, या जहाँ मान्य हो खाली), इंस्टॉलेशन से तुलना होती है और अलग होने पर योजना में `not applied, change on the Settings page` दिखता है। इन्हें Settings पृष्ठ पर बदलें। 1.0.0-rc.1 के निर्यात वहाँ `smokeping_perl_binary` और `smokeping_lib_dir` भी दिखाते हैं; ये सेटिंग अब नहीं हैं और आयात इन्हें छोड़ता है। + + +## XML + +```xml + + + + 1 + false + + + /var/lib/smokeping + + + + site-b + + + + + + + + +``` + +XML का ऊपर की YAML कुंजियों से एक-से-एक मेल है। बूलियन `true` या `false` हैं। रीडर कोई भी DOCTYPE या एंटिटी घोषणा अस्वीकार करता है, बाहरी संसाधन नहीं लाता और केवल ये तत्व स्वीकार करता है। + + +## YAML उपसमुच्चय + +रीडर ब्लॉक मैप, ब्लॉक सूची, साधारण तथा एकल/दोहरे उद्धरण वाले स्केलर, टिप्पणियाँ और `|` व `|-` शाब्दिक ब्लॉक स्वीकार करता है, शुरू में एक वैकल्पिक `---` सहित। दोहरे उद्धरण वाले स्केलर `\\ \" \/ \n \t \r \0 \b \f \e \xHH \uHHHH` एस्केप स्वीकार करते हैं; एकल उद्धरण वाले उद्धरण को दोहराते हैं (`''`)। उद्धृत स्केलर अपनी ही पंक्ति में बंद होता है। + +यह पंक्ति संख्या के साथ अस्वीकार करता है: एंकर (`&x`), उपनाम (`*x`), टैग (`!x`), फ़्लो संग्रह (`[a, b]`, `{a: b}`), फ़ोल्डेड ब्लॉक (`>`), कई दस्तावेज़, निर्देश, मर्ज कुंजियाँ (`<<`), जटिल कुंजियाँ (`?`), दोहराई कुंजियाँ, इंडेंट के लिए टैब, बहुपंक्ति साधारण स्केलर और 8 स्तर से गहरा नेस्टिंग। ऐसे साधारण स्केलर भी अस्वीकार होते हैं जिन्हें दूसरा YAML संस्करण पाठ के बजाय कुछ और पढ़े: `yes`, `no`, `on`, `off`, `y`, `n`, शुरू में शून्य वाले अंक, दशमलव, हेक्स, तिथियाँ और `1:30` जैसे समय। उन्हें उद्धृत करें (`'yes'`)। `true`, `false`, `null`, `~` और साधारण पूर्णांक अपना अर्थ रखते हैं। + +निर्यातक हर ऐसी स्ट्रिंग उद्धृत करता है जिसे रीडर गलत पार्स कर सकता हो, जैसे कोलन या `#`, आरंभ या अंत में रिक्त जगह, या ऐसा पहला वर्ण जिसे YAML संकेतक मानता हो। + + +## सीमाएँ + +दोनों प्रारूपों में फ़ाइल अधिकतम 8 MiB और नेस्टिंग 8 स्तर है, तथा एक पंक्ति अधिकतम 16 KiB। फ़ाइल पढ़ने से पहले आकार जाँचा जाता है। diff --git a/docs/i18n/hi-IN/docs/install.md b/docs/i18n/hi-IN/docs/install.md new file mode 100644 index 0000000..63d3ece --- /dev/null +++ b/docs/i18n/hi-IN/docs/install.md @@ -0,0 +1,214 @@ + + + +# SmokePing प्लगइन स्थापित करना + +यह मार्गदर्शिका Cacti 1.2 होस्ट और SmokePing इंस्टॉलेशन को शुरुआत से Cacti ग्राफ़ तक ले जाती है। इसमें प्लगइन, डेटा डायरेक्टरी की केवल-पठन पहुँच (सबसे अधिक गलती वाली जगह), सत्यापन, कंटेनर और समर्थन हैं। रोज़ का संचालन [संचालन](operations.md), अलर्ट [अलर्ट](alerting.md), बैकअप [बैकअप और बहाली](backup-restore.md) में हैं। + + +## क्या समर्थित है + +| घटक | समर्थित | यहाँ परीक्षित | +|---|---|---| +| Cacti | 1.2.31 और वर्तमान 1.2.x (1.2.32 स्रोत पथ जाँच बदलता है; नीचे माउंट देखें) | 1.2.31 रिलीज़ और 1.2.32 विकास प्रति | +| PHP | 8.2 या बाद का। 8.0/8.1 में स्थापना अस्वीकार, Cacti चालू रहता है | एकीकरण और एंड-टू-एंड के लिए 8.2.35; प्रवेश बिंदुओं का 8.0 सिंटैक्स लिंट | +| SmokePing | 2.9.0, 2.8.2, 2.7.3 (केवल Ubuntu 22.04, 2027-06-01 तक) | तीनों का कॉन्फ़िगरेशन पार्सर, मूल पार्सर से 2.7.3 (Ubuntu 22.04), 2.8.2 (Debian 13), 2.9.0 (Fedora 45) पर तुलना; तीनों की ग्राफ़ समानता | +| rrdtool | Cacti का संस्करण; रीडर `path_rrdtool` चलाता है | 1.7.2 | +| Thold, Maint | बदलाव नहीं चाहिए | प्लगइन कार्यक्षेत्र के संस्करण | +| शृंखला संख्या | प्रति इंस्टॉलेशन 10,000, 20 पिंग और 300 सेकंड चरण, चार समर्पित vCPU व 8 GB ([प्रदर्शन](performance.md#supported-series-count)) | रिलीज़ रनर पर 100, 1,000 और 10,000 | + +«शृंखला» एक स्थान (मास्टर या स्लेव) पर एक लक्ष्य है। वितरण समर्थन विक्रेताओं की पूर्ण समर्थन अवधि के अनुसार है; [वितरण तालिका](../../../research/distribution-matrix/README.md) देखें। Debian 13, Ubuntu 22.04 से 26.10, EL 9, Fedora 43 से 45, Alpine 3.22 से 3.24 में SmokePing पैकेज है। **EL 10 और openSUSE Leap 16 में SmokePing पैकेज नहीं**, इसलिए वहाँ प्लगइन उतना ही चलता है जितना स्रोत से स्थापित SmokePing; यह मार्गदर्शिका उसे नहीं बताती। + + +## हिस्से कैसे जुड़ते हैं + +SmokePing RRD लिखता है। Cacti ग्राफ़ बनाता और प्लगइन नवीनतम मान पढ़ता है; दोनों लिखते नहीं। Cacti 1.2.32 और बाद RRA के बाहर स्रोत पथ अस्वीकार करते हैं, इसलिए प्लगइन **Cacti RRA पथ के अंदर केवल-पठन माउंट** से डेटा दिखाता है, डिफ़ॉल्ट `/smokeping` ([निर्णय 0007](../../../decisions/0007-read-only-mount-under-rra-path.md))। यही फ़ाइलों की मुख्य सुरक्षा है: Cacti सफ़ाई इसके जरिए हटा या नाम नहीं बदल सकती। + +रीडर चलाने वाले Cacti पोलर को SmokePing होस्ट पर दो चीजें पढ़नी चाहिए: + +1. कॉन्फ़िगरेशन (`/etc/smokeping/config`) और शामिल फ़ाइलें, प्लगइन के अपने PHP पार्सर से। शामिल फ़ाइलें उसी डायरेक्टरी या नीचे हों; अन्य अस्वीकार। प्लगइन Perl नहीं चलाता और SmokePing Perl लाइब्रेरी नहीं चाहिए। +2. माउंट से डेटा डायरेक्टरी। + +अलग होस्ट हों तो डेटा केवल-पठन NFS से साझा करके SmokePing पोलर होस्ट पर माउंट करें; [संचालन](operations.md#topologies) देखें। Cacti दूरस्थ संग्रहकर्ता पर SmokePing बाद का चरण है, इस रिलीज़ में नहीं। + + +## 1. SmokePing स्थापित करें (यदि नहीं है) + +Debian 13 और Ubuntu पर: + + +```sh +apt-get update +DEBIAN_FRONTEND=noninteractive apt-get install -y smokeping +``` + +EL 9 पर (पैकेज EPEL में है और CodeReady Builder चाहिए): + + +```sh +dnf install -y epel-release +dnf config-manager --set-enabled crb +dnf install -y smokeping +``` + +सामान्य रूप से कॉन्फ़िगर कर `systemctl enable --now smokeping` चलाएँ। डेटा डायरेक्टरी Debian/Ubuntu/Alpine पर `/var/lib/smokeping`, EL/Fedora पर `/var/lib/smokeping/rrd` है। नीचे `DATADIR` वही है (`*** Database ***` अनुभाग का `datadir`) और `RRA` Cacti RRA पथ (Console > Configuration > Settings > Paths, «RRA Path»; उदाहरण में `/var/www/html/cacti/rra`)। + +**डेटा डायरेक्टरी में और क्या है।** Debian स्लेव कैश `DATADIR/__cgi/
/` (SmokePing `dyndir`) में रखता है और अनुभाग डायरेक्टरी खुद नहीं बनाता, इसलिए अभी तक रिपोर्ट न करने वाला स्लेव इसे खाली या अनुपस्थित छोड़ता है; Alpine चित्र कैश `DATADIR/images` में, और sorter कैश `DATADIR/__sortercache` में हैं। प्लगइन सब अनदेखा करता है: डायरेक्टरी सूची कभी नहीं पढ़ता, केवल कॉन्फ़िगरेशन वाली RRD (`
/.rrd`, हर स्लेव का `~.rrd`) पढ़ता है। न ये डायरेक्टरियाँ, न बिना लक्ष्य की RRD (जैसे `Local/LocalMachine.rrd`) पढ़ी, सूचीबद्ध या त्रुटि बताई जाती है। Debian 13 मास्टर और दो स्लेव पर जाँचा गया ([परीक्षण](../../../testing.md#the-live-suite))। + + +## 2. Cacti पोलर को SmokePing पढ़ने दें + +पैकेज वितरणों में RRD सभी के पढ़ने योग्य और ऊपर की डायरेक्टरियाँ सभी के गुजरने योग्य हैं, इसलिए पोलर उपयोगकर्ता को **किसी समूह सदस्यता की जरूरत नहीं**। कॉन्फ़िगरेशन Debian/Ubuntu/Alpine पर सभी पढ़ सकते हैं; EL/Fedora में `0640 root:apache`, केवल `apache` और root। + +पोलर उपयोगकर्ता बनकर जाँचें (`www-data` Debian/Ubuntu, `apache` EL/Fedora): + + +```sh +runuser -u "$POLLER_USER" -- test -r "$DATADIR" && echo "datadir readable" +runuser -u "$POLLER_USER" -- test -r /etc/smokeping/config && echo "config readable" +runuser -u "$POLLER_USER" -- ls "$DATADIR" > /dev/null && echo "datadir listable" +``` + +हर पंक्ति को प्रिंट करना चाहिए और पैकेज अनुमतियों में होता है: SmokePing होस्ट पर समूह या अन्य सेटअप नहीं चाहिए। तभी विफल जब अनुमतियाँ पैकेज से सख्त हों (जैसे `datadir` `0750 smokeping:smokeping`) या EL/Fedora में पोलर `apache` के अलावा हो, जहाँ कॉन्फ़िगरेशन `0640 root:apache` है। तब केवल उस उपयोगकर्ता को पढ़ने की पहुँच दें, जैसे कॉन्फ़िगरेशन डायरेक्टरी और `DATADIR` पर ACL (`setfacl -R -m u:$POLLER_USER:rX`); Cacti उपयोगकर्ता को SmokePing फ़ाइलें लिखने योग्य कभी न बनाएँ। + + +## 3. डेटा डायरेक्टरी Cacti RRA के अंदर केवल-पठन माउंट करें + +दो में से एक तरीका चुनें। दोनों bind mount बनाते हैं और एक बार root चाहिए। + + +### विकल्प A: `/etc/fstab` पंक्ति + + +```sh +mkdir -p "$RRA/smokeping" +echo "$DATADIR $RRA/smokeping none bind,ro 0 0" >> /etc/fstab +mount "$RRA/smokeping" +``` + +माउंट तुरंत और हर बूट पर लागू होता है। साधारण `mount --bind` से जाँचें तो remount जोड़ें क्योंकि पुराना `util-linux` पहले bind पर `ro` अनदेखा करता है: `mount -o remount,bind,ro "$RRA/smokeping"`। + + +### विकल्प B: systemd `.mount` यूनिट + +फ़ाइल नाम माउंट पथ में `/` की जगह `-` होना चाहिए; systemd से निकालें: + + +```sh +unit=$(systemd-escape --path --suffix=mount "$RRA/smokeping") +cat > "/etc/systemd/system/$unit" < +### माउंट सत्यापित करें + + +```sh +findmnt -no TARGET,SOURCE,OPTIONS "$RRA/smokeping" +findmnt -no OPTIONS "$RRA/smokeping" | tr ',' '\n' | grep -x ro +touch "$RRA/smokeping/.cacti-write-test" && echo "WRITABLE: fix the mount before continuing" || echo "read-only, as required" +ls "$RRA/smokeping" | head +``` + +`ro` दिखना चाहिए, `touch` को `Read-only file system` से विफल होना चाहिए (root भी), और सूची में SmokePing अनुभाग दिखने चाहिए। Health `/proc/self/mountinfo` से फिर जाँचकर लिखने योग्य/गायब माउंट या पथ के सिम्बॉलिक लिंक को **त्रुटि** बताता है। सिम्बॉलिक लिंक माउंट का विकल्प नहीं: Cacti 1.2.32 और बाद उससे गुजरते स्रोत पथ अस्वीकार करते हैं। + + +## 4. प्लगइन स्थापित करें + +रिलीज़ आर्काइव से ([पैकेजिंग](../../../release.md) देखें): + +```sh +tar -xzf smokeping-0.2.0.tar.gz -C /var/www/html/cacti/plugins +chown -R root:root /var/www/html/cacti/plugins/smokeping +cd /var/www/html/cacti +sudo -u www-data php cli/plugin_manage.php --plugin=smokeping --install --enable --allperms +``` + +डायरेक्टरी नाम `smokeping` होना चाहिए। अंतिम कमांड Cacti फ़ाइलों के मालिक (`apache` EL पर) से चलाएँ। `--allperms` कंसोल व्यवस्थापक को तीनों क्षेत्र देता है; दूसरे उपयोगकर्ताओं को User Management से **SmokePing View**, **SmokePing Operator** या **SmokePing Admin** दें। Operator में View और Admin में Operator पहुँच शामिल है। प्लगइन तालिकाएँ तथा ग्राफ़/होस्ट टेम्पलेट लगाता है; टेम्पलेट आयात विफल हो तो Health में बताकर काम जारी रखता है और कारण सुधारने पर **Retry Template Import** दोहराता है। + +8.2 से पुराने PHP में आवश्यक संस्करण बताते हुए स्थापना अस्वीकार होती है, बाकी Cacti अप्रभावित रहता है। + + +## 5. कॉन्फ़िगर और पुष्टि करें + +**Console > Configuration > Settings > SmokePing** खोलकर जाँचें: + +| सेटिंग | अर्थ | +|---|---| +| SmokePing Poller | SmokePing होस्ट पर या साझा फ़ाइल सिस्टम वाला Cacti पोलर। केवल यही डेटा पढ़ता है। | +| SmokePing Configuration File | `/etc/smokeping/config`, यदि आपने न बदला हो | +| SmokePing Data Directory | SmokePing को दिखता `DATADIR` | +| Cacti Mount of the Data Directory | चरण 3 का माउंट; डिफ़ॉल्ट `/smokeping` | +| Loss Colors | Automatic, लेकिन रीडर `Smokeping.pm` न देख सके और संस्करण 2.7 हो तो SmokePing 2.7। [हानि रंग](provisioning.md#loss-colors) देखें | + +फिर SmokePing पोलर सर्वर पर **SmokePing Health** खोलें। कॉन्फ़िगरेशन पंक्ति तुरंत पढ़कर लक्ष्य संख्या या फ़ाइल/पंक्ति सहित पहली त्रुटि दिखाती है। अगले पोलर चक्र के बाद PHP, कॉन्फ़िगरेशन, रीडर, इन्वेंटरी, माउंट और टेम्पलेट सभी OK होने चाहिए। प्रतीक्षा के बिना पहला रीडर और इन्वेंटरी चलाएँ: + +```sh +sudo -u www-data php plugins/smokeping/poller_smokeping.php --force --inventory +``` + +**SmokePing Inventory** अब सभी लक्ष्य दिखाता है। अभी ग्राफ़ नहीं; Cacti में जोड़ने के लिए [प्रोविज़निंग](provisioning.md) देखें। + + +## भाषाएँ + +प्लगइन में स्पेन का स्पैनिश (`es-ES`), फ़्रेंच (`fr-FR`), जर्मन (`de-DE`), सरल चीनी (`zh-CN`), हिंदी (`hi-IN`), अरबी (`ar-SA`) और जापानी (`ja-JP`) हैं। Language Support चालू (Configuration > Settings > General > Language Support) करके उपयोगकर्ता भाषा चुने तो Cacti दिखाता है। लैटिन अमेरिकी स्पैनिश (`es-419`) भी है, पर Cacti 1.2 में वह लोकेल चुनने को नहीं, इसलिए Cacti के जोड़ने पर ही प्रभावी होगा; तब तक स्पैनिश (`es-ES`) चुनें। + + +## कंटेनर + +रीडर वहाँ चलाएँ जहाँ शुरुआत की दोनों चीजें दिखें। + +- **कंटेनर में Cacti, होस्ट पर SmokePing।** डेटा RRA पथ पर केवल-पठन और कॉन्फ़िगरेशन भी केवल-पठन माउंट करें: + + ```sh + docker run -d --name cacti \ + -v /var/lib/smokeping:/var/www/html/cacti/rra/smokeping:ro \ + -v /etc/smokeping:/etc/smokeping:ro \ + my-cacti-image + ``` + + डेटा माउंट का बायाँ भाग होस्ट के `DATADIR` से बदलें। इमेज को SmokePing से कुछ नहीं चाहिए: न Perl, न `smokeping` पैकेज। कंटेनर PHP 8.2 या बाद होना चाहिए। Health माउंट का `:ro` जाँचता है; बिना इसके त्रुटि। +- **Docker Compose।** यही `volumes:` में `read_only: true` और `type: bind` से: + + ```yaml + services: + cacti: + volumes: + - type: bind + source: /var/lib/smokeping + target: /var/www/html/cacti/rra/smokeping + read_only: true + ``` + +- **Kubernetes।** `volumeMounts` में `readOnly: true`, पीछे hostPath या NFS/CSI वॉल्यूम जहाँ SmokePing pod लिखता है। +- **कंटेनर में SmokePing।** `datadir` Cacti होस्ट से साझा वॉल्यूम पर रखें और ऊपर की तरह केवल-पठन माउंट करें। प्लगइन को SmokePing कंटेनर में प्रवेश नहीं चाहिए। + + +## Cacti RRD क्लीनर SmokePing फ़ाइलें दिखाएगा + +क्लीनर (**Utilities > RRD Cleaner**) पूरा RRA पथ देखता है, इसलिए बिना Cacti स्रोत की SmokePing RRD, स्लेव `target~slave.rrd` सहित, अनुपयोगी दिखाकर हटाने का विकल्प देता है। न चुनें। केवल-पठन माउंट से हटाना/संग्रहित करना विफल, Cacti चेतावनी लॉग और कतार प्रविष्टि हटाता है; फ़ाइलें बचती हैं, लेकिन चेतावनियाँ अनावश्यक हैं और लिखने योग्य माउंट डेटा खो देता। प्लगइन purge से पहले पहचानी कतार प्रविष्टियाँ हटाता है (हर पोलर रन शुरू में), इसलिए चेतावनियाँ कम होती हैं। क्लीनर में बहिष्करण सूची नहीं; चयन से पहले सूची पढ़ें। + + +## अपग्रेड और हटाना + +नई रिलीज़ से प्लगइन डायरेक्टरी बदलकर Plugins पृष्ठ खोलें या अगला पोलर चक्र आने दें; तालिकाएँ और टेम्पलेट माइग्रेट करके सभी चरण सफल होने पर ही संस्करण दर्ज करता है, इसलिए बाधित अपग्रेड अगली बार पूरा होता है। निष्क्रिय करने से काम रुकते हैं, SmokePing फ़ाइलें नहीं बदलतीं। **अनइंस्टॉल से पहले स्वयं कॉन्फ़िगरेशन निर्यात करें और सत्यापित करें कि बैकअप पढ़ने योग्य और पूर्ण है।** अनइंस्टॉल प्लगइन कॉन्फ़िगरेशन का YAML निर्यात Backup Directory या Cacti के `cache/smokeping/` में लिखने का प्रयास करता है (यादृच्छिक नाम, मोड `0600`, सफलता पर पथ दिखाया जाता है)। निर्यात विफल होने पर चेतावनी लॉग में दर्ज होती है और दिखाई जाती है, लेकिन अनइंस्टॉल जारी रहता है। **Keep Plugin Tables on Uninstall** सेट न हो तो प्लगइन की तालिकाएँ हटती हैं; SmokePing फ़ाइलें और कॉन्फ़िगरेशन कभी नहीं बदलते। diff --git a/docs/i18n/hi-IN/docs/operations.md b/docs/i18n/hi-IN/docs/operations.md new file mode 100644 index 0000000..783f86b --- /dev/null +++ b/docs/i18n/hi-IN/docs/operations.md @@ -0,0 +1,107 @@ + + + +# SmokePing प्लगइन का संचालन + +प्लगइन का प्रदर्शन कैसे पढ़ें, हर स्थिति का अर्थ और प्रमाण, कुछ गलत दिखने पर क्या जाँचें और इनपुट विफल होने पर व्यवहार। स्थापना [स्थापना](install.md), अलर्ट [अलर्ट](alerting.md) और बैकअप [बैकअप और बहाली](backup-restore.md) में हैं। + +View, Operator और Admin अनुमतियों तथा व्यक्तिगत ट्रायेज व्यवहार के लिए [पहुँच भूमिकाएँ](../README.md#access-roles) देखें। + + +## पृष्ठ + +| पृष्ठ | क्षेत्र | क्या दिखाता है | +|---|---|---| +| **SmokePing** (ऊपरी टैब) | View | आपके देखने योग्य उपकरणों से मैप लक्ष्यों की नवीनतम स्थिति, हर लक्ष्य और स्थान की एक पंक्ति | +| **SmokePing Inventory** | Admin | कॉन्फ़िगरेशन के सभी लक्ष्य, मैप हों या नहीं, और खुले पुनः संबद्ध प्रस्ताव | +| **SmokePing Health** | Admin | नीचे की जाँचें और टेम्पलेट आयात फिर करने का बटन | +| **SmokePing Configuration** | Admin | प्लगइन कॉन्फ़िगरेशन निर्यात और आयात ([प्रारूप](configuration-format.md)) | +| **Import SmokePing Configuration** (Import/Export में) | Admin | मौजूदा SmokePing कॉन्फ़िगरेशन को उपकरण, ग्राफ़ और ग्राफ़ ट्री में आयात ([तरीका](provisioning.md#a-whole-smokeping-configuration)) | + +स्मोक और सारांश ग्राफ़ सामान्य Cacti ग्राफ़ हैं, इसलिए Cacti ग्राफ़ और उपकरण अनुमतियाँ लागू होती हैं। + + +## हर स्थिति का अर्थ + +SmokePing पृष्ठ की हर पंक्ति स्वतंत्र आयाम जोड़ती है। इन्हें एक रंग में नहीं मिलाया जाता, क्योंकि बंद संग्रहकर्ता और पूर्ण पैकेट हानि की प्रतिक्रियाएँ अलग होती हैं। + +| आयाम | स्थितियाँ | प्रमाण | +|---|---|---| +| ताज़गी | `current`, `delayed`, `stale`, `never` | RRD अंतिम अपडेट की आयु (`rrdtool lastupdate` से), लक्ष्य `step` के सापेक्ष। Current: एक `step` और ताज़गी छूट (डिफ़ॉल्ट 60 सेकंड) के भीतर। Delayed: उससे पुराना, `step` के दोगुने तक, जो SmokePing heartbeat है। Stale: heartbeat से आगे, जब मान अज्ञात हो गए। Never: फ़ाइल अनुपस्थित या बनने के बाद कभी अपडेट नहीं हुई | +| निष्पादन | `completed`, `probe_error`, `unknown` | संख्यात्मक हानि लिखने पर चक्र पूर्ण है। पुराना या कभी न देखा डेटा अंतिम चक्र की जानकारी नहीं देता, इसलिए `unknown`। `probe_error` कभी सेट नहीं होता: विफल प्रोब वही मान लिखता है जो जवाब न देने वाला लक्ष्य ([शोध](../../../research/probe-failures.md)) | +| दशा | `within_policy`, `degraded`, `complete_loss`, `unknown` | अंतिम पूर्ण चक्र से। `loss` बराबर `pings` और मध्यिका अनुपस्थित हो तो पूर्ण हानि। उससे कम कोई हानि degraded है। बंद संग्रहकर्ता कभी हानि नहीं दिखता: वह stale होता है और दशा `unknown` | +| प्रशासनिक | `enabled`, `disabled`, `archived` | लक्ष्य का प्लगइन रिकॉर्ड। निष्क्रिय या संग्रहित लक्ष्य पढ़ा नहीं जाता | +| रखरखाव | रखरखाव में या बाहर | लक्ष्य उपकरण का Maint `is_device_in_maintenance` हुक, लक्ष्य पृष्ठ के Maintenance कॉलम में। Maint अनुपस्थित या बंद हो तो सभी उपकरण बाहर दिखते हैं | +| मापन समय | अंतिम अपडेट से सेकंड | RRD का अपना टाइमस्टैम्प। पृष्ठ ताज़ा करना कभी मापन नहीं है | + +हर स्थान की ताज़गी उसकी अपनी फ़ाइल से आती है (स्लेव के लिए `target~slave.rrd`), इसलिए मास्टर current होते हुए भी पीछे चलता स्लेव stale दिखता है। + +हानि कॉलम अंतिम चक्र का `lost/pings` दिखाता है और मध्यिका मिलीसेकंड में है; `U` अज्ञात है, शून्य नहीं। + + +## स्वास्थ्य जाँच + +| जाँच | OK का अर्थ | OK न होने पर | +|---|---|---| +| `php_binary` | Cacti सेटिंग का PHP बाइनरी मौजूद और निष्पादन योग्य है | रीडर शुरू नहीं हो सकता: Cacti «PHP Binary Path» सुधारें | +| `reader` | अंतिम रन तीन पोलर अंतराल के भीतर, समय बजट में पूरा हुआ | चेतावनी: रीडर देर से या बजट से अधिक चला। कई शृंखलाओं पर बजट बढ़ाएँ या स्टोरेज जाँचें; [प्रदर्शन](performance.md) देखें | +| `inventory` | अंतिम इन्वेंटरी ने SmokePing कॉन्फ़िगरेशन पार्स किया | त्रुटि: SmokePing पार्सर का फ़ाइल और पंक्ति सहित संदेश। पुरानी इन्वेंटरी बनी रहती है | +| `mount`, `read-only`, `writable` | माउंट RRA पथ के अंदर है, बिना सिम्बॉलिक लिंक पहुँचा जाता है, केवल-पठन माउंट है और लिखने योग्य नहीं | त्रुटि। [स्थापना मार्गदर्शिका](install.md#3-mount-the-data-directory-read-only-inside-cactis-rra-path) देखें | +| `visibility` | इन्वेंटरी फ़ाइलें माउंट से दिखती हैं | चेतावनी में अनुपस्थित संख्या | +| `templates` | SmokePing टेम्पलेट आयातित हैं | कारण सहित त्रुटि; ठीक कर **Retry Template Import** इस्तेमाल करें | +| `device_pollers` | सारांश स्रोत वाले सभी उपकरण रीडर के पोलर से पोल होते हैं | उपकरण नाम सहित त्रुटि: उस पोलर का उपयोग होने तक सारांश और अलर्ट को डेटा नहीं मिलता | +| `loss_colors` | Loss Colors द्वारा चुने रंग: रीडर को मिले SmokePing संस्करण के या बताए गए। बदलाव के बाद मुख्य पोलर अगले चक्रों में 200 ग्राफ़ प्रति चक्र बदलता है; `upgrade-graphs` तुरंत करता है। पंक्ति दूसरे रंगों पर बचे ग्राफ़ गिनती है और विफल बदलाव बताती है | संस्करण न मिले और सेटिंग Automatic हो तो अज्ञात: ग्राफ़ 2.8 और बाद के रंग लेते हैं। मिली संस्करण से सेटिंग अलग हो तो चेतावनी। [हानि रंग](provisioning.md#loss-colors) देखें | +| `dual_alerting` | किसी लक्ष्य में SmokePing `alerts` और सारांश स्रोत पर सक्षम Thold थ्रेशोल्ड दोनों नहीं हैं | अधिकतम 10 लक्ष्य सहित चेतावनी: दोनों शर्तें पूरी करने वाली समस्या दो सूचनाएँ देती है। शर्तों की तुलना नहीं होती; जैसे Thold `age` बिना SmokePing हानि अलर्ट चल सकता है। SmokePing अलर्ट हटाने या थ्रेशोल्ड बंद करने से पहले तुलना करें। Thold न हो तो OK | + + +## सामान्य स्थितियाँ + +- **सब `stale` है।** SmokePing ने लिखना रोका या माउंट पुराना है। `systemctl status smokeping` देखें, फिर माउंट का `rrdtool lastupdate` SmokePing होस्ट की उसी फ़ाइल से मिलाएँ। केवल-पठन NFS अपने एट्रिब्यूट कैश समय से पीछे हो सकता है। +- **एक स्लेव `stale`, मास्टर `current` है।** स्लेव ने भेजना रोका। मास्टर देर से आए परिणाम लागू करता है, इसलिए ग्राफ़ पीछे का डेटा भरता है; Thold फिर मूल्यांकन नहीं करता ([अलर्ट](alerting.md))। +- **लक्ष्य `never` दिखाता है।** RRD अभी बना नहीं (SmokePing रीलोड के बाद पहले चक्र में बनाता है) या माउंट नहीं दिखा रहा। `visibility` देखें। +- **Cacti 1.2.32 अपग्रेड के बाद ग्राफ़ खाली है।** RRA के बाहर स्रोत पथ को Cacti अपने बनाए पथ से बदलता है। माउंट प्लगइन की बताई जगह हो और कोई सिम्बॉलिक लिंक न हो। +- **SmokePing अनुभाग का नाम बदला।** नए पथ के लिए नई फ़ाइल शुरू होती है। इन्वेंटरी फिर जोड़ने का प्रस्ताव देती है, व्यवस्थापक पुष्टि तक कुछ नहीं बदलती ([प्रोविज़निंग](provisioning.md#re-linking-a-renamed-target))। + + +## टोपोलॉजी + +1. **Cacti पोलर के होस्ट पर SmokePing।** पोलर उपयोगकर्ता bind mount से डेटा डायरेक्टरी पढ़ता है। स्थापना मार्गदर्शिका यही बताती है। +2. **Cacti होस्ट से साझा SmokePing डेटा डायरेक्टरी।** SmokePing पोलर वाले होस्ट के RRA पथ पर NFS से केवल-पठन माउंट करें। स्वास्थ्य पृष्ठ हर फ़ाइल का अंतिम अपडेट घड़ी से मिलाता है, इसलिए पीछे का माउंट `delayed` या `stale` दिखता है। स्मोक ग्राफ़ वेब UI देने वाले Cacti सर्वर पर बनते हैं, इसलिए उसे भी शेयर चाहिए; केवल पोलर के पास हो तो सारांश और अलर्ट चलते हैं, स्मोक ग्राफ़ खाली रहते हैं। +3. **Cacti दूरस्थ डेटा संग्रहकर्ता पर SmokePing** बाद का चरण है, इस रिलीज़ में समर्थित नहीं। + +केवल **SmokePing Poller** में नामित पोलर SmokePing डेटा पढ़ता है। सारांश स्रोत वाले उपकरण उसी से पोल होने चाहिए। + + +## इनपुट विफल होने पर + +रिलीज़ का परीक्षण इन व्यवहारों के विरुद्ध हुआ है ([विफलता परीक्षण](../../../failure-qualification.md)); इनमें कोई डेटा नहीं खोता। + +| विफलता | दस्तावेज़ित व्यवहार | +|---|---| +| SmokePing कॉन्फ़िगरेशन अपठनीय या टूटा | इन्वेंटरी Health पर पार्सर संदेश के साथ विफल; पिछली इन्वेंटरी रहती है, कुछ नहीं हटता | +| SmokePing चलते हुए प्रोब न चले: बाइनरी त्रुटि से निकले, स्रोत पता होस्ट पर नहीं, fping पैरामीटर न स्वीकारे या FPing6 के लिए IPv6 बंद | उस प्रोब के हर लक्ष्य के लिए पूर्ण हानि लिखता है, बिना जवाब वाले लक्ष्य जैसी। मापन `complete_loss`। एक प्रोब के सभी लक्ष्य साथ पूर्ण हानि दिखाएँ तो SmokePing लॉग में प्रोब त्रुटि देखें | +| SmokePing द्वारा पहचानी प्रोब विफलता: बाइनरी अनुपस्थित, पैरामीटर सीमा से बाहर, fping का raw socket नहीं | SmokePing शुरू होते या पहले चक्र में निकलता है। सभी लक्ष्य `delayed` फिर `stale`, जैसे SmokePing रुक गया | +| लक्ष्य होस्ट नाम हल न हों (DNS विफलता) | प्रोब विफल होकर हानि लिखते हैं; प्लगइन वही पढ़ता है। मापन `degraded` या `complete_loss`, stale नहीं। प्लगइन खुद नाम नहीं खोजता | +| SmokePing या उसका संग्रहकर्ता रुकता है | ताज़गी `delayed` फिर `stale`; `median` और `loss_pct` अज्ञात, `age` बढ़ता रहता है। कभी शून्य हानि नहीं | +| Cacti और SmokePing घड़ियों का अंतर | ताज़गी RRD अपडेट समय को Cacti घड़ी से मिलाती है, इसलिए हर आयु उतनी बदलती है। आगे का SmokePing भविष्य का समय लिखता है जो `current` दिखता है; बंद संग्रहकर्ता अंतर बीतने तक `current` रहता है। पीछे की घड़ी हर शृंखला पुरानी दिखाती है, और दोगुने `step` से आगे `stale`। दोनों होस्ट NTP पर रखें | +| RRD अपठनीय या खराब | रीडर उस फ़ाइल की चेतावनी लिखकर बाकी जारी रखता है। कभी न पढ़ी शृंखला अज्ञात (`U`)। पहले पढ़ी शृंखला अंतिम कैश मान रखती है, जो `delayed` और `stale` से अज्ञात होता है; खराब फ़ाइल कभी शून्य हानि नहीं बनती | +| Cacti होस्ट का स्टोरेज भरा | रीडर केवल डेटाबेस कैश लिखता है। लिखना अस्वीकार हो तो रन सामान्य रूप से निकलता है और हर कैश पंक्ति पूरी पुरानी अवस्था में रहती है; स्टोरेज ठीक होने के बाद अगला चक्र नई जानकारी कैश करता है। Cacti के सारांश RRD अन्य स्रोतों की तरह विफल होते हैं | +| रीडर बीच में समाप्त किया गया | हर कैश पंक्ति पूरी लिखी जाती है, इसलिए पूर्ण रीडिंग बचती हैं। Cacti मृत प्रक्रिया पहचानता है और अगला रन तुरंत शुरू होकर सभी शृंखलाएँ पूरा करता है | +| दूसरा रीडर शुरू हो | Cacti प्रक्रिया तालिका प्रति पोलर एक रीडर देती है। दोहराव तुरंत 0 से निकलकर नोट लिखता है (Medium लॉग स्तर); पहला अप्रभावित | +| रखरखाव शुरू और समाप्त | Maint उपकरण सूचनाएँ दबाता है; Thold मूल्यांकन और सारांश पोलिंग जारी | +| प्लगइन अपग्रेड बाधित | दर्ज संस्करण सभी चरण सफल होने पर ही बदलता है; अगला पृष्ठ या पोलर चक्र अपग्रेड पूरा करता है | + + +## आयात और निर्यात + +[कॉन्फ़िगरेशन प्रारूप](configuration-format.md) देखें। संक्षिप्त रूप: + +```sh +php plugins/smokeping/cli/smokeping.php export --file=/var/backups/smokeping-config.yaml +php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml +``` + + +## लॉग + +प्लगइन Cacti लॉग में `SMOKEPING` टैग से लिखता है। `grep SMOKEPING log/cacti.log` रीडर आँकड़े (`SMOKEPING STATS`), इन्वेंटरी और टेम्पलेट आयात विफलताएँ तथा लागू हर कॉन्फ़िगरेशन आयात दिखाता है। diff --git a/docs/i18n/hi-IN/docs/performance.md b/docs/i18n/hi-IN/docs/performance.md new file mode 100644 index 0000000..147a275 --- /dev/null +++ b/docs/i18n/hi-IN/docs/performance.md @@ -0,0 +1,101 @@ + + + +# प्रदर्शन + +क्षमता शृंखलाओं में बताई जाती है: एक मापन स्थान (मास्टर या स्लेव) पर एक लक्ष्य। यह पृष्ठ 100, 1,000 और 10,000 शृंखलाओं पर प्लगइन की लागत, मापन वातावरण और अभी शेष आँकड़े बताता है। आवश्यकता ID [#42](https://github.com/somethingwithproof/plugin_smokeping/issues/42) से हैं। + + +## प्रति अनुरोध और चक्र का काम + +- **कोई पृष्ठ अनुरोध प्रोब नहीं चलाता, RRD नहीं पढ़ता या दूरस्थ संग्रहकर्ता की प्रतीक्षा नहीं करता (REQ-PERF-003)।** अवलोकन पृष्ठ डेटाबेस से रीडर कैश पंक्तियाँ पढ़ता है। `tests/bin/perf-page.php` माउंट पथ को अनुपस्थित डायरेक्टरी पर रखकर भी वही पृष्ठ बनाता है। ग्राफ़ Cacti ग्राफ़ हैं और अन्य Cacti ग्राफ़ों की तरह फ़ाइलें पढ़ते हैं। +- **प्रति पोलर एक रीडर प्रक्रिया हर चक्र में हर शृंखला एक बार पढ़ती है**, एक `rrdtool` पाइप से, समय बजट के साथ (डिफ़ॉल्ट 120 सेकंड)। बजट पूरा होने पर रन रुकता है और अगला सबसे अधिक प्रतीक्षा वाली शृंखला से जारी होता है। एक फ़ाइल पढ़ना `lastupdate` कॉल है जो हेडर पढ़ता है, इसलिए RRD आकार पर निर्भर नहीं। +- **हर सारांश स्रोत एक कैश पंक्ति पढ़ता है** और RRD कभी नहीं छूता। +- **सामूहिक जोड़ की पुष्टि स्क्रीन कुछ बनाने से पहले भार दिखाती है (REQ-PERF-004)**: मिलते लक्ष्यों के लिए शृंखला संख्या, प्रति सेकंड SmokePing प्रोब पैकेट और RRD अपडेट, तथा Cacti स्रोत पंक्तियों और ग्राफ़ आइटम पंक्तियों की संख्या। गणना `lib/LoadEstimate.php` में है। + + +## गणना + +10,000 शृंखलाओं और हर 300 सेकंड में 20 पिंग पर: औसतन लगभग 667 पैकेट/सेकंड, 33 SmokePing RRD अपडेट/सेकंड और, रीडर हर चरण में हर शृंखला जाँचे तो, 33 `lastupdate` पढ़ाइयाँ/सेकंड। Cacti ऑब्जेक्ट 260,000 `data_template_rrd` पंक्तियाँ (प्रति शृंखला स्मोक स्रोत के लिए 23, सारांश के लिए 3) और 550,000 ग्राफ़ आइटम पंक्तियाँ (स्मोक ग्राफ़ के लिए 50, सारांश के लिए 5) हैं, तथा स्क्रिप्ट सर्वर 10,000 सारांश स्रोत पोल करता है। नीचे रिलीज़ रन ने [#81](https://github.com/somethingwithproof/plugin_smokeping/issues/81) से पहले के टेम्पलेट इस्तेमाल कर ठीक पंक्तियाँ गिनीं: प्रति स्मोक ग्राफ़ 47, कुल 520,000। #81 ने मानक विचलन, am/s और प्रोब लाइन आइटम जोड़े। पुष्टि स्क्रीन यही संख्या निकालती है और `tests/Unit/LoadEstimateTest.php` इन्हें वितरित टेम्पलेट से जाँचता है। + + +## स्थानीय प्रारंभिक माप + +एक लैपटॉप के Docker कंटेनरों में प्लगइन स्क्रिप्ट (`sh tests/run-perf.sh `) से मापा: **इस कोड का स्थानीय प्रारंभिक माप, रिलीज़ आँकड़ा नहीं।** मशीन: Apple silicon, aarch64, Docker के लिए 14 CPU और 15.7 GiB, उसी होस्ट के कंटेनरों में MariaDB 10.11 और PHP 8.2, Docker bind mount पर RRD। शृंखलाएँ: 20 पिंग, 300 सेकंड चरण, हर परीक्षण RRD 193 KB (SmokePing की फ़ाइलें कई MB होती हैं; `lastupdate` हेडर पढ़ता है, इसलिए आकार पढ़ने को नहीं बदलता)। + +| शृंखलाएँ | रीडर, पहला पूरा चक्र | रीडर, अपरिवर्तित फ़ाइलें | एक डिफ़ॉल्ट (120 सेकंड) चक्र में शृंखलाएँ | अवलोकन पृष्ठ (CLI, केवल डेटाबेस) | पृष्ठ अधिकतम मेमोरी | पृष्ठ HTML | +|---|---|---|---|---|---|---| +| 100 | 0.2 s | 0.1 सेकंड से कम | 100 / 100 | 0.002 s | 8 MB | 0.02 MB | +| 1,000 | 1.2 s | 1.1 s | 1,000 / 1,000 | 0.012 s | 12 MB | 0.17 MB | +| 10,000 | 12.3 s | 11.6 s | 10,000 / 10,000 | 0.119 s | 58 MB | 1.68 MB | + +तालिका में यहाँ प्रति शृंखला रीडर लागत लगभग 1.2 ms है और रैखिक रूप से बढ़ती है, इसलिए स्थानीय डिस्क पर 10,000 शृंखलाएँ डिफ़ॉल्ट बजट का लगभग दसवाँ हिस्सा लेती हैं। अवलोकन सभी मैप की शृंखलाएँ एक पृष्ठ पर दिखाता है (10,000 पर लगभग 10,000 पंक्तियाँ, 1.7 MB HTML), और डेटाबेस तथा PHP समय कम है। इनमें ब्राउज़र, वेब सर्वर, Cacti पृष्ठ ढाँचा, NFS और उसी समय फ़ाइलें लिखता SmokePing शामिल नहीं हैं। + +यहाँ नहीं मापा: प्रोविज़न किए ऑब्जेक्टों के साथ Cacti प्रबंधन पृष्ठ (रिलीज़ माप देखें), केवल-पठन NFS माउंट, और रीडर चलने के दौरान प्रति सेकंड 33 फ़ाइलें लिखता वास्तविक SmokePing डेमन। + + +## रिलीज़ माप + +2026-11-15 को एक DigitalOcean droplet पर मापा: sfo3 में `c-4`, 4 समर्पित vCPU (Intel Xeon Platinum 8280), 8 GB, Ubuntu 24.04; उसी होस्ट के कंटेनरों में Cacti 1.2.31, PHP 8.5.12, RRDtool 1.7.2 और MariaDB 10.11.19। शृंखलाएँ 20 पिंग और 300 सेकंड चरण, हर लक्ष्य अपने उपकरण पर, परीक्षण RRD केवल-पठन bind mount पर। + + +### रीडर और अवलोकन पृष्ठ + +`sh tests/run-perf.sh `: + +| शृंखलाएँ | रीडर, पहला पूरा चक्र | रीडर, अपरिवर्तित फ़ाइलें | एक डिफ़ॉल्ट (120 सेकंड) चक्र में शृंखलाएँ | अवलोकन पृष्ठ (CLI, केवल डेटाबेस) | पृष्ठ अधिकतम मेमोरी | पृष्ठ HTML | +|---|---|---|---|---|---|---| +| 100 | 0.2 s | 0.1 सेकंड से कम | 100 / 100 | 0.004 s | 8 MB | 0.02 MB | +| 1,000 | 1.9 s | 2 s | 1,000 / 1,000 | 0.028 s | 12 MB | 0.17 MB | +| 10,000 | 20.6 s | 19.9 s | 10,000 / 10,000 | 0.244 s | 58 MB | 1.68 MB | + +इस होस्ट पर रीडर लगभग 2 ms प्रति शृंखला लेता है, इसलिए 10,000 शृंखलाएँ डिफ़ॉल्ट बजट का लगभग छठा हिस्सा लेती हैं। + + +### सभी ऑब्जेक्टों के साथ Cacti पृष्ठ और पोलर + +`sh tests/run-perf-objects.sh ` लक्ष्य और उपकरण बनाता है, पृष्ठों का समय मापता है, प्लगइन से हर लक्ष्य के सारांश और स्मोक ऑब्जेक्ट तैयार करता है, फिर पृष्ठ मापता है और दो पोलर चक्र चलाता है, हर बार पिछले चक्र का रीडर समाप्त होने के बाद। `PERF_OBJECTS=stock` हर उपकरण को इसके बजाय Cacti Local Linux Machine टेम्पलेट से दो ग्राफ़ देता है («Unix - Load Average» और «Linux - Memory Usage»): प्रति शृंखला उतने ही ग्राफ़, REQ-PERF-002 की तुलना के लिए। पृष्ठ समय HTTP पर मिलीसेकंड में p50/p95 है, एक वार्म-अप के बाद 20 अनुरोध, व्यवस्थापक लॉगिन और PHP अंतर्निहित सर्वर से। «केवल उपकरण» वही उपकरण हैं, किसी ग्राफ़ से पहले। + +| शृंखलाएँ | ऑब्जेक्ट | उपकरण सूची | स्रोत सूची | ग्राफ़ सूची | प्लगइन अवलोकन | +|---|---|---|---|---|---| +| 100 | केवल उपकरण | 28/31 | 25/35 | 35/37 | 38/40 | +| 100 | मानक ग्राफ़ | 28/39 | 48/56 | 33/48 | 29/39 | +| 100 | प्लगइन ऑब्जेक्ट | 28/39 | 51/53 | 33/34 | 28/29 | +| 1,000 | केवल उपकरण | 30/42 | 25/26 | 26/36 | 59/64 | +| 1,000 | मानक ग्राफ़ | 32/33 | 50/51 | 39/40 | 65/66 | +| 1,000 | प्लगइन ऑब्जेक्ट | 42/44 | 54/77 | 39/40 | 58/68 | +| 10,000 | केवल उपकरण | 50/57 | 28/37 | 28/30 | 301/319 | +| 10,000 | मानक ग्राफ़ | 66/69 | 50/75 | 107/111 | 331/338 | +| 10,000 | प्लगइन ऑब्जेक्ट | 65/68 | 54/78 | 105/119 | 318/340 | + +| शृंखलाएँ | प्लगइन ऑब्जेक्ट प्रोविज़न करना | पहला पोलर चक्र (RRD बनाता है) | स्थिर पोलर चक्र | रीडर | +|---|---|---|---|---| +| 100 | 31 s | 2.0 s | 1.6 s | 0.2 s | +| 1,000 | 324 s | 6.5 s | 5.1 s | 1.6 s | +| 10,000 | 3,284 s | 57.1 s | 43.5 s | 21.5 s | + +10,000 शृंखलाओं पर प्लगइन ऑब्जेक्ट 260,000 `data_template_rrd` पंक्तियाँ, 520,000 ग्राफ़ आइटम पंक्तियाँ और 10,000 पोलर आइटम हैं; मानक ग्राफ़ों के लिए 50,000 और 240,000 हैं। पोलर चक्र एक cmd.php प्रक्रिया है जो 10,000 सारांश स्रोत पोल करती है; `poller_bottom` से शुरू रीडर साथ चलता है। दोनों 300 सेकंड अंतराल के भीतर काफी नीचे रहते हैं। प्रोविज़निंग एक व्यवस्थापक का सामूहिक जोड़ है: लगभग 0.33 सेकंड प्रति शृंखला, यानी 10,000 के लिए लगभग एक घंटा। उसी droplet पर उसी स्क्रिप्ट का पिछला रन 10,000 के लिए 6,141 सेकंड (0.61 प्रति शृंखला) था, इसलिए एक से दो घंटे रखें। + + +### आवश्यकताओं की तुलना + +- **REQ-PERF-001 (10,000 पर अवलोकन दो सेकंड से कम): पूरा।** HTTP पर p95 0.34 सेकंड। +- **REQ-PERF-002 (10,000 पर प्रबंधन पृष्ठ बेसलाइन +20 प्रतिशत के भीतर): पूरा**, मानक ग्राफ़ बेसलाइन के सापेक्ष। 10,000 पर प्लगइन p95 उपकरण सूची में 1 प्रतिशत कम, स्रोत सूची में 4 प्रतिशत अधिक और ग्राफ़ सूची में 7 प्रतिशत अधिक है। 1,000 पर स्रोत p95 मानक से 51 प्रतिशत अधिक (77 बनाम 51 ms), जबकि मध्यिकाएँ 8 प्रतिशत अलग हैं, दोनों रन में: सबसे धीमे अनुरोध, सामान्य नहीं। केवल उपकरण, बिना ग्राफ़ की तुलना में, कोई भी 20,000 ग्राफ़ सभी पृष्ठ धीमे करते हैं, मानक हों या प्लगइन के। +- **REQ-PERF-003 (प्रति अनुरोध कोई प्रोब नहीं, सीमित RRD पढ़ना, दूरस्थ प्रतीक्षा नहीं): पूरा** (पहला अनुभाग देखें)। +- **REQ-PERF-004 (सामूहिक जोड़ से पहले भार): पूरा।** अनुमान रन द्वारा गिनी पंक्तियों से मिलता है। + + +## समर्थित शृंखला संख्या + +**प्रति Cacti इंस्टॉलेशन 10,000 शृंखलाएँ**, 20 पिंग और 300 सेकंड चरण पर, रिलीज़ रनर जैसे हार्डवेयर पर: चार समर्पित vCPU और 8 GB, उसी होस्ट पर डेटाबेस। इस संख्या पर रीडर डिफ़ॉल्ट बजट का छठा और पोलर चक्र अंतराल का सातवाँ हिस्सा लेता है, तथा Cacti प्रबंधन पृष्ठ उतने ही मानक ग्राफ़ों के 7 प्रतिशत के भीतर रहते हैं। 10,000 से अधिक का मापन नहीं हुआ। + + +## दोबारा मापना + +```sh +sh tests/run-perf.sh # 100, 1,000, and 10,000 series +sh tests/run-perf.sh 1000 # one size +sh tests/run-perf-objects.sh # Cacti's pages and the poller with every object +``` + +हर रन `tests/bin/perf-seed.php` से लक्ष्य तैयार करता है, `tests/bin/make-fixture-rrds.php` से RRD बनाता है, `poller_smokeping.php --force` से पढ़ता है और `tests/bin/perf-page.php` से पृष्ठ बनाता है। diff --git a/docs/i18n/hi-IN/docs/provisioning.md b/docs/i18n/hi-IN/docs/provisioning.md new file mode 100644 index 0000000..9574b13 --- /dev/null +++ b/docs/i18n/hi-IN/docs/provisioning.md @@ -0,0 +1,115 @@ + + + +# Cacti में SmokePing लक्ष्य जोड़ना + +इन्वेंटरी को मिला हर लक्ष्य **SmokePing Inventory** पर व्यवस्थापकों को दिखता है और Cacti उपकरण से मैप होने तक दूसरों को नहीं। व्यवस्थापक पुष्टि के बिना कुछ नहीं बनता। प्लगइन SmokePing फ़ाइलें कभी नहीं लिखता। + + +## एक लक्ष्य + +SmokePing Inventory में मौजूद, बिना मैप लक्ष्य पर **Add to Cacti** लिंक है। पुष्टि स्क्रीन दो विकल्प देती है: + +- «SmokePing Target» टेम्पलेट से **नया उपकरण बनाएँ**। वह लक्ष्य का होस्ट लेता है, उपलब्धता जाँच बंद रहती है (SmokePing पहले से मापता है) और रीडर के पोलर को सौंपा जाता है। +- **मौजूदा उपकरण से मैप करें।** सूची में आपके बदलने योग्य उपकरण हैं। + +दोनों में लक्ष्य को अलर्ट के लिए सारांश स्रोत और ग्राफ़ मिलता है ([अलर्ट](alerting.md) देखें), और SmokePing डेटा ग्राफ़ योग्य हो तो प्रति स्थान स्मोक ग्राफ़। `pings` 10, 20 या 30 न हो, Cacti RRDproxy पर RRD रखे, या फ़ाइल केवल-पठन माउंट से न दिखे तो स्मोक ग्राफ़ नहीं बनता और पृष्ठ कारण बताता है। सारांश डेटा बना रहता है। + +सारांश स्रोत रीडर वाले पोलर से पोल होता है। मौजूदा उपकरण दूसरे पोलर पर हो तो प्लगइन स्रोत नहीं बनाता और सही पोलर बताता है। बाद में दूसरे पोलर पर ले जाए उपकरण स्वास्थ्य पृष्ठ दिखाता है। + + +## कई उपकरण + +उपकरण सूची में चुनकर **Add SmokePing Targets** लें। पुष्टि हर उपकरण के लिए बिना मैप लक्ष्य दिखाती है जिनका SmokePing `host` उपकरण होस्ट नाम से मिलता है (अक्षर केस की उपेक्षा), और कुल मिलान संख्या। जारी रखने से जुड़ते हैं। बिना मिलान उपकरण बताए जाते हैं और बदले नहीं जाते; कोई उपकरण बनाया नहीं जाता। स्थानीय कंटेनर में एक अनुरोध के 100 उपकरण लगभग 24 सेकंड लगे; बहुत लंबा चयन अनुरोध सीमा से थोड़ा पहले नए उपकरण शुरू करना रोकता है। फिर चलाने पर काम पूरा होता है क्योंकि पहले से जुड़े उपकरण छोड़े जाते हैं। + + +## पूरी SmokePing कॉन्फ़िगरेशन + +**Console > Import/Export > Import SmokePing Configuration** मौजूदा SmokePing इंस्टॉलेशन एक चरण में Cacti में लाता है। SmokePing Admin क्षेत्र और सभी उपकरणों की अनुमति चाहिए; ग्राफ़ ट्री में प्रतिबिंब के लिए Trees क्षेत्र भी। + +इनपुट चुनें: + +- **कॉन्फ़िगर की गई फ़ाइल** (डिफ़ॉल्ट): SmokePing Configuration File सेटिंग, सर्वर पर उसके सभी शामिल फ़ाइलों सहित पढ़ी जाती है। शामिल फ़ाइल उसी डायरेक्टरी या नीचे होनी चाहिए। +- अधिकतम 4 MiB की **अपलोड फ़ाइल**। स्वतंत्र पढ़ी जाती है, इसलिए `@include` पंक्ति संख्या सहित अस्वीकार होता है। लक्ष्य रीडर पोलर को दिखते RRD से बनते हैं; अगली इन्वेंटरी उस पोलर के SmokePing में न मिले लक्ष्य अनुपस्थित चिह्नित करती है। + +फिर विकल्प: + +| विकल्प | डिफ़ॉल्ट | अर्थ | +|---|---|---| +| उपकरण | प्रति SmokePing होस्ट एक | समान होस्ट मापने वाले लक्ष्य उपकरण साझा करते हैं। प्रति लक्ष्य एक चुनने पर हर लक्ष्य को अपने शीर्षक वाला उपकरण मिलता है। | +| उपकरण टेम्पलेट | SmokePing Target | आयात द्वारा बने उपकरणों का टेम्पलेट। | +| पोलर | रीडर का पोलर | रीडर चलाने वाला होना चाहिए; अन्य अस्वीकार क्योंकि वहाँ सारांश स्रोत को डेटा नहीं मिलता। | +| साइट | कोई नहीं | नए उपकरणों की साइट। | +| ग्राफ़ ट्री | प्रतिबिंब नहीं | मौजूदा ट्री या नाम से नया। हर SmokePing अनुभाग शाखा और हर उपकरण उसके लक्ष्यों की शाखा के नीचे होस्ट प्रविष्टि बनता है। | + +**Preview** कॉन्फ़िगरेशन पढ़ता है, लिखता नहीं। यह चेकबॉक्स सहित अनुभाग (चुनकर **Update Preview** से केवल वे लक्ष्य आयात करें), बनाए या पुनः उपयोग किए उपकरण, बनाए ग्राफ़, केवल सारांश पाने वाले लक्ष्य और कारण (10/20/30 के अलावा पिंग या RRDproxy), शाखाएँ और प्रविष्टियाँ तथा सामूहिक क्रिया जैसा अनुमानित भार दिखाता है। चुने पोलर पर लक्ष्य होस्ट नाम वाला उपकरण पुनः उपयोग होता है (प्रति लक्ष्य उपकरण में विवरण भी लक्ष्य शीर्षक होना चाहिए); दो मिलें तो वे लक्ष्य छोड़े और सूचीबद्ध होते हैं, जिन्हें SmokePing Inventory पर मैप करें। **Import** Cacti उपकरण, ग्राफ़ और ट्री फ़ंक्शन से ठीक पूर्वावलोकित योजना लागू करता है। तब से कॉन्फ़िगरेशन या Cacti बदला हो तो कुछ नहीं लिखता और दोबारा पूर्वावलोकन चाहिए। + +दोबारा आयात कुछ नया नहीं बनाता: मैप लक्ष्य उपकरण रखते हैं, मौजूदा ग्राफ़ और ट्री प्रविष्टियाँ पुनः उपयोग होती हैं और हर लक्ष्य पहले से Cacti में बताया जाता है। आयात SmokePing फ़ाइल या माउंट कभी नहीं लिखता। + +उन्हीं विकल्पों से कमांड लाइन आयात: + +```sh +php plugins/smokeping/cli/smokeping.php import-smokeping --dry-run --tree-name=SmokePing +php plugins/smokeping/cli/smokeping.php import-smokeping --apply --confirm=PLAN --tree-name=SmokePing +``` + +`--file=PATH` अन्य फ़ाइल को अपलोड की तरह स्वतंत्र पढ़ता है। `--sections=Europe,Lab/Core`, `--device-per=target`, `--device-template=ID`, `--poller=ID`, `--site=ID` और `--tree=ID` अन्य विकल्प हैं। ड्राई रन योजना और ID दिखाता है; `--apply` को वही ID चाहिए और योजना अब भी मिलनी चाहिए। + + +## ग्राफ़ पैमाना + +SmokePing हर रेंडर पर डेटा से पैमाना तय करता है। Cacti ग्राफ़ का हर समय सीमा के लिए एक ऊपरी सीमा है, इसलिए प्लगइन पिछले दिन पर SmokePing विवरण ग्राफ़ नियम (`Smokeping.pm` का `findmax`) लगाता है: उस फ़ाइल में पिछले दिन की सबसे बड़ी मध्यिका का 1.2 गुना। SmokePing Navigator Graph 1.5 गुना लेता है; प्लगइन में नेविगेटर नहीं। बनाते समय और फिर लगभग दैनिक पैमाना तय होता है। पिछले दिन मध्यिका न हो तो वर्तमान सीमा रहती है; नए ग्राफ़ की टेम्पलेट सीमा 0.05 सेकंड (50 ms) रहती है। + +दैनिक समायोजन डिफ़ॉल्ट चालू है, कोई सेटिंग नहीं। हर पढ़ाई के बाद रीडर अपने पोलर के लक्ष्यों में कम से कम एक दिन से न बदले स्मोक ग्राफ़ समायोजित करता है, सबसे लंबे प्रतीक्षारत पहले, अधिकतम 25 प्रति चक्र। प्रति ग्राफ़ एक RRD पढ़ता है, प्रोब नहीं चलाता। पढ़ाई में बजट खत्म हो तो वह चक्र छोड़ता है। हर पाँच मिनट चक्र पर रोज़ 7,200 ग्राफ़ होते हैं; अधिक हों तो हर ग्राफ़ दैनिक से थोड़ा कम बार समायोजित होता है। + +प्लगइन हर ग्राफ़ पर अपनी लगाई सीमा दर्ज करता है। अलग सीमा ग्राफ़ पृष्ठ पर मैन्युअल सेट मानी जाती है और उसे कभी नहीं बदलता। नियंत्रण लौटाने के लिए प्लगइन की अंतिम सीमा फिर सेट करें, जिसे `size-graphs` हर मैन्युअल सीमा वाले ग्राफ़ के लिए दिखाता है। + +अभी सभी स्मोक ग्राफ़ समायोजित करें: + +```sh +php plugins/smokeping/cli/smokeping.php size-graphs +``` + +हर ग्राफ़ की नई सीमा या पुरानी/मैन्युअल सीमा रखे जाने की सूचना देता है। दैनिक जैसी मैन्युअल सीमा नीति है। Cacti rrdtool पथ (Configuration > Settings > Paths) चाहिए; बिना उसके सीमाएँ रहती हैं। + +1.0.0-rc.1 से अपग्रेड पर किसने पुरानी सीमाएँ लगाईं इसका रिकॉर्ड नहीं, इसलिए प्लगइन वर्तमान सीमा अपनी मानकर अगली दैनिक बारी में समायोजित करता है। पहले `size-graphs` मैन्युअल सीमाएँ भी बदलता था। सीमा तभी मैन्युअल है जब दर्ज सीमा से अलग हो; अपग्रेड के बाद दर्ज सीमा अपनाई हुई है। मैन्युअल रखने के लिए दैनिक समायोजन बदलने के बाद उसे फिर लगाएँ। उस समायोजन को मध्यिका न मिले तो अपनाई सीमा रहती है; वही मान फिर लगाने से कुछ नहीं बदलता और बाद का समायोजन अभी भी बदल सकता है। + + +## ग्राफ़ संकेतक और टेम्पलेट अपग्रेड + +स्मोक ग्राफ़ संकेतक SmokePing जैसा है: मध्यिका का औसत, अधिकतम, न्यूनतम और अंतिम मान, मानक विचलन, am/s (औसत/मानक विचलन), फिर हानि मान और रंग तथा प्रोब पंक्ति, जैसे `probe: 20 ICMP Echo Pings (56 Bytes) every 300s`। प्रोब पंक्ति लक्ष्य के प्रोब, पैकेट आकार, पिंग और चरण से आती है जिन्हें इन्वेंटरी कॉन्फ़िगरेशन से पढ़ती है। मुख्य पोलर हर ग्राफ़ पर इसे लिखता है और प्रोब बदलने या टेम्पलेट आयात से रीसेट होने पर फिर लिखता है। प्रोब पढ़ने से पहले संग्रहित लक्ष्य उसका नाम दिखाता है। + +अपग्रेड में नए टेम्पलेट हों तो पुराने ग्राफ़ पुराने आइटम रखते हैं और बनते रहते हैं, जब तक प्लगइन उन्हें नए टेम्पलेट पर लाए। मुख्य पोलर प्रति चक्र 200 करता है, शीर्षक और ऊपरी सीमा रखते हुए। सभी अभी करें: + +```sh +php plugins/smokeping/cli/smokeping.php upgrade-graphs +``` + +अपग्रेड आइटम टेम्पलेट के अनुसार करता है, इसलिए प्लगइन ग्राफ़ आइटम के मैन्युअल बदलाव बदल जाते हैं। बाद में जाँचता है कि आइटम ठीक टेम्पलेट जैसे हों और हर प्रयुक्त VDEF मौजूद हो। विफल ग्राफ़ पुराने आइटम और संस्करण रखता है, Cacti लॉग उसका नाम देता है। पोलर फिर कोशिश नहीं करता। `upgrade-graphs` हर रन में हर ऐसे ग्राफ़ को फिर कोशिश करता है और कोई विफल रहे तो 1 से निकलता है। + + +## हानि रंग + +SmokePing 2.7 सात स्थिर स्तरों से हानि रंगता है; 2.8 और बाद पिंग अनुपात से स्तर और पूर्ण हानि स्तर जोड़ते हैं। प्लगइन दोनों के टेम्पलेट उन्हीं स्रोतों पर देता है और दोनों मूल ग्राफ़ से मिलते हैं ([ग्राफ़ समानता](../../../research/graph-fidelity.md))। सेटिंग में **Loss Colors** चुनता है: + +- **Automatic** (डिफ़ॉल्ट) SmokePing के पास `Smokeping.pm` (`/usr/share/perl5`, `/usr/share/smokeping`, `/opt/smokeping/lib` या `/usr/local/smokeping/lib`) में मिले संस्करण का अनुसरण करता है, जो हर इन्वेंटरी में दर्ज है। 2.8 से नीचे 2.7 रंग। संस्करण न मिले, जैसे दूसरे कंटेनर में हो, तो 2.8 और बाद के रंग। +- **SmokePing 2.8 and later** या **SmokePing 2.7** रीडर परिणाम चाहे जो हो, रंग तय करता है। + +स्वास्थ्य की `loss_colors` पंक्ति रंग और कारण दिखाती है। सेटिंग या SmokePing अपग्रेड से रंग बदलें तो मुख्य पोलर प्रति चक्र 200 ग्राफ़ दूसरे टेम्पलेट पर ले जाता है, शीर्षक, सीमा और डेटा रखते हुए। `upgrade-graphs` सब तुरंत करता है। विफल ग्राफ़ रंग रखता है और अगले `upgrade-graphs` पर फिर कोशिश होती है। + + +## नाम बदले लक्ष्य को फिर जोड़ना + +SmokePing फ़ाइल नाम ट्री में स्थान से रखता है, इसलिए नाम या स्थान बदलने पर नई खाली फ़ाइल शुरू होती है। आयात को गायब पथ और उसी होस्ट/प्रोब का नया पथ मिले तो केवल प्रस्ताव दर्ज करता है। Inventory में **Review** पुष्टि खोलता है। फिर जोड़ने पर स्मोक ग्राफ़, सारांश स्रोत और उपकरण मैपिंग नए लक्ष्य में जाते हैं और पुरानी फ़ाइल का इतिहास संग्रहित ग्राफ़ में पढ़ने योग्य रहता है। **Dismiss Proposal** बिना बदलाव बंद करता है। + + +## अनुमतियाँ + +प्लगइन के तीन क्षेत्र हैं। **SmokePing View** पृष्ठ खोलने देता है, जिसमें केवल उपयोगकर्ता के देखने योग्य उपकरणों से मैप लक्ष्य हैं, और उपकरण ग्राफ़ से लिंक खोलने देता है। **SmokePing Operator** Operations पृष्ठ और वर्तमान अवलोकनों की व्यक्तिगत स्वीकृतियाँ जोड़ता है; मापी स्वास्थ्य स्थिति नहीं बदलता और अलर्ट नहीं दबाता। **SmokePing Admin** में Operator पहुँच शामिल है और इन्वेंटरी, स्वास्थ्य पृष्ठ तथा ऊपर की क्रियाएँ खुलती हैं। सीमित उपकरण अनुमति वाला व्यवस्थापक बिना मैप लक्ष्य और अपने देखने योग्य उपकरणों के लक्ष्य देखता है। + +ग्राफ़ और स्रोत सामान्य Cacti ऑब्जेक्ट हैं, इसलिए Cacti अनुमतियाँ तय करती हैं कि कौन देखे। डिफ़ॉल्ट अनुमति विधि उदार है: उपयोगकर्ता केवल कुछ उपकरणों तक तभी सीमित होता है जब उपकरण, ग्राफ़ और ग्राफ़ टेम्पलेट नीतियाँ सभी निषेध करें। बदलाव अगले अनुरोध पर लागू होते हैं। + + +## उपकरण हटाना + +मैप उपकरण हटाने से उसकी मैपिंग और स्रोतों के प्लगइन रिकॉर्ड हटते हैं, लक्ष्य इन्वेंटरी में बिना मैप रहता है। SmokePing फ़ाइलें नहीं छुई जातीं: [ADR 0007](../../../decisions/0007-read-only-mount-under-rra-path.md) देखें। diff --git a/docs/i18n/manifest.json b/docs/i18n/manifest.json new file mode 100644 index 0000000..9c15e51 --- /dev/null +++ b/docs/i18n/manifest.json @@ -0,0 +1,19 @@ +{ + "locales": [ + "zh-CN", + "hi-IN", + "es-ES", + "es-419", + "ar-SA" + ], + "sources": [ + "README.md", + "docs/install.md", + "docs/operations.md", + "docs/provisioning.md", + "docs/alerting.md", + "docs/backup-restore.md", + "docs/configuration-format.md", + "docs/performance.md" + ] +} diff --git a/docs/i18n/zh-CN/README.md b/docs/i18n/zh-CN/README.md new file mode 100644 index 0000000..11f9673 --- /dev/null +++ b/docs/i18n/zh-CN/README.md @@ -0,0 +1,142 @@ + + + +[English](../../../README.md) | [简体中文](README.md) | [हिन्दी](../hi-IN/README.md) | [Español (España)](../es-ES/README.md) | [Español (Latinoamérica)](../es-419/README.md) | [العربية](../ar-SA/README.md) + + +

+ + + SmokePing Cacti 插件:佩戴含 SmokePing 图表徽章的仙人掌 + +

+ + +# Cacti 的 SmokePing 插件 + +[![CI](https://github.com/somethingwithproof/plugin_smokeping/actions/workflows/plugin-ci-workflow.yml/badge.svg)](https://github.com/somethingwithproof/plugin_smokeping/actions/workflows/plugin-ci-workflow.yml) +[![License: GPL-2.0-or-later](https://img.shields.io/badge/license-GPL--2.0--or--later-blue.svg)](../../../LICENSE) +![PHP >= 8.2](https://img.shields.io/badge/php-%3E%3D8.2-777bb4.svg) +![Cacti >= 1.2.31](https://img.shields.io/badge/cacti-%3E%3D1.2.31-2e7d32.svg) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=coverage)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=somethingwithproof_plugin_smokeping&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=somethingwithproof_plugin_smokeping) +![SmokePing: read-only](https://img.shields.io/badge/smokeping-read--only-6b7280.svg) + +这是一个 Cacti 1.2 插件,将 SmokePing 的延迟和丢包测量作为普通设备、数据源和图表引入 Cacti。烟雾图与所属设备一起显示,遵循 Cacti 权限,并可由 Thold 告警和 Maint 抑制。它是面向 Cacti 的独立实现,不属于 [SmokePing](https://oss.oetiker.ch/smokeping/),也未获得其认可;SmokePing 的原作者是 Tobias Oetiker 和 Niko Tyni。插件不包含也不运行 SmokePing 代码:它读取 SmokePing 写入的配置和 RRD 文件,其图表模板用于绘制与 SmokePing 原生图表相同的序列。 + +> **状态:开发中。观测模式(第 1 阶段)已在 `main` 实现,并作为 1.0.0-rc.1 预发布版发布。** 插件读取 SmokePing 配置和 RRD 文件,显示其状态,为其创建 Cacti 设备、数据源和图表,并向 Thold 和 Maint 提供数据。它不会向 SmokePing 写入任何内容。托管模式(由插件写入 SmokePing 配置)和远程采集器属于后续阶段,尚未开始,不在此版本中。真实安装环境的试点和更接近 SmokePing 原生图例的工作仍在里程碑 4 中待完成。入门请参阅 [docs/install.md](docs/install.md)。 + + +## 访问角色 + +| 权限域 | 访问权限 | +| --- | --- | +| SmokePing View | 现有监控页面。 | +| SmokePing Operator | 监控、运维页面以及个人排查确认。 | +| SmokePing Admin | 操作员访问权限及现有配置和管理操作。 | + +复制升级文件后,以管理员身份打开插件页面,注册新权限域。在**配置 > 用户**或用户组中明确授予 Operator 权限域。升级保留现有 View 和 Admin 权限域的 ID 及授权。每次请求时,Admin 继承 Operator 访问权限,Operator 继承 View 访问权限;这不会向用户或组添加持久化授权。插件设置除需要 Cacti 的设置权限外,还需要 SmokePing Admin 权限。 + +Cacti 设备权限仍限制每位用户可访问的行和操作;未映射对象需要管理员处理。凭据、配置、映射、删除和其他管理更改仍在管理页面中执行。确认记录仅在当前用户会话中有效,最多一小时,并且仅在同一观测结果仍然新鲜时有效。新出现或更改的观测结果会使确认失效。确认绝不会将失败的测量标记为健康,也不会抑制告警。 + + +## 截图 + +从运行中的 SmokePing 2.8.2 网络导入 Cacti 1.2.31,显示最近 12 小时。每个目标的设备都有主节点烟雾图和每个从节点(`lon1`、`sgp1`)的烟雾图,在图表树中归入相应 SmokePing 部分。 + +![Bangalore 目标的 Cacti 树视图:主节点及 lon1、sgp1 从节点的烟雾图](../../images/screenshot-tree-asia.png) + +![London 目标的 Cacti 树视图:同地区的 lon1 从节点显示微秒延迟和可见烟雾](../../images/screenshot-tree-europe.png) + + +## 原因 + +SmokePing 善于测量延迟分布和丢包,其烟雾图能显示仅平均值图表隐藏的变化。与 Cacti 一起运行时,仍有三个缺口: + +- **访问控制独立。** SmokePing CGI 不知道 Cacti 用户、组或设备权限。 +- **没有设备上下文。** 同一设备的延迟和接口计数器位于不同工具中。 +- **无法接入 Cacti 告警。** Thold 和 Maint 作用于 Cacti 数据源及设备,因此 SmokePing 告警需单独配置和抑制。 + +插件将每个 SmokePing 目标表示为指向现有 SmokePing RRD 文件的 Cacti 对象,并添加少量采集的摘要值,补足这些缺口。它复用 Cacti 图表、权限、Thold 和 Maint,而不是另建一套。Cacti 远程数据采集器支持计划在第 3 阶段提供,不在此版本中。 + + +## 范围与状态 + +| 阶段 | 范围 | 里程碑 | 状态 | +|---|---|---|---| +| 0,研究 | 兼容性矩阵、上游行为确认、图表保真度原型 | [M1](https://github.com/somethingwithproof/plugin_smokeping/milestone/1) | 结果在 `docs/research`;部分研究议题仍未解决 | +| 1,观测 | 清单导入、Cacti 设备、烟雾和摘要图表、Thold 告警、Maint 抑制、健康状态页面 | [M2](https://github.com/somethingwithproof/plugin_smokeping/milestone/2)、[M3](https://github.com/somethingwithproof/plugin_smokeping/milestone/3)、[M4](https://github.com/somethingwithproof/plugin_smokeping/milestone/4) | 已作为 1.0.0-rc.1 发布;试点待完成 | +| 2,托管 | Cacti 所有的配置命名空间、ICMP 和 TCP 探针配置、修订、验证、重载、回滚 | [M5](https://github.com/somethingwithproof/plugin_smokeping/milestone/5) | 已计划,未开始 | +| 3,远程 | Cacti 远程数据采集器上的 SmokePing、从节点作为测量位置 | [M6](https://github.com/somethingwithproof/plugin_smokeping/milestone/6) | 已计划,未开始 | + +范围之外:插件自有告警引擎、报表引擎、自定义守护进程或网络协议、托管 HTTP/DNS/服务检查(由 servcheck 覆盖),以及写入 SmokePing RRD 文件。 + + +## 兼容性目标 + +| 组件 | 目标 | +|---|---| +| Cacti | 1.2.x 中的 1.2.31 或更高版本,无需核心补丁 | +| PHP | 8.2 或更高版本;`setup.php` 在 8.0 中仍可解析,使不支持的运行时得到拒绝,而不是损坏 Cacti 界面 | +| SmokePing | 2.9.0、2.8.2 和 2.7.3(后者仅限 Ubuntu 22.04,直到 2027-06-01) | +| Thold、Maint | 无需更改 | +| 序列 | 每个安装支持 10,000 条,使用 20 次 ping 和 300 秒步长([性能](docs/performance.md#supported-series-count)) | + + +## 文档 + +| | | +|---|---| +| [安装](docs/install.md) | 要求、SmokePing 数据目录的只读挂载、安装、容器、支持版本 | +| [运维](docs/operations.md) | 各状态含义及证据、健康检查、输入失败时的行为 | +| [向 Cacti 添加目标](docs/provisioning.md) | 单目标、多设备、重新关联、权限 | +| [告警](docs/alerting.md) | 摘要值、Thold 持续时间、过期和延迟数据、与 SmokePing 告警重叠、Maint | +| [配置格式](docs/configuration-format.md) | YAML 和 XML 导出、导入 | +| [备份与恢复](docs/backup-restore.md) | 备份内容及恢复后的继续运行方式 | +| [性能](docs/performance.md) | 本地和发布运行器在 100、1,000、10,000 条序列下的测量,以及每安装 10,000 条的支持上限 | +| [故障验证](../../failure-qualification.md) | 故障场景及各自测试方式 | +| [发布流程](../../RELEASING.md) | 拉取请求、签名标签、工作流行为以及验证发布结果的步骤 | +| [发布归档](../../release.md) | 版本、变更日志和发布归档 | +| [测试](../../testing.md) | 测试套件、CI 执行内容和针对真实 SmokePing 的实时套件 | + + +## 设计 + +- [docs/PLAN.md](../../PLAN.md) 是完整计划:架构、依赖的上游事实(含来源)、状态模型、安全边界、性能计算、测试和风险。 +- [docs/decisions/](../../decisions) 保存已做出的架构决策记录。 +- [docs/REQUIREMENTS.md](../../REQUIREMENTS.md) 将每个需求 ID 映射到对应议题。 + +```mermaid +flowchart LR + SP[SmokePing daemon] --> RRD[(RRD files)] + RRD -->|read-only| R[Reader on the adjacent Cacti poller] + RRD -->|read-only| G[Cacti graph templates] + R --> SS[Script server summary data sources] + SS -->|poller_output| T[Thold and Maint] + G --> P[Cacti graph permissions] +``` + + +## 工作跟踪方式 + +- **里程碑**遵循计划。每个里程碑都有一个史诗议题,列出子议题和完成证据。 +- **议题**按标签分类:`type: requirement`、`type: research`、`type: decision`、`type: epic`。需求议题包含带编号的可测试需求(`REQ-AREA-NNN`)和验收标准。 +- **标签**还包括 `area:`、`phase:`、`priority:` 和 `status:`。参阅 [CONTRIBUTING.md](../../../CONTRIBUTING.md#labels)。 +- [项目看板](https://github.com/users/somethingwithproof/projects/6) 显示各里程碑的全部议题。 + + +## 贡献 + +请阅读 [CONTRIBUTING.md](../../../CONTRIBUTING.md)。提交需要 DCO 签署。设计讨论在议题中进行;未决决策带有 `type: decision` 标签。 + + +## 安全 + +请私下报告漏洞;参阅 [SECURITY.md](../../../SECURITY.md)。 + + +## 许可证 + +GNU 通用公共许可证 v2.0,与 Cacti 及其插件相同。参阅 [LICENSE](../../../LICENSE)。 diff --git a/docs/i18n/zh-CN/docs/alerting.md b/docs/i18n/zh-CN/docs/alerting.md new file mode 100644 index 0000000..14ab3f8 --- /dev/null +++ b/docs/i18n/zh-CN/docs/alerting.md @@ -0,0 +1,63 @@ + + + +# 使用 Thold 和 Maint 对 SmokePing 数据告警 + +插件不发送告警。它为每个目标位置向 Cacti 提供一个被轮询的“SmokePing Summary”数据源,Thold 和 Maint 像处理其他数据源一样处理它([ADR 0002](../../../decisions/0002-alert-through-cacti-data-sources.md))。这两个插件都无需更改。本页面向操作员,说明数据源报告的内容及此方法的边界。 + + +## 数据源报告的内容 + +每个摘要数据源由 Cacti 采集器通过脚本服务器轮询。脚本只读取读取器缓存中的一行:在 Cacti 轮询期间绝不打开 RRD 文件,也不联系 SmokePing。 + +| 数据源 | 含义 | 何时为 `U`(未知) | +|---|---|---| +| `median` | 最近一轮已完成测量的往返时间中位数,单位毫秒 | 此轮超过 SmokePing 心跳期限(`step` 的两倍)、RRD 缺失或从未更新,或该轮没有中位数(全部丢包) | +| `loss_pct` | 最近一轮已完成测量的 `loss / pings x 100` | 此轮超过心跳期限、RRD 缺失或从未更新,或该轮没有写入丢包值 | +| `age` | 距 RRD 上次更新的秒数 | RRD 不存在,或读取器没有对应缓存行 | + +数据缺失时,`median` 和 `loss_pct` 绝不会是 `0`。因此停止的采集器不会显示为零丢包。只要 RRD 存在,`age` 就保持数值,即使其他两个已变为 `U`,因此可以针对过期告警。对于已创建但从未更新的文件,报告从插件首次发现目标起经过的时间。 + +从 `step + freshness allowance` 到 `step` 两倍之间的轮次为“延迟”:仍报告其值。全部丢包表现为 `loss_pct` 100 且 `median` 为 `U`。 + +摘要数据源必须由运行读取器的 Cacti 采集器(“SmokePing Poller”设置)轮询,因为缓存存储在该采集器的数据库中。插件拒绝在分配给其他采集器的设备上创建摘要数据源,并指出应使用的采集器。 + + +## 阈值 + +使用 Thold 模板或在各数据源上为 `loss_pct`、`median` 和 `age` 创建 Thold 阈值。典型值如下: + +| 告警内容 | 阈值 | 备注 | +|---|---|---| +| 丢包 | `loss_pct` 高阈值为 5 至 10 | 全部丢包为 100 | +| 延迟 | `median` 高阈值为您的毫秒限制 | `U` 不产生延迟告警 | +| 采集器停止或缓慢 | `age` 高阈值为 `step` 的 2 至 3 倍 | 唯一能报告采集器停止的值 | + +值为 `U` 时,`median` 或 `loss_pct` 阈值不会触发。请使用 `age` 判断“SmokePing 已停止测量”。 + + +## 限制 + +这些限制来自 Cacti 和 SmokePing 的采样方式,而非插件,插件无法消除它们。 + +**Thold 持续时间至少应为一个 `step`。** Cacti 按自己的间隔轮询,SmokePing 按自己的 `step` 测量。Cacti 间隔短于 `step` 时,同一轮会报告多次;长于它时,会跳过一些轮次。因此,一个超限样本并不等于一轮超限测量。将 Thold 触发持续时间设为至少一个 `step`(默认 300 秒步长和 300 秒采集间隔时,触发计数设为 2 次轮询)。短于 `step` 的持续时间可能因同一轮被计数两次而告警。 + +**延迟到达的从节点数据绝不会重新触发或清除告警。** SmokePing 从节点缓存未能送达的结果并重发,主节点按时间戳顺序应用它们,因此过去时间窗口的数据可能延迟到达。Thold 在轮询时评估值。迟到的轮次会更新 RRD 和图表,但不会更改 Thold 已评估的值,因此不会补发遗漏的告警,也不会清除已触发的告警。从节点落后时,该位置的 `age` 增长,使延迟可见。 + +**告警只看到摘要。** 中位数、丢包和年龄描述最后一轮。调查分布请使用烟雾图。 + +**SmokePing 自身的告警独立运行。** SmokePing 配置中的 `alerts` 部分仍然有效。若一个目标同时在 SmokePing 和 Thold 中告警,且符合两者条件,同一问题可能产生两次通知;插件不会关闭任何一方。健康页面根据清单读取的 `alerts` 值,在 `dual_alerting` 下列出这些目标,其继承方式与 SmokePing 相同。 + +**Cacti RRD 是副本。** 摘要值同时存储在 Cacti 和 SmokePing 自己的 RRD 中,因此两者的保留期或合并方式差异可能反映在图表中。 + + +## 维护 + +在目标设备上设置“Cacti device”类型的 Maint 计划,会抑制该设备的 Thold 通知。Thold 继续评估,插件继续填充摘要数据源,因此图表和 `age` 不会出现空缺。计划结束且仍超限时,需要再次达到触发计数才恢复通知:设备维护期间,Thold 不计入超限次数。 + +Maint 只识别设备,不识别单个目标。持有多个目标的设备会对所有目标静默。目标级计划需要新增 Maint 计划类型,不属于本插件范围。 + + +## 验证 + +`tests/run-alert-e2e.sh` 在容器内使用 Cacti 1.2.31 和插件工作区中的 `plugin_thold`、`plugin_maint` 副本运行整个路径:测试采集器向 SmokePing 布局的 RRD 追加轮次,读取器缓存它们,`poller.php` 通过脚本服务器轮询摘要数据源,然后 Thold 和 Maint 对其处理。它验证 `loss_pct` 阈值在达到触发计数后告警并恢复,Maint 设备计划在数据源仍被轮询时抑制通知,维护结束后告警触发,以及测试采集器停止时 `age` 阈值触发、恢复采集后恢复。 diff --git a/docs/i18n/zh-CN/docs/backup-restore.md b/docs/i18n/zh-CN/docs/backup-restore.md new file mode 100644 index 0000000..8fee1c6 --- /dev/null +++ b/docs/i18n/zh-CN/docs/backup-restore.md @@ -0,0 +1,98 @@ + + + +# 备份与恢复 + +同时恢复三项内容后,Cacti 和 SmokePing 组合即可继续工作:Cacti 数据库、SmokePing 配置及 SmokePing 数据目录。本页说明每项保存什么、如何备份、恢复后做什么,以及数据库丢失时如何从 YAML 导出恢复插件自身配置。 + + +## 备份内容 + +| 项目 | 保存内容 | 插件为何需要 | +|---|---|---| +| Cacti 数据库 | 插件表(目标、映射、创建的对象、读取器缓存、健康状态)、Cacti 设备、数据源、图表及插件设置 | 映射、数据源路径和图表定义存储在这里 | +| SmokePing 配置:`/etc/smokeping/config` **及它包含的每个文件**(`@include` 行、Debian 和 Ubuntu 的 `config.d/*`、`secrets` 文件、`smokemail`、`basepage.html`) | 目标树 | 清单解析它。目标身份是树中的路径,其 RRD 文件是 `datadir/.rrd` | +| SmokePing 数据目录(`datadir`) | RRD 文件 | 每个图表和摘要值均读取它们;它们是历史记录,无法重建 | + +插件设置存储在数据库中。[下文](#restore-from-the-yaml-export)所述导出是插件自身配置的第二份文本副本,不能替代上述三项中的任何一项。 + + +## 执行备份 + +在大致相同的时间转储数据库并复制文件,使数据库中的目标与磁盘文件描述相同配置。 + +```sh +# The Cacti database (use your own credentials file or option file, not a password on the command line) +mariadb-dump --defaults-extra-file=/root/.cacti-backup.cnf --single-transaction cacti > cacti.sql + +# SmokePing's configuration, with its included files +tar -czf smokeping-config.tgz -C /etc/smokeping . + +# SmokePing's data directory +tar -czf smokeping-datadir.tgz -C /var/lib/smokeping . + +# The plugin's own configuration, as YAML (optional second copy) +php /var/www/html/cacti/plugins/smokeping/cli/smokeping.php export --file=/var/backups/smokeping-config.yaml +``` + +使用您的发行版的 `datadir`(EL 和 Fedora 为 `/var/lib/smokeping/rrd`)。SmokePing 持续写入 RRD 文件,运行期间复制可能取得正在更新中的文件。为获得一致副本,请使用文件系统或卷快照,或在复制期间停止 SmokePing(`systemctl stop smokeping`;这造成测量缺口,而不是丢失历史)。SmokePing 数据目录可能包含其他目录(Debian 的 `__cgi`、Alpine 的 `images`);包含或省略它们都安全。 + +插件绝不写入 SmokePing 文件,因此恢复数据目录与插件所存内容的差异只可能来自下述映射。 + + +## 恢复 + +1. 按[安装指南](install.md)安装 Cacti、PHP 和 SmokePing,并从发布归档安装同版本或更新的插件。 +2. 恢复 Cacti 数据库。 +3. 将 SmokePing 配置和数据目录恢复到备份时的路径,并启动 SmokePing。 +4. 在插件挂载路径以只读方式挂载数据目录([安装指南第 3 步](install.md#3-mount-the-data-directory-read-only-inside-cactis-rra-path))。 +5. 等待采集器运行,或执行一次 `php plugins/smokeping/poller_smokeping.php --force --inventory`。 + +无需其他步骤。如果插件文件比恢复的数据库更新,插件会在下次页面加载或采集周期迁移其表,并仅在每一步成功后记录版本。 + +恢复内容及其原理: + +- **映射解析到相同的 RRD 文件。** 数据源路径为 `/smokeping/.rrd`,相对于挂载点,因此主机或 Cacti 目录改变时它不变。目标身份是其在 SmokePing 树中的路径,而不是数据库 ID;恢复后的配置具有相同树。 +- **读取器恢复运行。** 读取器缓存保存每个文件最后看到的轮次;下次运行读取各文件的 `lastupdate` 并替换该行。Cacti 停机时 SmokePing 写入的轮次会在第一次运行时取得,每个序列的新鲜度根据文件自己的时间计算,而不是读取器上次查看的时间。 +- **图表可以渲染。** 它们是基于已恢复数据源和文件的普通 Cacti 图表。 + +在 **SmokePing Health** 检查结果:一个采集周期后,挂载、读取器和清单均为 OK,SmokePing 页面列出映射目标并显示当前新鲜度。 + + +### 恢复的数据库早于 SmokePing 配置时 + +数据库备份后新增的 SmokePing 目标不会出现在恢复的数据库中。下次清单会发现它并列为未映射。此后删除的目标标记为已消失,管理员像平常一样重新关联或归档。不会丢失任何内容:文件仍在数据目录中,在 **SmokePing Inventory** 单击即可映射。 + + +### 恢复的数据目录不含最新轮次时 + +SmokePing 从恢复文件的最后更新时间起继续写入。图表中的缺口就是备份与恢复之间的时间段。 + + +## 从 YAML 导出恢复 + +Cacti 数据库丢失且只剩导出时,可以不依赖数据库恢复插件目标和映射,并重新创建数据源与图表: + +1. 在新主机安装 Cacti 和插件,恢复 SmokePing 配置和数据目录,并按上文挂载数据目录。在 Settings 页面设置路径(路径不导入;参见[格式](configuration-format.md))。 +2. 使用与之前**相同的主机名和描述**重新创建 Cacti 设备。ID 可以不同。导出通过这两个值标识每个映射设备。 +3. 检查并应用导出: + + ```sh + php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml + php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml --apply --confirm= + ``` + + 检查会列出拟更改内容,并拒绝设备缺失或存在歧义的映射。第二条命令执行前不写入任何内容,它需要第一条命令打印的计划 ID。 +4. 为每个映射目标重新创建数据源和图表:`php plugins/smokeping/cli/smokeping.php provision --device=`。它们指向原来的文件。 + +导出保存插件设置、目标和映射,不保存数据源、图表或 RRD 路径,因此需要第 4 步;从数据库备份恢复时不需要这一步。 + + +## 卸载 + +卸载会尝试导出 YAML(参见[安装指南](install.md#upgrading-and-removing)),但导出失败不会阻止卸载。**卸载前,请自行导出配置,并验证备份可读且完整。** 卸载绝不触碰 SmokePing 文件;请按上述方法从已验证的导出恢复。 + + +## 验证 + +`sh tests/run-restore-e2e.sh ` 在全新容器和数据库中运行两种恢复:在可用安装中预配设备与数据源,转储数据库并归档 SmokePing 配置和数据目录,在 SmokePing 写入新一轮时将三者恢复到新容器,并检查插件已启用且升级无操作,每个映射、设备和数据源路径相同,每个数据源在挂载点下解析到校验和与备份一致的文件,图表可渲染,以及一个采集周期后读取器缓存包含新轮次。随后仅从 YAML 导出恢复到全新数据库,并检查映射跟随设备名称,清单运行后仍保留映射,预配能在相同文件上重建数据源。 diff --git a/docs/i18n/zh-CN/docs/configuration-format.md b/docs/i18n/zh-CN/docs/configuration-format.md new file mode 100644 index 0000000..348b125 --- /dev/null +++ b/docs/i18n/zh-CN/docs/configuration-format.md @@ -0,0 +1,121 @@ + + + +# 配置文件格式 + +插件自身配置使用一种格式导入和导出,提供两种表示:YAML(默认)和 XML。本页定义架构版本 1。设计原因见[决策 0008](../../../decisions/0008-yaml-and-xml-configuration-files.md)。 + +文件包含插件设置、插件已读取的 SmokePing 目标(观测目标)及每个目标映射到的 Cacti 设备。它不包含数据源、图表、RRD 路径或凭据。Cacti 的图表、数据和主机模板是另一回事,仍采用 Cacti XML。 + + +## 命令 + +```sh +php plugins/smokeping/cli/smokeping.php export # YAML to standard output +php plugins/smokeping/cli/smokeping.php export --format=xml --file=/var/backups/smokeping-config.xml +php plugins/smokeping/cli/smokeping.php import --file=smokeping-config.yaml # check only +php plugins/smokeping/cli/smokeping.php import --file=smokeping-config.yaml --apply --confirm= +``` + +`export --file` 创建仅所有者可读的新文件,拒绝覆盖现有文件。不带 `--apply` 的 `import` 读取并检查文件,打印所有拟更改内容及计划 ID,不写入任何内容。`--apply` 需要带该 ID 的 `--confirm`;它在单个事务中应用,如果检查后文件或安装发生变化则拒绝。退出状态:0 完成,1 拒绝或失败,2 文件或计划有错误。 + +在 **Management > SmokePing Configuration**(SmokePing Admin 权限域)可执行相同操作:下载导出,选择文件检查,查看所列更改,然后应用。 + +导入仅添加和更新。它绝不删除目标、将映射移到其他设备(请在 Inventory 页面重新关联)、创建数据源、图表或 RRD 文件,也不读写 SmokePing 数据目录。卸载将配置的 YAML 导出写入 **Backup Directory** 设置指定的位置;若该设置为空,则写入 Cacti 目录中的 `cache/smokeping/`。文件使用随机名称和 `0600` 权限,默认目录含拒绝所有访问的 `.htaccess` 和不提供任何内容的 `index.php`。若 Backup Directory 不存在或不可写,则不写导出(插件不会退回默认目录),卸载仍继续,并报告文件写入位置或未写入文件。请选择 Web 根目录之外的目录。 + + +## 架构版本 1 + +```yaml +schema_version: 1 # required; a higher number is refused + +settings: # optional; any subset of the settings below + smokeping_poller_id: 1 + smokeping_reader_budget: 120 + smokeping_inventory_interval: 300 + smokeping_freshness_allowance: 60 + smokeping_uninstall_keep_tables: false + +reference_settings: # optional; shown for reference, never imported + smokeping_config_file: /etc/smokeping/config + smokeping_backup_dir: '' + smokeping_datadir: /var/lib/smokeping + smokeping_mount_path: /var/www/html/cacti/rra/smokeping # omitted from exports while it is the default + +targets: # optional + - path: Europe/Paris # required; the SmokePing tree path + poller_id: 1 # default 1; must exist + host: paris.example.net + probe: FPing + menu: Paris # optional text + title: 'Paris: gateway' # optional text + slaves: # optional list of slave names + - site-b + nomasterpoll: false + step: 300 # 0 to 604800 + pings: 20 # 0 to 10000 + mode: observed # only observed + admin_state: enabled # enabled, disabled, or archived + present: true # honored for a new target only + +mappings: # optional + - target: Europe/Paris # a target in this file or already in the installation + poller_id: 1 + device: + hostname: paris-gw.example.net # the Cacti device's host name (not case sensitive) + description: Paris gateway # and its description (exact) +``` + +身份。目标由 `poller_id` 和 `path` 标识。设备由 `hostname` 和 `description` 标识;没有设备或多个设备具有该组合时,检查拒绝映射。导入会去除文本两端空格,因为插件读取所有存储值时也会这样处理。 + +保留键。`managed_targets` 和 `probe_profiles` 留给将来增加托管模式的版本。版本 1 以指出键名的错误拒绝它们,使为未来版本编写的文件不会被部分应用。后续版本通过它们扩展架构;只有更改此处现有键的含义时才提高 `schema_version`。 + +更新。对于已存在目标,导入只更改 `host`、`probe`、`menu`、`title`、`slaves`、`nomasterpoll`、`step`、`pings` 和 `admin_state`。前六个字段仍以 SmokePing 配置为源,下次清单运行会恢复它们。因此请用导入恢复 `admin_state` 或初始化全新安装,不要用它编辑目标。 + +设置值必须为指定类型。文本不得包含控制字符。 + +仅供参考的设置。指定文件或目录的设置(上述 `reference_settings` 中的全部设置)绝不通过导入写入:文件不得更改插件读写的位置。架构通过类型标识它们,将其中一个置于 `settings` 的文件会被拒绝。在 `reference_settings` 中,它们会被检查格式(绝对路径,或允许时为空)、与安装比较,有差异时在计划中列为 `not applied, change on the Settings page`。请在 Settings 页面更改。1.0.0-rc.1 导出的文件还在此列出 `smokeping_perl_binary` 和 `smokeping_lib_dir`;这些设置已不存在,导入会跳过。 + + +## XML + +```xml + + + + 1 + false + + + /var/lib/smokeping + + + + site-b + + + + + + + + +``` + +XML 与上述 YAML 键一一对应。布尔值为 `true` 或 `false`。读取器拒绝任何 DOCTYPE 或实体声明,不加载外部资源,且只接受这些元素。 + + +## YAML 子集 + +读取器接受块映射、块列表、普通标量、单引号及双引号标量、注释、`|` 和 `|-` 字面块,并可在开头使用一个可选的 `---`。双引号标量接受转义 `\\ \" \/ \n \t \r \0 \b \f \e \xHH \uHHHH`;单引号标量通过重复引号(`''`)转义。带引号标量在自身所在行闭合。 + +以下内容会被拒绝并报告行号:锚点(`&x`)、别名(`*x`)、标签(`!x`)、流集合(`[a, b]`、`{a: b}`)、折叠块(`>`)、多个文档、指令、合并键(`<<`)、复杂键(`?`)、重复键、用作缩进的制表符、多行普通标量及超过 8 层的嵌套。对于其他 YAML 版本会解释为非文本的普通标量也会拒绝:`yes`、`no`、`on`、`off`、`y`、`n`、前导零数字、小数、十六进制、日期以及 `1:30` 等时间。请加引号(`'yes'`)。`true`、`false`、`null`、`~` 和普通整数保留其含义。 + +导出器会为读取器可能误解析的每个字符串加引号,包括含冒号或 `#`、首尾空格或首字符被 YAML 视为指示符的字符串。 + + +## 限制 + +两种格式的文件均限制为 8 MiB 和 8 层嵌套,每行限制为 16 KiB。读取前先检查文件大小。 diff --git a/docs/i18n/zh-CN/docs/install.md b/docs/i18n/zh-CN/docs/install.md new file mode 100644 index 0000000..f853871 --- /dev/null +++ b/docs/i18n/zh-CN/docs/install.md @@ -0,0 +1,214 @@ + + + +# 安装 SmokePing 插件 + +本指南将 Cacti 1.2 主机和 SmokePing 安装从零配置到 Cacti 图表,涵盖插件安装、对 SmokePing 数据目录的只读访问(最常出错的部分)、验证、容器及支持范围。日常运维见[运维](operations.md),告警见[告警](alerting.md),备份见[备份与恢复](backup-restore.md)。 + + +## 支持范围 + +| 组件 | 支持 | 此处测试 | +|---|---|---| +| Cacti | 1.2.31 和当前 1.2.x 分支(1.2.32 改变数据源路径检查,见挂载说明) | 1.2.31 发布版和 1.2.32 开发副本 | +| PHP | 8.2 或更新。8.0/8.1 拒绝安装,Cacti 继续工作 | 集成及端到端测试用 8.2.35;入口点用 8.0 语法检查 | +| SmokePing | 2.9.0、2.8.2、2.7.3(仅 Ubuntu 22.04,至 2027-06-01) | 三者均测配置解析器,与 2.7.3(Ubuntu 22.04)、2.8.2(Debian 13)、2.9.0(Fedora 45)原生解析器比较;三者均测图表保真度 | +| rrdtool | Cacti 所用版本;读取器执行 `path_rrdtool` | 1.7.2 | +| Thold、Maint | 无需更改 | 插件工作区版本 | +| 序列数 | 每安装 10,000 条,20 次 ping、300 秒步长、4 个专用 vCPU 和 8 GB([性能](performance.md#supported-series-count)) | 发布运行器上 100、1,000、10,000 条 | + +“序列”是一个目标在一个测量位置(主节点或从节点)。发行版支持遵循供应商完整支持期;见[发行版矩阵](../../../research/distribution-matrix/README.md)。Debian 13、Ubuntu 22.04 至 26.10、EL 9、Fedora 43 至 45、Alpine 3.22 至 3.24 提供 SmokePing 包。**EL 10 和 openSUSE Leap 16 没有 SmokePing 包**,因此仅在源码安装可用的范围内工作,本指南不覆盖源码安装。 + + +## 组件如何配合 + +SmokePing 写入 RRD,Cacti 绘图,插件读取最新值,后两者均不写入。Cacti 1.2.32 及以后拒绝 RRA 目录之外的数据源路径,因此插件通过 **Cacti RRA 路径内的只读挂载**访问 SmokePing 数据目录,默认为 `/smokeping`([决策 0007](../../../decisions/0007-read-only-mount-under-rra-path.md))。挂载也是主要保护:Cacti 清理功能无法通过它删除或重命名。 + +运行读取器的 Cacti 采集器必须能读取 SmokePing 主机上两项内容: + +1. 配置文件(`/etc/smokeping/config`)及包含文件,由插件自身 PHP 解析器读取。包含文件必须在配置目录或下层,其他路径拒绝。插件不运行 Perl,也不需要 SmokePing Perl 库。 +2. 通过挂载读取数据目录。 + +若位于不同主机,以只读 NFS 共享数据并挂载到运行 SmokePing 采集器的主机;见[运维](operations.md#topologies)。在 Cacti 远程数据采集器上运行 SmokePing 属于后续阶段,本版本不支持。 + + +## 1. 安装 SmokePing(如尚未安装) + +Debian 13 和 Ubuntu: + + +```sh +apt-get update +DEBIAN_FRONTEND=noninteractive apt-get install -y smokeping +``` + +EL 9(包在 EPEL,需要 CodeReady Builder): + + +```sh +dnf install -y epel-release +dnf config-manager --set-enabled crb +dnf install -y smokeping +``` + +照常配置 SmokePing,用 `systemctl enable --now smokeping` 启动。数据目录在 Debian、Ubuntu、Alpine 为 `/var/lib/smokeping`,EL、Fedora 为 `/var/lib/smokeping/rrd`。下文 `DATADIR` 指该目录(配置 `*** Database ***` 中的 `datadir`),`RRA` 指 Cacti RRA 路径(Console > Configuration > Settings > Paths 的“RRA Path”;示例为 `/var/www/html/cacti/rra`)。 + +**目录中其他内容。** Debian 将从节点缓存存于 `DATADIR/__cgi/
/`(SmokePing `dyndir`),不自行创建部分目录,因此尚未报告的从节点对应 `__cgi/
/` 为空或缺失;Alpine 图片缓存位于 `DATADIR/images`,排序器缓存位于 `DATADIR/__sortercache`。插件全部忽略:它绝不列出数据目录,只读取配置声明的 RRD(`
/.rrd` 和各从节点 `~.rrd`)。这些目录及无目标拥有的 RRD(如 `Local/LocalMachine.rrd`)都不读取、不列出、不报错。已在 Debian 13 主节点和两个从节点验证([测试](../../../testing.md#the-live-suite))。 + + +## 2. 允许 Cacti 采集器读取 SmokePing + +发行版包的 RRD 对所有人可读,所有父目录可遍历,因此采集器用户**无需加入组**。配置在 Debian、Ubuntu、Alpine 对所有人可读,在 EL、Fedora 为 `0640 root:apache`,仅 `apache` 和 root 可读。 + +以采集器用户身份检查可读性(Debian/Ubuntu 为 `www-data`,EL/Fedora 为 `apache`): + + +```sh +runuser -u "$POLLER_USER" -- test -r "$DATADIR" && echo "datadir readable" +runuser -u "$POLLER_USER" -- test -r /etc/smokeping/config && echo "config readable" +runuser -u "$POLLER_USER" -- ls "$DATADIR" > /dev/null && echo "datadir listable" +``` + +每行必须打印,包默认权限下确实如此:无需组成员资格或 SmokePing 主机上其他设置。只有权限严于软件包(如 `datadir` 为 `0750 smokeping:smokeping`),或 EL/Fedora 使用非 `apache` 用户时才失败。此时只给予该用户读取权,例如对配置目录和 `DATADIR` 使用 ACL(`setfacl -R -m u:$POLLER_USER:rX`),绝不让 Cacti 用户可写 SmokePing 文件。 + + +## 3. 在 Cacti RRA 路径内只读挂载数据目录 + +选择以下一种。两者均创建绑定挂载,需要使用 root 一次。 + + +### 选项 A:`/etc/fstab` 行 + + +```sh +mkdir -p "$RRA/smokeping" +echo "$DATADIR $RRA/smokeping none bind,ro 0 0" >> /etc/fstab +mount "$RRA/smokeping" +``` + +立即生效并在每次启动生效。若用普通 `mount --bind` 测试,还需重新挂载,因为旧 `util-linux` 首次绑定忽略 `ro`:`mount -o remount,bind,ro "$RRA/smokeping"`。 + + +### 选项 B:systemd `.mount` 单元 + +文件名须为挂载路径中 `/` 变成 `-`;让 systemd 计算: + + +```sh +unit=$(systemd-escape --path --suffix=mount "$RRA/smokeping") +cat > "/etc/systemd/system/$unit" < +### 验证挂载 + + +```sh +findmnt -no TARGET,SOURCE,OPTIONS "$RRA/smokeping" +findmnt -no OPTIONS "$RRA/smokeping" | tr ',' '\n' | grep -x ro +touch "$RRA/smokeping/.cacti-write-test" && echo "WRITABLE: fix the mount before continuing" || echo "read-only, as required" +ls "$RRA/smokeping" | head +``` + +必须出现 `ro`,`touch` 必须以 `Read-only file system` 失败(即使 root),列表必须显示 SmokePing 部分。Health 从 `/proc/self/mountinfo` 重复检查,将可写挂载、缺少挂载或路径中符号链接报告为**错误**。符号链接不能替代挂载:Cacti 1.2.32 及以后拒绝经过符号链接的数据源路径。 + + +## 4. 安装插件 + +从发布归档安装(见[打包](../../../release.md)): + +```sh +tar -xzf smokeping-0.2.0.tar.gz -C /var/www/html/cacti/plugins +chown -R root:root /var/www/html/cacti/plugins/smokeping +cd /var/www/html/cacti +sudo -u www-data php cli/plugin_manage.php --plugin=smokeping --install --enable --allperms +``` + +目录必须名为 `smokeping`。以 Cacti 文件所有者(EL 为 `apache`)运行最后命令。`--allperms` 给控制台管理员三个插件权限域;其他用户由 User Management 获得 **SmokePing View**、**SmokePing Operator** 或 **SmokePing Admin**。Operator 包含 View 访问权限,Admin 包含 Operator 访问权限。插件安装表以及图表和主机模板;模板导入失败时在 Health 显示并继续工作,修复原因后可用 **Retry Template Import** 重试。 + +PHP 低于 8.2 时拒绝安装并提示所需版本,Cacti 其他部分不受影响。 + + +## 5. 配置与确认 + +打开 **Console > Configuration > Settings > SmokePing** 并检查: + +| 设置 | 含义 | +|---|---| +| SmokePing Poller | 与 SmokePing 同主机或共享文件系统的 Cacti 采集器。只有它读取数据。 | +| SmokePing Configuration File | `/etc/smokeping/config`,除非已移动 | +| SmokePing Data Directory | SmokePing 所见的 `DATADIR` | +| Cacti Mount of the Data Directory | 第 3 步挂载点;默认 `/smokeping` | +| Loss Colors | Automatic;若读取器看不到 SmokePing 的 `Smokeping.pm` 且版本为 2.7,则选 SmokePing 2.7。见[丢包颜色](provisioning.md#loss-colors) | + +在 SmokePing 采集器服务器打开 **SmokePing Health**。配置行立即读取文件,显示目标数或第一个错误的文件与行号。下次采集后每行应为 OK:PHP、配置、读取器、清单、挂载、模板。要立即运行而不等待: + +```sh +sudo -u www-data php plugins/smokeping/poller_smokeping.php --force --inventory +``` + +**SmokePing Inventory** 现在列出全部目标。尚未绘图;见[预配](provisioning.md)以添加到 Cacti。 + + +## 语言 + +插件包含西班牙西班牙语(`es-ES`)、法语(`fr-FR`)、德语(`de-DE`)、简体中文(`zh-CN`)、印地语(`hi-IN`)、阿拉伯语(`ar-SA`)和日语(`ja-JP`)。启用语言支持(Configuration > Settings > General > Language Support)且用户选择语言后显示。还包含拉丁美洲西班牙语(`es-419`),但 Cacti 1.2 无此可选区域,因此需 Cacti 添加后才生效;此前请选择西班牙语(`es-ES`)。 + + +## 容器 + +让读取器从开始就能访问本指南所述两项内容。 + +- **Cacti 在容器,SmokePing 在主机。** 将数据只读挂载到 RRA 路径,配置目录也只读挂载: + + ```sh + docker run -d --name cacti \ + -v /var/lib/smokeping:/var/www/html/cacti/rra/smokeping:ro \ + -v /etc/smokeping:/etc/smokeping:ro \ + my-cacti-image + ``` + + 将数据挂载左侧替换为主机的 `DATADIR`。镜像不需要 SmokePing 内容:无需 Perl 或 `smokeping` 包。容器 PHP 必须 8.2 或更新。Health 检查挂载的 `:ro`;缺少则报告错误。 +- **Docker Compose。** 相同配置,使用带 `read_only: true` 和 `type: bind` 的 `volumes:` 项: + + ```yaml + services: + cacti: + volumes: + - type: bind + source: /var/lib/smokeping + target: /var/www/html/cacti/rra/smokeping + read_only: true + ``` + +- **Kubernetes。** `volumeMounts` 中设置 `readOnly: true`,后端为 SmokePing pod 写入的 hostPath、NFS 或 CSI 卷。 +- **SmokePing 在容器。** 将其 `datadir` 放在与 Cacti 主机共享的卷,按上文只读挂载到 Cacti。插件无需进入 SmokePing 容器。 + + +## Cacti RRD 清理器会列出 SmokePing 文件 + +清理器(**Utilities > RRD Cleaner**)遍历整个 RRA,因此将没有 Cacti 数据源的 SmokePing RRD(包括从节点 `target~slave.rrd`)列为未使用并提供删除。不要选择它们。通过只读挂载删除或归档会失败,Cacti 记录警告并移除队列项,文件得以保留;但警告造成干扰,可写挂载则会丢数据。插件在清除前移除可识别队列项(每次采集开始扫描),使警告少见。清理器无排除列表,选择文件前请阅读列表。 + + +## 升级与移除 + +用新版替换插件目录,打开 Plugins 页面或等待下一采集周期;插件迁移表及模板,仅在每步成功后记录新版,因此下一次会完成中断升级。禁用停止任务,不动 SmokePing 文件。**卸载前,请自行导出配置,并验证备份可读且完整。** 卸载会尝试将插件配置导出为 YAML,写入 Backup Directory 或 Cacti 的 `cache/smokeping/`(随机文件名、模式 `0600`,成功后显示路径)。如果导出失败,会记录并显示警告,但卸载仍会继续。除非设置 **Keep Plugin Tables on Uninstall**,否则删除插件表;绝不触碰 SmokePing 文件或配置。 diff --git a/docs/i18n/zh-CN/docs/operations.md b/docs/i18n/zh-CN/docs/operations.md new file mode 100644 index 0000000..1f3c1ac --- /dev/null +++ b/docs/i18n/zh-CN/docs/operations.md @@ -0,0 +1,107 @@ + + + +# SmokePing 插件运维 + +本页说明如何解读插件显示的内容、各状态含义和依据、异常时检查什么,以及输入失败时插件如何响应。安装见[安装](install.md),告警见[告警](alerting.md),备份见[备份与恢复](backup-restore.md)。 + +View、Operator 和 Admin 权限及个人分诊行为见[访问角色](../README.md#access-roles)。 + + +## 页面 + +| 页面 | 权限域 | 内容 | +|---|---|---| +| **SmokePing**(顶部标签) | View | 映射到可见设备的目标的最新状态,每目标、每位置一行 | +| **SmokePing Inventory** | Admin | 配置列出的全部 SmokePing 目标,无论是否映射,以及待处理重新关联建议 | +| **SmokePing Health** | Admin | 下列检查和重试模板导入按钮 | +| **SmokePing Configuration** | Admin | 插件配置导出与导入([格式](configuration-format.md)) | +| **Import SmokePing Configuration**(在 Import/Export 下) | Admin | 将现有 SmokePing 配置导入为设备、图表及图表树([方法](provisioning.md#a-whole-smokeping-configuration)) | + +烟雾图和摘要图都是普通 Cacti 图表,受 Cacti 图表和设备权限控制。 + + +## 各状态的含义 + +SmokePing 每行组合独立维度。它们绝不合为一种颜色,因为采集器停止和全部丢包需要不同响应。 + +| 维度 | 状态 | 依据 | +|---|---|---| +| 新鲜度 | `current`、`delayed`、`stale`、`never` | RRD 最后更新时间(由 `rrdtool lastupdate` 读取)距今时长,与目标 `step` 比较。Current:在一个 `step` 加新鲜度余量(默认 60 秒)内。Delayed:更久,但不超过 `step` 两倍,即 SmokePing 心跳期限。Stale:超过心跳期限,SmokePing 值已未知。Never:文件缺失或创建后从未更新 | +| 执行 | `completed`、`probe_error`、`unknown` | 写入数值丢包时,该轮完成。过期或从未观测的数据不能说明最后一轮,因此为 `unknown`。绝不设置 `probe_error`:失败探针写出的值与目标不响应相同([研究](../../../research/probe-failures.md)) | +| 状况 | `within_policy`、`degraded`、`complete_loss`、`unknown` | 来自最后一轮完成的测量。`loss` 等于 `pings` 且无中位数为全部丢包。低于此值的任何丢包为退化。停止的采集器绝不显示为丢包:它变为过期,状况为 `unknown` | +| 管理 | `enabled`、`disabled`、`archived` | 插件中的目标记录。禁用或归档的目标不读取 | +| 维护 | 维护中或非维护中 | Maint 对目标设备的 `is_device_in_maintenance` 钩子,显示在目标页面 Maintenance 列。没有 Maint 或禁用时,所有设备显示不在维护中 | +| 测量时间 | 距最后更新的秒数 | RRD 自身时间戳。刷新页面绝不算作测量 | + +每个位置的新鲜度来自自身文件(从节点为 `target~slave.rrd`),因此即使主节点当前,从节点落后也会显示过期。 + +丢包列显示最后一轮的 `lost/pings`,中位数以毫秒表示;`U` 表示未知,不是零。 + + +## 健康检查 + +| 检查 | OK 的含义 | 非 OK 时 | +|---|---|---| +| `php_binary` | Cacti 设置指定的 PHP 二进制存在且可执行 | 读取器无法启动:修正 Cacti 的“PHP Binary Path”设置 | +| `reader` | 上次运行在三个采集间隔内完成,且未超预算 | 警告:读取器延迟或超预算。序列多时提高预算或检查存储;见[性能](performance.md) | +| `inventory` | 上次清单成功解析 SmokePing 配置 | 错误:显示 SmokePing 解析器的文件、行号和消息。继续使用上一份清单 | +| `mount`、`read-only`、`writable` | 挂载路径在 RRA 内,不经过符号链接,只读挂载且不可写 | 错误。见[安装指南](install.md#3-mount-the-data-directory-read-only-inside-cactis-rra-path) | +| `visibility` | 清单中的文件通过挂载可见 | 警告,注明缺失数量 | +| `templates` | 已导入 SmokePing 模板 | 错误并给出原因;修复后使用 **Retry Template Import** | +| `device_pollers` | 所有具有摘要数据源的设备都由读取器所在采集器轮询 | 错误并列出设备:改由该采集器轮询之前,摘要值和告警没有数据 | +| `loss_colors` | Loss Colors 选择的丢包颜色:读取器发现的 SmokePing 版本颜色或指定颜色。更改后主采集器在后续周期迁移现有图表,每周期 200 个;`upgrade-graphs` 立即迁移。该行统计仍用其他颜色的图表,并警告迁移失败者 | 读取器未发现版本且设置为 Automatic 时未知:使用 2.8 及以后颜色。设置与发现版本不符时警告。见[丢包颜色](provisioning.md#loss-colors) | +| `dual_alerting` | 没有目标同时有 SmokePing `alerts` 值和摘要数据源上已启用的 Thold 阈值 | 警告列出最多 10 个目标:同时符合两方条件会通知两次。检查不比较条件;例如没有 SmokePing 丢包告警时,Thold `age` 阈值仍可能触发。删除 SmokePing 告警或禁用阈值前先比较。未安装 Thold 时为 OK | + + +## 常见情况 + +- **全部为 `stale`。** SmokePing 停止写入,或挂载已过期。检查 `systemctl status smokeping`,然后比较通过挂载和 SmokePing 主机上对相同文件执行 `rrdtool lastupdate` 的结果。只读 NFS 挂载可能因属性缓存时间而延迟。 +- **一个从节点 `stale`,主节点 `current`。** 从节点停止投递。主节点在迟到结果到达时应用它们,因此图表回填;Thold 不重新评估([告警](alerting.md))。 +- **目标显示 `never`。** RRD 尚不存在(SmokePing 在重载后首轮创建),或挂载未显示它。检查 `visibility` 结果。 +- **Cacti 升级到 1.2.32 后图表为空。** RRA 之外的数据源路径会被 Cacti 生成的路径替换。确认挂载位于插件所述位置,且没有任何符号链接。 +- **SmokePing 部分被重命名。** SmokePing 为新路径创建新文件。清单提出重新关联建议,在管理员确认前不更改([预配](provisioning.md#re-linking-a-renamed-target))。 + + +## 拓扑 + +1. **SmokePing 位于 Cacti 采集器主机。** 采集器用户通过绑定挂载读取数据目录。安装指南描述此场景。 +2. **SmokePing 数据目录共享给 Cacti 主机。** 在运行 SmokePing 采集器的主机 RRA 路径下,通过 NFS 只读挂载。健康页面将文件最后更新时间与时钟比较,因此滞后挂载显示 `delayed` 或 `stale`。烟雾图在提供 Web 界面的 Cacti 服务器渲染,所以该服务器也需要共享;仅采集器挂载时,摘要源和告警可用,但烟雾图为空。 +3. **SmokePing 位于 Cacti 远程数据采集器** 属于后续阶段,本版本不支持。 + +只有 **SmokePing Poller** 指定的采集器读取 SmokePing 数据。摘要数据源所在设备必须由它轮询。 + + +## 输入失败时 + +以下是该版本经过验证的行为([故障验证](../../../failure-qualification.md));均不会丢失数据。 + +| 故障 | 已记录行为 | +|---|---| +| SmokePing 配置不可读或损坏 | 清单失败并在 Health 显示解析器消息;保留上一份清单,不删除内容 | +| SmokePing 继续运行但探针无法执行:二进制错误退出、源地址不在主机上、fping 拒绝参数或 FPing6 的 IPv6 被禁用 | SmokePing 对该探针全部目标写入全部丢包,与无响应目标相同。测量显示 `complete_loss`。若一个探针的所有目标同时全部丢包,请在 SmokePing 日志查找探针错误 | +| SmokePing 检测到探针故障:二进制缺失、参数越界、fping 无原始套接字 | SmokePing 在启动或首轮退出。所有目标变为 `delayed`,随后 `stale`,与 SmokePing 停止相同 | +| 目标主机名无法解析(DNS 故障) | 探针失败并写入丢包;插件读取 SmokePing 所写内容。显示 `degraded` 或 `complete_loss`,不是过期。插件自身不解析名称 | +| SmokePing 或其采集器停止 | 新鲜度变为 `delayed` 再 `stale`;`median` 和 `loss_pct` 未知,`age` 持续增加。绝不为零丢包 | +| Cacti 与 SmokePing 主机时钟偏差 | 新鲜度比较 RRD 更新时间和 Cacti 时钟,偏差会平移所有年龄。SmokePing 领先时给轮次写入未来时间,显示 `current`;停止的采集器会保持 `current` 直到偏差时间过去。SmokePing 落后时所有序列看起来更旧,超过 `step` 两倍即 `stale`。两台主机均保持 NTP | +| RRD 不可读或损坏 | 读取器对文件记录警告并继续其他文件。从未读取的序列为未知(`U`)。之前读取过的保留缓存最后值,随时间经过 `delayed` 和 `stale` 变未知,因此文件损坏绝不变为零丢包 | +| Cacti 主机存储已满 | 读取器只写数据库缓存。写入被拒绝时正常退出,所有缓存行完整保持原样;存储恢复后下一周期缓存新轮次。摘要源的 Cacti RRD 与其他数据源一样失败 | +| 读取器运行中被终止 | 每个缓存行完整写入,因此已留下的行是完整读数。Cacti 检测到死进程,下一次运行立即开始并完成全部序列 | +| 第二个读取器启动 | Cacti 进程表允许每采集器一个读取器。重复进程立即以 0 退出并记录备注(Medium 日志级别);不干扰第一个 | +| 维护开始与结束 | Maint 抑制设备通知;Thold 继续评估,摘要数据源继续轮询 | +| 插件升级中断 | 记录版本只在每步成功后更改;下次页面加载或采集周期完成升级 | + + +## 导入与导出 + +见[配置格式](configuration-format.md)。简写形式: + +```sh +php plugins/smokeping/cli/smokeping.php export --file=/var/backups/smokeping-config.yaml +php plugins/smokeping/cli/smokeping.php import --file=/var/backups/smokeping-config.yaml +``` + + +## 日志 + +插件以 `SMOKEPING` 标签写入 Cacti 日志。`grep SMOKEPING log/cacti.log` 显示读取器统计(`SMOKEPING STATS`)、清单失败、模板导入失败以及每次已应用的配置导入。 diff --git a/docs/i18n/zh-CN/docs/performance.md b/docs/i18n/zh-CN/docs/performance.md new file mode 100644 index 0000000..300560d --- /dev/null +++ b/docs/i18n/zh-CN/docs/performance.md @@ -0,0 +1,101 @@ + + + +# 性能 + +容量以序列表示:一个目标在一个测量位置(主节点或从节点)。本页说明插件在 100、1,000 和 10,000 条序列下的成本、测量环境及尚待补充的数据。需求 ID 来自 [#42](https://github.com/somethingwithproof/plugin_smokeping/issues/42)。 + + +## 每个请求和周期的工作 + +- **页面请求不运行探针、不读取 RRD 文件,也不等待远程采集器(REQ-PERF-003)。** 概览页面从数据库读取读取器缓存行。`tests/bin/perf-page.php` 将挂载路径指向不存在的目录来渲染它,结果相同。图表是 Cacti 图表,按所有 Cacti 图表的方式读取文件。 +- **每个采集器有一个读取器进程,每周期读取每条序列一次**,使用一条 `rrdtool` 管道,并有时间预算(默认 120 秒)。达到预算的运行停止,下次从等待最久的序列继续。读取一个文件是一次读取文件头的 `lastupdate` 调用,因此不依赖 RRD 大小。 +- **每个摘要数据源只读取一行缓存**,绝不接触 RRD 文件。 +- **批量添加的确认界面在创建前显示负载(REQ-PERF-004)**:对匹配目标,显示序列数、SmokePing 将承担的每秒探针包数和 RRD 更新数,以及 Cacti 数据源行数和图表项行数。计算位于 `lib/LoadEstimate.php`。 + + +## 计算 + +10,000 条序列,每 300 秒 20 次 ping:平均约 667 包/秒,SmokePing RRD 约 33 次更新/秒;若读取器每步检查所有序列,则约 33 次 `lastupdate` 读取/秒。Cacti 对象为 260,000 行 `data_template_rrd`(每序列烟雾数据源 23 行、摘要 3 行)和 550,000 行图表项(每序列烟雾图 50 行、摘要图 5 行),脚本服务器轮询 10,000 个摘要数据源。下文发布测试使用 [#81](https://github.com/somethingwithproof/plugin_smokeping/issues/81) 之前的模板,并精确统计其行数:每个烟雾图 47 行,总计 520,000 行。#81 添加了标准差、am/s 和探针行项。确认界面计算相同数字,`tests/Unit/LoadEstimateTest.php` 将其与分发的模板核对。 + + +## 本地初步测量 + +在一台笔记本的 Docker 容器中,使用插件脚本(`sh tests/run-perf.sh `)测量:**这是代码的本地初步测量,不是发布性能指标。** 机器:Apple silicon、aarch64,Docker 可用 14 个 CPU 和 15.7 GiB,同一主机容器中运行 MariaDB 10.11 和 PHP 8.2,RRD 文件位于 Docker 绑定挂载。序列:20 次 ping、300 秒步长,每个测试 RRD 为 193 KB(SmokePing 原生文件为数 MB;`lastupdate` 读取头部,大小不影响该读取)。 + +| 序列 | 读取器,首次完整遍历 | 读取器,文件未变化 | 一个默认(120 秒)周期覆盖的序列 | 概览渲染(CLI,仅数据库) | 页面内存峰值 | 页面 HTML | +|---|---|---|---|---|---|---| +| 100 | 0.2 s | 低于 0.1 秒 | 100 / 100 | 0.002 s | 8 MB | 0.02 MB | +| 1,000 | 1.2 s | 1.1 s | 1,000 / 1,000 | 0.012 s | 12 MB | 0.17 MB | +| 10,000 | 12.3 s | 11.6 s | 10,000 / 10,000 | 0.119 s | 58 MB | 1.68 MB | + +表格显示:在此环境读取器每序列约需 1.2 ms,呈线性增长,因此本地磁盘上 10,000 条序列消耗约十分之一默认预算。概览在一页列出全部已映射序列(10,000 条时约 10,000 行、1.7 MB HTML),数据库和 PHP 耗时很小。这些数字不包括浏览器、Web 服务器、Cacti 页面框架、NFS,也不包括 SmokePing 同时写入文件的情况。 + +这里未测量:已预配对象的 Cacti 管理页面(见发布测量)、只读 NFS 挂载,以及读取器运行期间真实 SmokePing 守护进程每秒写入 33 个文件。 + + +## 发布测量 + +于 2026-11-15 在一个 DigitalOcean droplet 测量:sfo3 的 `c-4`、4 个专用 vCPU(Intel Xeon Platinum 8280)、8 GB、Ubuntu 24.04,同一主机容器中运行 Cacti 1.2.31、PHP 8.5.12、RRDtool 1.7.2 和 MariaDB 10.11.19。序列为 20 次 ping、300 秒步长,每个目标有自己的设备,测试 RRD 位于只读绑定挂载。 + + +### 读取器与概览页面 + +`sh tests/run-perf.sh `: + +| 序列 | 读取器,首次完整遍历 | 读取器,文件未变化 | 一个默认(120 秒)周期覆盖的序列 | 概览渲染(CLI,仅数据库) | 页面内存峰值 | 页面 HTML | +|---|---|---|---|---|---|---| +| 100 | 0.2 s | 低于 0.1 秒 | 100 / 100 | 0.004 s | 8 MB | 0.02 MB | +| 1,000 | 1.9 s | 2 s | 1,000 / 1,000 | 0.028 s | 12 MB | 0.17 MB | +| 10,000 | 20.6 s | 19.9 s | 10,000 / 10,000 | 0.244 s | 58 MB | 1.68 MB | + +此主机读取器每序列约需 2 ms,因此 10,000 条消耗约六分之一默认预算。 + + +### 带全部对象的 Cacti 页面和采集器 + +`sh tests/run-perf-objects.sh ` 创建目标及设备,计时页面,通过插件预配每个目标的摘要和烟雾对象,再次计时,然后运行两个采集周期,每次都等待前一周期的读取器完成。`PERF_OBJECTS=stock` 则为每设备分配两个 Cacti Local Linux Machine 模板图表(“Unix - Load Average”和“Linux - Memory Usage”):每序列图表数与插件相同,用于 REQ-PERF-002 对比。页面时间为 HTTP 上的 p50/p95 毫秒值,预热一次后请求 20 次,以管理员登录,由 PHP 内置服务器提供。“仅设备”表示尚未创建任何图表的相同设备。 + +| 序列 | 对象 | 设备列表 | 数据源列表 | 图表列表 | 插件概览 | +|---|---|---|---|---|---| +| 100 | 仅设备 | 28/31 | 25/35 | 35/37 | 38/40 | +| 100 | 标准图表 | 28/39 | 48/56 | 33/48 | 29/39 | +| 100 | 插件对象 | 28/39 | 51/53 | 33/34 | 28/29 | +| 1,000 | 仅设备 | 30/42 | 25/26 | 26/36 | 59/64 | +| 1,000 | 标准图表 | 32/33 | 50/51 | 39/40 | 65/66 | +| 1,000 | 插件对象 | 42/44 | 54/77 | 39/40 | 58/68 | +| 10,000 | 仅设备 | 50/57 | 28/37 | 28/30 | 301/319 | +| 10,000 | 标准图表 | 66/69 | 50/75 | 107/111 | 331/338 | +| 10,000 | 插件对象 | 65/68 | 54/78 | 105/119 | 318/340 | + +| 序列 | 预配插件对象 | 首次采集周期(创建 RRD) | 稳定采集周期 | 读取器 | +|---|---|---|---|---| +| 100 | 31 s | 2.0 s | 1.6 s | 0.2 s | +| 1,000 | 324 s | 6.5 s | 5.1 s | 1.6 s | +| 10,000 | 3,284 s | 57.1 s | 43.5 s | 21.5 s | + +10,000 条序列下,插件对象为 260,000 行 `data_template_rrd`、520,000 行图表项和 10,000 个采集项;标准图表相应为 50,000 和 240,000 行。采集周期由一个 cmd.php 进程轮询 10,000 个摘要数据源;读取器由 `poller_bottom` 启动并在旁运行。两者均远低于 300 秒间隔。预配是单个管理员的批量添加:每序列约 0.33 秒,因此 10,000 条接近一小时。同一 droplet 上同一脚本早前运行对 10,000 条耗时 6,141 秒(每条 0.61 秒),因此应预留一到两小时。 + + +### 与需求对照 + +- **REQ-PERF-001(10,000 条时概览少于两秒):满足。** HTTP p95 为 0.34 秒。 +- **REQ-PERF-002(10,000 条时管理页面在基准加 20% 内):满足**,基准为标准图表。10,000 条时,插件 p95 在设备列表低 1%,数据源列表高 4%,图表列表高 7%。1,000 条时,数据源列表 p95 比标准图表高 51%(77 对 51 ms),而中位数相差 8%,两次运行均如此:差异在最慢请求,而不是典型请求。与完全没有图表的设备相比,任何 20,000 个图表,无论标准还是插件,都会使所有页面变慢。 +- **REQ-PERF-003(每请求无探针、RRD 读取有界、无远程等待):满足**(见首节)。 +- **REQ-PERF-004(批量添加前显示负载):满足。** 估算与运行中统计的行数一致。 + + +## 支持的序列数 + +**每个 Cacti 安装 10,000 条序列**,20 次 ping、300 秒步长,硬件类似发布运行器:4 个专用 vCPU、8 GB,数据库位于同一主机。在此数量下,读取器消耗六分之一默认预算,采集周期占间隔七分之一,Cacti 管理页面与同数量标准图表的差异不超过 7%。超过 10,000 条尚未测量。 + + +## 复现 + +```sh +sh tests/run-perf.sh # 100, 1,000, and 10,000 series +sh tests/run-perf.sh 1000 # one size +sh tests/run-perf-objects.sh # Cacti's pages and the poller with every object +``` + +每次运行用 `tests/bin/perf-seed.php` 初始化目标,用 `tests/bin/make-fixture-rrds.php` 创建 RRD,用 `poller_smokeping.php --force` 读取,再用 `tests/bin/perf-page.php` 渲染页面。 diff --git a/docs/i18n/zh-CN/docs/provisioning.md b/docs/i18n/zh-CN/docs/provisioning.md new file mode 100644 index 0000000..15090c3 --- /dev/null +++ b/docs/i18n/zh-CN/docs/provisioning.md @@ -0,0 +1,115 @@ + + + +# 向 Cacti 添加 SmokePing 目标 + +清单发现的每个目标在 **SmokePing Inventory** 中对管理员可见,在映射到 Cacti 设备前对其他人不可见。未经管理员确认不创建任何内容。插件绝不写入 SmokePing 文件。 + + +## 单个目标 + +在 SmokePing Inventory 中,存在且未映射的目标有 **Add to Cacti** 链接。确认界面提供两种选择: + +- **创建新设备**,使用“SmokePing Target”模板。设备使用目标主机,关闭可用性检查(SmokePing 已测量),并分配给运行读取器的采集器。 +- **映射到现有设备。** 下拉列表包含您可以更改的设备。 + +无论哪种方式,目标均获得用于告警的摘要数据源和图表(见[告警](alerting.md)),且当 SmokePing 数据可绘图时,每个位置有一张烟雾图。若 `pings` 不是 10、20 或 30,Cacti 在 RRDproxy 存储 RRD,或文件在只读挂载中不可见,则没有烟雾图,页面说明原因。此目标仍保留摘要数据。 + +摘要源由运行读取器的采集器轮询。现有设备由其他采集器轮询时,插件不创建摘要源,并指出应使用的采集器。健康页面列出后来被移至其他采集器的设备。 + + +## 多个设备 + +在设备列表选择设备并选 **Add SmokePing Targets**。确认界面对每设备列出 SmokePing `host` 与设备主机名相同(不区分大小写)的未映射目标,以及总匹配数。继续即添加。无匹配设备会被报告并保持原样,不创建设备。本地容器中一次请求添加 100 个设备约耗时 24 秒;极长选择会在请求时限前停止启动新设备,再运行即可完成,因为已添加设备会跳过。 + + +## 整份 SmokePing 配置 + +**Console > Import/Export > Import SmokePing Configuration** 一步将现有 SmokePing 安装引入 Cacti。需要 SmokePing Admin 权限域及覆盖全部设备的权限;镜像到图表树还需要 Trees 权限域。 + +选择输入: + +- **已配置文件**(默认):SmokePing Configuration File 设置,在服务器读取并包含其所有引用文件。包含文件必须在该目录或下层目录。 +- **上传文件**,最大 4 MiB。独立读取,因此不允许 `@include`,会带行号拒绝。目标使用读取器采集器可见的 RRD 绘图;下次清单会将该采集器 SmokePing 中不存在的目标标记为缺失。 + +然后选择选项: + +| 选项 | 默认 | 含义 | +|---|---|---| +| 设备 | 每 SmokePing 主机一个 | 探测相同主机的目标共用设备。每目标一个则各有独立设备,以其标题命名。 | +| 设备模板 | SmokePing Target | 导入创建的设备模板。 | +| 采集器 | 读取器的采集器 | 必须运行读取器;其他采集器被拒绝,因为其摘要源得不到数据。 | +| 站点 | 无 | 新设备的站点。 | +| 图表树 | 不镜像 | 现有树或按名称创建新树。每个 SmokePing 部分成为分支,每设备作为主机项位于其目标所在分支下。 | + +**Preview** 读取配置但不写入。显示每个 SmokePing 部分及复选框(选择部分并点 **Update Preview** 以只导入这些目标)、待创建或复用设备、待创建图表、仅获得摘要数据的目标及原因(ping 次数非 10/20/30,或 RRDproxy)、树分支与项,以及与批量操作相同的预计负载。所选采集器上若设备主机名匹配目标则复用(每目标一个设备时,描述还须匹配标题);两个设备匹配时,跳过并列出这些目标,需在 SmokePing Inventory 映射。**Import** 通过 Cacti 设备、图表和树函数精确应用预览计划。预览后若配置或 Cacti 改变,不写任何内容,需重新预览。 + +重复导入不创建新内容:已映射目标保留设备,复用图表和树项,结果列出各目标已在 Cacti 中。导入绝不写 SmokePing 文件或挂载。 + +使用相同选项的命令行导入: + +```sh +php plugins/smokeping/cli/smokeping.php import-smokeping --dry-run --tree-name=SmokePing +php plugins/smokeping/cli/smokeping.php import-smokeping --apply --confirm=PLAN --tree-name=SmokePing +``` + +`--file=PATH` 像上传一样独立读取另一个文件。`--sections=Europe,Lab/Core`、`--device-per=target`、`--device-template=ID`、`--poller=ID`、`--site=ID` 和 `--tree=ID` 设置其他选项。试运行打印计划及 ID;`--apply` 需要此 ID 且仍须匹配。 + + +## 图表尺度 + +SmokePing 每次渲染根据数据调整图表。Cacti 图表对所有时间范围只有一个上限,因此插件对最后一天应用 SmokePing 详细图规则(`Smokeping.pm` 的 `findmax`):图表文件最后一天最大中位数的 1.2 倍。SmokePing Navigator Graph 使用 1.5 倍;插件没有导航图。烟雾图创建时调整,之后约每日调整。最后一天无中位数则保留当前上限;新图保留模板的 0.05 秒(50 ms)。 + +每日调整默认开启,无设置选项。每次读取后,读取器调整其采集器目标中距上次调整至少一天的烟雾图,等待最久者优先,每周期最多 25 个。每图读取一个 RRD,不运行探针。读取耗尽预算的周期会跳过。五分钟一个周期可每天覆盖 7,200 图;更多时,每图频率略低于每日一次。 + +插件记录每图设定的上限。与记录不同的上限视为在图表页面手动设置,插件绝不更改。要交回控制,将其恢复为插件最后设置的值;`size-graphs` 对每个手动上限图表打印该值。 + +立即调整所有烟雾图: + +```sh +php plugins/smokeping/cli/smokeping.php size-graphs +``` + +它打印每图新上限、保留原上限或保留手动上限。手动上限规则与每日调整相同。需要 Cacti rrdtool 路径(Configuration > Settings > Paths);缺少时保留上限。 + +从 1.0.0-rc.1 升级时,没有记录说明已有上限是谁设置的,因此插件将每图当前上限视为自己的,在下次每日轮次调整。此前 `size-graphs` 也会覆盖手动上限。仅当上限不同于插件记录时才算手动,升级后记录值就是采纳值。要保留手动上限,请在每日调整替换后重新设置。若该次调整没有找到中位数,会保留采纳值;再次设置相同值无变化,之后的调整仍可能替换。 + + +## 图例和模板升级 + +烟雾图图例遵循 SmokePing:中位数的平均、最大、最小、最后值,标准差,am/s(平均除以标准差),随后是丢包值及颜色、探针行,例如 `probe: 20 ICMP Echo Pings (56 Bytes) every 300s`。探针行来自清单从配置读取的目标探针、包大小、ping 次数和步长。主采集器写入每图,并在目标探针改变或模板导入重置后重写。清单尚未读取探针前存储的目标显示探针名称。 + +升级带来新图表模板时,旧模板创建的图表保留旧项且仍可渲染,直到插件迁移。主采集器每周期处理 200 图,保留标题和上限。立即处理所有图: + +```sh +php plugins/smokeping/cli/smokeping.php upgrade-graphs +``` + +升级按模板设置图表项,因此手动修改的插件图表项会被替换。随后插件检查项与模板完全一致且使用的每个 VDEF 都存在。失败图保留旧项与旧版本,Cacti 日志注明名称。采集器不重试。`upgrade-graphs` 每次运行重新尝试每个失败图,若仍有失败则退出 1。 + + +## 丢包颜色 + +SmokePing 2.7 使用七个固定丢包等级;2.8 及以后按 ping 比例分级并增加全部丢包等级。插件为两者分发基于相同数据源的烟雾图模板,均匹配 SmokePing 原生图表([图表保真度](../../../research/graph-fidelity.md))。设置中的 **Loss Colors** 选择: + +- **Automatic**(默认)跟随读取器在 SmokePing 附近的 `Smokeping.pm`(`/usr/share/perl5`、`/usr/share/smokeping`、`/opt/smokeping/lib` 或 `/usr/local/smokeping/lib`)发现的版本,每次清单记录。低于 2.8 使用 2.7 颜色;找不到版本(如 SmokePing 在另一容器)则使用 2.8 及以后。 +- **SmokePing 2.8 and later** 或 **SmokePing 2.7** 固定颜色,不论读取器发现什么。 + +健康页 `loss_colors` 行显示当前颜色和原因。设置或 SmokePing 升级导致颜色改变时,主采集器每周期迁移 200 图到其他模板,保留标题、上限和数据。`upgrade-graphs` 立即迁移全部。失败图保留颜色,由下次 `upgrade-graphs` 重试,如上所述。 + + +## 重新关联已重命名目标 + +SmokePing 根据目标在配置树中的位置命名文件,因此重命名或移动节点会创建新空文件。导入发现某路径消失且出现相同主机和探针的新路径时,记录建议但不更改。清单页 **Review** 打开确认界面。重新关联将烟雾图、摘要源及设备映射移到新目标,同时在归档图表保留旧文件历史可读。**Dismiss Proposal** 关闭建议而不更改。 + + +## 权限 + +插件有三个权限域。**SmokePing View** 允许打开 SmokePing 页面(只列出映射到用户可见设备的目标),并从设备图表链接进入。**SmokePing Operator** 添加 Operations 页面及当前观测的个人确认;它不改变测量健康状态,也不抑制告警。**SmokePing Admin** 包含 Operator 访问权限,并打开清单、健康页及上述操作。设备权限受限的管理员可见未映射目标及其可见设备的目标。 + +图表和数据源是普通 Cacti 对象,由 Cacti 图表和设备权限决定谁可见。Cacti 默认权限方式是宽松的:只有设备、图表和图表模板策略全部拒绝时,用户才受限于部分设备。权限更改在用户下一请求生效。 + + +## 删除设备 + +删除已映射设备会移除映射及插件的数据源记录,将目标留在清单中且未映射。SmokePing 文件不受影响:见 [ADR 0007](../../../decisions/0007-read-only-mount-under-rra-path.md)。 diff --git a/docs/install.md b/docs/install.md index 09adbc2..61ca252 100644 --- a/docs/install.md +++ b/docs/install.md @@ -89,7 +89,6 @@ unit=$(systemd-escape --path --suffix=mount "$RRA/smokeping") cat > "/etc/systemd/system/$unit" < Settings > General > Language Support) and a user picks the language. A Latin American Spanish catalog (`es-419`) ships as well, but Cacti 1.2 has no Latin American Spanish locale to select, so it takes effect only when Cacti adds one; until then, choose Spanish (`es-ES`). +The plugin ships translations into Spanish (Spain, `es-ES`), French (`fr-FR`), German (`de-DE`), Simplified Chinese (`zh-CN`), Hindi (`hi-IN`), Arabic (`ar-SA`) and Japanese (`ja-JP`). Cacti shows them once language support is on (Configuration > Settings > General > Language Support) and a user picks the language. A Latin American Spanish catalog (`es-419`) ships as well, but Cacti 1.2 has no Latin American Spanish locale to select, so it takes effect only when Cacti adds one; until then, choose Spanish (`es-ES`). ## Containers @@ -168,7 +167,7 @@ Run the reader where it can see both things from the start of this guide. ```sh docker run -d --name cacti \ - -v /var/lib/smokeping:/var/www/html/rra/smokeping:ro \ + -v /var/lib/smokeping:/var/www/html/cacti/rra/smokeping:ro \ -v /etc/smokeping:/etc/smokeping:ro \ my-cacti-image ``` @@ -182,7 +181,7 @@ Run the reader where it can see both things from the start of this guide. volumes: - type: bind source: /var/lib/smokeping - target: /var/www/html/rra/smokeping + target: /var/www/html/cacti/rra/smokeping read_only: true ``` @@ -195,4 +194,4 @@ Cacti's RRD cleaner (**Utilities > RRD Cleaner**) walks the whole RRA path, so i ## Upgrading and removing -Replace the plugin directory with the new release and open the Plugins page or wait for the next poller cycle; the plugin migrates its tables and templates and records the new version only after every step succeeds, so an interrupted upgrade is finished by the next one. Disabling the plugin stops its jobs and leaves SmokePing's files alone. Uninstalling writes a YAML export of the plugin's configuration first, to the Backup Directory setting or else `cache/smokeping/` in the Cacti directory (random file name, mode `0600`, and the path is shown to you), drops the plugin's tables unless **Keep Plugin Tables on Uninstall** is set, and never touches SmokePing's files or configuration. +Replace the plugin directory with the new release and open the Plugins page or wait for the next poller cycle; the plugin migrates its tables and templates and records the new version only after every step succeeds, so an interrupted upgrade is finished by the next one. Disabling the plugin stops its jobs and leaves SmokePing's files alone. **Before uninstalling, export the configuration yourself and verify that the backup is readable and complete.** Uninstall attempts a YAML export of the plugin's configuration to the Backup Directory setting or else `cache/smokeping/` in the Cacti directory (random file name, mode `0600`, and the path is shown on success). If the export fails, a warning is logged and shown, but uninstall continues. It drops the plugin's tables unless **Keep Plugin Tables on Uninstall** is set, and never touches SmokePing's files or configuration. diff --git a/docs/operations.md b/docs/operations.md index b618f28..be8f1f1 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -2,6 +2,9 @@ How to read what the plugin shows, what each state means and what evidence it comes from, what to check when something looks wrong, and how the plugin behaves when its inputs fail. Installation is in [install](install.md), alerting in [alerting](alerting.md), backup in [backup and restore](backup-restore.md). +See [Access roles](../README.md#access-roles) for the View, Operator and Admin +permissions and personal triage behavior. + ## Pages | Page | Realm | Shows | diff --git a/docs/provisioning.md b/docs/provisioning.md index 2dc23ad..c6813da 100644 --- a/docs/provisioning.md +++ b/docs/provisioning.md @@ -94,7 +94,7 @@ SmokePing names a target's file after its place in the configuration tree, so re ## Permissions -The plugin has two realms. **SmokePing View** lets a user open the SmokePing page, which lists only targets mapped to devices the user is allowed to see, and follow the link from a device's graphs. **SmokePing Admin** opens the inventory and health pages and the actions above. An administrator whose device permissions are limited sees unmapped targets and the targets of the devices they may see. +The plugin has three realms. **SmokePing View** lets a user open the SmokePing page, which lists only targets mapped to devices the user is allowed to see, and follow the link from a device's graphs. **SmokePing Operator** adds the Operations page and personal acknowledgments of current observations; it does not change measured health or suppress alerts. **SmokePing Admin** includes Operator access and opens the inventory and health pages and the actions above. An administrator whose device permissions are limited sees unmapped targets and the targets of the devices they may see. Graphs and data sources are ordinary Cacti objects, so Cacti's own graph and device permissions decide who sees them. Cacti's default permission method is permissive: a user is limited to some devices only when the device, graph, and graph template policies all deny. Permission changes apply on the user's next request. diff --git a/include/operator.php b/include/operator.php new file mode 100644 index 0000000..1bd35be --- /dev/null +++ b/include/operator.php @@ -0,0 +1,64 @@ + + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This file is part of plugin_smokeping, a plugin for Cacti. + * https://github.com/somethingwithproof/plugin_smokeping + * + * 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. + */ + +use Somethingwithproof\Smokeping\SystemClock; +use Somethingwithproof\Smokeping\TargetRepository; +use Somethingwithproof\Smokeping\ObservationRepository; +use Somethingwithproof\Smokeping\FreshnessEvaluator; + +/** @return list */ +function smokeping_operator_rows(): array { + $rows = []; + $ids = []; + + foreach (get_allowed_devices() as $device) { + $ids[] = (int) $device['id']; + } + $targets = (new TargetRepository(false))->mappedTo($ids); + $targetIds = []; + + foreach ($targets as $entry) { + if ($entry['target']->id !== null) { + $targetIds[] = $entry['target']->id->value; + } + } + $observations = (new ObservationRepository(false))->forTargets($targetIds); + $freshness = new FreshnessEvaluator(new SystemClock(), smokeping_settings()->freshnessAllowance); + + foreach ($targets as $entry) { + $target = $entry['target']; + + if ($target->id === null) { + continue; + } + + foreach ($observations[$target->id->value] ?? [] as $observation) { + $rows[] = [ + 'id' => $target->id->value . ':' . $observation->location, + 'name' => $target->displayName() . ' / ' . ($observation->location === '' ? __('Master', 'smokeping') : $observation->location), + 'state' => $freshness->freshness($observation)->value . ' / ' . $freshness->condition($observation)->value, + 'observed' => $observation->observedAt, + 'interval' => $observation->expectedInterval, + 'detail' => __('Compare loss and latency with the SmokePing graphs and maintenance state. Escalate missing files, imports and relinking to an administrator.', 'smokeping') + ]; + } + } + + return $rows; +} diff --git a/lib/OperatorPage.php b/lib/OperatorPage.php new file mode 100644 index 0000000..c4262e5 --- /dev/null +++ b/lib/OperatorPage.php @@ -0,0 +1,133 @@ + + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This file is part of plugin_smokeping, a plugin for Cacti. + * https://github.com/somethingwithproof/plugin_smokeping + * + * 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. + */ + +namespace Somethingwithproof\Smokeping; + +/** Personal triage of current observations. It never changes measured health. */ +final class OperatorPage { + /** @param list $actions */ + public static function actionStatus(bool $allowed, string $action, string $method, bool $csrf, array $actions): int { + if (!$allowed) { + return 403; + } + + if (!in_array($action, $actions, true)) { + return 400; + } + + if ($method !== 'POST') { + return 405; + } + + return $csrf ? 200 : 403; + } + + /** @param array{id: string, name: string, state: string, observed: int, interval: int, detail: string} $row */ + public static function fingerprint(array $row): string { + return hash('sha256', (string) json_encode($row)); + } + + /** @param array{id: string, name: string, state: string, observed: int, interval: int, detail: string} $row */ + public static function fresh(array $row, int $now): bool { + return $row['observed'] > 0 && $row['observed'] <= $now && $now - $row['observed'] <= max(60, $row['interval']) * 2; + } + + /** + * Session-only acknowledgments expire with the evidence or after one hour. + * Only rows reloaded within the current user's device scope may be supplied. + * @param array $session + * @param array{id: string, name: string, state: string, observed: int, interval: int, detail: string} $row + */ + public static function acknowledge(array &$session, array $row, string $fingerprint, int $user, int $now): bool { + if ($user <= 0 || !self::fresh($row, $now) || !hash_equals(self::fingerprint($row), $fingerprint)) { + return false; + } + $entries = isset($session['entries'], $session['user']) && $session['user'] === $user && is_array($session['entries']) ? $session['entries'] : []; + + foreach ($entries as $id => $entry) { + if (!is_array($entry) || !isset($entry['at']) || !is_int($entry['at']) || $entry['at'] > $now || $now - $entry['at'] > 3600) { + unset($entries[$id]); + } + } + unset($entries[$row['id']]); + $entries[$row['id']] = ['fingerprint' => $fingerprint, 'at' => $now]; + $session = ['user' => $user, 'entries' => array_slice($entries, -100, null, true)]; + + return true; + } + + /** + * @param array $session + * @param array{id: string, name: string, state: string, observed: int, interval: int, detail: string} $row + */ + public static function acknowledged(array $session, array $row, int $user, int $now): bool { + $entries = $session['entries'] ?? []; + $entry = is_array($entries) ? ($entries[$row['id']] ?? null) : null; + + return ($session['user'] ?? 0) === $user && is_array($entry) + && isset($entry['fingerprint'], $entry['at']) && is_string($entry['fingerprint']) && is_int($entry['at']) + && $entry['at'] <= $now && $now - $entry['at'] <= 3600 + && self::fresh($row, $now) && hash_equals(self::fingerprint($row), $entry['fingerprint']); + } + + /** @param array{id: string, name: string, state: string, observed: int, interval: int, detail: string} $row */ + public static function form(array $row, string $action, string $label): void { + form_start('smokeping_operator.php'); + print ''; + print ''; + print ''; + print ''; + form_end(false); + } + + /** + * @param list $rows + * @param array $session + * @param array $actions + */ + public static function render(array $rows, array $session, int $user, int $now, array $actions): void { + print '

' . html_escape(__('Review the recorded observations below. Acknowledgments are personal to this session, expire when observations change, and never suppress alerts or change health.', 'smokeping')) . '

'; + print '
'; + html_start_box(__('SmokePing Operations', 'smokeping'), '100%', '', '3', 'center', ''); + print '' . implode('', array_map('html_escape', [__('Object', 'smokeping'), __('State', 'smokeping'), __('Observed (UTC)', 'smokeping'), __('Investigation', 'smokeping'), __('Actions', 'smokeping')])) . ''; + + foreach ($rows as $row) { + $fresh = self::fresh($row, $now); + $state = $row['state'] . ($fresh ? '' : ' / ' . __('Unknown or stale', 'smokeping')); + print '' . html_escape($row['name']) . '' . html_escape($state) . '' . html_escape($row['observed'] > 0 ? gmdate('Y-m-d H:i:s', $row['observed']) : __('Never', 'smokeping')) . '' . html_escape($row['detail']) . ''; + + if (self::acknowledged($session, $row, $user, $now)) { + print html_escape(__('Acknowledged; health unchanged.', 'smokeping')); + } elseif ($fresh) { + self::form($row, 'acknowledge', __('Acknowledge', 'smokeping')); + } + + foreach ($actions as $action => $label) { + self::form($row, $action, $label); + } + print ''; + } + + if ($rows === []) { + print '' . html_escape(__('No observations are available for devices you may access.', 'smokeping')) . ''; + } + html_end_box(); + print '
'; + } +} diff --git a/lib/Pages.php b/lib/Pages.php index 802ade3..5ee018a 100644 --- a/lib/Pages.php +++ b/lib/Pages.php @@ -26,6 +26,7 @@ * page script the plugin ships must appear in exactly one realm below. */ final class Pages { + public const OPERATOR = ['smokeping_operator.php']; public const VIEW = 'smokeping.php'; public const IMPORT = 'smokeping_import.php'; public const ADMIN = ['smokeping_inventory.php', 'smokeping_health.php', 'smokeping_config.php', self::IMPORT]; @@ -35,6 +36,7 @@ final class Pages { */ public static function realms(): array { return [ + ['name' => __('SmokePing Operator', 'smokeping'), 'files' => self::OPERATOR], ['name' => __('SmokePing View', 'smokeping'), 'files' => [self::VIEW]], ['name' => __('SmokePing Admin', 'smokeping'), 'files' => self::ADMIN], ]; @@ -44,7 +46,7 @@ public static function realms(): array { * @return list */ public static function files(): array { - return array_merge([self::VIEW], self::ADMIN); + return array_merge([self::VIEW], self::ADMIN, self::OPERATOR); } /** @@ -56,6 +58,7 @@ public static function files(): array { */ public static function menu(): array { return [ + 'smokeping_operator.php' => __('SmokePing Operations', 'smokeping'), 'smokeping_inventory.php' => __('SmokePing Inventory', 'smokeping'), 'smokeping_health.php' => __('SmokePing Health', 'smokeping'), 'smokeping_config.php' => __('SmokePing Configuration', 'smokeping'), diff --git a/lib/Schema.php b/lib/Schema.php index 9b70b9e..dc1d358 100644 --- a/lib/Schema.php +++ b/lib/Schema.php @@ -36,6 +36,7 @@ final class Schema { public const HOOKS = [ + 'auth_alternate_realms' => 'smokeping_auth_alternate_realms', 'config_arrays' => 'smokeping_config_arrays', 'config_settings' => 'smokeping_config_settings', 'draw_navigation_text' => 'smokeping_draw_navigation_text', @@ -195,6 +196,10 @@ public function recordPluginVersion(string $version, string $author, string $hom db_execute_prepared('UPDATE plugin_config SET version = ?, author = ?, webpage = ? WHERE directory = ?', [$version, $author, $homepage, self::PLUGIN], true, $this->connection); } + public function pluginEnabled(): bool { + return (int) db_fetch_cell_prepared('SELECT status FROM plugin_config WHERE directory = ?', [self::PLUGIN], '', true, $this->connection) === 1; + } + public function hooksRegistered(): bool { $placeholders = implode(', ', array_fill(0, count(self::HOOKS), '?')); diff --git a/locales/LC_MESSAGES/ar-SA.mo b/locales/LC_MESSAGES/ar-SA.mo new file mode 100644 index 0000000..921bd1d Binary files /dev/null and b/locales/LC_MESSAGES/ar-SA.mo differ diff --git a/locales/LC_MESSAGES/de-DE.mo b/locales/LC_MESSAGES/de-DE.mo index 9618c31..1a5edf0 100644 Binary files a/locales/LC_MESSAGES/de-DE.mo and b/locales/LC_MESSAGES/de-DE.mo differ diff --git a/locales/LC_MESSAGES/es-419.mo b/locales/LC_MESSAGES/es-419.mo index ce75caa..d7ea1a1 100644 Binary files a/locales/LC_MESSAGES/es-419.mo and b/locales/LC_MESSAGES/es-419.mo differ diff --git a/locales/LC_MESSAGES/es-ES.mo b/locales/LC_MESSAGES/es-ES.mo index 58c108b..a54a9e5 100644 Binary files a/locales/LC_MESSAGES/es-ES.mo and b/locales/LC_MESSAGES/es-ES.mo differ diff --git a/locales/LC_MESSAGES/fr-FR.mo b/locales/LC_MESSAGES/fr-FR.mo index 81dec23..3f94948 100644 Binary files a/locales/LC_MESSAGES/fr-FR.mo and b/locales/LC_MESSAGES/fr-FR.mo differ diff --git a/locales/LC_MESSAGES/hi-IN.mo b/locales/LC_MESSAGES/hi-IN.mo new file mode 100644 index 0000000..6afc5f7 Binary files /dev/null and b/locales/LC_MESSAGES/hi-IN.mo differ diff --git a/locales/LC_MESSAGES/ja-JP.mo b/locales/LC_MESSAGES/ja-JP.mo index 07751e6..3c1f1eb 100644 Binary files a/locales/LC_MESSAGES/ja-JP.mo and b/locales/LC_MESSAGES/ja-JP.mo differ diff --git a/locales/LC_MESSAGES/zh-CN.mo b/locales/LC_MESSAGES/zh-CN.mo index 155e19f..54cbb4d 100644 Binary files a/locales/LC_MESSAGES/zh-CN.mo and b/locales/LC_MESSAGES/zh-CN.mo differ diff --git a/locales/build_gettext.sh b/locales/build_gettext.sh index e5aad0e..4889125 100755 --- a/locales/build_gettext.sh +++ b/locales/build_gettext.sh @@ -92,6 +92,8 @@ if [ "${1:-}" = "--check" ]; then fi done + python3 tests/check_translations.py || rc=1 + [ $rc -eq 0 ] && echo "catalogs are complete and compiled" exit $rc fi diff --git a/locales/po/ar-SA.po b/locales/po/ar-SA.po new file mode 100644 index 0000000..24c843b --- /dev/null +++ b/locales/po/ar-SA.po @@ -0,0 +1,1330 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: 2026 Thomas Vincent +# +msgid "" +msgstr "" +"Project-Id-Version: smokeping 1.0.0-rc.1\n" +"Report-Msgid-Bugs-To: https://github.com/somethingwithproof/plugin_smokeping/issues\n" +"PO-Revision-Date: 2026-11-17 00:00+0000\n" +"Last-Translator: Thomas Vincent \n" +"Language-Team: Thomas Vincent \n" +"Language: ar-SA\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" + +#: include/operator.php lib/ViewPage.php +msgid "Master" +msgstr "الرئيسي" + +#: include/operator.php +msgid "Compare loss and latency with the SmokePing graphs and maintenance state. Escalate missing files, imports and relinking to an administrator." +msgstr "قارن الفقد وزمن الاستجابة برسوم SmokePing وحالة الصيانة. أحِل الملفات المفقودة والاستيراد وإعادة الربط إلى مسؤول." + +#: lib/ActionOutcome.php +#, php-format +msgid "skipped, %s" +msgstr "متخطّى، %s" + +#: lib/ConfigPage.php +msgid "XML" +msgstr "XML" + +#: lib/ConfigPage.php +msgid "YAML (default)" +msgstr "YAML (الافتراضي)" + +#: lib/ConfigPage.php lib/Pages.php +msgid "SmokePing Configuration" +msgstr "إعدادات SmokePing" + +#: lib/ConfigPage.php +msgid "Your device permissions do not cover every device, so you cannot export or import the SmokePing configuration. Ask an administrator with access to all devices." +msgstr "لا تشمل أذونات أجهزتك جميع الأجهزة، لذا لا يمكنك تصدير إعدادات SmokePing أو استيرادها. اطلب ذلك من مسؤول يملك الوصول إلى جميع الأجهزة." + +#: lib/ConfigPage.php +msgid "Export the SmokePing Configuration" +msgstr "تصدير إعدادات SmokePing" + +#: lib/ConfigPage.php +msgid "The export holds the plugin settings, the SmokePing targets the plugin has read, and which device each is mapped to, by the device's host name and description. It holds no data source, graph, RRD file, or credential." +msgstr "يتضمن التصدير إعدادات الإضافة وأهداف SmokePing التي قرأتها الإضافة والجهاز المرتبط بكل هدف، باسم المضيف ووصفه. لا يتضمن مصادر بيانات أو رسومًا أو ملفات RRD أو بيانات اعتماد." + +#: lib/ConfigPage.php +msgid "Download" +msgstr "تنزيل" + +#: lib/ConfigPage.php +msgid "Import a SmokePing Configuration" +msgstr "استيراد إعدادات SmokePing" + +#: lib/ConfigPage.php +msgid "Choosing a file only checks it. The next screen lists every change the file would make, and nothing is written until you confirm that list. An import adds and updates; it never deletes a target or moves a mapping, and it never creates an RRD file or touches the SmokePing data directory." +msgstr "لا يؤدي اختيار ملف إلا إلى فحصه. تسرد الشاشة التالية كل تغيير سيُجريه الملف، ولا يُكتب شيء حتى تؤكد القائمة. يضيف الاستيراد ويحدّث؛ ولا يحذف هدفًا أو ينقل ربطًا مطلقًا، ولا ينشئ ملف RRD أو يمس دليل بيانات SmokePing." + +#: lib/ConfigPage.php +msgid "Check File" +msgstr "فحص الملف" + +#: lib/ConfigPage.php lib/ImportPage.php +msgid "Import Check" +msgstr "فحص الاستيراد" + +#: lib/ConfigPage.php +msgid "Nothing was written." +msgstr "لم يُكتب شيء." + +#: lib/ConfigPage.php lib/ImportPage.php smokeping_import.php +msgid "Back" +msgstr "رجوع" + +#: lib/ConfigPage.php +msgid "The file cannot be imported until these errors are fixed. Nothing was written." +msgstr "لا يمكن استيراد الملف حتى تُصلح هذه الأخطاء. لم يُكتب شيء." + +#: lib/ConfigPage.php +msgid "The installation already matches the file. There is nothing to import." +msgstr "التثبيت يطابق الملف بالفعل. لا يوجد ما يُستورد." + +#: lib/ConfigPage.php +#, php-format +msgid "Plan %s. Applying makes exactly these changes in one transaction. If the file or the installation changed since this check, the import is refused and you check again." +msgstr "الخطة %s. يطبّق التنفيذ هذه التغييرات بالضبط في معاملة واحدة. إذا تغيّر الملف أو التثبيت منذ هذا الفحص، يُرفض الاستيراد وتُعيد الفحص." + +#: lib/ConfigPage.php +msgid "Apply Import" +msgstr "تطبيق الاستيراد" + +#: lib/ConfigPage.php lib/ImportPage.php lib/InventoryForms.php +msgid "Cancel" +msgstr "إلغاء" + +#: lib/DeviceActions.php +msgid "Add SmokePing Targets" +msgstr "إضافة أهداف SmokePing" + +#: lib/DeviceActions.php +msgid "no matching SmokePing target" +msgstr "لا يوجد هدف SmokePing مطابق" + +#: lib/DeviceActions.php +msgid "Click Continue to add the SmokePing targets whose host is the host name of each selected device. Each target gets a summary graph for alerting and, when SmokePing's data can be graphed, a smoke graph. Devices are never created here." +msgstr "انقر متابعة لإضافة أهداف SmokePing التي يطابق مضيفها اسم مضيف كل جهاز محدد. يحصل كل هدف على رسم ملخص للتنبيه، وعلى رسم دخاني عندما يمكن رسم بيانات SmokePing. لا تُنشأ أجهزة هنا مطلقًا." + +#: lib/DeviceActions.php +#, php-format +msgid "%d targets match." +msgstr "يوجد %d هدف مطابق." + +#: lib/DeviceActions.php +#, php-format +msgid "%d objects created or mapped, %d skipped." +msgstr "أُنشئ أو رُبط %d كائن، وتُخطّي %d." + +#: lib/DeviceSaveCheck.php +#, php-format +msgid "This device has SmokePing targets, but the reader that fills their summary values runs on poller %d and the device is saved on poller %d. Summary values and alerts stop until the device is assigned to poller %d again." +msgstr "لهذا الجهاز أهداف SmokePing، لكن القارئ الذي يملأ قيم ملخصها يعمل على المُستطلِع %d والجهاز محفوظ على المُستطلِع %d. تتوقف قيم الملخص والتنبيهات حتى يُسند الجهاز إلى المُستطلِع %d مجددًا." + +#: lib/GraphLinks.php +msgid "SmokePing Targets of this Device" +msgstr "أهداف SmokePing لهذا الجهاز" + +#: lib/HealthCheck.php +#, php-format +msgid "%d smoke graphs still draw the other colors; the main poller moves up to 200 per cycle." +msgstr "لا تزال %d رسوم دخانية تستخدم الألوان الأخرى؛ ينقل المُستطلِع الرئيسي حتى 200 في كل دورة." + +#: lib/HealthCheck.php +#, php-format +msgid "%d smoke graphs could not be moved; run upgrade-graphs to try them again, and see the Cacti log for the cause." +msgstr "تعذّر نقل %d رسوم دخانية؛ شغّل upgrade-graphs لإعادة المحاولة، وراجع سجل Cacti لمعرفة السبب." + +#: lib/HealthCheck.php +#, php-format +msgid "The Loss Colors setting asks for SmokePing %s loss colors, but the reader found SmokePing %s. Set it to Automatic unless the graphs should differ from SmokePing's." +msgstr "يطلب إعداد ألوان الفقد ألوان SmokePing %s، لكن القارئ وجد SmokePing %s. عيّنه إلى تلقائي ما لم تكن تريد أن تختلف الرسوم عن رسوم SmokePing." + +#: lib/HealthCheck.php +#, php-format +msgid "The Loss Colors setting selects SmokePing %s loss colors for smoke graphs." +msgstr "يختار إعداد ألوان الفقد ألوان SmokePing %s للرسوم الدخانية." + +#: lib/HealthCheck.php +msgid "The reader found no SmokePing version, so the Loss Colors setting selects the loss colors of SmokePing 2.8 and later. If SmokePing is 2.7, set Loss Colors to SmokePing 2.7." +msgstr "لم يجد القارئ إصدار SmokePing، لذلك يختار إعداد ألوان الفقد ألوان SmokePing 2.8 والأحدث. إذا كان الإصدار 2.7، فاضبط ألوان الفقد على SmokePing 2.7." + +#: lib/HealthCheck.php +#, php-format +msgid "The reader found SmokePing %s, so the Loss Colors setting selects its loss colors." +msgstr "وجد القارئ SmokePing %s، لذا يختار إعداد ألوان الفقد ألوانه." + +#: lib/HealthCheck.php +msgid "Thold is not installed, so no target alerts in both SmokePing and Thold." +msgstr "Thold غير مثبّت، لذا لا ينبه أي هدف في كل من SmokePing وThold." + +#: lib/HealthCheck.php +msgid "No target has both a SmokePing alert and an enabled Thold threshold." +msgstr "لا يوجد هدف يملك تنبيه SmokePing وعتبة Thold مفعّلة معًا." + +#: lib/HealthCheck.php +#, php-format +msgid "%d targets have both a SmokePing alert and an enabled Thold threshold, so one problem may notify twice. Compare their alert conditions before removing either: %s" +msgstr "يوجد %d هدف يملك تنبيه SmokePing وعتبة Thold مفعّلة معًا، لذا قد تُرسل المشكلة إشعارين. قارن شروط التنبيه قبل إزالة أي منهما: %s" + +#: lib/HealthCheck.php +#, php-format +msgid "The SmokePing templates failed to import and are not retried automatically: %s Use Retry Template Import after fixing the cause." +msgstr "فشل استيراد قوالب SmokePing ولا يُعاد تلقائيًا: %s استخدم إعادة محاولة استيراد القوالب بعد إصلاح السبب." + +#: lib/HealthCheck.php +msgid "The SmokePing templates are not imported. Use Retry Template Import." +msgstr "قوالب SmokePing غير مستوردة. استخدم إعادة محاولة استيراد القوالب." + +#: lib/HealthCheck.php smokeping_health.php +msgid "The SmokePing templates are imported." +msgstr "قوالب SmokePing مستوردة." + +#: lib/HealthCheck.php +msgid "Every device with summary data sources is polled by the reader's poller." +msgstr "يستطلع مُستطلِع القارئ كل جهاز ذي مصادر بيانات ملخصة." + +#: lib/HealthCheck.php +#, php-format +msgid "%d devices have summary data sources but are not polled by poller %d, which runs the reader, so their summary values and alerts have no data: %s" +msgstr "يوجد %d جهاز له مصادر بيانات ملخصة، لكنه لا يُستطلع بواسطة المُستطلِع %d الذي يشغّل القارئ، لذا لا بيانات لقيم ملخصه وتنبيهاته: %s" + +#: lib/HealthCheck.php +#, php-format +msgid "The SmokePing configuration is read on poller %d, not on this server; the inventory row shows the result of its last read." +msgstr "تُقرأ إعدادات SmokePing على المُستطلِع %d لا على هذا الخادم؛ يعرض صف المخزون نتيجة آخر قراءة له." + +#: lib/HealthCheck.php +#, php-format +msgid "The SmokePing configuration %s cannot be read: %s" +msgstr "تتعذّر قراءة إعدادات SmokePing %s: %s" + +#: lib/HealthCheck.php +#, php-format +msgid "The SmokePing configuration %s lists %d targets; %d entries are skipped: %s" +msgstr "تسرد إعدادات SmokePing %s عدد %d هدف؛ تُخطّيت %d إدخالات: %s" + +#: lib/HealthCheck.php +#, php-format +msgid "The SmokePing configuration %s lists %d targets." +msgstr "تسرد إعدادات SmokePing %s عدد %d هدف." + +#: lib/HealthCheck.php +msgid "The PHP binary path setting is empty or not an executable file, so the reader cannot start." +msgstr "إعداد مسار ملف PHP التنفيذي فارغ أو ليس ملفًا قابلًا للتنفيذ، لذا لا يمكن بدء القارئ." + +#: lib/HealthCheck.php +#, php-format +msgid "The reader starts with %s." +msgstr "يبدأ القارئ باستخدام %s." + +#: lib/HealthCheck.php +msgid "The reader has not completed a run on this poller." +msgstr "لم يُكمل القارئ تشغيلًا على هذا المُستطلِع." + +#: lib/HealthCheck.php +#, php-format +msgid "The last reader run finished %d seconds ago, more than three poller intervals." +msgstr "انتهى آخر تشغيل للقارئ قبل %d ثانية، وهي أكثر من ثلاثة فواصل استطلاع." + +#: lib/HealthCheck.php +#, php-format +msgid "The reader read %d of %d series in %.1f seconds and has exceeded its time budget %d times." +msgstr "قرأ القارئ %d من %d سلسلة في %.1f ثانية، وتجاوز وقته المخصص %d مرات." + +#: lib/HealthCheck.php +#, php-format +msgid "The reader read %d of %d series in %.1f seconds, %d seconds ago." +msgstr "قرأ القارئ %d من %d سلسلة في %.1f ثانية، قبل %d ثانية." + +#: lib/HealthCheck.php +msgid "No inventory has been read on this poller." +msgstr "لم يُقرأ مخزون على هذا المُستطلِع." + +#: lib/HealthCheck.php +#, php-format +msgid "The last inventory failed %d seconds ago and the previous one is still in use: %s" +msgstr "فشل آخر جرد قبل %d ثانية ولا يزال الجرد السابق مستخدمًا: %s" + +#: lib/HealthCheck.php +#, php-format +msgid "The inventory listed %d targets %d seconds ago." +msgstr "سرد الجرد %d هدف قبل %d ثانية." + +#: lib/HealthPage.php +#, php-format +msgid "SmokePing Health for Poller %d" +msgstr "حالة SmokePing الصحية للمُستطلِع %d" + +#: lib/HealthPage.php +msgid "Check" +msgstr "الفحص" + +#: lib/HealthPage.php +msgid "Detail" +msgstr "التفصيل" + +#: lib/HealthPage.php +msgid "Status" +msgstr "الحالة" + +#: lib/HealthPage.php +msgid "Retry Template Import" +msgstr "إعادة محاولة استيراد القوالب" + +#: lib/Html.php +msgid "OK" +msgstr "سليم" + +#: lib/Html.php +msgid "Warning" +msgstr "تحذير" + +#: lib/Html.php lib/ImportPage.php +msgid "Error" +msgstr "الخطأ" + +#: lib/Html.php lib/ViewPage.php +msgid "Unknown" +msgstr "غير معروف" + +#: lib/Html.php +#, php-format +msgid "%d s ago" +msgstr "قبل %d ث" + +#: lib/Html.php lib/ViewPage.php +msgid "never" +msgstr "أبدًا" + +#: lib/ImportPage.php lib/Pages.php +msgid "Import SmokePing Configuration" +msgstr "استيراد إعدادات SmokePing" + +#: lib/ImportPage.php +msgid "Configuration" +msgstr "الإعدادات" + +#: lib/ImportPage.php +msgid "The configured SmokePing file is read with the files it includes, from its own directory. An uploaded file is read on its own: @include is not allowed in it." +msgstr "يُقرأ ملف SmokePing المحدد مع الملفات التي يضمّنها، من دليله. يُقرأ الملف المرفوع بمفرده: لا يُسمح فيه بـ @include." + +#: lib/ImportPage.php +#, php-format +msgid "The configured file, %s" +msgstr "الملف المحدد، %s" + +#: lib/ImportPage.php +msgid "An uploaded file, without @include" +msgstr "ملف مرفوع، دون @include" + +#: lib/ImportPage.php +msgid "Uploaded File" +msgstr "الملف المرفوع" + +#: lib/ImportPage.php +msgid "Only for an uploaded file: a SmokePing configuration of at most 4 MiB." +msgstr "للملف المرفوع فقط: إعدادات SmokePing بحجم أقصى 4 MiB." + +#: lib/ImportPage.php +msgid "Devices" +msgstr "الأجهزة" + +#: lib/ImportPage.php +msgid "One device per SmokePing host groups targets that probe the same host. A device that already has the host name on the chosen poller is used instead of a new one." +msgstr "يجمع جهاز واحد لكل مضيف SmokePing الأهداف التي تفحص المضيف نفسه. يُستخدم الجهاز الموجود بالاسم نفسه على المُستطلِع المختار بدل إنشاء جهاز جديد." + +#: lib/ImportPage.php +msgid "One device per SmokePing host" +msgstr "جهاز واحد لكل مضيف SmokePing" + +#: lib/ImportPage.php +msgid "One device per SmokePing target" +msgstr "جهاز واحد لكل هدف SmokePing" + +#: lib/ImportPage.php +msgid "Device Template" +msgstr "قالب الجهاز" + +#: lib/ImportPage.php +msgid "The template of devices the import creates." +msgstr "قالب الأجهزة التي ينشئها الاستيراد." + +#: lib/ImportPage.php +msgid "Poller" +msgstr "المُستطلِع" + +#: lib/ImportPage.php +msgid "The poller of new devices. It must be the poller that runs the SmokePing reader, or their summary data sources get no data." +msgstr "مُستطلِع الأجهزة الجديدة. يجب أن يكون المُستطلِع الذي يشغّل قارئ SmokePing، وإلا لن تتلقى مصادر بيانات ملخصها بيانات." + +#: lib/ImportPage.php +msgid "Site" +msgstr "الموقع" + +#: lib/ImportPage.php +msgid "The site of new devices." +msgstr "موقع الأجهزة الجديدة." + +#: lib/ImportPage.php smokeping_inventory.php +msgid "None" +msgstr "لا شيء" + +#: lib/ImportPage.php +msgid "Graph Tree" +msgstr "شجرة الرسوم" + +#: lib/ImportPage.php +msgid "Mirror the SmokePing hierarchy into a graph tree: each section becomes a branch, and each device a host under the branch of its targets. Existing branches and hosts are reused." +msgstr "اعكس تسلسل SmokePing الهرمي في شجرة رسوم: يصبح كل قسم فرعًا وكل جهاز مضيفًا تحت فرع أهدافه. تُعاد الاستفادة من الفروع والمضيفين الموجودين." + +#: lib/ImportPage.php +msgid "A new tree, named below" +msgstr "شجرة جديدة، اسمها أدناه" + +#: lib/ImportPage.php +msgid "Do not mirror" +msgstr "عدم النسخ إلى شجرة" + +#: lib/ImportPage.php +msgid "New Tree Name" +msgstr "اسم الشجرة الجديدة" + +#: lib/ImportPage.php +msgid "Only for a new tree. A tree that already has this name is used." +msgstr "للشجرة الجديدة فقط. تُستخدم الشجرة التي تحمل هذا الاسم إن كانت موجودة." + +#: lib/ImportPage.php +msgid "Preview reads the configuration and lists what the import would create. Nothing is written until you confirm that list on the next screen, and SmokePing's own files are never written." +msgstr "تقرأ المعاينة الإعدادات وتسرد ما سينشئه الاستيراد. لا يُكتب شيء حتى تؤكد القائمة في الشاشة التالية، ولا تُكتب ملفات SmokePing نفسها مطلقًا." + +#: lib/ImportPage.php +msgid "Preview" +msgstr "معاينة" + +#: lib/ImportPage.php +msgid "Note" +msgstr "ملاحظة" + +#: lib/ImportPage.php +msgid "Level" +msgstr "المستوى" + +#: lib/ImportPage.php +msgid "Message" +msgstr "الرسالة" + +#: lib/ImportPage.php +msgid "SmokePing Sections" +msgstr "أقسام SmokePing" + +#: lib/ImportPage.php +msgid "Import" +msgstr "استيراد" + +#: lib/ImportPage.php +msgid "Section" +msgstr "القسم" + +#: lib/ImportPage.php +msgid "Targets" +msgstr "الأهداف" + +#: lib/ImportPage.php +msgid "No section is checked, so every target is selected. Check sections and update the preview to import only those." +msgstr "لم يُحدَّد أي قسم، لذا اختير كل هدف. حدّد الأقسام وحدّث المعاينة لاستيرادها وحدها." + +#: lib/ImportPage.php +msgid "Only targets in the checked sections are selected." +msgstr "اختيرت الأهداف في الأقسام المحددة فقط." + +#: lib/ImportPage.php +msgid "Update Preview" +msgstr "تحديث المعاينة" + +#: lib/ImportPage.php +msgid "Create" +msgstr "إنشاء" + +#: lib/ImportPage.php +#, php-format +msgid "Use device %d" +msgstr "استخدام الجهاز %d" + +#: lib/ImportPage.php +#, php-format +msgid "Already mapped to device %d" +msgstr "مرتبط بالجهاز %d بالفعل" + +#: lib/ImportPage.php +#, php-format +msgid "Skip: %s" +msgstr "تخطٍّ: %s" + +#: lib/ImportPage.php +#, php-format +msgid "Devices: %d to create, %d existing to use, %d already mapped, %d skipped" +msgstr "الأجهزة: %d للإنشاء، %d موجودة للاستخدام، %d مرتبطة بالفعل، %d متخطاة" + +#: lib/ImportPage.php lib/InventoryPage.php +msgid "Action" +msgstr "الإجراء" + +#: lib/ImportPage.php +msgid "Description" +msgstr "الوصف" + +#: lib/ImportPage.php +msgid "Host Name" +msgstr "اسم المضيف" + +#: lib/ImportPage.php lib/ViewPage.php +msgid "SmokePing Targets" +msgstr "أهداف SmokePing" + +#: lib/ImportPage.php +msgid "No device." +msgstr "لا يوجد جهاز." + +#: lib/ImportPage.php +msgid "Smoke" +msgstr "دخاني" + +#: lib/ImportPage.php +msgid "Summary" +msgstr "الملخص" + +#: lib/ImportPage.php lib/TargetActions.php +msgid "master" +msgstr "الرئيسي" + +#: lib/ImportPage.php +#, php-format +msgid "Graphs: %d to create, %d already exist" +msgstr "الرسوم: %d للإنشاء، %d موجودة بالفعل" + +#: lib/ImportPage.php +msgid "Graph" +msgstr "الرسم" + +#: lib/ImportPage.php lib/ViewPage.php +msgid "Location" +msgstr "الموضع" + +#: lib/ImportPage.php +msgid "SmokePing Target" +msgstr "هدف SmokePing" + +#: lib/ImportPage.php +msgid "No graph to create." +msgstr "لا يوجد رسم لإنشائه." + +#: lib/ImportPage.php +msgid "Reason" +msgstr "السبب" + +#: lib/ImportPage.php +#, php-format +msgid "Summary Data Only: %d targets" +msgstr "بيانات ملخصة فقط: %d هدف" + +#: lib/ImportPage.php +msgid "Branch" +msgstr "الفرع" + +#: lib/ImportPage.php lib/ViewPage.php +msgid "Device" +msgstr "الجهاز" + +#: lib/ImportPage.php +#, php-format +msgid "Graph Tree: %d branches, %d device entries" +msgstr "شجرة الرسوم: %d فروع، %d إدخالات أجهزة" + +#: lib/ImportPage.php +msgid "Estimate" +msgstr "التقدير" + +#: lib/ImportPage.php +msgid "Estimated Load" +msgstr "الحمل المقدّر" + +#: lib/ImportPage.php +msgid "Confirm" +msgstr "تأكيد" + +#: lib/ImportPage.php +msgid "The configuration cannot be imported until the errors above are fixed. Nothing was written." +msgstr "لا يمكن استيراد الإعدادات حتى تُصلح الأخطاء أعلاه. لم يُكتب شيء." + +#: lib/ImportPage.php +msgid "Every selected target is already in Cacti. There is nothing to import." +msgstr "كل هدف محدد موجود في Cacti بالفعل. لا يوجد ما يُستورد." + +#: lib/ImportPage.php +#, php-format +msgid "Plan %s. Importing creates exactly what is listed above through Cacti's device, graph, and tree functions. If the SmokePing configuration or Cacti changed since this preview, the import is refused and you preview again." +msgstr "الخطة %s. ينشئ الاستيراد ما سُرد أعلاه بالضبط عبر وظائف الأجهزة والرسوم والأشجار في Cacti. إذا تغيّرت إعدادات SmokePing أو Cacti منذ هذه المعاينة، يُرفض الاستيراد وتُعيد المعاينة." + +#: lib/ImportPage.php +#, php-format +msgid "%s and %d more" +msgstr "%s و%d أخرى" + +#: lib/InventoryForms.php +#, php-format +msgid "Add %s to Cacti" +msgstr "إضافة %s إلى Cacti" + +#: lib/InventoryForms.php +#, php-format +msgid "SmokePing target %s (host %s) has no Cacti device. Choose what to do with it." +msgstr "ليس لهدف SmokePing %s (المضيف %s) جهاز Cacti. اختر ما تريد فعله به." + +#: lib/InventoryForms.php +msgid "Create a new device from the SmokePing Target template" +msgstr "إنشاء جهاز جديد من قالب SmokePing Target" + +#: lib/InventoryForms.php +msgid "Map it to an existing device" +msgstr "ربطه بجهاز موجود" + +#: lib/InventoryForms.php +msgid "Either way the target gets a summary graph for alerting and, when SmokePing's data can be graphed, a smoke graph. Cacti never writes SmokePing's files." +msgstr "في الحالتين يحصل الهدف على رسم ملخص للتنبيه، وعلى رسم دخاني عندما يمكن رسم بيانات SmokePing. لا يكتب Cacti ملفات SmokePing مطلقًا." + +#: lib/InventoryForms.php +msgid "Add" +msgstr "إضافة" + +#: lib/InventoryForms.php +msgid "Confirm Re-link" +msgstr "تأكيد إعادة الربط" + +#: lib/InventoryForms.php +#, php-format +msgid "SmokePing no longer lists %s. %s has the same host (%s) and probe (%s). SmokePing starts a new, empty file for a new path." +msgstr "لم يعد SmokePing يسرد %s. للهدف %s المضيف نفسه (%s) والمسبار نفسه (%s). يبدأ SmokePing ملفًا جديدًا فارغًا للمسار الجديد." + +#: lib/InventoryForms.php +msgid "Re-linking moves the smoke graph and the summary data source to the new target and the device mapping with them. The old file keeps its history in an archived graph. Nothing is deleted." +msgstr "تنقل إعادة الربط الرسم الدخاني ومصدر بيانات الملخص إلى الهدف الجديد وتنقل ربط الجهاز معهما. يحتفظ الملف القديم بتاريخه في رسم مؤرشف. لا يُحذف شيء." + +#: lib/InventoryForms.php +#, php-format +msgid "Device %d is mapped to the old target." +msgstr "الجهاز %d مرتبط بالهدف القديم." + +#: lib/InventoryForms.php +msgid "Dismiss Proposal" +msgstr "استبعاد الاقتراح" + +#: lib/InventoryForms.php +msgid "Re-link" +msgstr "إعادة الربط" + +#: lib/InventoryPage.php +msgid "Gone" +msgstr "زائل" + +#: lib/InventoryPage.php +msgid "Present" +msgstr "موجود" + +#: lib/InventoryPage.php +msgid "Unmapped" +msgstr "غير مرتبط" + +#: lib/InventoryPage.php +msgid "Add to Cacti" +msgstr "إضافة إلى Cacti" + +#: lib/InventoryPage.php lib/Pages.php +msgid "SmokePing Inventory" +msgstr "مخزون SmokePing" + +#: lib/InventoryPage.php +msgid "Host" +msgstr "المضيف" + +#: lib/InventoryPage.php +msgid "Inventory" +msgstr "المخزون" + +#: lib/InventoryPage.php +msgid "Mapping" +msgstr "الربط" + +#: lib/InventoryPage.php +msgid "Name" +msgstr "الاسم" + +#: lib/InventoryPage.php +msgid "Path" +msgstr "المسار" + +#: lib/InventoryPage.php +msgid "Probe" +msgstr "المسبار" + +#: lib/InventoryPage.php +msgid "Slaves" +msgstr "التوابع" + +#: lib/InventoryPage.php +msgid "Step / Pings" +msgstr "الخطوة / اختبارات ping" + +#: lib/InventoryPage.php +msgid "No targets have been imported on this poller." +msgstr "لم تُستورد أهداف على هذا المُستطلِع." + +#: lib/InventoryPage.php +msgid "Review" +msgstr "مراجعة" + +#: lib/InventoryPage.php +msgid "Re-link Proposals" +msgstr "اقتراحات إعادة الربط" + +#: lib/InventoryPage.php +msgid "Disappeared Path" +msgstr "المسار المختفي" + +#: lib/InventoryPage.php +msgid "New Path" +msgstr "المسار الجديد" + +#: lib/InventoryPage.php +msgid "No re-link proposals." +msgstr "لا توجد اقتراحات إعادة ربط." + +#: lib/LoadEstimate.php +#, php-format +msgid "%d series: about %.1f probe packets per second and %.2f RRD updates per second in SmokePing." +msgstr "%d سلسلة: نحو %.1f حزمة مسبار في الثانية و%.2f تحديث RRD في الثانية في SmokePing." + +#: lib/LoadEstimate.php +#, php-format +msgid "Cacti gets about %d data source rows and %d graph item rows." +msgstr "يحصل Cacti على نحو %d صفوف مصادر بيانات و%d صفوف عناصر رسوم." + +#: lib/MountCheck.php +#, php-format +msgid "The SmokePing mount %s does not exist. Mount SmokePing's data directory there read-only." +msgstr "نقطة تركيب SmokePing %s غير موجودة. ركّب دليل بيانات SmokePing هناك للقراءة فقط." + +#: lib/MountCheck.php +#, php-format +msgid "%s is inside the RRA path and not reached through a symlink." +msgstr "يقع %s داخل مسار RRA ولا يُوصل إليه عبر رابط رمزي." + +#: lib/MountCheck.php +#, php-format +msgid "The Cacti user can write to %s. SmokePing's RRD files must be read-only to Cacti." +msgstr "يمكن لمستخدم Cacti الكتابة إلى %s. يجب أن تكون ملفات RRD الخاصة بـ SmokePing للقراءة فقط بالنسبة إلى Cacti." + +#: lib/MountCheck.php +#, php-format +msgid "The SmokePing mount %s is not inside the Cacti RRA path %s." +msgstr "نقطة تركيب SmokePing %s ليست داخل مسار RRA في Cacti، وهو %s." + +#: lib/MountCheck.php +#, php-format +msgid "The Cacti RRA path %s does not exist." +msgstr "مسار RRA في Cacti، وهو %s، غير موجود." + +#: lib/MountCheck.php +#, php-format +msgid "The SmokePing mount %s contains an empty, \".\" or \"..\" segment." +msgstr "تحتوي نقطة تركيب SmokePing %s على جزء فارغ أو \".\" أو \"..\"." + +#: lib/MountCheck.php +#, php-format +msgid "The SmokePing mount %s is reached through a symlink, which Cacti refuses. Use a read-only bind mount instead." +msgstr "يُوصل إلى نقطة تركيب SmokePing %s عبر رابط رمزي يرفضه Cacti. استخدم تركيب bind للقراءة فقط بدلًا منه." + +#: lib/MountCheck.php +msgid "Unable to read the mount table, so the mount could not be confirmed read-only." +msgstr "تعذّرت قراءة جدول التركيب، لذا تعذّر التأكد من أن التركيب للقراءة فقط." + +#: lib/MountCheck.php +#, php-format +msgid "%s is on a read-only mount." +msgstr "يقع %s على تركيب للقراءة فقط." + +#: lib/MountCheck.php +#, php-format +msgid "%s is on the writable mount %s. Mount SmokePing's data directory read-only." +msgstr "يقع %s على التركيب القابل للكتابة %s. ركّب دليل بيانات SmokePing للقراءة فقط." + +#: lib/MountCheck.php +msgid "No inventory yet, so no RRD files are expected." +msgstr "لا يوجد مخزون بعد، لذا لا تُتوقع ملفات RRD." + +#: lib/MountCheck.php +#, php-format +msgid "All %d expected RRD files are visible through the mount." +msgstr "كل ملفات RRD المتوقعة وعددها %d ظاهرة عبر التركيب." + +#: lib/MountCheck.php +#, php-format +msgid "%d of %d expected RRD files are not visible through the mount, for example %s." +msgstr "لا تظهر %d من ملفات RRD المتوقعة وعددها %d عبر التركيب، مثل %s." + +#: lib/OperatorPage.php +msgid "Review the recorded observations below. Acknowledgments are personal to this session, expire when observations change, and never suppress alerts or change health." +msgstr "راجع الملاحظات المسجلة أدناه. الإقرارات شخصية لهذه الجلسة، وتنتهي عند تغيّر الملاحظات، ولا تمنع التنبيهات أو تغيّر الحالة الصحية مطلقًا." + +#: lib/OperatorPage.php lib/Pages.php +msgid "SmokePing Operations" +msgstr "عمليات SmokePing" + +#: lib/OperatorPage.php +msgid "Actions" +msgstr "الإجراءات" + +#: lib/OperatorPage.php +msgid "Investigation" +msgstr "التحقيق" + +#: lib/OperatorPage.php +msgid "Object" +msgstr "الكائن" + +#: lib/OperatorPage.php +msgid "Observed (UTC)" +msgstr "وقت الملاحظة (UTC)" + +#: lib/OperatorPage.php +msgid "State" +msgstr "الحالة" + +#: lib/OperatorPage.php +msgid "Unknown or stale" +msgstr "غير معروف أو متقادم" + +#: lib/OperatorPage.php +msgid "Never" +msgstr "أبدًا" + +#: lib/OperatorPage.php +msgid "Acknowledged; health unchanged." +msgstr "تم الإقرار؛ الحالة الصحية لم تتغير." + +#: lib/OperatorPage.php +msgid "Acknowledge" +msgstr "إقرار" + +#: lib/OperatorPage.php +msgid "No observations are available for devices you may access." +msgstr "لا تتوفر ملاحظات للأجهزة التي يمكنك الوصول إليها." + +#: lib/Pages.php +msgid "SmokePing Operator" +msgstr "مشغّل SmokePing" + +#: lib/Pages.php +msgid "SmokePing View" +msgstr "عرض SmokePing" + +#: lib/Pages.php +msgid "SmokePing Admin" +msgstr "إدارة SmokePing" + +#: lib/Pages.php +msgid "SmokePing Health" +msgstr "حالة SmokePing الصحية" + +#: lib/Pages.php setup.php +msgid "SmokePing" +msgstr "SmokePing" + +#: lib/RelinkGuard.php +msgid "both targets must be on the poller that runs the reader" +msgstr "يجب أن يكون الهدفان على المُستطلِع الذي يشغّل القارئ" + +#: lib/RelinkGuard.php +#, php-format +msgid "the new target is already mapped to device %d" +msgstr "الهدف الجديد مرتبط بالجهاز %d بالفعل" + +#: lib/RelinkGuard.php +#, php-format +msgid "the old target has data sources on device %d, which it is not mapped to" +msgstr "للهدف القديم مصادر بيانات على الجهاز %d الذي لا يرتبط به" + +#: lib/Settings.php +msgid "SmokePing Source" +msgstr "مصدر SmokePing" + +#: lib/Settings.php +msgid "SmokePing Poller" +msgstr "مُستطلِع SmokePing" + +#: lib/Settings.php +msgid "The Cacti poller that runs on, or shares a filesystem with, the SmokePing host. Only this poller reads SmokePing data." +msgstr "مُستطلِع Cacti الذي يعمل على مضيف SmokePing أو يشترك معه في نظام ملفات. هذا المُستطلِع وحده يقرأ بيانات SmokePing." + +#: lib/Settings.php +msgid "SmokePing Configuration File" +msgstr "ملف إعدادات SmokePing" + +#: lib/Settings.php +msgid "The main SmokePing configuration file, read by the poller that runs the reader. The plugin reads it and the files it includes with its own parser and never writes to them. Includes must stay inside this file's directory." +msgstr "ملف إعدادات SmokePing الرئيسي الذي يقرؤه المُستطلِع المشغّل للقارئ. تقرؤه الإضافة والملفات التي يضمّنها بمحلّلها ولا تكتب إليها مطلقًا. يجب أن تبقى الملفات المضمّنة داخل دليل هذا الملف." + +#: lib/Settings.php +msgid "SmokePing Data Directory" +msgstr "دليل بيانات SmokePing" + +#: lib/Settings.php +msgid "The datadir from SmokePing's configuration, as SmokePing sees it." +msgstr "قيمة datadir في إعدادات SmokePing كما يراها SmokePing." + +#: lib/Settings.php +msgid "Cacti Mount of the Data Directory" +msgstr "تركيب دليل البيانات في Cacti" + +#: lib/Settings.php +msgid "A read-only bind or NFS mount of the SmokePing data directory inside the Cacti RRA path. Cacti only reads RRD files inside its RRA path and never through a symlink." +msgstr "تركيب bind أو NFS للقراءة فقط لدليل بيانات SmokePing داخل مسار RRA في Cacti. لا يقرأ Cacti ملفات RRD إلا داخل مسار RRA الخاص به، ولا يقرؤها عبر رابط رمزي مطلقًا." + +#: lib/Settings.php +msgid "Reader" +msgstr "القارئ" + +#: lib/Settings.php +msgid "Reader Time Budget" +msgstr "الوقت المخصص للقارئ" + +#: lib/Settings.php +msgid "Seconds one reader run may spend reading RRD files before it stops and resumes on the next poller cycle." +msgstr "عدد الثواني التي يمكن أن ينفقها تشغيل القارئ في قراءة ملفات RRD قبل التوقف والاستئناف في دورة الاستطلاع التالية." + +#: lib/Settings.php +msgid "Inventory Interval" +msgstr "فاصل الجرد" + +#: lib/Settings.php +msgid "Minimum seconds between inventory runs. The inventory also runs when the configuration file changes." +msgstr "الحد الأدنى للثواني بين عمليات الجرد. يُجرى الجرد أيضًا عند تغيّر ملف الإعدادات." + +#: lib/Settings.php +msgid "Freshness Allowance" +msgstr "مهلة الحداثة الإضافية" + +#: lib/Settings.php +msgid "Seconds past one step for which a measurement still counts as current." +msgstr "الثواني بعد خطوة واحدة التي يظل القياس خلالها محسوبًا كحديث." + +#: lib/Settings.php +msgid "Loss Colors" +msgstr "ألوان الفقد" + +#: lib/Settings.php +msgid "Which SmokePing loss colors the smoke graphs draw. SmokePing 2.7 draws other loss levels than 2.8 and later. Automatic follows the SmokePing version the reader finds next to SmokePing, shown on the health page, and uses 2.8 and later when it finds none." +msgstr "ألوان فقد SmokePing التي تستخدمها الرسوم الدخانية. يرسم SmokePing 2.7 مستويات فقد مختلفة عن 2.8 والأحدث. يتبع الخيار التلقائي إصدار SmokePing الذي يجده القارئ بجانب SmokePing ويعرضه في صفحة الحالة الصحية، ويستخدم 2.8 والأحدث عندما لا يجد إصدارًا." + +#: lib/Settings.php +msgid "Automatic" +msgstr "تلقائي" + +#: lib/Settings.php +msgid "SmokePing 2.8 and later" +msgstr "SmokePing 2.8 والأحدث" + +#: lib/Settings.php +msgid "SmokePing 2.7" +msgstr "SmokePing 2.7" + +#: lib/Settings.php +msgid "Uninstall" +msgstr "إلغاء التثبيت" + +#: lib/Settings.php +msgid "Keep Plugin Tables on Uninstall" +msgstr "الاحتفاظ بجداول الإضافة عند إلغاء التثبيت" + +#: lib/Settings.php +msgid "When checked, uninstalling the plugin keeps its inventory, mapping, and health tables. SmokePing files are never removed either way." +msgstr "عند التحديد، يحتفظ إلغاء التثبيت بجداول المخزون والربط والحالة الصحية. لا تُحذف ملفات SmokePing في الحالتين مطلقًا." + +#: lib/Settings.php +msgid "Backup Directory" +msgstr "دليل النسخ الاحتياطي" + +#: lib/Settings.php +msgid "Where the uninstall writes its export of the plugin configuration. Leave blank to use the cache/smokeping directory of Cacti, which the plugin protects with a deny-all rule. A directory set here must already exist, be writable, and be outside the web root; when it is not writable no export is written." +msgstr "الموضع الذي يكتب إليه إلغاء التثبيت تصدير إعدادات الإضافة. اتركه فارغًا لاستخدام دليل cache/smokeping في Cacti الذي تحميه الإضافة بقاعدة منع شامل. يجب أن يكون الدليل المحدد موجودًا وقابلًا للكتابة وخارج جذر الويب؛ وإذا تعذّرت الكتابة إليه فلا يُكتب تصدير." + +#: lib/SmokeProvisioner.php +msgid "The target has not been saved yet." +msgstr "لم يُحفظ الهدف بعد." + +#: lib/SmokeProvisioner.php +#, php-format +msgid "The target sends %d pings per round. Smoke graphs exist only for 10, 20, and 30; it has summary data only." +msgstr "يرسل الهدف %d اختبارات ping في كل جولة. تتوفر الرسوم الدخانية للأعداد 10 و20 و30 فقط؛ لذلك لا توجد له إلا بيانات ملخصة." + +#: lib/SmokeProvisioner.php +msgid "Cacti keeps RRD files on an RRDproxy, where SmokePing's files do not exist. Only summary data is available." +msgstr "يحتفظ Cacti بملفات RRD على RRDproxy حيث لا توجد ملفات SmokePing. لا تتوفر إلا بيانات ملخصة." + +#: lib/SmokeProvisioner.php +#, php-format +msgid "The device is polled by poller %d, but the reader that fills the summary values runs on poller %d. Assign the device to poller %d." +msgstr "يستطلع الجهازَ المُستطلِع %d، لكن القارئ الذي يملأ قيم الملخص يعمل على المُستطلِع %d. أسند الجهاز إلى المُستطلِع %d." + +#: lib/SmokeProvisioner.php +msgid "The summary graph template is not installed." +msgstr "قالب رسم الملخص غير مثبّت." + +#: lib/SmokeProvisioner.php +msgid "The summary data template is not installed." +msgstr "قالب بيانات الملخص غير مثبّت." + +#: lib/SmokeProvisioner.php +msgid "Cacti did not create the summary graph." +msgstr "لم ينشئ Cacti رسم الملخص." + +#: lib/SmokeProvisioner.php +msgid "Both targets must be saved first." +msgstr "يجب حفظ الهدفين أولًا." + +#: lib/SmokeProvisioner.php +msgid "The old target has no smoke data source to move." +msgstr "ليس للهدف القديم مصدر بيانات دخاني لنقله." + +#: lib/SmokeProvisioner.php +#, php-format +msgid "The RRD file %s is not visible through the SmokePing mount." +msgstr "ملف RRD %s غير ظاهر عبر تركيب SmokePing." + +#: lib/SmokeProvisioner.php +#, php-format +msgid "The RRD file %s resolves outside the SmokePing mount." +msgstr "ينتهي المسار الفعلي لملف RRD %s خارج تركيب SmokePing." + +#: lib/SmokeProvisioner.php +msgid "The smoke graph template is not installed." +msgstr "قالب الرسم الدخاني غير مثبّت." + +#: lib/SmokeProvisioner.php +msgid "Cacti did not create the smoke graph." +msgstr "لم ينشئ Cacti الرسم الدخاني." + +#: lib/SmokeProvisioner.php +msgid "Cacti does not accept the SmokePing path for a data source." +msgstr "لا يقبل Cacti مسار SmokePing لمصدر بيانات." + +#: lib/SmokepingImportService.php +msgid "Another SmokePing configuration import is running, so nothing was imported. Check again when it has finished." +msgstr "يجري استيراد آخر لإعدادات SmokePing، لذا لم يُستورد شيء. أعد الفحص عند اكتماله." + +#: lib/SmokepingImportService.php +msgid "The configuration or the installation changed since the check, so nothing was imported. Check again." +msgstr "تغيّرت الإعدادات أو التثبيت منذ الفحص، لذا لم يُستورد شيء. أعد الفحص." + +#: lib/SmokepingImportService.php +msgid "Mirroring into a graph tree needs permission to edit trees." +msgstr "يتطلب النسخ إلى شجرة رسوم إذن تعديل الأشجار." + +#: lib/SmokepingImportService.php +msgid "The targets could not be stored; see the Cacti log. Nothing else was changed." +msgstr "تعذّر تخزين الأهداف؛ راجع سجل Cacti. لم يتغير شيء آخر." + +#: lib/SmokepingImportService.php +#, php-format +msgid "%s: skipped, %s" +msgstr "%s: متخطّى، %s" + +#: lib/SmokepingImportService.php +#, php-format +msgid "%s: skipped, Cacti did not create the device" +msgstr "%s: متخطّى، لم ينشئ Cacti الجهاز" + +#: lib/SmokepingImportService.php +#, php-format +msgid "%s: created device %d" +msgstr "%s: أُنشئ الجهاز %d" + +#: lib/SmokepingImportService.php +#, php-format +msgid "%s: skipped, the target was not stored" +msgstr "%s: متخطّى، لم يُخزّن الهدف" + +#: lib/SmokepingImportService.php +#, php-format +msgid "%s: already in Cacti on device %d" +msgstr "%s: موجود في Cacti على الجهاز %d بالفعل" + +#: lib/SmokepingImportService.php +#, php-format +msgid "The graph tree %s could not be created." +msgstr "تعذّر إنشاء شجرة الرسوم %s." + +#: lib/SmokepingImportService.php +#, php-format +msgid "created graph tree %s" +msgstr "أُنشئت شجرة الرسوم %s" + +#: lib/SmokepingImportService.php +#, php-format +msgid "the tree branch %s could not be created" +msgstr "تعذّر إنشاء فرع الشجرة %s" + +#: lib/SmokepingImportService.php +#, php-format +msgid "tree branch %s" +msgstr "فرع الشجرة %s" + +#: lib/SmokepingImportService.php +#, php-format +msgid "device %d could not be added to the tree" +msgstr "تعذّرت إضافة الجهاز %d إلى الشجرة" + +#: lib/SmokepingImportService.php +#, php-format +msgid "device %d under tree branch %s" +msgstr "الجهاز %d تحت فرع الشجرة %s" + +#: lib/TargetActions.php +msgid "the target has not been saved yet" +msgstr "لم يُحفظ الهدف بعد" + +#: lib/TargetActions.php +#, php-format +msgid "already mapped to device %d" +msgstr "مرتبط بالجهاز %d بالفعل" + +#: lib/TargetActions.php +msgid "Cacti did not create the device" +msgstr "لم ينشئ Cacti الجهاز" + +#: lib/TargetActions.php +#, php-format +msgid "created device %d" +msgstr "أُنشئ الجهاز %d" + +#: lib/TargetActions.php +#, php-format +msgid "the target was mapped to another device meanwhile; device %d has no SmokePing graphs" +msgstr "رُبط الهدف بجهاز آخر في هذه الأثناء؛ ليس للجهاز %d رسوم SmokePing" + +#: lib/TargetActions.php +msgid "the target was mapped to another device meanwhile" +msgstr "رُبط الهدف بجهاز آخر في هذه الأثناء" + +#: lib/TargetActions.php +#, php-format +msgid "mapped to device %d" +msgstr "رُبط بالجهاز %d" + +#: lib/TargetActions.php +#, php-format +msgid "summary graph %d for %s" +msgstr "رسم الملخص %d لـ %s" + +#: lib/TargetActions.php +#, php-format +msgid "no summary for %s: %s" +msgstr "لا يوجد ملخص لـ %s: %s" + +#: lib/TargetActions.php +#, php-format +msgid "smoke graph %d for %s" +msgstr "الرسم الدخاني %d لـ %s" + +#: lib/TargetActions.php +#, php-format +msgid "no smoke graph for %s: %s" +msgstr "لا يوجد رسم دخاني لـ %s: %s" + +#: lib/TargetActions.php +#, php-format +msgid "%d devices were not processed in the time allowed. Run the action again for them; devices already added are skipped." +msgstr "لم تُعالج %d أجهزة خلال الوقت المسموح. أعد تنفيذ الإجراء لها؛ تُتخطى الأجهزة المضافة بالفعل." + +#: lib/TargetActions.php +msgid "Time limit" +msgstr "الحد الزمني" + +#: lib/TargetActions.php +#, php-format +msgid "no unmapped SmokePing target has the host %s" +msgstr "لا يوجد هدف SmokePing غير مرتبط له المضيف %s" + +#: lib/TargetActions.php +msgid "the proposal is no longer open" +msgstr "الاقتراح لم يعد معلّقًا" + +#: lib/TargetActions.php +msgid "the new target is mapped to another device" +msgstr "الهدف الجديد مرتبط بجهاز آخر" + +#: lib/TargetActions.php +#, php-format +msgid "smoke graph %d now reads the new file; the old file stays graphable in an archived graph" +msgstr "يقرأ الرسم الدخاني %d الملف الجديد الآن؛ ويظل الملف القديم قابلًا للرسم في رسم مؤرشف" + +#: lib/TargetActions.php +#, php-format +msgid "summary data source %d follows the new target" +msgstr "يتبع مصدر بيانات الملخص %d الهدف الجديد" + +#: lib/TargetActions.php +#, php-format +msgid "device %d is mapped to the new target" +msgstr "الجهاز %d مرتبط بالهدف الجديد" + +#: lib/ViewPage.php +msgid "Condition" +msgstr "الحالة" + +#: lib/ViewPage.php +msgid "Freshness" +msgstr "الحداثة" + +#: lib/ViewPage.php +msgid "Last Update" +msgstr "آخر تحديث" + +#: lib/ViewPage.php +msgid "Loss" +msgstr "الفقد" + +#: lib/ViewPage.php +msgid "Maintenance" +msgstr "الصيانة" + +#: lib/ViewPage.php +msgid "Median" +msgstr "الوسيط" + +#: lib/ViewPage.php +msgid "Target" +msgstr "الهدف" + +#: lib/ViewPage.php +msgid "No SmokePing targets are mapped to devices you can view." +msgstr "لا توجد أهداف SmokePing مرتبطة بأجهزة يمكنك عرضها." + +#: lib/ViewPage.php +msgid "In maintenance" +msgstr "قيد الصيانة" + +#: lib/ViewPage.php +msgid "No" +msgstr "لا" + +#: lib/ViewPage.php +msgid "Never observed" +msgstr "لم يُلاحَظ قط" + +#: setup.php +#, php-format +msgid "The SmokePing plugin requires PHP %s or later. This server runs PHP %s, so the plugin was not installed or enabled." +msgstr "تتطلب إضافة SmokePing الإصدار PHP %s أو أحدث. يشغّل هذا الخادم PHP %s، لذا لم تُثبَّت الإضافة أو تُفعَّل." + +#: setup.php +msgid "The SmokePing plugin is not enabled." +msgstr "إضافة SmokePing غير مفعّلة." + +#: setup.php +#, php-format +msgid "The SmokePing plugin requires PHP %s or later." +msgstr "تتطلب إضافة SmokePing الإصدار PHP %s أو أحدث." + +#: setup.php +#, php-format +msgid "The SmokePing configuration was exported to %s" +msgstr "صُدّرت إعدادات SmokePing إلى %s" + +#: setup.php +msgid "The SmokePing configuration was not exported; see the SmokePing log. The uninstall went ahead." +msgstr "لم تُصدَّر إعدادات SmokePing؛ راجع سجل SmokePing. استمر إلغاء التثبيت." + +#: setup.php +msgid "Management" +msgstr "الإدارة" + +#: setup.php +msgid "Import/Export" +msgstr "استيراد/تصدير" + +#: setup.php +msgid "You do not have permission to add SmokePing targets." +msgstr "لا تملك إذن إضافة أهداف SmokePing." + +#: smokeping_config.php smokeping_import.php +msgid "No file was uploaded, or it is larger than the server accepts." +msgstr "لم يُرفع ملف، أو حجمه أكبر مما يقبله الخادم." + +#: smokeping_config.php +msgid "There is no checked import to apply. Check the file again." +msgstr "لا يوجد استيراد مفحوص لتطبيقه. افحص الملف مجددًا." + +#: smokeping_config.php +msgid "The configuration was imported." +msgstr "استُوردت الإعدادات." + +#: smokeping_health.php +msgid "The SmokePing templates failed to import. See the health table." +msgstr "فشل استيراد قوالب SmokePing. راجع جدول الحالة الصحية." + +#: smokeping_import.php +msgid "Your device permissions do not cover every device, so you cannot import a SmokePing configuration. Ask an administrator with access to all devices." +msgstr "لا تشمل أذونات أجهزتك جميع الأجهزة، لذا لا يمكنك استيراد إعدادات SmokePing. اطلب ذلك من مسؤول يملك الوصول إلى جميع الأجهزة." + +#: smokeping_import.php +msgid "Name the new graph tree, or choose an existing tree or no tree." +msgstr "سمِّ شجرة الرسوم الجديدة، أو اختر شجرة موجودة أو عدم استخدام شجرة." + +#: smokeping_import.php +msgid "The uploaded file is larger than 4 MiB." +msgstr "الملف المرفوع أكبر من 4 MiB." + +#: smokeping_import.php +#, php-format +msgid "The SmokePing configuration cannot be read, so nothing was imported: %s" +msgstr "تتعذّر قراءة إعدادات SmokePing، لذا لم يُستورد شيء: %s" + +#: smokeping_import.php +msgid "There is no previewed import to apply. Preview it again." +msgstr "لا يوجد استيراد تمت معاينته لتطبيقه. أعد المعاينة." + +#: smokeping_import.php +#, php-format +msgid "and %d more; see the Cacti log" +msgstr "و%d أخرى؛ راجع سجل Cacti" + +#: smokeping_import.php +msgid "The SmokePing configuration was imported." +msgstr "استُوردت إعدادات SmokePing." + +#: smokeping_inventory.php +msgid "Choose a target on this poller and, to map it, a device you may change." +msgstr "اختر هدفًا على هذا المُستطلِع، ولربطه اختر جهازًا يمكنك تعديله." + +#: smokeping_inventory.php +msgid "The proposal is not open, or it involves a device or poller you may not change." +msgstr "الاقتراح غير معلّق، أو يتضمن جهازًا أو مُستطلِعًا لا يمكنك تعديله." + +#: smokeping_inventory.php +msgid "The proposal was dismissed." +msgstr "استُبعد الاقتراح." + +#: smokeping_operator.php +msgid "Monitoring view" +msgstr "عرض المراقبة" + +#: smokeping_operator.php +msgid "Observations could not be read. Ask an administrator to check the plugin log." +msgstr "تعذّرت قراءة الملاحظات. اطلب من مسؤول مراجعة سجل الإضافة." diff --git a/locales/po/cacti.pot b/locales/po/cacti.pot index 1b7496a..d7149fb 100644 --- a/locales/po/cacti.pot +++ b/locales/po/cacti.pot @@ -16,6 +16,14 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#: include/operator.php lib/ViewPage.php +msgid "Master" +msgstr "" + +#: include/operator.php +msgid "Compare loss and latency with the SmokePing graphs and maintenance state. Escalate missing files, imports and relinking to an administrator." +msgstr "" + #: lib/ActionOutcome.php #, php-format msgid "skipped, %s" @@ -772,6 +780,58 @@ msgstr "" msgid "%d of %d expected RRD files are not visible through the mount, for example %s." msgstr "" +#: lib/OperatorPage.php +msgid "Review the recorded observations below. Acknowledgments are personal to this session, expire when observations change, and never suppress alerts or change health." +msgstr "" + +#: lib/OperatorPage.php lib/Pages.php smokeping.php +msgid "SmokePing Operations" +msgstr "" + +#: lib/OperatorPage.php +msgid "Actions" +msgstr "" + +#: lib/OperatorPage.php +msgid "Investigation" +msgstr "" + +#: lib/OperatorPage.php +msgid "Object" +msgstr "" + +#: lib/OperatorPage.php +msgid "Observed (UTC)" +msgstr "" + +#: lib/OperatorPage.php +msgid "State" +msgstr "" + +#: lib/OperatorPage.php +msgid "Unknown or stale" +msgstr "" + +#: lib/OperatorPage.php +msgid "Never" +msgstr "" + +#: lib/OperatorPage.php +msgid "Acknowledged; health unchanged." +msgstr "" + +#: lib/OperatorPage.php +msgid "Acknowledge" +msgstr "" + +#: lib/OperatorPage.php +msgid "No observations are available for devices you may access." +msgstr "" + +#: lib/Pages.php +msgid "SmokePing Operator" +msgstr "" + #: lib/Pages.php msgid "SmokePing View" msgstr "" @@ -1158,10 +1218,6 @@ msgstr "" msgid "No SmokePing targets are mapped to devices you can view." msgstr "" -#: lib/ViewPage.php -msgid "Master" -msgstr "" - #: lib/ViewPage.php msgid "In maintenance" msgstr "" @@ -1266,3 +1322,11 @@ msgstr "" #: smokeping_inventory.php msgid "The proposal was dismissed." msgstr "" + +#: smokeping_operator.php +msgid "Monitoring view" +msgstr "" + +#: smokeping_operator.php +msgid "Observations could not be read. Ask an administrator to check the plugin log." +msgstr "" diff --git a/locales/po/de-DE.po b/locales/po/de-DE.po index beba959..586c449 100644 --- a/locales/po/de-DE.po +++ b/locales/po/de-DE.po @@ -14,6 +14,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: include/operator.php lib/ViewPage.php +msgid "Master" +msgstr "Master" + +#: include/operator.php +msgid "Compare loss and latency with the SmokePing graphs and maintenance state. Escalate missing files, imports and relinking to an administrator." +msgstr "Vergleichen Sie Paketverlust und Latenz mit den SmokePing-Diagrammen und dem Wartungsstatus. Wenden Sie sich bei fehlenden Dateien, Importen und erneuten Verknüpfungen an einen Administrator." + #: lib/ActionOutcome.php #, php-format msgid "skipped, %s" @@ -770,6 +778,58 @@ msgstr "Alle %d erwarteten RRD-Dateien sind über den Mount sichtbar." msgid "%d of %d expected RRD files are not visible through the mount, for example %s." msgstr "%d von %d erwarteten RRD-Dateien sind über den Mount nicht sichtbar, zum Beispiel %s." +#: lib/OperatorPage.php +msgid "Review the recorded observations below. Acknowledgments are personal to this session, expire when observations change, and never suppress alerts or change health." +msgstr "Prüfen Sie die unten aufgezeichneten Beobachtungen. Bestätigungen gelten nur für Ihre Sitzung, verfallen bei Änderungen der Beobachtungen und unterdrücken weder Alarme noch ändern sie den Zustandsstatus." + +#: lib/OperatorPage.php lib/Pages.php +msgid "SmokePing Operations" +msgstr "SmokePing-Betrieb" + +#: lib/OperatorPage.php +msgid "Actions" +msgstr "Aktionen" + +#: lib/OperatorPage.php +msgid "Investigation" +msgstr "Untersuchung" + +#: lib/OperatorPage.php +msgid "Object" +msgstr "Objekt" + +#: lib/OperatorPage.php +msgid "Observed (UTC)" +msgstr "Beobachtet (UTC)" + +#: lib/OperatorPage.php +msgid "State" +msgstr "Zustand" + +#: lib/OperatorPage.php +msgid "Unknown or stale" +msgstr "Unbekannt oder veraltet" + +#: lib/OperatorPage.php +msgid "Never" +msgstr "Nie" + +#: lib/OperatorPage.php +msgid "Acknowledged; health unchanged." +msgstr "Bestätigt; Zustandsstatus unverändert." + +#: lib/OperatorPage.php +msgid "Acknowledge" +msgstr "Bestätigen" + +#: lib/OperatorPage.php +msgid "No observations are available for devices you may access." +msgstr "Für Geräte, auf die Sie zugreifen dürfen, liegen keine Beobachtungen vor." + +#: lib/Pages.php +msgid "SmokePing Operator" +msgstr "SmokePing-Operator" + #: lib/Pages.php msgid "SmokePing View" msgstr "SmokePing-Ansicht" @@ -1156,10 +1216,6 @@ msgstr "Ziel" msgid "No SmokePing targets are mapped to devices you can view." msgstr "Keine SmokePing-Ziele sind Zielsystemen zugeordnet, die Sie sehen können." -#: lib/ViewPage.php -msgid "Master" -msgstr "Master" - #: lib/ViewPage.php msgid "In maintenance" msgstr "In Wartung" @@ -1265,6 +1321,14 @@ msgstr "Der Vorschlag ist nicht offen, oder er betrifft ein Zielsystem oder eine msgid "The proposal was dismissed." msgstr "Der Vorschlag wurde verworfen." +#: smokeping_operator.php +msgid "Monitoring view" +msgstr "Überwachungsansicht" + +#: smokeping_operator.php +msgid "Observations could not be read. Ask an administrator to check the plugin log." +msgstr "Die Beobachtungen konnten nicht gelesen werden. Bitten Sie einen Administrator, das Plugin-Protokoll zu prüfen." + #, php-format #~ msgid "Smoke graphs are set to SmokePing %s loss colors, as the Loss Colors setting asks." #~ msgstr "Smoke-Graphen sind auf die Verlustfarben von SmokePing %s eingestellt, wie die Einstellung „Verlustfarben“ es verlangt." diff --git a/locales/po/es-419.po b/locales/po/es-419.po index f30cb97..982276d 100644 --- a/locales/po/es-419.po +++ b/locales/po/es-419.po @@ -1,10 +1,11 @@ # SPDX-License-Identifier: GPL-2.0-or-later # SPDX-FileCopyrightText: 2026 Thomas Vincent +# msgid "" msgstr "" "Project-Id-Version: smokeping 1.0.0-rc.1\n" "Report-Msgid-Bugs-To: https://github.com/somethingwithproof/plugin_smokeping/issues\n" -"PO-Revision-Date: 2026-11-14 12:00+0000\n" +"PO-Revision-Date: 2026-11-17 00:00+0000\n" "Last-Translator: Thomas Vincent \n" "Language-Team: Thomas Vincent \n" "Language: es-419\n" @@ -13,6 +14,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: include/operator.php lib/ViewPage.php +msgid "Master" +msgstr "Maestro" + +#: include/operator.php +msgid "Compare loss and latency with the SmokePing graphs and maintenance state. Escalate missing files, imports and relinking to an administrator." +msgstr "Compare la pérdida y la latencia con los gráficos de SmokePing y el estado de mantenimiento. Solicite a un administrador que resuelva los archivos ausentes, las importaciones y la reasignación de vínculos." + #: lib/ActionOutcome.php #, php-format msgid "skipped, %s" @@ -769,6 +778,58 @@ msgstr "Los %d archivos RRD esperados son visibles a través del montaje." msgid "%d of %d expected RRD files are not visible through the mount, for example %s." msgstr "%d de %d archivos RRD esperados no son visibles a través del montaje, por ejemplo %s." +#: lib/OperatorPage.php +msgid "Review the recorded observations below. Acknowledgments are personal to this session, expire when observations change, and never suppress alerts or change health." +msgstr "Revise las observaciones registradas a continuación. Los acuses de recibo son personales y exclusivos de esta sesión, caducan cuando cambian las observaciones y no suprimen alertas ni modifican el estado de salud." + +#: lib/OperatorPage.php lib/Pages.php +msgid "SmokePing Operations" +msgstr "Operaciones de SmokePing" + +#: lib/OperatorPage.php +msgid "Actions" +msgstr "Acciones" + +#: lib/OperatorPage.php +msgid "Investigation" +msgstr "Investigación" + +#: lib/OperatorPage.php +msgid "Object" +msgstr "Objeto" + +#: lib/OperatorPage.php +msgid "Observed (UTC)" +msgstr "Observado (UTC)" + +#: lib/OperatorPage.php +msgid "State" +msgstr "Estado" + +#: lib/OperatorPage.php +msgid "Unknown or stale" +msgstr "Desconocido o desactualizado" + +#: lib/OperatorPage.php +msgid "Never" +msgstr "Nunca" + +#: lib/OperatorPage.php +msgid "Acknowledged; health unchanged." +msgstr "Acuse de recibo registrado; estado de salud sin cambios." + +#: lib/OperatorPage.php +msgid "Acknowledge" +msgstr "Acusar recibo" + +#: lib/OperatorPage.php +msgid "No observations are available for devices you may access." +msgstr "No hay observaciones disponibles para los dispositivos a los que tiene acceso." + +#: lib/Pages.php +msgid "SmokePing Operator" +msgstr "Operador de SmokePing" + #: lib/Pages.php msgid "SmokePing View" msgstr "Vista de SmokePing" @@ -1155,10 +1216,6 @@ msgstr "Destino" msgid "No SmokePing targets are mapped to devices you can view." msgstr "Ningún destino de SmokePing está asociado a dispositivos que usted pueda ver." -#: lib/ViewPage.php -msgid "Master" -msgstr "Maestro" - #: lib/ViewPage.php msgid "In maintenance" msgstr "En mantenimiento" @@ -1264,9 +1321,10 @@ msgstr "La propuesta no está abierta, o implica un dispositivo o sondeador que msgid "The proposal was dismissed." msgstr "Se descartó la propuesta." -#, php-format -#~ msgid "Smoke graphs are set to SmokePing %s loss colors, as the Loss Colors setting asks." -#~ msgstr "Las gráficas de humo están configuradas con los colores de pérdida de SmokePing %s, como pide la opción Colores de pérdida." +#: smokeping_operator.php +msgid "Monitoring view" +msgstr "Vista de supervisión" -#~ msgid "Targets alerting in both SmokePing and Thold cannot be listed until SmokePing data sources exist." -#~ msgstr "Los destinos que alertan tanto en SmokePing como en Thold no se pueden listar hasta que existan fuentes de datos de SmokePing." +#: smokeping_operator.php +msgid "Observations could not be read. Ask an administrator to check the plugin log." +msgstr "No se pudieron leer las observaciones. Pida a un administrador que revise el registro del complemento." diff --git a/locales/po/es-ES.po b/locales/po/es-ES.po index 2244116..7774a07 100644 --- a/locales/po/es-ES.po +++ b/locales/po/es-ES.po @@ -1,10 +1,11 @@ # SPDX-License-Identifier: GPL-2.0-or-later # SPDX-FileCopyrightText: 2026 Thomas Vincent +# msgid "" msgstr "" "Project-Id-Version: smokeping 1.0.0-rc.1\n" "Report-Msgid-Bugs-To: https://github.com/somethingwithproof/plugin_smokeping/issues\n" -"PO-Revision-Date: 2026-11-14 12:00+0000\n" +"PO-Revision-Date: 2026-11-17 00:00+0000\n" "Last-Translator: Thomas Vincent \n" "Language-Team: Thomas Vincent \n" "Language: es-ES\n" @@ -13,6 +14,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: include/operator.php lib/ViewPage.php +msgid "Master" +msgstr "Maestro" + +#: include/operator.php +msgid "Compare loss and latency with the SmokePing graphs and maintenance state. Escalate missing files, imports and relinking to an administrator." +msgstr "Compare la pérdida y la latencia con los gráficos de SmokePing y el estado de mantenimiento. Solicite a un administrador que resuelva los archivos ausentes, las importaciones y la reasignación de vínculos." + #: lib/ActionOutcome.php #, php-format msgid "skipped, %s" @@ -769,6 +778,58 @@ msgstr "Los %d archivos RRD esperados son visibles a través del montaje." msgid "%d of %d expected RRD files are not visible through the mount, for example %s." msgstr "%d de %d archivos RRD esperados no son visibles a través del montaje, por ejemplo %s." +#: lib/OperatorPage.php +msgid "Review the recorded observations below. Acknowledgments are personal to this session, expire when observations change, and never suppress alerts or change health." +msgstr "Revise las observaciones registradas a continuación. Los acuses de recibo son personales y exclusivos de esta sesión, caducan cuando cambian las observaciones y no suprimen alertas ni modifican el estado de salud." + +#: lib/OperatorPage.php lib/Pages.php +msgid "SmokePing Operations" +msgstr "Operaciones de SmokePing" + +#: lib/OperatorPage.php +msgid "Actions" +msgstr "Acciones" + +#: lib/OperatorPage.php +msgid "Investigation" +msgstr "Investigación" + +#: lib/OperatorPage.php +msgid "Object" +msgstr "Objeto" + +#: lib/OperatorPage.php +msgid "Observed (UTC)" +msgstr "Observado (UTC)" + +#: lib/OperatorPage.php +msgid "State" +msgstr "Estado" + +#: lib/OperatorPage.php +msgid "Unknown or stale" +msgstr "Desconocido o desactualizado" + +#: lib/OperatorPage.php +msgid "Never" +msgstr "Nunca" + +#: lib/OperatorPage.php +msgid "Acknowledged; health unchanged." +msgstr "Acuse de recibo registrado; estado de salud sin cambios." + +#: lib/OperatorPage.php +msgid "Acknowledge" +msgstr "Acusar recibo" + +#: lib/OperatorPage.php +msgid "No observations are available for devices you may access." +msgstr "No hay observaciones disponibles para los dispositivos a los que tiene acceso." + +#: lib/Pages.php +msgid "SmokePing Operator" +msgstr "Operador de SmokePing" + #: lib/Pages.php msgid "SmokePing View" msgstr "Vista de SmokePing" @@ -1155,10 +1216,6 @@ msgstr "Destino" msgid "No SmokePing targets are mapped to devices you can view." msgstr "Ningún destino de SmokePing está asociado a dispositivos que usted pueda ver." -#: lib/ViewPage.php -msgid "Master" -msgstr "Maestro" - #: lib/ViewPage.php msgid "In maintenance" msgstr "En mantenimiento" @@ -1264,9 +1321,10 @@ msgstr "La propuesta no está abierta, o implica un dispositivo o sondeador que msgid "The proposal was dismissed." msgstr "Se descartó la propuesta." -#, php-format -#~ msgid "Smoke graphs are set to SmokePing %s loss colors, as the Loss Colors setting asks." -#~ msgstr "Las gráficas de humo están configuradas con los colores de pérdida de SmokePing %s, como pide la opción Colores de pérdida." +#: smokeping_operator.php +msgid "Monitoring view" +msgstr "Vista de supervisión" -#~ msgid "Targets alerting in both SmokePing and Thold cannot be listed until SmokePing data sources exist." -#~ msgstr "Los destinos que alertan tanto en SmokePing como en Thold no se pueden listar hasta que existan fuentes de datos de SmokePing." +#: smokeping_operator.php +msgid "Observations could not be read. Ask an administrator to check the plugin log." +msgstr "No se pudieron leer las observaciones. Pida a un administrador que revise el registro del complemento." diff --git a/locales/po/fr-FR.po b/locales/po/fr-FR.po index 3a31246..8c03fe0 100644 --- a/locales/po/fr-FR.po +++ b/locales/po/fr-FR.po @@ -14,6 +14,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +#: include/operator.php lib/ViewPage.php +msgid "Master" +msgstr "Maître" + +#: include/operator.php +msgid "Compare loss and latency with the SmokePing graphs and maintenance state. Escalate missing files, imports and relinking to an administrator." +msgstr "Comparez les pertes et la latence aux graphiques SmokePing et à l’état de maintenance. Confiez les fichiers manquants, les importations et le rétablissement des associations à un administrateur." + #: lib/ActionOutcome.php #, php-format msgid "skipped, %s" @@ -770,6 +778,58 @@ msgstr "Les %d fichiers RRD attendus sont tous visibles via le montage." msgid "%d of %d expected RRD files are not visible through the mount, for example %s." msgstr "%d fichiers RRD attendus sur %d ne sont pas visibles via le montage, par exemple %s." +#: lib/OperatorPage.php +msgid "Review the recorded observations below. Acknowledgments are personal to this session, expire when observations change, and never suppress alerts or change health." +msgstr "Consultez les observations enregistrées ci-dessous. Les acquittements sont personnels et propres à cette session ; ils expirent lorsque les observations changent et ne suppriment jamais les alertes ni ne modifient l’état de santé." + +#: lib/OperatorPage.php lib/Pages.php +msgid "SmokePing Operations" +msgstr "Opérations SmokePing" + +#: lib/OperatorPage.php +msgid "Actions" +msgstr "Actions" + +#: lib/OperatorPage.php +msgid "Investigation" +msgstr "Investigation" + +#: lib/OperatorPage.php +msgid "Object" +msgstr "Objet" + +#: lib/OperatorPage.php +msgid "Observed (UTC)" +msgstr "Observé (UTC)" + +#: lib/OperatorPage.php +msgid "State" +msgstr "État" + +#: lib/OperatorPage.php +msgid "Unknown or stale" +msgstr "Inconnu ou obsolète" + +#: lib/OperatorPage.php +msgid "Never" +msgstr "Jamais" + +#: lib/OperatorPage.php +msgid "Acknowledged; health unchanged." +msgstr "Acquitté ; état de santé inchangé." + +#: lib/OperatorPage.php +msgid "Acknowledge" +msgstr "Acquitter" + +#: lib/OperatorPage.php +msgid "No observations are available for devices you may access." +msgstr "Aucune observation n’est disponible pour les équipements auxquels vous avez accès." + +#: lib/Pages.php +msgid "SmokePing Operator" +msgstr "Opérateur SmokePing" + #: lib/Pages.php msgid "SmokePing View" msgstr "Vue SmokePing" @@ -1156,10 +1216,6 @@ msgstr "Cible" msgid "No SmokePing targets are mapped to devices you can view." msgstr "Aucune cible SmokePing n'est associée à des équipements que vous pouvez voir." -#: lib/ViewPage.php -msgid "Master" -msgstr "Maître" - #: lib/ViewPage.php msgid "In maintenance" msgstr "En maintenance" @@ -1265,6 +1321,14 @@ msgstr "La proposition n'est pas ouverte, ou elle concerne un équipement ou un msgid "The proposal was dismissed." msgstr "La proposition a été rejetée." +#: smokeping_operator.php +msgid "Monitoring view" +msgstr "Vue de supervision" + +#: smokeping_operator.php +msgid "Observations could not be read. Ask an administrator to check the plugin log." +msgstr "Impossible de lire les observations. Demandez à un administrateur de consulter le journal du greffon." + #, php-format #~ msgid "Smoke graphs are set to SmokePing %s loss colors, as the Loss Colors setting asks." #~ msgstr "Les graphes de fumée sont réglés sur les couleurs de perte de SmokePing %s, comme le demande le paramètre Couleurs de perte." diff --git a/locales/po/hi-IN.po b/locales/po/hi-IN.po new file mode 100644 index 0000000..9ce1cde --- /dev/null +++ b/locales/po/hi-IN.po @@ -0,0 +1,1330 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: 2026 Thomas Vincent +# +msgid "" +msgstr "" +"Project-Id-Version: smokeping 1.0.0-rc.1\n" +"Report-Msgid-Bugs-To: https://github.com/somethingwithproof/plugin_smokeping/issues\n" +"PO-Revision-Date: 2026-11-17 00:00+0000\n" +"Last-Translator: Thomas Vincent \n" +"Language-Team: Thomas Vincent \n" +"Language: hi-IN\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" + +#: include/operator.php lib/ViewPage.php +msgid "Master" +msgstr "मास्टर" + +#: include/operator.php +msgid "Compare loss and latency with the SmokePing graphs and maintenance state. Escalate missing files, imports and relinking to an administrator." +msgstr "हानि और विलंबता की तुलना SmokePing ग्राफ़ और रखरखाव स्थिति से करें। अनुपस्थित फ़ाइलें, आयात और दोबारा जोड़ने का काम व्यवस्थापक को सौंपें।" + +#: lib/ActionOutcome.php +#, php-format +msgid "skipped, %s" +msgstr "छोड़ा गया, %s" + +#: lib/ConfigPage.php +msgid "XML" +msgstr "XML" + +#: lib/ConfigPage.php +msgid "YAML (default)" +msgstr "YAML (डिफ़ॉल्ट)" + +#: lib/ConfigPage.php lib/Pages.php +msgid "SmokePing Configuration" +msgstr "SmokePing कॉन्फ़िगरेशन" + +#: lib/ConfigPage.php +msgid "Your device permissions do not cover every device, so you cannot export or import the SmokePing configuration. Ask an administrator with access to all devices." +msgstr "आपकी डिवाइस अनुमतियाँ सभी डिवाइस को शामिल नहीं करतीं, इसलिए आप SmokePing कॉन्फ़िगरेशन निर्यात या आयात नहीं कर सकते। सभी डिवाइस तक पहुँच वाले व्यवस्थापक से कहें।" + +#: lib/ConfigPage.php +msgid "Export the SmokePing Configuration" +msgstr "SmokePing कॉन्फ़िगरेशन निर्यात करें" + +#: lib/ConfigPage.php +msgid "The export holds the plugin settings, the SmokePing targets the plugin has read, and which device each is mapped to, by the device's host name and description. It holds no data source, graph, RRD file, or credential." +msgstr "निर्यात में प्लगइन सेटिंग, प्लगइन द्वारा पढ़े गए SmokePing लक्ष्य और हर लक्ष्य किस डिवाइस से मैप है, उसके होस्ट नाम और विवरण सहित होते हैं। इसमें डेटा स्रोत, ग्राफ़, RRD फ़ाइल या क्रेडेंशियल नहीं होता।" + +#: lib/ConfigPage.php +msgid "Download" +msgstr "डाउनलोड" + +#: lib/ConfigPage.php +msgid "Import a SmokePing Configuration" +msgstr "SmokePing कॉन्फ़िगरेशन आयात करें" + +#: lib/ConfigPage.php +msgid "Choosing a file only checks it. The next screen lists every change the file would make, and nothing is written until you confirm that list. An import adds and updates; it never deletes a target or moves a mapping, and it never creates an RRD file or touches the SmokePing data directory." +msgstr "फ़ाइल चुनने पर केवल उसकी जाँच होती है। अगली स्क्रीन फ़ाइल द्वारा किए जाने वाले हर बदलाव को दिखाती है और सूची की पुष्टि तक कुछ नहीं लिखा जाता। आयात जोड़ता और अपडेट करता है; कभी लक्ष्य नहीं हटाता या मैपिंग नहीं बदलता, और न RRD फ़ाइल बनाता न SmokePing डेटा निर्देशिका छूता है।" + +#: lib/ConfigPage.php +msgid "Check File" +msgstr "फ़ाइल जाँचें" + +#: lib/ConfigPage.php lib/ImportPage.php +msgid "Import Check" +msgstr "आयात जाँच" + +#: lib/ConfigPage.php +msgid "Nothing was written." +msgstr "कुछ नहीं लिखा गया।" + +#: lib/ConfigPage.php lib/ImportPage.php smokeping_import.php +msgid "Back" +msgstr "वापस" + +#: lib/ConfigPage.php +msgid "The file cannot be imported until these errors are fixed. Nothing was written." +msgstr "इन त्रुटियों के ठीक होने तक फ़ाइल आयात नहीं हो सकती। कुछ नहीं लिखा गया।" + +#: lib/ConfigPage.php +msgid "The installation already matches the file. There is nothing to import." +msgstr "स्थापना पहले से फ़ाइल से मेल खाती है। आयात करने के लिए कुछ नहीं है।" + +#: lib/ConfigPage.php +#, php-format +msgid "Plan %s. Applying makes exactly these changes in one transaction. If the file or the installation changed since this check, the import is refused and you check again." +msgstr "योजना %s। लागू करने पर एक ट्रांज़ैक्शन में ठीक यही बदलाव होंगे। इस जाँच के बाद फ़ाइल या स्थापना बदली हो तो आयात अस्वीकार होगा और आपको फिर जाँच करनी होगी।" + +#: lib/ConfigPage.php +msgid "Apply Import" +msgstr "आयात लागू करें" + +#: lib/ConfigPage.php lib/ImportPage.php lib/InventoryForms.php +msgid "Cancel" +msgstr "रद्द करें" + +#: lib/DeviceActions.php +msgid "Add SmokePing Targets" +msgstr "SmokePing लक्ष्य जोड़ें" + +#: lib/DeviceActions.php +msgid "no matching SmokePing target" +msgstr "कोई मेल खाता SmokePing लक्ष्य नहीं" + +#: lib/DeviceActions.php +msgid "Click Continue to add the SmokePing targets whose host is the host name of each selected device. Each target gets a summary graph for alerting and, when SmokePing's data can be graphed, a smoke graph. Devices are never created here." +msgstr "हर चुने गए डिवाइस के होस्ट नाम से मेल खाने वाले SmokePing लक्ष्य जोड़ने के लिए जारी रखें दबाएँ। हर लक्ष्य को अलर्ट के लिए सारांश ग्राफ़ और, जब SmokePing डेटा का ग्राफ़ बन सके, स्मोक ग्राफ़ मिलता है। यहाँ कभी डिवाइस नहीं बनाए जाते।" + +#: lib/DeviceActions.php +#, php-format +msgid "%d targets match." +msgstr "%d लक्ष्य मेल खाते हैं।" + +#: lib/DeviceActions.php +#, php-format +msgid "%d objects created or mapped, %d skipped." +msgstr "%d ऑब्जेक्ट बनाए या मैप किए गए, %d छोड़े गए।" + +#: lib/DeviceSaveCheck.php +#, php-format +msgid "This device has SmokePing targets, but the reader that fills their summary values runs on poller %d and the device is saved on poller %d. Summary values and alerts stop until the device is assigned to poller %d again." +msgstr "इस डिवाइस में SmokePing लक्ष्य हैं, लेकिन सारांश मान भरने वाला रीडर पोलर %d पर चलता है और डिवाइस पोलर %d पर सहेजा है। डिवाइस फिर पोलर %d को दिए जाने तक सारांश मान और अलर्ट रुकते हैं।" + +#: lib/GraphLinks.php +msgid "SmokePing Targets of this Device" +msgstr "इस डिवाइस के SmokePing लक्ष्य" + +#: lib/HealthCheck.php +#, php-format +msgid "%d smoke graphs still draw the other colors; the main poller moves up to 200 per cycle." +msgstr "%d स्मोक ग्राफ़ अभी दूसरे रंगों में बनते हैं; मुख्य पोलर हर चक्र में अधिकतम 200 बदलता है।" + +#: lib/HealthCheck.php +#, php-format +msgid "%d smoke graphs could not be moved; run upgrade-graphs to try them again, and see the Cacti log for the cause." +msgstr "%d स्मोक ग्राफ़ बदले नहीं जा सके; फिर प्रयास के लिए upgrade-graphs चलाएँ और कारण के लिए Cacti लॉग देखें।" + +#: lib/HealthCheck.php +#, php-format +msgid "The Loss Colors setting asks for SmokePing %s loss colors, but the reader found SmokePing %s. Set it to Automatic unless the graphs should differ from SmokePing's." +msgstr "हानि रंग सेटिंग SmokePing %s के रंग माँगती है, लेकिन रीडर को SmokePing %s मिला। जब तक ग्राफ़ SmokePing से अलग न चाहिए हों, इसे स्वचालित रखें।" + +#: lib/HealthCheck.php +#, php-format +msgid "The Loss Colors setting selects SmokePing %s loss colors for smoke graphs." +msgstr "हानि रंग सेटिंग स्मोक ग्राफ़ के लिए SmokePing %s के हानि रंग चुनती है।" + +#: lib/HealthCheck.php +msgid "The reader found no SmokePing version, so the Loss Colors setting selects the loss colors of SmokePing 2.8 and later. If SmokePing is 2.7, set Loss Colors to SmokePing 2.7." +msgstr "रीडर को SmokePing संस्करण नहीं मिला, इसलिए हानि रंग सेटिंग SmokePing 2.8 और बाद के रंग चुनती है। यदि SmokePing 2.7 है, तो हानि रंग SmokePing 2.7 रखें।" + +#: lib/HealthCheck.php +#, php-format +msgid "The reader found SmokePing %s, so the Loss Colors setting selects its loss colors." +msgstr "रीडर को SmokePing %s मिला, इसलिए हानि रंग सेटिंग उसके रंग चुनती है।" + +#: lib/HealthCheck.php +msgid "Thold is not installed, so no target alerts in both SmokePing and Thold." +msgstr "Thold स्थापित नहीं है, इसलिए कोई लक्ष्य SmokePing और Thold दोनों में अलर्ट नहीं देता।" + +#: lib/HealthCheck.php +msgid "No target has both a SmokePing alert and an enabled Thold threshold." +msgstr "किसी लक्ष्य में SmokePing अलर्ट और सक्षम Thold सीमा दोनों नहीं हैं।" + +#: lib/HealthCheck.php +#, php-format +msgid "%d targets have both a SmokePing alert and an enabled Thold threshold, so one problem may notify twice. Compare their alert conditions before removing either: %s" +msgstr "%d लक्ष्यों में SmokePing अलर्ट और सक्षम Thold सीमा दोनों हैं, इसलिए एक समस्या दो सूचनाएँ दे सकती है। किसी को हटाने से पहले उनकी अलर्ट शर्तें तुलना करें: %s" + +#: lib/HealthCheck.php +#, php-format +msgid "The SmokePing templates failed to import and are not retried automatically: %s Use Retry Template Import after fixing the cause." +msgstr "SmokePing टेम्पलेट आयात विफल हुआ और अपने आप फिर प्रयास नहीं होता: %s कारण ठीक करने के बाद टेम्पलेट आयात फिर प्रयास करें उपयोग करें।" + +#: lib/HealthCheck.php +msgid "The SmokePing templates are not imported. Use Retry Template Import." +msgstr "SmokePing टेम्पलेट आयात नहीं हैं। टेम्पलेट आयात फिर प्रयास करें उपयोग करें।" + +#: lib/HealthCheck.php smokeping_health.php +msgid "The SmokePing templates are imported." +msgstr "SmokePing टेम्पलेट आयात हो गए हैं।" + +#: lib/HealthCheck.php +msgid "Every device with summary data sources is polled by the reader's poller." +msgstr "सारांश डेटा स्रोत वाला हर डिवाइस रीडर के पोलर से पोल होता है।" + +#: lib/HealthCheck.php +#, php-format +msgid "%d devices have summary data sources but are not polled by poller %d, which runs the reader, so their summary values and alerts have no data: %s" +msgstr "%d डिवाइस में सारांश डेटा स्रोत हैं, लेकिन वे रीडर चलाने वाले पोलर %d से पोल नहीं होते, इसलिए उनके सारांश मान और अलर्ट में डेटा नहीं है: %s" + +#: lib/HealthCheck.php +#, php-format +msgid "The SmokePing configuration is read on poller %d, not on this server; the inventory row shows the result of its last read." +msgstr "SmokePing कॉन्फ़िगरेशन पोलर %d पर पढ़ा जाता है, इस सर्वर पर नहीं; सूची की पंक्ति पिछली पढ़ाई का परिणाम दिखाती है।" + +#: lib/HealthCheck.php +#, php-format +msgid "The SmokePing configuration %s cannot be read: %s" +msgstr "SmokePing कॉन्फ़िगरेशन %s पढ़ा नहीं जा सकता: %s" + +#: lib/HealthCheck.php +#, php-format +msgid "The SmokePing configuration %s lists %d targets; %d entries are skipped: %s" +msgstr "SmokePing कॉन्फ़िगरेशन %s में %d लक्ष्य हैं; %d प्रविष्टियाँ छोड़ी गईं: %s" + +#: lib/HealthCheck.php +#, php-format +msgid "The SmokePing configuration %s lists %d targets." +msgstr "SmokePing कॉन्फ़िगरेशन %s में %d लक्ष्य हैं।" + +#: lib/HealthCheck.php +msgid "The PHP binary path setting is empty or not an executable file, so the reader cannot start." +msgstr "PHP बाइनरी पथ खाली है या निष्पादन योग्य फ़ाइल नहीं है, इसलिए रीडर शुरू नहीं हो सकता।" + +#: lib/HealthCheck.php +#, php-format +msgid "The reader starts with %s." +msgstr "रीडर %s से शुरू होता है।" + +#: lib/HealthCheck.php +msgid "The reader has not completed a run on this poller." +msgstr "इस पोलर पर रीडर का कोई रन पूरा नहीं हुआ।" + +#: lib/HealthCheck.php +#, php-format +msgid "The last reader run finished %d seconds ago, more than three poller intervals." +msgstr "पिछला रीडर रन %d सेकंड पहले पूरा हुआ, जो तीन पोलर अंतराल से अधिक है।" + +#: lib/HealthCheck.php +#, php-format +msgid "The reader read %d of %d series in %.1f seconds and has exceeded its time budget %d times." +msgstr "रीडर ने %d श्रृंखलाएँ (कुल %d में से) %.1f सेकंड में पढ़ीं और अपना समय बजट %d बार पार किया है।" + +#: lib/HealthCheck.php +#, php-format +msgid "The reader read %d of %d series in %.1f seconds, %d seconds ago." +msgstr "रीडर ने %d श्रृंखलाएँ (कुल %d में से) %.1f सेकंड में, %d सेकंड पहले पढ़ीं।" + +#: lib/HealthCheck.php +msgid "No inventory has been read on this poller." +msgstr "इस पोलर पर कोई सूची नहीं पढ़ी गई।" + +#: lib/HealthCheck.php +#, php-format +msgid "The last inventory failed %d seconds ago and the previous one is still in use: %s" +msgstr "पिछली सूची %d सेकंड पहले विफल हुई और उससे पहले वाली अभी उपयोग में है: %s" + +#: lib/HealthCheck.php +#, php-format +msgid "The inventory listed %d targets %d seconds ago." +msgstr "सूची में %d लक्ष्य %d सेकंड पहले मिले।" + +#: lib/HealthPage.php +#, php-format +msgid "SmokePing Health for Poller %d" +msgstr "पोलर %d के लिए SmokePing स्वास्थ्य" + +#: lib/HealthPage.php +msgid "Check" +msgstr "जाँच" + +#: lib/HealthPage.php +msgid "Detail" +msgstr "विवरण" + +#: lib/HealthPage.php +msgid "Status" +msgstr "स्थिति" + +#: lib/HealthPage.php +msgid "Retry Template Import" +msgstr "टेम्पलेट आयात फिर प्रयास करें" + +#: lib/Html.php +msgid "OK" +msgstr "ठीक" + +#: lib/Html.php +msgid "Warning" +msgstr "चेतावनी" + +#: lib/Html.php lib/ImportPage.php +msgid "Error" +msgstr "त्रुटि" + +#: lib/Html.php lib/ViewPage.php +msgid "Unknown" +msgstr "अज्ञात" + +#: lib/Html.php +#, php-format +msgid "%d s ago" +msgstr "%d सेकंड पहले" + +#: lib/Html.php lib/ViewPage.php +msgid "never" +msgstr "कभी नहीं" + +#: lib/ImportPage.php lib/Pages.php +msgid "Import SmokePing Configuration" +msgstr "SmokePing कॉन्फ़िगरेशन आयात करें" + +#: lib/ImportPage.php +msgid "Configuration" +msgstr "कॉन्फ़िगरेशन" + +#: lib/ImportPage.php +msgid "The configured SmokePing file is read with the files it includes, from its own directory. An uploaded file is read on its own: @include is not allowed in it." +msgstr "कॉन्फ़िगर की गई SmokePing फ़ाइल उसके शामिल किए गए फ़ाइलों सहित उसी निर्देशिका से पढ़ी जाती है। अपलोड की गई फ़ाइल अकेले पढ़ी जाती है: उसमें @include अनुमत नहीं है।" + +#: lib/ImportPage.php +#, php-format +msgid "The configured file, %s" +msgstr "कॉन्फ़िगर की गई फ़ाइल, %s" + +#: lib/ImportPage.php +msgid "An uploaded file, without @include" +msgstr "अपलोड की गई फ़ाइल, बिना @include" + +#: lib/ImportPage.php +msgid "Uploaded File" +msgstr "अपलोड की गई फ़ाइल" + +#: lib/ImportPage.php +msgid "Only for an uploaded file: a SmokePing configuration of at most 4 MiB." +msgstr "केवल अपलोड की गई फ़ाइल के लिए: अधिकतम 4 MiB का SmokePing कॉन्फ़िगरेशन।" + +#: lib/ImportPage.php +msgid "Devices" +msgstr "डिवाइस" + +#: lib/ImportPage.php +msgid "One device per SmokePing host groups targets that probe the same host. A device that already has the host name on the chosen poller is used instead of a new one." +msgstr "हर SmokePing होस्ट के लिए एक डिवाइस उन लक्ष्यों को समूहित करता है जो समान होस्ट जाँचते हैं। चुने पोलर पर उसी होस्ट नाम वाला डिवाइस पहले से हो तो नए के बजाय वही उपयोग होता है।" + +#: lib/ImportPage.php +msgid "One device per SmokePing host" +msgstr "हर SmokePing होस्ट के लिए एक डिवाइस" + +#: lib/ImportPage.php +msgid "One device per SmokePing target" +msgstr "हर SmokePing लक्ष्य के लिए एक डिवाइस" + +#: lib/ImportPage.php +msgid "Device Template" +msgstr "डिवाइस टेम्पलेट" + +#: lib/ImportPage.php +msgid "The template of devices the import creates." +msgstr "आयात द्वारा बनाए गए डिवाइस का टेम्पलेट।" + +#: lib/ImportPage.php +msgid "Poller" +msgstr "पोलर" + +#: lib/ImportPage.php +msgid "The poller of new devices. It must be the poller that runs the SmokePing reader, or their summary data sources get no data." +msgstr "नए डिवाइस का पोलर। यह SmokePing रीडर चलाने वाला पोलर होना चाहिए, नहीं तो सारांश डेटा स्रोत को डेटा नहीं मिलता।" + +#: lib/ImportPage.php +msgid "Site" +msgstr "साइट" + +#: lib/ImportPage.php +msgid "The site of new devices." +msgstr "नए डिवाइस की साइट।" + +#: lib/ImportPage.php smokeping_inventory.php +msgid "None" +msgstr "कोई नहीं" + +#: lib/ImportPage.php +msgid "Graph Tree" +msgstr "ग्राफ़ ट्री" + +#: lib/ImportPage.php +msgid "Mirror the SmokePing hierarchy into a graph tree: each section becomes a branch, and each device a host under the branch of its targets. Existing branches and hosts are reused." +msgstr "SmokePing पदानुक्रम को ग्राफ़ ट्री में प्रतिरूपित करें: हर खंड एक शाखा और हर डिवाइस अपने लक्ष्यों की शाखा के नीचे होस्ट बनता है। मौजूदा शाखाएँ और होस्ट फिर उपयोग होते हैं।" + +#: lib/ImportPage.php +msgid "A new tree, named below" +msgstr "नीचे नामित नया ट्री" + +#: lib/ImportPage.php +msgid "Do not mirror" +msgstr "प्रतिरूप न बनाएँ" + +#: lib/ImportPage.php +msgid "New Tree Name" +msgstr "नए ट्री का नाम" + +#: lib/ImportPage.php +msgid "Only for a new tree. A tree that already has this name is used." +msgstr "केवल नए ट्री के लिए। इस नाम का ट्री पहले से हो तो वही उपयोग होता है।" + +#: lib/ImportPage.php +msgid "Preview reads the configuration and lists what the import would create. Nothing is written until you confirm that list on the next screen, and SmokePing's own files are never written." +msgstr "पूर्वावलोकन कॉन्फ़िगरेशन पढ़कर आयात द्वारा बनने वाली चीज़ें सूचीबद्ध करता है। अगली स्क्रीन पर सूची की पुष्टि तक कुछ नहीं लिखा जाता, और SmokePing की अपनी फ़ाइलें कभी नहीं लिखी जातीं।" + +#: lib/ImportPage.php +msgid "Preview" +msgstr "पूर्वावलोकन" + +#: lib/ImportPage.php +msgid "Note" +msgstr "टिप्पणी" + +#: lib/ImportPage.php +msgid "Level" +msgstr "स्तर" + +#: lib/ImportPage.php +msgid "Message" +msgstr "संदेश" + +#: lib/ImportPage.php +msgid "SmokePing Sections" +msgstr "SmokePing खंड" + +#: lib/ImportPage.php +msgid "Import" +msgstr "आयात" + +#: lib/ImportPage.php +msgid "Section" +msgstr "खंड" + +#: lib/ImportPage.php +msgid "Targets" +msgstr "लक्ष्य" + +#: lib/ImportPage.php +msgid "No section is checked, so every target is selected. Check sections and update the preview to import only those." +msgstr "कोई खंड चिह्नित नहीं है, इसलिए हर लक्ष्य चुना गया है। केवल कुछ खंड आयात करने के लिए उन्हें चिह्नित करके पूर्वावलोकन अपडेट करें।" + +#: lib/ImportPage.php +msgid "Only targets in the checked sections are selected." +msgstr "केवल चिह्नित खंडों के लक्ष्य चुने गए हैं।" + +#: lib/ImportPage.php +msgid "Update Preview" +msgstr "पूर्वावलोकन अपडेट करें" + +#: lib/ImportPage.php +msgid "Create" +msgstr "बनाएँ" + +#: lib/ImportPage.php +#, php-format +msgid "Use device %d" +msgstr "डिवाइस %d उपयोग करें" + +#: lib/ImportPage.php +#, php-format +msgid "Already mapped to device %d" +msgstr "पहले से डिवाइस %d से मैप है" + +#: lib/ImportPage.php +#, php-format +msgid "Skip: %s" +msgstr "छोड़ें: %s" + +#: lib/ImportPage.php +#, php-format +msgid "Devices: %d to create, %d existing to use, %d already mapped, %d skipped" +msgstr "डिवाइस: %d बनाने हैं, %d मौजूदा उपयोग करने हैं, %d पहले से मैप हैं, %d छोड़े गए" + +#: lib/ImportPage.php lib/InventoryPage.php +msgid "Action" +msgstr "कार्रवाई" + +#: lib/ImportPage.php +msgid "Description" +msgstr "विवरण" + +#: lib/ImportPage.php +msgid "Host Name" +msgstr "होस्ट नाम" + +#: lib/ImportPage.php lib/ViewPage.php +msgid "SmokePing Targets" +msgstr "SmokePing लक्ष्य" + +#: lib/ImportPage.php +msgid "No device." +msgstr "कोई डिवाइस नहीं।" + +#: lib/ImportPage.php +msgid "Smoke" +msgstr "स्मोक" + +#: lib/ImportPage.php +msgid "Summary" +msgstr "सारांश" + +#: lib/ImportPage.php lib/TargetActions.php +msgid "master" +msgstr "मास्टर" + +#: lib/ImportPage.php +#, php-format +msgid "Graphs: %d to create, %d already exist" +msgstr "ग्राफ़: %d बनाने हैं, %d पहले से मौजूद हैं" + +#: lib/ImportPage.php +msgid "Graph" +msgstr "ग्राफ़" + +#: lib/ImportPage.php lib/ViewPage.php +msgid "Location" +msgstr "स्थान" + +#: lib/ImportPage.php +msgid "SmokePing Target" +msgstr "SmokePing लक्ष्य" + +#: lib/ImportPage.php +msgid "No graph to create." +msgstr "बनाने के लिए कोई ग्राफ़ नहीं।" + +#: lib/ImportPage.php +msgid "Reason" +msgstr "कारण" + +#: lib/ImportPage.php +#, php-format +msgid "Summary Data Only: %d targets" +msgstr "केवल सारांश डेटा: %d लक्ष्य" + +#: lib/ImportPage.php +msgid "Branch" +msgstr "शाखा" + +#: lib/ImportPage.php lib/ViewPage.php +msgid "Device" +msgstr "डिवाइस" + +#: lib/ImportPage.php +#, php-format +msgid "Graph Tree: %d branches, %d device entries" +msgstr "ग्राफ़ ट्री: %d शाखाएँ, %d डिवाइस प्रविष्टियाँ" + +#: lib/ImportPage.php +msgid "Estimate" +msgstr "अनुमान" + +#: lib/ImportPage.php +msgid "Estimated Load" +msgstr "अनुमानित लोड" + +#: lib/ImportPage.php +msgid "Confirm" +msgstr "पुष्टि करें" + +#: lib/ImportPage.php +msgid "The configuration cannot be imported until the errors above are fixed. Nothing was written." +msgstr "ऊपर की त्रुटियाँ ठीक होने तक कॉन्फ़िगरेशन आयात नहीं हो सकता। कुछ नहीं लिखा गया।" + +#: lib/ImportPage.php +msgid "Every selected target is already in Cacti. There is nothing to import." +msgstr "हर चुना गया लक्ष्य पहले से Cacti में है। आयात करने के लिए कुछ नहीं है।" + +#: lib/ImportPage.php +#, php-format +msgid "Plan %s. Importing creates exactly what is listed above through Cacti's device, graph, and tree functions. If the SmokePing configuration or Cacti changed since this preview, the import is refused and you preview again." +msgstr "योजना %s। आयात Cacti के डिवाइस, ग्राफ़ और ट्री फ़ंक्शन से ठीक ऊपर सूचीबद्ध चीज़ें बनाता है। इस पूर्वावलोकन के बाद SmokePing कॉन्फ़िगरेशन या Cacti बदला हो तो आयात अस्वीकार होता है और आपको फिर पूर्वावलोकन करना होगा।" + +#: lib/ImportPage.php +#, php-format +msgid "%s and %d more" +msgstr "%s और %d अन्य" + +#: lib/InventoryForms.php +#, php-format +msgid "Add %s to Cacti" +msgstr "%s को Cacti में जोड़ें" + +#: lib/InventoryForms.php +#, php-format +msgid "SmokePing target %s (host %s) has no Cacti device. Choose what to do with it." +msgstr "SmokePing लक्ष्य %s (होस्ट %s) का कोई Cacti डिवाइस नहीं है। इसके लिए कार्रवाई चुनें।" + +#: lib/InventoryForms.php +msgid "Create a new device from the SmokePing Target template" +msgstr "SmokePing Target टेम्पलेट से नया डिवाइस बनाएँ" + +#: lib/InventoryForms.php +msgid "Map it to an existing device" +msgstr "इसे मौजूदा डिवाइस से मैप करें" + +#: lib/InventoryForms.php +msgid "Either way the target gets a summary graph for alerting and, when SmokePing's data can be graphed, a smoke graph. Cacti never writes SmokePing's files." +msgstr "दोनों तरीकों में लक्ष्य को अलर्ट के लिए सारांश ग्राफ़ और, जब SmokePing डेटा का ग्राफ़ बन सके, स्मोक ग्राफ़ मिलता है। Cacti कभी SmokePing फ़ाइलें नहीं लिखता।" + +#: lib/InventoryForms.php +msgid "Add" +msgstr "जोड़ें" + +#: lib/InventoryForms.php +msgid "Confirm Re-link" +msgstr "पुनः-जोड़ की पुष्टि करें" + +#: lib/InventoryForms.php +#, php-format +msgid "SmokePing no longer lists %s. %s has the same host (%s) and probe (%s). SmokePing starts a new, empty file for a new path." +msgstr "SmokePing अब %s सूचीबद्ध नहीं करता। %s का वही होस्ट (%s) और प्रोब (%s) है। नए पथ के लिए SmokePing नई, खाली फ़ाइल शुरू करता है।" + +#: lib/InventoryForms.php +msgid "Re-linking moves the smoke graph and the summary data source to the new target and the device mapping with them. The old file keeps its history in an archived graph. Nothing is deleted." +msgstr "पुनः-जोड़ स्मोक ग्राफ़, सारांश डेटा स्रोत और उनके साथ डिवाइस मैपिंग को नए लक्ष्य पर ले जाता है। पुरानी फ़ाइल का इतिहास संग्रहित ग्राफ़ में रहता है। कुछ नहीं हटता।" + +#: lib/InventoryForms.php +#, php-format +msgid "Device %d is mapped to the old target." +msgstr "डिवाइस %d पुराने लक्ष्य से मैप है।" + +#: lib/InventoryForms.php +msgid "Dismiss Proposal" +msgstr "प्रस्ताव खारिज करें" + +#: lib/InventoryForms.php +msgid "Re-link" +msgstr "दोबारा जोड़ें" + +#: lib/InventoryPage.php +msgid "Gone" +msgstr "चला गया" + +#: lib/InventoryPage.php +msgid "Present" +msgstr "मौजूद" + +#: lib/InventoryPage.php +msgid "Unmapped" +msgstr "मैप नहीं किया गया" + +#: lib/InventoryPage.php +msgid "Add to Cacti" +msgstr "Cacti में जोड़ें" + +#: lib/InventoryPage.php lib/Pages.php +msgid "SmokePing Inventory" +msgstr "SmokePing सूची" + +#: lib/InventoryPage.php +msgid "Host" +msgstr "होस्ट" + +#: lib/InventoryPage.php +msgid "Inventory" +msgstr "सूची" + +#: lib/InventoryPage.php +msgid "Mapping" +msgstr "मैपिंग" + +#: lib/InventoryPage.php +msgid "Name" +msgstr "नाम" + +#: lib/InventoryPage.php +msgid "Path" +msgstr "पथ" + +#: lib/InventoryPage.php +msgid "Probe" +msgstr "प्रोब" + +#: lib/InventoryPage.php +msgid "Slaves" +msgstr "स्लेव" + +#: lib/InventoryPage.php +msgid "Step / Pings" +msgstr "स्टेप / पिंग" + +#: lib/InventoryPage.php +msgid "No targets have been imported on this poller." +msgstr "इस पोलर पर कोई लक्ष्य आयात नहीं हुआ।" + +#: lib/InventoryPage.php +msgid "Review" +msgstr "समीक्षा" + +#: lib/InventoryPage.php +msgid "Re-link Proposals" +msgstr "दोबारा जोड़ने के प्रस्ताव" + +#: lib/InventoryPage.php +msgid "Disappeared Path" +msgstr "गायब हुआ पथ" + +#: lib/InventoryPage.php +msgid "New Path" +msgstr "नया पथ" + +#: lib/InventoryPage.php +msgid "No re-link proposals." +msgstr "कोई पुनः-जोड़ प्रस्ताव नहीं।" + +#: lib/LoadEstimate.php +#, php-format +msgid "%d series: about %.1f probe packets per second and %.2f RRD updates per second in SmokePing." +msgstr "%d श्रृंखलाएँ: SmokePing में लगभग %.1f प्रोब पैकेट प्रति सेकंड और %.2f RRD अपडेट प्रति सेकंड।" + +#: lib/LoadEstimate.php +#, php-format +msgid "Cacti gets about %d data source rows and %d graph item rows." +msgstr "Cacti को लगभग %d डेटा स्रोत पंक्तियाँ और %d ग्राफ़ आइटम पंक्तियाँ मिलती हैं।" + +#: lib/MountCheck.php +#, php-format +msgid "The SmokePing mount %s does not exist. Mount SmokePing's data directory there read-only." +msgstr "SmokePing माउंट %s मौजूद नहीं है। वहाँ SmokePing डेटा निर्देशिका केवल-पठन में माउंट करें।" + +#: lib/MountCheck.php +#, php-format +msgid "%s is inside the RRA path and not reached through a symlink." +msgstr "%s RRA पथ के भीतर है और प्रतीकात्मक लिंक से नहीं पहुँचा जाता।" + +#: lib/MountCheck.php +#, php-format +msgid "The Cacti user can write to %s. SmokePing's RRD files must be read-only to Cacti." +msgstr "Cacti उपयोगकर्ता %s में लिख सकता है। SmokePing RRD फ़ाइलें Cacti के लिए केवल-पठन होनी चाहिए।" + +#: lib/MountCheck.php +#, php-format +msgid "The SmokePing mount %s is not inside the Cacti RRA path %s." +msgstr "SmokePing माउंट %s, Cacti RRA पथ %s के भीतर नहीं है।" + +#: lib/MountCheck.php +#, php-format +msgid "The Cacti RRA path %s does not exist." +msgstr "Cacti RRA पथ %s मौजूद नहीं है।" + +#: lib/MountCheck.php +#, php-format +msgid "The SmokePing mount %s contains an empty, \".\" or \"..\" segment." +msgstr "SmokePing माउंट %s में खाली, \".\" या \"..\" खंड है।" + +#: lib/MountCheck.php +#, php-format +msgid "The SmokePing mount %s is reached through a symlink, which Cacti refuses. Use a read-only bind mount instead." +msgstr "SmokePing माउंट %s प्रतीकात्मक लिंक से पहुँचता है, जिसे Cacti अस्वीकार करता है। इसके बजाय केवल-पठन बाइंड माउंट उपयोग करें।" + +#: lib/MountCheck.php +msgid "Unable to read the mount table, so the mount could not be confirmed read-only." +msgstr "माउंट तालिका पढ़ी नहीं जा सकी, इसलिए माउंट के केवल-पठन होने की पुष्टि नहीं हुई।" + +#: lib/MountCheck.php +#, php-format +msgid "%s is on a read-only mount." +msgstr "%s केवल-पठन माउंट पर है।" + +#: lib/MountCheck.php +#, php-format +msgid "%s is on the writable mount %s. Mount SmokePing's data directory read-only." +msgstr "%s लिखने योग्य माउंट %s पर है। SmokePing डेटा निर्देशिका केवल-पठन माउंट करें।" + +#: lib/MountCheck.php +msgid "No inventory yet, so no RRD files are expected." +msgstr "अभी सूची नहीं है, इसलिए कोई RRD फ़ाइल अपेक्षित नहीं है।" + +#: lib/MountCheck.php +#, php-format +msgid "All %d expected RRD files are visible through the mount." +msgstr "सभी %d अपेक्षित RRD फ़ाइलें माउंट से दिखती हैं।" + +#: lib/MountCheck.php +#, php-format +msgid "%d of %d expected RRD files are not visible through the mount, for example %s." +msgstr "%d RRD फ़ाइलें (कुल %d अपेक्षित में से) माउंट से नहीं दिखतीं, जैसे %s।" + +#: lib/OperatorPage.php +msgid "Review the recorded observations below. Acknowledgments are personal to this session, expire when observations change, and never suppress alerts or change health." +msgstr "नीचे दर्ज अवलोकनों की समीक्षा करें। पुष्टि केवल इस सत्र में आपके लिए है, अवलोकन बदलने पर समाप्त हो जाती है और कभी अलर्ट दबाती या स्वास्थ्य बदलती नहीं है।" + +#: lib/OperatorPage.php lib/Pages.php +msgid "SmokePing Operations" +msgstr "SmokePing संचालन" + +#: lib/OperatorPage.php +msgid "Actions" +msgstr "कार्रवाइयाँ" + +#: lib/OperatorPage.php +msgid "Investigation" +msgstr "जाँच" + +#: lib/OperatorPage.php +msgid "Object" +msgstr "ऑब्जेक्ट" + +#: lib/OperatorPage.php +msgid "Observed (UTC)" +msgstr "अवलोकन समय (UTC)" + +#: lib/OperatorPage.php +msgid "State" +msgstr "स्थिति" + +#: lib/OperatorPage.php +msgid "Unknown or stale" +msgstr "अज्ञात या पुराना" + +#: lib/OperatorPage.php +msgid "Never" +msgstr "कभी नहीं" + +#: lib/OperatorPage.php +msgid "Acknowledged; health unchanged." +msgstr "पुष्टि की गई; स्वास्थ्य अपरिवर्तित।" + +#: lib/OperatorPage.php +msgid "Acknowledge" +msgstr "पुष्टि करें" + +#: lib/OperatorPage.php +msgid "No observations are available for devices you may access." +msgstr "जिन डिवाइस तक आपकी पहुँच है, उनके लिए कोई अवलोकन उपलब्ध नहीं है।" + +#: lib/Pages.php +msgid "SmokePing Operator" +msgstr "SmokePing ऑपरेटर" + +#: lib/Pages.php +msgid "SmokePing View" +msgstr "SmokePing दृश्य" + +#: lib/Pages.php +msgid "SmokePing Admin" +msgstr "SmokePing प्रशासन" + +#: lib/Pages.php +msgid "SmokePing Health" +msgstr "SmokePing स्वास्थ्य" + +#: lib/Pages.php setup.php +msgid "SmokePing" +msgstr "SmokePing" + +#: lib/RelinkGuard.php +msgid "both targets must be on the poller that runs the reader" +msgstr "दोनों लक्ष्य रीडर चलाने वाले पोलर पर होने चाहिए" + +#: lib/RelinkGuard.php +#, php-format +msgid "the new target is already mapped to device %d" +msgstr "नया लक्ष्य पहले से डिवाइस %d से मैप है" + +#: lib/RelinkGuard.php +#, php-format +msgid "the old target has data sources on device %d, which it is not mapped to" +msgstr "पुराने लक्ष्य के डेटा स्रोत डिवाइस %d पर हैं, जिससे वह मैप नहीं है" + +#: lib/Settings.php +msgid "SmokePing Source" +msgstr "SmokePing स्रोत" + +#: lib/Settings.php +msgid "SmokePing Poller" +msgstr "SmokePing पोलर" + +#: lib/Settings.php +msgid "The Cacti poller that runs on, or shares a filesystem with, the SmokePing host. Only this poller reads SmokePing data." +msgstr "वह Cacti पोलर जो SmokePing होस्ट पर चलता है या उसके साथ फ़ाइलसिस्टम साझा करता है। केवल यही पोलर SmokePing डेटा पढ़ता है।" + +#: lib/Settings.php +msgid "SmokePing Configuration File" +msgstr "SmokePing कॉन्फ़िगरेशन फ़ाइल" + +#: lib/Settings.php +msgid "The main SmokePing configuration file, read by the poller that runs the reader. The plugin reads it and the files it includes with its own parser and never writes to them. Includes must stay inside this file's directory." +msgstr "मुख्य SmokePing कॉन्फ़िगरेशन फ़ाइल, जिसे रीडर चलाने वाला पोलर पढ़ता है। प्लगइन इसे और शामिल फ़ाइलों को अपने पार्सर से पढ़ता है और कभी लिखता नहीं। शामिल फ़ाइलें इसी फ़ाइल की निर्देशिका के भीतर होनी चाहिए।" + +#: lib/Settings.php +msgid "SmokePing Data Directory" +msgstr "SmokePing डेटा निर्देशिका" + +#: lib/Settings.php +msgid "The datadir from SmokePing's configuration, as SmokePing sees it." +msgstr "SmokePing कॉन्फ़िगरेशन का datadir, जैसा SmokePing उसे देखता है।" + +#: lib/Settings.php +msgid "Cacti Mount of the Data Directory" +msgstr "डेटा निर्देशिका का Cacti माउंट" + +#: lib/Settings.php +msgid "A read-only bind or NFS mount of the SmokePing data directory inside the Cacti RRA path. Cacti only reads RRD files inside its RRA path and never through a symlink." +msgstr "Cacti RRA पथ के भीतर SmokePing डेटा निर्देशिका का केवल-पठन बाइंड या NFS माउंट। Cacti केवल अपने RRA पथ के भीतर RRD फ़ाइलें पढ़ता है, कभी प्रतीकात्मक लिंक से नहीं।" + +#: lib/Settings.php +msgid "Reader" +msgstr "रीडर" + +#: lib/Settings.php +msgid "Reader Time Budget" +msgstr "रीडर समय बजट" + +#: lib/Settings.php +msgid "Seconds one reader run may spend reading RRD files before it stops and resumes on the next poller cycle." +msgstr "रीडर का एक रन RRD फ़ाइलें पढ़ने में जितने सेकंड लगा सकता है, जिसके बाद रुककर अगले पोलर चक्र में जारी रहता है।" + +#: lib/Settings.php +msgid "Inventory Interval" +msgstr "सूची अंतराल" + +#: lib/Settings.php +msgid "Minimum seconds between inventory runs. The inventory also runs when the configuration file changes." +msgstr "सूची रन के बीच न्यूनतम सेकंड। कॉन्फ़िगरेशन फ़ाइल बदलने पर भी सूची चलती है।" + +#: lib/Settings.php +msgid "Freshness Allowance" +msgstr "ताज़गी छूट" + +#: lib/Settings.php +msgid "Seconds past one step for which a measurement still counts as current." +msgstr "एक स्टेप के बाद अतिरिक्त सेकंड जिनमें माप अभी वर्तमान माना जाता है।" + +#: lib/Settings.php +msgid "Loss Colors" +msgstr "हानि रंग" + +#: lib/Settings.php +msgid "Which SmokePing loss colors the smoke graphs draw. SmokePing 2.7 draws other loss levels than 2.8 and later. Automatic follows the SmokePing version the reader finds next to SmokePing, shown on the health page, and uses 2.8 and later when it finds none." +msgstr "स्मोक ग्राफ़ में उपयोग होने वाले SmokePing हानि रंग। SmokePing 2.7 के हानि स्तर 2.8 और बाद से अलग हैं। स्वचालित विकल्प SmokePing के पास रीडर को मिले संस्करण का अनुसरण करता है, जो स्वास्थ्य पृष्ठ पर दिखता है; कोई न मिले तो 2.8 और बाद के रंग उपयोग करता है।" + +#: lib/Settings.php +msgid "Automatic" +msgstr "स्वचालित" + +#: lib/Settings.php +msgid "SmokePing 2.8 and later" +msgstr "SmokePing 2.8 और बाद" + +#: lib/Settings.php +msgid "SmokePing 2.7" +msgstr "SmokePing 2.7" + +#: lib/Settings.php +msgid "Uninstall" +msgstr "स्थापना रद्द करें" + +#: lib/Settings.php +msgid "Keep Plugin Tables on Uninstall" +msgstr "स्थापना रद्द करने पर प्लगइन तालिकाएँ रखें" + +#: lib/Settings.php +msgid "When checked, uninstalling the plugin keeps its inventory, mapping, and health tables. SmokePing files are never removed either way." +msgstr "चुनने पर प्लगइन की स्थापना रद्द करने से सूची, मैपिंग और स्वास्थ्य तालिकाएँ बनी रहती हैं। दोनों स्थितियों में SmokePing फ़ाइलें कभी नहीं हटतीं।" + +#: lib/Settings.php +msgid "Backup Directory" +msgstr "बैकअप निर्देशिका" + +#: lib/Settings.php +msgid "Where the uninstall writes its export of the plugin configuration. Leave blank to use the cache/smokeping directory of Cacti, which the plugin protects with a deny-all rule. A directory set here must already exist, be writable, and be outside the web root; when it is not writable no export is written." +msgstr "वह स्थान जहाँ स्थापना-रद्द प्रक्रिया प्लगइन कॉन्फ़िगरेशन का निर्यात लिखती है। खाली छोड़ने पर Cacti की cache/smokeping निर्देशिका उपयोग होती है, जिसे प्लगइन deny-all नियम से सुरक्षित करता है। यहाँ दी निर्देशिका पहले से मौजूद, लिखने योग्य और वेब रूट के बाहर होनी चाहिए; लिखने योग्य न हो तो निर्यात नहीं लिखा जाता।" + +#: lib/SmokeProvisioner.php +msgid "The target has not been saved yet." +msgstr "लक्ष्य अभी सहेजा नहीं गया।" + +#: lib/SmokeProvisioner.php +#, php-format +msgid "The target sends %d pings per round. Smoke graphs exist only for 10, 20, and 30; it has summary data only." +msgstr "लक्ष्य हर दौर में %d पिंग भेजता है। स्मोक ग्राफ़ केवल 10, 20 और 30 के लिए हैं; इसके पास केवल सारांश डेटा है।" + +#: lib/SmokeProvisioner.php +msgid "Cacti keeps RRD files on an RRDproxy, where SmokePing's files do not exist. Only summary data is available." +msgstr "Cacti RRD फ़ाइलें RRDproxy पर रखता है, जहाँ SmokePing फ़ाइलें नहीं हैं। केवल सारांश डेटा उपलब्ध है।" + +#: lib/SmokeProvisioner.php +#, php-format +msgid "The device is polled by poller %d, but the reader that fills the summary values runs on poller %d. Assign the device to poller %d." +msgstr "डिवाइस पोलर %d से पोल होता है, लेकिन सारांश मान भरने वाला रीडर पोलर %d पर चलता है। डिवाइस को पोलर %d दें।" + +#: lib/SmokeProvisioner.php +msgid "The summary graph template is not installed." +msgstr "सारांश ग्राफ़ टेम्पलेट स्थापित नहीं है।" + +#: lib/SmokeProvisioner.php +msgid "The summary data template is not installed." +msgstr "सारांश डेटा टेम्पलेट स्थापित नहीं है।" + +#: lib/SmokeProvisioner.php +msgid "Cacti did not create the summary graph." +msgstr "Cacti ने सारांश ग्राफ़ नहीं बनाया।" + +#: lib/SmokeProvisioner.php +msgid "Both targets must be saved first." +msgstr "पहले दोनों लक्ष्य सहेजने होंगे।" + +#: lib/SmokeProvisioner.php +msgid "The old target has no smoke data source to move." +msgstr "पुराने लक्ष्य में स्थानांतरित करने के लिए स्मोक डेटा स्रोत नहीं है।" + +#: lib/SmokeProvisioner.php +#, php-format +msgid "The RRD file %s is not visible through the SmokePing mount." +msgstr "RRD फ़ाइल %s SmokePing माउंट से नहीं दिखती।" + +#: lib/SmokeProvisioner.php +#, php-format +msgid "The RRD file %s resolves outside the SmokePing mount." +msgstr "RRD फ़ाइल %s का वास्तविक पथ SmokePing माउंट के बाहर है।" + +#: lib/SmokeProvisioner.php +msgid "The smoke graph template is not installed." +msgstr "स्मोक ग्राफ़ टेम्पलेट स्थापित नहीं है।" + +#: lib/SmokeProvisioner.php +msgid "Cacti did not create the smoke graph." +msgstr "Cacti ने स्मोक ग्राफ़ नहीं बनाया।" + +#: lib/SmokeProvisioner.php +msgid "Cacti does not accept the SmokePing path for a data source." +msgstr "Cacti डेटा स्रोत के लिए SmokePing पथ स्वीकार नहीं करता।" + +#: lib/SmokepingImportService.php +msgid "Another SmokePing configuration import is running, so nothing was imported. Check again when it has finished." +msgstr "दूसरा SmokePing कॉन्फ़िगरेशन आयात चल रहा है, इसलिए कुछ आयात नहीं हुआ। पूरा होने पर फिर जाँचें।" + +#: lib/SmokepingImportService.php +msgid "The configuration or the installation changed since the check, so nothing was imported. Check again." +msgstr "जाँच के बाद कॉन्फ़िगरेशन या स्थापना बदल गई, इसलिए कुछ आयात नहीं हुआ। फिर जाँचें।" + +#: lib/SmokepingImportService.php +msgid "Mirroring into a graph tree needs permission to edit trees." +msgstr "ग्राफ़ ट्री में प्रतिरूप बनाने के लिए ट्री संपादन अनुमति चाहिए।" + +#: lib/SmokepingImportService.php +msgid "The targets could not be stored; see the Cacti log. Nothing else was changed." +msgstr "लक्ष्य संग्रहीत नहीं हो सके; Cacti लॉग देखें। कुछ और नहीं बदला।" + +#: lib/SmokepingImportService.php +#, php-format +msgid "%s: skipped, %s" +msgstr "%s: छोड़ा गया, %s" + +#: lib/SmokepingImportService.php +#, php-format +msgid "%s: skipped, Cacti did not create the device" +msgstr "%s: छोड़ा गया, Cacti ने डिवाइस नहीं बनाया" + +#: lib/SmokepingImportService.php +#, php-format +msgid "%s: created device %d" +msgstr "%s: डिवाइस %d बनाया गया" + +#: lib/SmokepingImportService.php +#, php-format +msgid "%s: skipped, the target was not stored" +msgstr "%s: छोड़ा गया, लक्ष्य संग्रहीत नहीं हुआ" + +#: lib/SmokepingImportService.php +#, php-format +msgid "%s: already in Cacti on device %d" +msgstr "%s: पहले से Cacti में डिवाइस %d पर है" + +#: lib/SmokepingImportService.php +#, php-format +msgid "The graph tree %s could not be created." +msgstr "ग्राफ़ ट्री %s नहीं बन सका।" + +#: lib/SmokepingImportService.php +#, php-format +msgid "created graph tree %s" +msgstr "ग्राफ़ ट्री %s बनाया गया" + +#: lib/SmokepingImportService.php +#, php-format +msgid "the tree branch %s could not be created" +msgstr "ट्री शाखा %s नहीं बन सकी" + +#: lib/SmokepingImportService.php +#, php-format +msgid "tree branch %s" +msgstr "ट्री शाखा %s" + +#: lib/SmokepingImportService.php +#, php-format +msgid "device %d could not be added to the tree" +msgstr "डिवाइस %d ट्री में नहीं जोड़ा जा सका" + +#: lib/SmokepingImportService.php +#, php-format +msgid "device %d under tree branch %s" +msgstr "डिवाइस %d, ट्री शाखा %s के नीचे" + +#: lib/TargetActions.php +msgid "the target has not been saved yet" +msgstr "लक्ष्य अभी सहेजा नहीं गया" + +#: lib/TargetActions.php +#, php-format +msgid "already mapped to device %d" +msgstr "पहले से डिवाइस %d से मैप है" + +#: lib/TargetActions.php +msgid "Cacti did not create the device" +msgstr "Cacti ने डिवाइस नहीं बनाया" + +#: lib/TargetActions.php +#, php-format +msgid "created device %d" +msgstr "डिवाइस %d बनाया गया" + +#: lib/TargetActions.php +#, php-format +msgid "the target was mapped to another device meanwhile; device %d has no SmokePing graphs" +msgstr "इस बीच लक्ष्य अन्य डिवाइस से मैप हुआ; डिवाइस %d में SmokePing ग्राफ़ नहीं हैं" + +#: lib/TargetActions.php +msgid "the target was mapped to another device meanwhile" +msgstr "इस बीच लक्ष्य अन्य डिवाइस से मैप हुआ" + +#: lib/TargetActions.php +#, php-format +msgid "mapped to device %d" +msgstr "डिवाइस %d से मैप किया गया" + +#: lib/TargetActions.php +#, php-format +msgid "summary graph %d for %s" +msgstr "सारांश ग्राफ़ %d, %s के लिए" + +#: lib/TargetActions.php +#, php-format +msgid "no summary for %s: %s" +msgstr "%s का सारांश नहीं: %s" + +#: lib/TargetActions.php +#, php-format +msgid "smoke graph %d for %s" +msgstr "स्मोक ग्राफ़ %d, %s के लिए" + +#: lib/TargetActions.php +#, php-format +msgid "no smoke graph for %s: %s" +msgstr "%s का स्मोक ग्राफ़ नहीं: %s" + +#: lib/TargetActions.php +#, php-format +msgid "%d devices were not processed in the time allowed. Run the action again for them; devices already added are skipped." +msgstr "%d डिवाइस अनुमत समय में संसाधित नहीं हुए। उनके लिए कार्रवाई फिर चलाएँ; पहले से जोड़े गए डिवाइस छोड़ दिए जाते हैं।" + +#: lib/TargetActions.php +msgid "Time limit" +msgstr "समय सीमा" + +#: lib/TargetActions.php +#, php-format +msgid "no unmapped SmokePing target has the host %s" +msgstr "कोई अनमैप SmokePing लक्ष्य होस्ट %s नहीं रखता" + +#: lib/TargetActions.php +msgid "the proposal is no longer open" +msgstr "प्रस्ताव अब खुला नहीं है" + +#: lib/TargetActions.php +msgid "the new target is mapped to another device" +msgstr "नया लक्ष्य अन्य डिवाइस से मैप है" + +#: lib/TargetActions.php +#, php-format +msgid "smoke graph %d now reads the new file; the old file stays graphable in an archived graph" +msgstr "स्मोक ग्राफ़ %d अब नई फ़ाइल पढ़ता है; पुरानी फ़ाइल संग्रहित ग्राफ़ में ग्राफ़ बनाने योग्य रहती है" + +#: lib/TargetActions.php +#, php-format +msgid "summary data source %d follows the new target" +msgstr "सारांश डेटा स्रोत %d नए लक्ष्य का अनुसरण करता है" + +#: lib/TargetActions.php +#, php-format +msgid "device %d is mapped to the new target" +msgstr "डिवाइस %d नए लक्ष्य से मैप है" + +#: lib/ViewPage.php +msgid "Condition" +msgstr "दशा" + +#: lib/ViewPage.php +msgid "Freshness" +msgstr "ताज़गी" + +#: lib/ViewPage.php +msgid "Last Update" +msgstr "पिछला अपडेट" + +#: lib/ViewPage.php +msgid "Loss" +msgstr "हानि" + +#: lib/ViewPage.php +msgid "Maintenance" +msgstr "रखरखाव" + +#: lib/ViewPage.php +msgid "Median" +msgstr "मध्यिका" + +#: lib/ViewPage.php +msgid "Target" +msgstr "लक्ष्य" + +#: lib/ViewPage.php +msgid "No SmokePing targets are mapped to devices you can view." +msgstr "आप जिन डिवाइस को देख सकते हैं, उनसे कोई SmokePing लक्ष्य मैप नहीं है।" + +#: lib/ViewPage.php +msgid "In maintenance" +msgstr "रखरखाव में" + +#: lib/ViewPage.php +msgid "No" +msgstr "नहीं" + +#: lib/ViewPage.php +msgid "Never observed" +msgstr "कभी अवलोकन नहीं हुआ" + +#: setup.php +#, php-format +msgid "The SmokePing plugin requires PHP %s or later. This server runs PHP %s, so the plugin was not installed or enabled." +msgstr "SmokePing प्लगइन को PHP %s या बाद का संस्करण चाहिए। यह सर्वर PHP %s चला रहा है, इसलिए प्लगइन स्थापित या सक्षम नहीं किया गया।" + +#: setup.php +msgid "The SmokePing plugin is not enabled." +msgstr "SmokePing प्लगइन सक्षम नहीं है।" + +#: setup.php +#, php-format +msgid "The SmokePing plugin requires PHP %s or later." +msgstr "SmokePing प्लगइन को PHP %s या बाद का संस्करण चाहिए।" + +#: setup.php +#, php-format +msgid "The SmokePing configuration was exported to %s" +msgstr "SmokePing कॉन्फ़िगरेशन %s में निर्यात हुआ" + +#: setup.php +msgid "The SmokePing configuration was not exported; see the SmokePing log. The uninstall went ahead." +msgstr "SmokePing कॉन्फ़िगरेशन निर्यात नहीं हुआ; SmokePing लॉग देखें। स्थापना रद्द करना जारी रहा।" + +#: setup.php +msgid "Management" +msgstr "प्रबंधन" + +#: setup.php +msgid "Import/Export" +msgstr "आयात/निर्यात" + +#: setup.php +msgid "You do not have permission to add SmokePing targets." +msgstr "आपको SmokePing लक्ष्य जोड़ने की अनुमति नहीं है।" + +#: smokeping_config.php smokeping_import.php +msgid "No file was uploaded, or it is larger than the server accepts." +msgstr "कोई फ़ाइल अपलोड नहीं हुई, या सर्वर की सीमा से बड़ी है।" + +#: smokeping_config.php +msgid "There is no checked import to apply. Check the file again." +msgstr "लागू करने के लिए जाँचा गया आयात नहीं है। फ़ाइल फिर जाँचें।" + +#: smokeping_config.php +msgid "The configuration was imported." +msgstr "कॉन्फ़िगरेशन आयात हुआ।" + +#: smokeping_health.php +msgid "The SmokePing templates failed to import. See the health table." +msgstr "SmokePing टेम्पलेट आयात विफल हुआ। स्वास्थ्य तालिका देखें।" + +#: smokeping_import.php +msgid "Your device permissions do not cover every device, so you cannot import a SmokePing configuration. Ask an administrator with access to all devices." +msgstr "आपकी डिवाइस अनुमतियाँ सभी डिवाइस को शामिल नहीं करतीं, इसलिए आप SmokePing कॉन्फ़िगरेशन आयात नहीं कर सकते। सभी डिवाइस तक पहुँच वाले व्यवस्थापक से कहें।" + +#: smokeping_import.php +msgid "Name the new graph tree, or choose an existing tree or no tree." +msgstr "नए ग्राफ़ ट्री को नाम दें, या मौजूदा ट्री अथवा कोई ट्री नहीं चुनें।" + +#: smokeping_import.php +msgid "The uploaded file is larger than 4 MiB." +msgstr "अपलोड की गई फ़ाइल 4 MiB से बड़ी है।" + +#: smokeping_import.php +#, php-format +msgid "The SmokePing configuration cannot be read, so nothing was imported: %s" +msgstr "SmokePing कॉन्फ़िगरेशन पढ़ा नहीं जा सकता, इसलिए कुछ आयात नहीं हुआ: %s" + +#: smokeping_import.php +msgid "There is no previewed import to apply. Preview it again." +msgstr "लागू करने के लिए पूर्वावलोकित आयात नहीं है। फिर पूर्वावलोकन करें।" + +#: smokeping_import.php +#, php-format +msgid "and %d more; see the Cacti log" +msgstr "और %d अन्य; Cacti लॉग देखें" + +#: smokeping_import.php +msgid "The SmokePing configuration was imported." +msgstr "SmokePing कॉन्फ़िगरेशन आयात हुआ।" + +#: smokeping_inventory.php +msgid "Choose a target on this poller and, to map it, a device you may change." +msgstr "इस पोलर पर लक्ष्य चुनें और मैप करने के लिए ऐसा डिवाइस जिसे आप बदल सकते हैं।" + +#: smokeping_inventory.php +msgid "The proposal is not open, or it involves a device or poller you may not change." +msgstr "प्रस्ताव खुला नहीं है, या उसमें ऐसा डिवाइस या पोलर है जिसे आप नहीं बदल सकते।" + +#: smokeping_inventory.php +msgid "The proposal was dismissed." +msgstr "प्रस्ताव खारिज किया गया।" + +#: smokeping_operator.php +msgid "Monitoring view" +msgstr "निगरानी दृश्य" + +#: smokeping_operator.php +msgid "Observations could not be read. Ask an administrator to check the plugin log." +msgstr "अवलोकन पढ़े नहीं जा सके। किसी व्यवस्थापक से प्लगइन लॉग जाँचने को कहें।" diff --git a/locales/po/ja-JP.po b/locales/po/ja-JP.po index a989b2a..5b83c1d 100644 --- a/locales/po/ja-JP.po +++ b/locales/po/ja-JP.po @@ -13,6 +13,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +#: include/operator.php lib/ViewPage.php +msgid "Master" +msgstr "マスター" + +#: include/operator.php +msgid "Compare loss and latency with the SmokePing graphs and maintenance state. Escalate missing files, imports and relinking to an administrator." +msgstr "パケット損失と遅延を SmokePing のグラフおよびメンテナンス状態と比較してください。ファイルの欠落、インポート、関連付けの修正は管理者に依頼してください。" + #: lib/ActionOutcome.php #, php-format msgid "skipped, %s" @@ -769,6 +777,58 @@ msgstr "想定される %d 個の RRD ファイルはすべてマウント経由 msgid "%d of %d expected RRD files are not visible through the mount, for example %s." msgstr "想定される %d 個の RRD ファイルのうち %d 個がマウント経由で参照できません(例: %s)。" +#: lib/OperatorPage.php +msgid "Review the recorded observations below. Acknowledgments are personal to this session, expire when observations change, and never suppress alerts or change health." +msgstr "以下に記録された観測結果を確認してください。確認済みの記録はこのセッションの自分だけに適用され、観測結果が変わると失効します。アラートの抑制や健全性の変更は行いません。" + +#: lib/OperatorPage.php lib/Pages.php +msgid "SmokePing Operations" +msgstr "SmokePing 運用" + +#: lib/OperatorPage.php +msgid "Actions" +msgstr "操作" + +#: lib/OperatorPage.php +msgid "Investigation" +msgstr "調査" + +#: lib/OperatorPage.php +msgid "Object" +msgstr "対象" + +#: lib/OperatorPage.php +msgid "Observed (UTC)" +msgstr "観測日時 (UTC)" + +#: lib/OperatorPage.php +msgid "State" +msgstr "状態" + +#: lib/OperatorPage.php +msgid "Unknown or stale" +msgstr "不明または古い情報" + +#: lib/OperatorPage.php +msgid "Never" +msgstr "未実施" + +#: lib/OperatorPage.php +msgid "Acknowledged; health unchanged." +msgstr "確認済み。健全性に変更はありません。" + +#: lib/OperatorPage.php +msgid "Acknowledge" +msgstr "確認済みにする" + +#: lib/OperatorPage.php +msgid "No observations are available for devices you may access." +msgstr "アクセス権のあるデバイスの観測結果はありません。" + +#: lib/Pages.php +msgid "SmokePing Operator" +msgstr "SmokePing オペレーター" + #: lib/Pages.php msgid "SmokePing View" msgstr "SmokePing 表示" @@ -1155,10 +1215,6 @@ msgstr "ターゲット" msgid "No SmokePing targets are mapped to devices you can view." msgstr "表示可能なデバイスにマッピングされている SmokePing ターゲットはありません。" -#: lib/ViewPage.php -msgid "Master" -msgstr "マスター" - #: lib/ViewPage.php msgid "In maintenance" msgstr "メンテナンス中" @@ -1264,6 +1320,14 @@ msgstr "提案が受付中でないか、変更権限のないデバイスまた msgid "The proposal was dismissed." msgstr "提案を却下しました。" +#: smokeping_operator.php +msgid "Monitoring view" +msgstr "監視ビュー" + +#: smokeping_operator.php +msgid "Observations could not be read. Ask an administrator to check the plugin log." +msgstr "観測結果を読み取れませんでした。管理者にプラグインのログを確認するよう依頼してください。" + #, php-format #~ msgid "Smoke graphs are set to SmokePing %s loss colors, as the Loss Colors setting asks." #~ msgstr "損失色の設定どおり、スモークグラフは SmokePing %s の損失色に設定されています。" diff --git a/locales/po/zh-CN.po b/locales/po/zh-CN.po index 7faccb2..9bdd71f 100644 --- a/locales/po/zh-CN.po +++ b/locales/po/zh-CN.po @@ -1,10 +1,11 @@ # SPDX-License-Identifier: GPL-2.0-or-later # SPDX-FileCopyrightText: 2026 Thomas Vincent +# msgid "" msgstr "" "Project-Id-Version: smokeping 1.0.0-rc.1\n" "Report-Msgid-Bugs-To: https://github.com/somethingwithproof/plugin_smokeping/issues\n" -"PO-Revision-Date: 2026-11-14 00:00+0000\n" +"PO-Revision-Date: 2026-11-17 00:00+0000\n" "Last-Translator: Thomas Vincent \n" "Language-Team: Thomas Vincent \n" "Language: zh-CN\n" @@ -13,6 +14,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +#: include/operator.php lib/ViewPage.php +msgid "Master" +msgstr "主" + +#: include/operator.php +msgid "Compare loss and latency with the SmokePing graphs and maintenance state. Escalate missing files, imports and relinking to an administrator." +msgstr "将丢包和延迟与 SmokePing 图表及维护状态进行比较。文件缺失、导入和重新关联请交由管理员处理。" + #: lib/ActionOutcome.php #, php-format msgid "skipped, %s" @@ -769,6 +778,58 @@ msgstr "预期的 %d 个 RRD 文件均可通过挂载访问。" msgid "%d of %d expected RRD files are not visible through the mount, for example %s." msgstr "预期的 %d 个 RRD 文件中有 %d 个无法通过挂载访问,例如 %s。" +#: lib/OperatorPage.php +msgid "Review the recorded observations below. Acknowledgments are personal to this session, expire when observations change, and never suppress alerts or change health." +msgstr "查看下方记录的观测结果。确认记录仅对当前会话中的您有效,在观测结果变化时失效,且不会抑制告警或更改健康状态。" + +#: lib/OperatorPage.php lib/Pages.php +msgid "SmokePing Operations" +msgstr "SmokePing 运维" + +#: lib/OperatorPage.php +msgid "Actions" +msgstr "操作" + +#: lib/OperatorPage.php +msgid "Investigation" +msgstr "调查" + +#: lib/OperatorPage.php +msgid "Object" +msgstr "对象" + +#: lib/OperatorPage.php +msgid "Observed (UTC)" +msgstr "观测时间(UTC)" + +#: lib/OperatorPage.php +msgid "State" +msgstr "状态" + +#: lib/OperatorPage.php +msgid "Unknown or stale" +msgstr "未知或已过期" + +#: lib/OperatorPage.php +msgid "Never" +msgstr "从未" + +#: lib/OperatorPage.php +msgid "Acknowledged; health unchanged." +msgstr "已确认;健康状态未改变。" + +#: lib/OperatorPage.php +msgid "Acknowledge" +msgstr "确认" + +#: lib/OperatorPage.php +msgid "No observations are available for devices you may access." +msgstr "您有权访问的设备暂无观测结果。" + +#: lib/Pages.php +msgid "SmokePing Operator" +msgstr "SmokePing 操作员" + #: lib/Pages.php msgid "SmokePing View" msgstr "SmokePing 查看" @@ -1155,10 +1216,6 @@ msgstr "目标" msgid "No SmokePing targets are mapped to devices you can view." msgstr "没有 SmokePing 目标映射到您可查看的设备。" -#: lib/ViewPage.php -msgid "Master" -msgstr "主" - #: lib/ViewPage.php msgid "In maintenance" msgstr "维护中" @@ -1264,9 +1321,10 @@ msgstr "该建议未处于开放状态,或涉及您无权更改的设备或轮 msgid "The proposal was dismissed." msgstr "该建议已被忽略。" -#, php-format -#~ msgid "Smoke graphs are set to SmokePing %s loss colors, as the Loss Colors setting asks." -#~ msgstr "按照丢包颜色设置,烟雾图设为使用 SmokePing %s 的丢包颜色。" +#: smokeping_operator.php +msgid "Monitoring view" +msgstr "监控视图" -#~ msgid "Targets alerting in both SmokePing and Thold cannot be listed until SmokePing data sources exist." -#~ msgstr "在 SmokePing 数据源存在之前,无法列出同时在 SmokePing 和 Thold 中告警的目标。" +#: smokeping_operator.php +msgid "Observations could not be read. Ask an administrator to check the plugin log." +msgstr "无法读取观测结果。请联系管理员检查插件日志。" diff --git a/phpstan.neon b/phpstan.neon index b6b8991..6277f15 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -23,6 +23,7 @@ parameters: paths: - lib - setup.php + - include/operator.php scanDirectories: - %env.CACTI_PATH%/lib - %env.CACTI_PATH%/include diff --git a/phpunit.xml b/phpunit.xml index 7ac41dc..65d05b1 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -23,6 +23,10 @@ lib + setup.php + include/operator.php + smokeping_operator.php + smokeping.php diff --git a/setup.php b/setup.php index 5ec19c5..f2c2aa2 100644 --- a/setup.php +++ b/setup.php @@ -87,13 +87,18 @@ function smokeping_settings(): \Somethingwithproof\Smokeping\Settings { } /** - * Common start of every page script, after include/auth.php has authorized - * the realm. Refuses on an unsupported PHP or a disabled plugin, because - * Cacti keeps plugin realms registered while a plugin is disabled. + * Common start after include/auth.php establishes the user. Recheck the + * realm here because cookie and Basic login restore the user after the + * alternate-realms hook. Disabled plugins and unsupported runtimes refuse. */ function smokeping_page_start(): bool { if (smokeping_boot() && api_plugin_is_enabled('smokeping')) { - return true; + if (smokeping_page_allowed()) { + return true; + } + http_response_code(403); + + return false; } top_header(); @@ -207,12 +212,14 @@ function smokeping_setup_hooks(): void { include_once($config['library_path'] . '/poller.php'); } + $enabled = (new \Somethingwithproof\Smokeping\Schema(false))->pluginEnabled(); + foreach (\Somethingwithproof\Smokeping\Schema::HOOKS as $hook => $function) { - api_plugin_register_hook('smokeping', $hook, $function, 'setup.php'); + api_plugin_register_hook('smokeping', $hook, $function, 'setup.php', $enabled); } foreach (\Somethingwithproof\Smokeping\Pages::realms() as $realm) { - api_plugin_register_realm('smokeping', implode(',', $realm['files']), $realm['name'], true); + api_plugin_register_realm('smokeping', implode(',', $realm['files']), $realm['name'], $realm['files'] !== \Somethingwithproof\Smokeping\Pages::OPERATOR); } } @@ -299,6 +306,10 @@ function smokeping_show_tab(): void { function smokeping_config_settings(): void { global $tabs, $settings, $config; + if (PHP_SAPI !== 'cli' && !api_plugin_user_realm_auth('smokeping_inventory.php')) { + return; + } + if (!smokeping_boot()) { return; } @@ -312,10 +323,17 @@ function smokeping_config_settings(): void { * @return array */ function smokeping_draw_navigation_text($nav) { + global $current_user; + if (!smokeping_boot()) { return $nav; } + // Refresh settings after core restores cookie or Basic authentication. + if (get_current_page() === 'settings.php' && (PHP_SAPI === 'cli' || ($current_user['enabled'] ?? '') === 'on')) { + smokeping_config_settings(); + } + return array_merge($nav, \Somethingwithproof\Smokeping\Pages::navigation()); } @@ -643,3 +661,63 @@ function smokeping_poller_bottom(): void { // @phpstan-ignore argument.type exec_background($php, array('-q', __DIR__ . '/poller_smokeping.php', '--poller=' . (int) $config['poller_id'])); } + +/** Resolve role inheritance against Cacti's current user and group grants. */ +function smokeping_auth_alternate_realms(): void { + global $user_auth_realm_filenames; + + static $deferred = array(); + + foreach ($deferred as $file => $realm) { + $user_auth_realm_filenames[$file] = $realm; + } + $deferred = array(); + + if (!api_plugin_is_enabled('smokeping')) { + return; + } + + if (empty($_SESSION['sess_user_id'])) { + // Core restores cookie and Basic authentication after this hook. Only + // these entrypoints defer the realm check to their post-auth guard. + $page = get_current_page(); + + if (in_array($page, array('smokeping.php', 'smokeping_operator.php'), true) && isset($user_auth_realm_filenames[$page])) { + $deferred[$page] = $user_auth_realm_filenames[$page]; + $user_auth_realm_filenames[$page] = -1; + } + + return; + } + $operator = 'smokeping_operator.php'; + $admin = 'smokeping_inventory.php'; + $files = array('smokeping.php'); + $realm = $user_auth_realm_filenames[$admin] ?? 0; + if ($realm > 0 && is_realm_allowed($realm)) { + $files[] = $operator; + } else { + $realm = $user_auth_realm_filenames[$operator] ?? 0; + if ($realm <= 0 || !is_realm_allowed($realm)) { + return; + } + } + foreach ($files as $file) { + $user_auth_realm_filenames[$file] = $realm; + } +} + +/** Recheck the authenticated user before a plugin page reads data or acts. */ +function smokeping_page_allowed(): bool { + global $current_user; + + smokeping_auth_alternate_realms(); + $userId = $current_user['id'] ?? null; + $sessionId = $_SESSION['sess_user_id'] ?? null; + + return (is_int($userId) || (is_string($userId) && ctype_digit($userId))) + && (is_int($sessionId) || (is_string($sessionId) && ctype_digit($sessionId))) + && (int) $userId > 0 && (int) $userId === (int) $sessionId + && api_plugin_is_enabled('smokeping') + && ($current_user['enabled'] ?? '') === 'on' + && api_plugin_user_realm_auth(get_current_page()); +} diff --git a/smokeping.php b/smokeping.php index efa2a4f..e011e8d 100644 --- a/smokeping.php +++ b/smokeping.php @@ -48,5 +48,8 @@ ); top_graph_header(); +if (api_plugin_user_realm_auth('smokeping_operator.php')) { + print '

' . html_escape(__('SmokePing Operations', 'smokeping')) . '

'; +} $smokeping_page->render($smokeping_devices); bottom_footer(); diff --git a/smokeping_operator.php b/smokeping_operator.php new file mode 100644 index 0000000..9f79563 --- /dev/null +++ b/smokeping_operator.php @@ -0,0 +1,103 @@ + + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This file is part of plugin_smokeping, a plugin for Cacti. + * https://github.com/somethingwithproof/plugin_smokeping + * + * 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. + */ + +use Somethingwithproof\Smokeping\OperatorPage; + +chdir('../../'); +include('./include/auth.php'); +include_once('./plugins/smokeping/setup.php'); + +if (!smokeping_page_start()) { + exit; +} +require_once('./plugins/smokeping/include/operator.php'); + +$user = (int) ($_SESSION['sess_user_id'] ?? 0); +$allowed = $user > 0 && api_plugin_user_realm_auth('smokeping_operator.php'); + +if (!$allowed) { + http_response_code(403); + exit; +} +$actions = []; +$action = (string) get_nfilter_request_var('action'); +$session = $_SESSION['smokeping_triage'] ?? []; +$session = is_array($session) ? $session : []; + +try { + // Re-read on POST too: stale forms never retain revoked device access. + $rows = smokeping_operator_rows(); + $now = time(); + + if ($action !== '' && $action !== 'default') { + $method = $_SERVER['REQUEST_METHOD'] ?? ''; + $status = OperatorPage::actionStatus($allowed, $action, $method, $method === 'POST' && csrf_check(false), array_merge(['acknowledge'], array_keys($actions))); + + if ($status !== 200) { + http_response_code($status); + + if ($status === 405) { + header('Allow: POST'); + } + exit; + } + $id = (string) get_nfilter_request_var('id'); + $row = null; + + foreach ($rows as $candidate) { + if ($candidate['id'] === $id) { + $row = $candidate; + + break; + } + } + + if ($row === null) { + http_response_code(403); + exit; + } + $fingerprint = (string) get_nfilter_request_var('fingerprint'); + + if (!hash_equals(OperatorPage::fingerprint($row), $fingerprint)) { + http_response_code(409); + exit; + } + + if ($action === 'acknowledge') { + if (!OperatorPage::acknowledge($session, $row, $fingerprint, $user, $now)) { + http_response_code(409); + exit; + } + $_SESSION['smokeping_triage'] = $session; + } + cacti_log('Operator ' . $action . ' by user ' . $user . ' on object ' . hash('sha256', $id), false, 'SMOKEPING'); + header('Location: smokeping_operator.php'); + exit; + } + top_header(); + print '

' . html_escape(__('Monitoring view', 'smokeping')) . '

'; + OperatorPage::render($rows, $session, $user, $now, $actions); + bottom_footer(); +} catch (Throwable $error) { + cacti_log('Operator page failed (' . get_class($error) . ')', false, 'SMOKEPING'); + http_response_code(503); + top_header(); + print '

' . html_escape(__('Observations could not be read. Ask an administrator to check the plugin log.', 'smokeping')) . '

'; + bottom_footer(); +} diff --git a/tests/Integration/LifecycleTest.php b/tests/Integration/LifecycleTest.php index d085b92..6d0adc1 100644 --- a/tests/Integration/LifecycleTest.php +++ b/tests/Integration/LifecycleTest.php @@ -29,7 +29,7 @@ 'plugin_smokeping_target', ]; -const SMOKEPING_HOOKS = ['api_device_save', 'config_arrays', 'config_settings', 'data_source_remove', 'device_action_array', 'device_action_execute', 'device_action_prepare', 'device_remove', 'draw_navigation_text', 'graph_buttons', 'graph_buttons_thumbnails', 'poller_bottom', 'poller_finishing', 'poller_top', 'top_graph_header_tabs', 'top_header_tabs']; +const SMOKEPING_HOOKS = ['api_device_save', 'auth_alternate_realms', 'config_arrays', 'config_settings', 'data_source_remove', 'device_action_array', 'device_action_execute', 'device_action_prepare', 'device_remove', 'draw_navigation_text', 'graph_buttons', 'graph_buttons_thumbnails', 'poller_bottom', 'poller_finishing', 'poller_top', 'top_graph_header_tabs', 'top_header_tabs']; beforeEach(function () { lifecycle('reset'); @@ -43,7 +43,7 @@ lifecycle('reset'); }); -it('installs fresh with tracked tables, hooks, and both realms, leaving the plugin disabled', function () { +it('installs fresh with tracked tables, hooks, and three realms, leaving the plugin disabled', function () { $state = lifecycle('install'); expect($state['plugin']['status'])->toEqual('4') @@ -53,8 +53,9 @@ ->and($state['tracked'])->toBe(SMOKEPING_TABLES) ->and(array_keys($state['hooks']))->toBe(SMOKEPING_HOOKS) ->and($state['realms'])->toEqual([ - 'smokeping.php' => 'SmokePing View', + 'smokeping.php' => 'SmokePing View', 'smokeping_inventory.php,smokeping_health.php,smokeping_config.php,smokeping_import.php' => 'SmokePing Admin', + 'smokeping_operator.php' => 'SmokePing Operator', ]) ->and($state['admin'])->toBe(2); @@ -368,3 +369,23 @@ rmdir(dirname($rrd)); rmdir($dir); }); + +it('preserves old grants and resolves the three roles through Cacti including groups', function () { + lifecycle('install'); + lifecycle('enable'); + $roles = lifecycle('operator_roles')['result']; + expect($roles['ids_preserved'])->toBeTrue() + ->and($roles['viewer_grants'])->toBe([$roles['expected_view']]) + ->and($roles['hook_enabled'])->toBe(1) + ->and($roles['viewer'])->toBe([true, false, false]) + ->and($roles['operator'])->toBe([true, true, false]) + ->and($roles['admin'])->toBe([true, true, true]) + ->and($roles['revoked'])->toBe([false, false, false]) + ->and($roles['group_operator'])->toBe([true, true, false]) + ->and($roles['disabled_group'])->toBe([false, false, false]) + ->and($roles['first_request']['viewer'])->toBe([[true, true, true], [true, false, true], [false, false, true]]) + ->and($roles['first_request']['operator'])->toBe([[true, true, true], [true, true, true], [false, false, true]]) + ->and($roles['first_request']['admin'])->toBe([[true, true, true], [true, true, true], [false, true, true]]) + ->and($roles['first_request']['revoked'])->toBe([false, false, false]) + ->and($roles['disabled_user'])->toBe([false, false, false]); +}); diff --git a/tests/Support/OperatorStubs.php b/tests/Support/OperatorStubs.php new file mode 100644 index 0000000..955015e --- /dev/null +++ b/tests/Support/OperatorStubs.php @@ -0,0 +1,104 @@ + + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This file is part of plugin_smokeping, a plugin for Cacti. + * https://github.com/somethingwithproof/plugin_smokeping + * + * 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. + */ + +// These boundaries are supplied by Cacti in production. The recording DB +// stubs in bootstrap-unit.php continue to exercise the real repositories. +function api_plugin_is_enabled($plugin) { + return $GLOBALS['__operator_enabled'] ?? true; +} + +function get_current_page($basename = true) { + $page = $GLOBALS['__operator_page'] ?? 'smokeping_operator.php'; + + return $basename ? basename($page) : $page; +} + +function is_realm_allowed($realm, $check_user = false) { + return !empty($_SESSION['sess_user_id']) && in_array($realm, $GLOBALS['__operator_grants'] ?? [], true); +} + +function api_plugin_user_realm_auth($filename = '') { + global $user_auth_realm_filenames; + + return $filename !== '' && isset($user_auth_realm_filenames[basename($filename)]) + && is_realm_allowed($user_auth_realm_filenames[basename($filename)]); +} + +function get_allowed_devices($sql_where = '', $sql_order = 'description', $sql_limit = '', &$total_rows = 0, $user_id = 0, $device_id = 0) { + return $GLOBALS['__operator_devices'] ?? []; +} + +function form_start($action, $id = '', $multipart = false) { + print '
'; +} + +function form_end($ajax = true) { + print '
'; +} + +if (!function_exists('html_start_box')) { + function html_start_box($title, $width, $div, $cell_padding, $align, $add_text) { + print ''; + } +} + +if (!function_exists('html_end_box')) { + function html_end_box($trailing_br = true) { + print '
'; + } +} + +function top_header() { + print '
SmokePing
'; +} + +function top_graph_header() { + print '
SmokePing graphs
'; +} + +function bottom_footer() { + print '
SmokePing
'; +} + +function get_nfilter_request_var($name) { + return $_REQUEST[$name] ?? ''; +} + +function isset_request_var($name) { + return isset($_REQUEST[$name]); +} + +function csrf_check($fatal = true) { + if ($GLOBALS['__operator_csrf_failure'] ?? false) { + throw new RuntimeException('sensitive CSRF validation detail'); + } + + return true; +} + +function replicate_out($remote_poller_id = 1, $class = 'all') { +} + +function api_plugin_register_hook($plugin, $hook, $function, $file, $enable = false) { + $GLOBALS['__operator_hooks'][$hook] = [$function, $file, $enable]; +} + +function api_plugin_register_realm($plugin, $file, $display, $admin = true) { + $GLOBALS['__operator_registered_realms'][$file] = [$display, $admin]; +} diff --git a/tests/Unit/OperatorTest.php b/tests/Unit/OperatorTest.php new file mode 100644 index 0000000..64dc584 --- /dev/null +++ b/tests/Unit/OperatorTest.php @@ -0,0 +1,369 @@ + + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This file is part of plugin_smokeping, a plugin for Cacti. + * https://github.com/somethingwithproof/plugin_smokeping + * + * 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. + */ + +use Somethingwithproof\Smokeping\OperatorPage; +use Somethingwithproof\Smokeping\Pages; +use Somethingwithproof\Smokeping\Schema; + +require_once __DIR__ . '/../Support/OperatorStubs.php'; +require_once dirname(__DIR__, 2) . '/include/operator.php'; + +beforeEach(function () { + $GLOBALS['__operator_enabled'] = true; + $GLOBALS['__operator_page'] = 'smokeping_operator.php'; + $GLOBALS['__operator_grants'] = [102]; + $GLOBALS['__operator_devices'] = [['id' => '7', 'description' => 'gateway']]; + $GLOBALS['__operator_csrf_failure'] = false; + $GLOBALS['__operator_request_method'] = $_SERVER['REQUEST_METHOD'] ?? null; + $GLOBALS['user_auth_realm_filenames'] = ['smokeping.php' => 101, 'smokeping_operator.php' => 102, 'smokeping_inventory.php' => 103]; + $GLOBALS['current_user'] = ['id' => '2', 'enabled' => 'on']; + $_SESSION = ['sess_user_id' => 2]; + $_REQUEST = []; + $GLOBALS['__smokeping_db_assoc'] = []; + $GLOBALS['__smokeping_db_queries'] = []; + $GLOBALS['__smokeping_db_exec'] = []; + $GLOBALS['__smokeping_db_cell'] = 0; + $GLOBALS['__smokeping_log'] = []; + http_response_code(200); +}); + +afterEach(function () { + $GLOBALS['__operator_enabled'] = false; + smokeping_auth_alternate_realms(); + $GLOBALS['__operator_enabled'] = true; + $_SESSION = []; + $_REQUEST = []; + $GLOBALS['__smokeping_db_assoc'] = []; + $GLOBALS['__smokeping_db_cell'] = 0; + if ($GLOBALS['__operator_request_method'] === null) { + unset($_SERVER['REQUEST_METHOD']); + } else { + $_SERVER['REQUEST_METHOD'] = $GLOBALS['__operator_request_method']; + } + unset($GLOBALS['current_user']); +}); + +function smokeping_triage_fixture(): array { + return ['id' => '7', 'name' => '', 'state' => 'failed', 'observed' => 900, 'interval' => 60, 'detail' => 'timeout']; +} + +it('requires an operator, a known action, POST and a valid CSRF token', function () { + $actions = ['acknowledge', 'retry']; + expect(OperatorPage::actionStatus(false, 'retry', 'POST', true, $actions))->toBe(403) + ->and(OperatorPage::actionStatus(true, 'delete', 'POST', true, $actions))->toBe(400) + ->and(OperatorPage::actionStatus(true, 'retry', 'GET', true, $actions))->toBe(405) + ->and(OperatorPage::actionStatus(true, 'retry', 'POST', false, $actions))->toBe(403) + ->and(OperatorPage::actionStatus(true, 'retry', 'POST', true, $actions))->toBe(200); +}); + +it('acknowledges only unchanged, current evidence for the acting user', function () { + $row = smokeping_triage_fixture(); + $session = []; + $fingerprint = OperatorPage::fingerprint($row); + expect(OperatorPage::acknowledge($session, $row, $fingerprint, 2, 1000))->toBeTrue() + ->and(OperatorPage::acknowledged($session, $row, 2, 1000))->toBeTrue() + ->and(OperatorPage::acknowledged($session, $row, 3, 1000))->toBeFalse() + ->and(OperatorPage::acknowledged($session, $row, 2, 1021))->toBeFalse() + ->and(OperatorPage::acknowledged($session, array_replace($row, ['state' => 'ok']), 2, 1000))->toBeFalse() + ->and(OperatorPage::acknowledged($session, array_replace($row, ['observed' => 950]), 2, 1000))->toBeFalse() + ->and(OperatorPage::acknowledge($session, $row, 'forged', 2, 1000))->toBeFalse() + ->and(OperatorPage::acknowledge($session, $row, $fingerprint, 0, 1000))->toBeFalse() + ->and(OperatorPage::acknowledge($session, $row, $fingerprint, 2, 800))->toBeFalse(); +}); + +it('bounds personal acknowledgments and drops the previous users entries', function () { + $session = []; + + for ($i = 1; $i <= 120; $i++) { + $row = array_replace(smokeping_triage_fixture(), ['id' => (string) $i]); + OperatorPage::acknowledge($session, $row, OperatorPage::fingerprint($row), 2, 1000); + } + expect($session['entries'])->toHaveCount(100) + ->and($session['entries'])->not->toHaveKey('1'); + $row = smokeping_triage_fixture(); + OperatorPage::acknowledge($session, $row, OperatorPage::fingerprint($row), 3, 1000); + expect($session['entries'])->toHaveCount(1)->and($session['user'])->toBe(3); +}); + +it('never treats absent or future observations as fresh', function () { + $row = smokeping_triage_fixture(); + expect(OperatorPage::fresh(array_replace($row, ['observed' => 0]), 1000))->toBeFalse() + ->and(OperatorPage::fresh(array_replace($row, ['observed' => 1001]), 1000))->toBeFalse() + ->and(OperatorPage::fresh($row, 1020))->toBeTrue() + ->and(OperatorPage::fresh($row, 1021))->toBeFalse(); +}); + +it('ignores malformed session acknowledgments without hiding current health', function () { + $row = smokeping_triage_fixture(); + expect(OperatorPage::acknowledged(['user' => 2, 'entries' => 'bad'], $row, 2, 1000))->toBeFalse(); + $session = ['user' => 2, 'entries' => ['7' => ['at' => 'invalid']]]; + expect(OperatorPage::acknowledge($session, $row, OperatorPage::fingerprint($row), 2, 1000))->toBeTrue() + ->and($row['state'])->toBe('failed'); +}); + +function smokeping_operator_database(int $now): void { + $GLOBALS['__smokeping_db_assoc'] = function (string $sql, array $params) use ($now): array { + if (str_contains($sql, 'plugin_smokeping_mapping')) { + expect($params)->toBe([7]); + + return [ + ['id' => 11, 'path' => 'Network/gateway', 'title' => '', 'mapped_host_id' => 7], + ['id' => 12, 'path' => 'Network/quiet', 'mapped_host_id' => 7], + ]; + } + expect($sql)->toContain('plugin_smokeping_observation') + ->and($params)->toBe([11, 12]); + + return [ + ['target_id' => 11, 'location' => '', 'observed_at' => $now - 30, 'expected_interval' => 300, 'pings' => 20, 'loss' => 20, 'file_present' => 1], + ['target_id' => 11, 'location' => 'remote', 'observed_at' => $now - 900, 'expected_interval' => 300, 'pings' => 20, 'loss' => 0, 'median' => 0.02, 'file_present' => 1], + ]; + }; +} + +it('reads only mapped targets in the current device scope and preserves separate freshness and loss', function () { + $now = time(); + smokeping_operator_database($now); + $rows = smokeping_operator_rows(); + + expect(array_column($rows, 'id'))->toBe(['11:', '11:remote']) + ->and($rows[0]['name'])->toBe(' / Master') + ->and($rows[0]['state'])->toBe('current / complete_loss') + ->and($rows[1]['state'])->toBe('stale / unknown') + ->and($rows[0]['observed'])->toBe($now - 30) + ->and($rows[0]['interval'])->toBe(300) + ->and($rows[0]['detail'])->toContain('Escalate missing files, imports and relinking to an administrator.') + ->and($GLOBALS['__smokeping_db_exec'])->toBe([]); +}); + +it('reads no cache rows when no devices are allowed', function () { + $GLOBALS['__operator_devices'] = []; + + expect(smokeping_operator_rows())->toBe([]) + ->and($GLOBALS['__smokeping_db_queries'])->toBe([]); +}); + +it('does not turn a mapping without a target identity into an observation', function () { + $GLOBALS['__smokeping_db_assoc'] = [['path' => 'Network/incomplete', 'mapped_host_id' => 7]]; + + expect(smokeping_operator_rows())->toBe([]) + ->and($GLOBALS['__smokeping_db_queries'])->toHaveCount(1) + ->and($GLOBALS['__smokeping_db_exec'])->toBe([]); +}); + +it('renders escaped current, acknowledged, stale and absent observations without changing health', function () { + $row = smokeping_triage_fixture(); + $ack = array_replace($row, ['id' => 'ack']); + $stale = array_replace($row, ['id' => 'stale', 'observed' => 1]); + $never = array_replace($row, ['id' => 'never', 'observed' => 0]); + $session = []; + OperatorPage::acknowledge($session, $ack, OperatorPage::fingerprint($ack), 2, 1000); + ob_start(); + OperatorPage::render([$row, $ack, $stale, $never], $session, 2, 1000, ['inspect"' => '']); + $html = (string) ob_get_clean(); + + expect($html)->not->toContain('') + ->and($html)->toContain('<script>hidden</script>', 'Acknowledged; health unchanged.', 'failed / Unknown or stale', '>Never<', 'inspect"', '<Inspect>', 'method="post"', 'name="fingerprint"') + ->and(substr_count($html, 'name="action" value="acknowledge"'))->toBe(1) + ->and($ack['state'])->toBe('failed'); + ob_start(); + OperatorPage::render([], [], 2, 1000, []); + expect((string) ob_get_clean())->toContain('No observations are available for devices you may access.'); +}); + +it('expires acknowledgments after one hour even while a long-interval observation stays current', function () { + $row = array_replace(smokeping_triage_fixture(), ['interval' => 7200]); + $session = []; + OperatorPage::acknowledge($session, $row, OperatorPage::fingerprint($row), 2, 1000); + + expect(OperatorPage::acknowledged($session, $row, 2, 4600))->toBeTrue() + ->and(OperatorPage::fresh($row, 4601))->toBeTrue() + ->and(OperatorPage::acknowledged($session, $row, 2, 4601))->toBeFalse(); + $session['entries']['expired'] = ['at' => 1]; + $session['entries']['future'] = ['at' => 5000]; + $session['entries']['malformed'] = 'invalid'; + OperatorPage::acknowledge($session, $row, OperatorPage::fingerprint($row), 2, 4601); + expect(array_keys($session['entries']))->toBe([7]); +}); + +it('inherits only less privileged pages before and after a restored login', function (array $grants, array $expected) { + $GLOBALS['__operator_grants'] = $grants; + $native = $GLOBALS['user_auth_realm_filenames']; + + foreach (array_keys($native) as $index => $page) { + $GLOBALS['__operator_page'] = $page; + foreach ([false, true] as $restore) { + $GLOBALS['user_auth_realm_filenames'] = $native; + $_SESSION = $restore ? [] : ['sess_user_id' => 2]; + smokeping_auth_alternate_realms(); + if ($restore) { + expect($GLOBALS['user_auth_realm_filenames'][$page] === -1)->toBe($index < 2); + $_SESSION = ['sess_user_id' => 2]; + } + expect(smokeping_page_allowed())->toBe($expected[$index]) + ->and($GLOBALS['user_auth_realm_filenames'][$page])->toBeGreaterThan(0); + } + } +})->with([ + 'viewer' => [[101], [true, false, false]], + 'operator' => [[102], [true, true, false]], + 'administrator' => [[103], [true, true, true]], + 'no grant' => [[], [false, false, false]], +]); + +it('rejects disabled, missing and mismatched authenticated accounts', function ($current, $sessionId) { + $GLOBALS['current_user'] = $current; + $_SESSION = ['sess_user_id' => $sessionId]; + + expect(smokeping_page_allowed())->toBeFalse() + ->and(smokeping_page_start())->toBeFalse() + ->and(http_response_code())->toBe(403); +})->with([ + 'disabled' => [['id' => 2, 'enabled' => ''], 2], + 'missing' => [[], 2], + 'wrong account' => [['id' => 3, 'enabled' => 'on'], 2], + 'invalid account id' => [['id' => '2suffix', 'enabled' => 'on'], 2], + 'invalid session id' => [['id' => 2, 'enabled' => 'on'], '2suffix'], + 'no login' => [['id' => 2, 'enabled' => 'on'], null], +]); + +it('fails closed for missing realm registrations and restores native mappings when disabled', function () { + unset($GLOBALS['user_auth_realm_filenames']['smokeping_operator.php']); + expect(smokeping_page_allowed())->toBeFalse(); + $GLOBALS['user_auth_realm_filenames']['smokeping_operator.php'] = 102; + $_SESSION = []; + smokeping_auth_alternate_realms(); + $GLOBALS['__operator_enabled'] = false; + $_SESSION = ['sess_user_id' => 2]; + + expect(smokeping_page_allowed())->toBeFalse() + ->and($GLOBALS['user_auth_realm_filenames']['smokeping_operator.php'])->toBe(102); +}); + +it('registers the operator realm without an automatic administrator grant and retains disabled hook state', function (int $status) { + $GLOBALS['__smokeping_db_cell'] = $status; + $GLOBALS['__operator_hooks'] = []; + $GLOBALS['__operator_registered_realms'] = []; + smokeping_setup_hooks(); + + expect($GLOBALS['__operator_hooks'])->toHaveCount(count(Schema::HOOKS)) + ->and($GLOBALS['__operator_hooks']['auth_alternate_realms'])->toBe(['smokeping_auth_alternate_realms', 'setup.php', $status === 1]) + ->and(array_column($GLOBALS['__operator_hooks'], 2))->toBe(array_fill(0, count(Schema::HOOKS), $status === 1)) + ->and($GLOBALS['__operator_registered_realms']['smokeping_operator.php'])->toBe(['SmokePing Operator', false]) + ->and($GLOBALS['__operator_registered_realms']['smokeping.php'])->toBe(['SmokePing View', true]) + ->and(Pages::files())->toContain('smokeping_operator.php') + ->and(Pages::menu()['smokeping_operator.php'])->toBe('SmokePing Operations'); + smokeping_config_settings(); + expect($GLOBALS['settings'])->toHaveKey('smokeping'); +})->with([0, 1]); + +it('refreshes settings only on settings navigation and preserves existing Cacti entries', function (string $page, bool $refresh) { + $GLOBALS['__operator_page'] = $page; + $GLOBALS['__operator_grants'] = [103]; + $tabs = $GLOBALS['tabs'] ?? []; + $settings = $GLOBALS['settings'] ?? []; + $GLOBALS['tabs'] = ['general' => 'General']; + $GLOBALS['settings'] = ['general' => ['existing' => true]]; + + try { + $navigation = smokeping_draw_navigation_text(['index.php:' => ['title' => 'Console']]); + + expect($navigation['index.php:'])->toBe(['title' => 'Console']) + ->and($navigation['smokeping_operator.php:']['title'])->toBe('SmokePing Operations') + ->and($GLOBALS['tabs']['general'])->toBe('General') + ->and($GLOBALS['settings']['general'])->toBe(['existing' => true]) + ->and(isset($GLOBALS['tabs']['smokeping']))->toBe($refresh) + ->and(isset($GLOBALS['settings']['smokeping']))->toBe($refresh); + if ($refresh) { + expect($GLOBALS['tabs']['smokeping'])->toBe('SmokePing') + ->and($GLOBALS['settings']['smokeping'])->toHaveKey('smokeping_freshness_allowance'); + } + } finally { + $GLOBALS['tabs'] = $tabs; + $GLOBALS['settings'] = $settings; + } +})->with(['monitoring' => ['smokeping.php', false], 'settings' => ['settings.php', true]]); + +function smokeping_test_entrypoint(string $page): string { + $root = dirname(__DIR__, 2); + $fixture = sys_get_temp_dir() . '/smokeping-operator-' . bin2hex(random_bytes(6)); + mkdir($fixture . '/include', 0700, true); + mkdir($fixture . '/plugins/smokeping/include', 0700, true); + file_put_contents($fixture . '/include/auth.php', ' 'acknowledge', 'id' => '11:']; + $_SERVER['REQUEST_METHOD'] = 'POST'; + } + $html = smokeping_test_entrypoint('smokeping_operator.php'); + if ($failure !== '') { + expect(http_response_code())->toBe(503) + ->and($html)->toContain('Observations could not be read. Ask an administrator to check the plugin log.') + ->and($html)->not->toContain('sensitive database detail', 'sensitive CSRF validation detail') + ->and($GLOBALS['__smokeping_log'][0]['message'])->toBe('Operator page failed (RuntimeException)') + ->and($_SESSION)->not->toHaveKey('smokeping_triage'); + } else { + expect(http_response_code())->toBe(200) + ->and($html)->toContain('Monitoring view', '<script>gateway</script> / Master', 'current / complete_loss', 'stale / unknown') + ->and($GLOBALS['__smokeping_db_exec'])->toBe([]) + ->and($_SESSION)->not->toHaveKey('smokeping_triage'); + } +})->with(['render' => '', 'repository failure' => 'repository', 'CSRF failure' => 'csrf']); + + +it('exposes the operations route from the monitoring tab only to operators and administrators without console access', function (int $grant, bool $visible) { + $GLOBALS['__operator_grants'] = [$grant]; + $GLOBALS['__operator_page'] = 'smokeping.php'; + $html = smokeping_test_entrypoint('smokeping.php'); + + expect(http_response_code())->toBe(200) + ->and($GLOBALS['__operator_grants'])->not->toContain(8) + ->and(str_contains($html, 'SmokePing Operations'))->toBe($visible) + ->and($GLOBALS['__smokeping_db_exec'])->toBe([]); +})->with(['viewer' => [101, false], 'operator' => [102, true], 'administrator' => [103, true]]); diff --git a/tests/Unit/PagesTest.php b/tests/Unit/PagesTest.php index 72bb587..650ce98 100644 --- a/tests/Unit/PagesTest.php +++ b/tests/Unit/PagesTest.php @@ -29,5 +29,5 @@ expect($covered)->toBe($scripts) ->and(array_unique($covered))->toBe($covered) - ->and(array_column(Pages::realms(), 'name'))->toBe(['SmokePing View', 'SmokePing Admin']); + ->and(array_column(Pages::realms(), 'name'))->toBe(['SmokePing Operator', 'SmokePing View', 'SmokePing Admin']); }); diff --git a/tests/bin/lifecycle.php b/tests/bin/lifecycle.php index dd8ead5..7b5c9b9 100644 --- a/tests/bin/lifecycle.php +++ b/tests/bin/lifecycle.php @@ -327,6 +327,10 @@ function lifecycle_hook_probe($args) { ob_end_clean(); print json_encode(db_fetch_assoc($argument)) . PHP_EOL; exit(0); + case 'operator_roles': + include(__DIR__ . '/operator-roles.php'); + + break; case 'state': break; default: diff --git a/tests/bin/operator-roles.php b/tests/bin/operator-roles.php new file mode 100644 index 0000000..7dba8d8 --- /dev/null +++ b/tests/bin/operator-roles.php @@ -0,0 +1,114 @@ + + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This file is part of plugin_smokeping, a plugin for Cacti. + * https://github.com/somethingwithproof/plugin_smokeping + * + * 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. + */ + +// Executed only by lifecycle.php in a disposable Cacti database. +if (PHP_SAPI !== 'cli') { + exit(1); +} + +if (getenv('SMOKEPING_TEST_DATABASE') !== 'disposable') { + exit(2); +} +require_once $config['library_path'] . '/auth.php'; +require_once $config['base_path'] . '/plugins/smokeping/setup.php'; +smokeping_boot(); +$view = \Somethingwithproof\Smokeping\Pages::VIEW; +$admin = \Somethingwithproof\Smokeping\Pages::ADMIN[0]; +$operator = 'smokeping_operator.php'; +api_plugin_load_realms(); +$old = [$view => $user_auth_realm_filenames[$view], $admin => $user_auth_realm_filenames[$admin]]; +// Emulate an installed two-realm release without modifying the existing IDs. +$operatorId = $user_auth_realm_filenames[$operator]; +db_execute_prepared('DELETE FROM user_auth_realm WHERE realm_id = ?', [$operatorId]); +db_execute_prepared('DELETE FROM plugin_realms WHERE id = ?', [$operatorId - 100]); +db_execute("DELETE FROM plugin_hooks WHERE name = 'smokeping' AND hook = 'auth_alternate_realms'"); +db_execute("INSERT INTO user_auth (username, password, realm, full_name, enabled) VALUES ('smokeping_role_test', '', 0, 'Role test', 'on')"); +$user = (int) db_fetch_insert_id(); +db_execute_prepared('INSERT INTO user_auth_realm (user_id, realm_id) VALUES (?, ?)', [$user, $old[$view]]); +$_SESSION = ['sess_user_id' => $user]; +plugin_smokeping_upgrade(); +api_plugin_load_realms(); +$result = [ + 'ids_preserved' => $old === [$view => $user_auth_realm_filenames[$view], $admin => $user_auth_realm_filenames[$admin]], + 'viewer_grants' => array_map('intval', array_column(db_fetch_assoc_prepared('SELECT realm_id FROM user_auth_realm WHERE user_id = ?', [$user]), 'realm_id')), + 'expected_view' => $old[$view], + 'hook_enabled' => (int) db_fetch_cell("SELECT status FROM plugin_hooks WHERE name = 'smokeping' AND hook = 'auth_alternate_realms'"), +]; +$realms = [$view => $user_auth_realm_filenames[$view], $operator => $user_auth_realm_filenames[$operator], $admin => $user_auth_realm_filenames[$admin]]; +$check = static function () use ($user, $view, $operator, $admin): array { + $_SESSION = ['sess_user_id' => $user]; + api_plugin_load_realms(); + smokeping_auth_alternate_realms(); + + return [api_plugin_user_realm_auth($view), api_plugin_user_realm_auth($operator), api_plugin_user_realm_auth($admin)]; +}; + +foreach (['viewer' => $view, 'operator' => $operator, 'admin' => $admin] as $role => $file) { + db_execute_prepared('DELETE FROM user_auth_realm WHERE user_id = ?', [$user]); + db_execute_prepared('INSERT INTO user_auth_realm (user_id, realm_id) VALUES (?, ?)', [$user, $realms[$file]]); + $result[$role] = $check(); + + foreach ([$view, $operator, $admin] as $page) { + $_SERVER['SCRIPT_NAME'] = '/plugins/smokeping/' . $page; + $_SESSION = []; + api_plugin_load_realms(); + smokeping_auth_alternate_realms(); + $deferred = $user_auth_realm_filenames[$page] === -1; + // Both cookie restore and Basic auth establish the user after the hook. + $_SESSION = ['sess_user_id' => $user]; + $current_user = db_fetch_row_prepared('SELECT * FROM user_auth WHERE id = ?', [$user]); + $allowed = smokeping_page_allowed(); + $result['first_request'][$role][] = [$deferred, $allowed, $user_auth_realm_filenames[$page] > 0]; + } +} +// A valid realm never enables a disabled account after authentication restore. +db_execute_prepared("UPDATE user_auth SET enabled = '' WHERE id = ?", [$user]); +foreach ([$view, $operator, $admin] as $page) { + $_SERVER['SCRIPT_NAME'] = '/plugins/smokeping/' . $page; + $_SESSION = []; + api_plugin_load_realms(); + smokeping_auth_alternate_realms(); + $_SESSION = ['sess_user_id' => $user]; + $current_user = db_fetch_row_prepared('SELECT * FROM user_auth WHERE id = ?', [$user]); + $result['disabled_user'][] = smokeping_page_allowed(); +} +db_execute_prepared("UPDATE user_auth SET enabled = 'on' WHERE id = ?", [$user]); +db_execute_prepared('DELETE FROM user_auth_realm WHERE user_id = ?', [$user]); +$result['revoked'] = $check(); +foreach ([$view, $operator, $admin] as $page) { + $_SERVER['SCRIPT_NAME'] = '/plugins/smokeping/' . $page; + $_SESSION = []; + api_plugin_load_realms(); + smokeping_auth_alternate_realms(); + $_SESSION = ['sess_user_id' => $user]; + $current_user = db_fetch_row_prepared('SELECT * FROM user_auth WHERE id = ?', [$user]); + $result['first_request']['revoked'][] = smokeping_page_allowed(); +} +db_execute("INSERT INTO user_auth_group (name, enabled) VALUES ('smokeping_role_test', 'on')"); +$group = (int) db_fetch_insert_id(); +db_execute_prepared('INSERT INTO user_auth_group_members (group_id, user_id) VALUES (?, ?)', [$group, $user]); +db_execute_prepared('INSERT INTO user_auth_group_realm (group_id, realm_id) VALUES (?, ?)', [$group, $realms[$operator]]); +$result['group_operator'] = $check(); +db_execute_prepared("UPDATE user_auth_group SET enabled = '' WHERE id = ?", [$group]); +$result['disabled_group'] = $check(); +db_execute_prepared('DELETE FROM user_auth_group_realm WHERE group_id = ?', [$group]); +db_execute_prepared('DELETE FROM user_auth_group_members WHERE group_id = ?', [$group]); +db_execute_prepared('DELETE FROM user_auth_group WHERE id = ?', [$group]); +db_execute_prepared('DELETE FROM user_auth WHERE id = ?', [$user]); +$_SESSION = []; diff --git a/tests/bin/php-guard-check.php b/tests/bin/php-guard-check.php index efbcd6d..cf7f03f 100644 --- a/tests/bin/php-guard-check.php +++ b/tests/bin/php-guard-check.php @@ -94,8 +94,8 @@ function guard_state() { if ($supported) { guard_expect($state['status'] == 1, 'install and enable succeed (status ' . $state['status'] . ')'); - guard_expect($state['tables'] === 5, 'all five plugin tables exist (' . $state['tables'] . ')'); - guard_expect($state['hooks'] === 4 && $state['realms'] === 2, 'hooks and realms are registered'); + guard_expect($state['tables'] === 6, 'all six plugin tables exist (' . $state['tables'] . ')'); + guard_expect($state['hooks'] === 17 && $state['realms'] === 3, 'hooks and realms are registered'); } else { guard_expect($state['status'] == 2, 'plugin is left as needing configuration, not enabled (status ' . $state['status'] . ')'); guard_expect($state['tables'] === 0 && $state['hooks'] === 0 && $state['realms'] === 0, 'no tables, hooks, or realms were created'); diff --git a/tests/check_translations.py b/tests/check_translations.py new file mode 100644 index 0000000..316e179 --- /dev/null +++ b/tests/check_translations.py @@ -0,0 +1,164 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: 2026 Thomas Vincent +"""Check required catalogs and translated user guides without third-party packages.""" + +import ast +import gettext +import hashlib +import json +from pathlib import Path +import re +import sys +from urllib.parse import unquote, urlsplit + + +LOCALES = ("zh-CN", "hi-IN", "es-ES", "es-419", "ar-SA") +NAVIGATION = re.compile(r"\n.*?\n\n?", re.S) +HEADER = re.compile(r"") +TOKENS = re.compile(r"%(?:\d+\$)?[-+ 0#]*\d*(?:\.\d+)?[sdfuxXcoeEgGi]|%%|<[^>]*>") + + +def messages(path): + result = [] + for block in path.read_text(encoding="utf-8").split("\n\n"): + fields = {} + current = None + for line in block.splitlines(): + match = re.match(r'(msgid_plural|msgid) (".*")$', line) + if match: + current = match[1] + fields[current] = ast.literal_eval(match[2]) + elif line.startswith('"') and current: + fields[current] += ast.literal_eval(line) + else: + current = None + if fields.get("msgid"): + result.append(fields) + return result + + +def edges(text): + return (text[:len(text) - len(text.lstrip())], text[len(text.rstrip()):]) + + +def source_text(text): + return NAVIGATION.sub("", text) + + +def fenced_sections(text: str) -> tuple[list[tuple[str, str]], str]: + blocks = [] + prose = [] + fence = None + content = [] + language = "" + for line in text.splitlines(): + match = re.match(r"^[ \t]*(`{3,}|~{3,})(.*)$", line) + if fence is None and match: + fence, language = match[1], match[2].strip() + content = [] + prose.append("") + elif (fence is not None and match + and match[1][0] == fence[0] + and len(match[1]) >= len(fence) + and not match[2].strip()): + blocks.append((language, "\n".join(content))) + fence = None + elif fence is not None: + content.append(line) + else: + prose.append(line) + if fence is not None: + raise ValueError("unclosed code fence") + return blocks, "\n".join(prose) + + +def code_blocks(text): + blocks, _ = fenced_sections(text) + return [content for language, content in blocks if language != "mermaid"] + + +def links(text): + # Fenced examples can contain literal Markdown and URLs that are not links. + _, text = fenced_sections(text) + result = re.findall(r"\]\(]+)>?(?:\s+[\"'][^\n]*?[\"'])?\)", text) + result.extend(re.findall(r"(?:href|src|srcset)=[\"']([^\"']+)[\"']", text)) + return result + + +def heading_levels(text): + _, text = fenced_sections(text) + return [len(level) for level in re.findall(r"^(#{1,6})\s+", text, re.M)] + + +def validate(root): + failures = [] + manifest_path = root / "docs/i18n/manifest.json" + manifest = json.loads(manifest_path.read_text(encoding="utf-8")) + sources = manifest["sources"] + if manifest["locales"] != list(LOCALES): + failures.append("manifest locales must include both Spanish variants") + if "README.md" not in sources or len(sources) != len(set(sources)): + failures.append("manifest needs README.md and unique source paths") + template = messages(root / "locales/po/cacti.pot") + for locale in LOCALES: + for path in (root / "locales/po" / (locale + ".po"), root / "locales/LC_MESSAGES" / (locale + ".mo")): + if not path.is_file(): + failures.append("missing catalog: " + str(path.relative_to(root))) + mo = root / "locales/LC_MESSAGES" / (locale + ".mo") + if mo.is_file(): + with mo.open("rb") as stream: + catalog = gettext.GNUTranslations(stream) + if catalog.info().get("language") != locale: + failures.append("wrong compiled language header: " + locale) + for entry in template: + original = entry["msgid"] + values = [catalog.gettext(original)] + if "msgid_plural" in entry: + values = [catalog.ngettext(original, entry["msgid_plural"], n) for n in (0, 1, 2, 3, 11, 100)] + for value in values: + if sorted(TOKENS.findall(original)) != sorted(TOKENS.findall(value)) or edges(original) != edges(value): + failures.append("placeholder, markup or whitespace mismatch: " + locale + ": " + original) + for source in sources: + original = root / source + translated = root / "docs/i18n" / locale / source + label = str(translated.relative_to(root)) + if not original.is_file() or not translated.is_file(): + failures.append("missing source or translation: " + label) + continue + english = source_text(original.read_text(encoding="utf-8")) + text = translated.read_text(encoding="utf-8") + header = HEADER.search(text) + digest = hashlib.sha256(english.encode()).hexdigest() + if header is None or header[1] != source or header[2] != digest: + failures.append("source changed; review and refresh translation: " + label) + body = re.sub(r'^\n', "", text, flags=re.M) + if source_text(HEADER.sub("", body)).strip() == english.strip(): + failures.append("translation is an English copy: " + label) + if heading_levels(english) != heading_levels(text): + failures.append("heading structure differs from source: " + label) + try: + if code_blocks(english) != code_blocks(text): + failures.append("code examples differ from source: " + label) + except ValueError as error: + failures.append(str(error) + ": " + label) + for link in links(text): + parts = urlsplit(link) + if parts.scheme or parts.netloc or not parts.path or parts.path.startswith("/"): + continue + target = (translated.parent / unquote(parts.path)).resolve() + if not target.is_relative_to(root.resolve()) or not target.exists(): + failures.append("broken local link: " + label + " -> " + link) + if failures: + print("\n".join(failures), file=sys.stderr) + return 1 + print(f"Verified {len(LOCALES)} locale catalogs and {len(sources) * len(LOCALES)} translated guides") + return 0 + + +if __name__ == "__main__": + try: + sys.exit(validate(Path(__file__).resolve().parents[1])) + except (OSError, ValueError, KeyError) as error: + print("Translation validation failed: " + str(error), file=sys.stderr) + sys.exit(1) diff --git a/tests/release-e2e.sh b/tests/release-e2e.sh index b54d171..58c8ab4 100644 --- a/tests/release-e2e.sh +++ b/tests/release-e2e.sh @@ -54,7 +54,7 @@ $realms = db_fetch_cell("SELECT COUNT(*) FROM plugin_realms WHERE plugin = \"smo $host = db_fetch_cell("SELECT COUNT(*) FROM host_template WHERE name = \"SmokePing Target\""); $graph = db_fetch_cell("SELECT COUNT(*) FROM graph_templates WHERE name LIKE \"SmokePing Smoke (%\""); echo "$tables $hooks $realms $host $graph";' > /tmp/counts 2>/dev/null -[ "$(cat /tmp/counts)" = "6 16 2 1 6" ] && result PASS installed-objects "6 tables, 16 hooks, 2 realms, the host template, 6 smoke graph templates (3 ping counts, 2 loss color tables)" || result FAIL installed-objects "$(cat /tmp/counts)" +[ "$(cat /tmp/counts)" = "6 17 3 1 6" ] && result PASS installed-objects "6 tables, 17 hooks, 3 realms, the host template, 6 smoke graph templates (3 ping counts, 2 loss color tables)" || result FAIL installed-objects "$(cat /tmp/counts)" # The shipped files work: the CLI and the reader run, and the translation template and docs are present. out=$(php plugins/smokeping/cli/smokeping.php export 2>&1 | head -1) diff --git a/tests/run-release-e2e.sh b/tests/run-release-e2e.sh index 4caa209..3a9c9f3 100644 --- a/tests/run-release-e2e.sh +++ b/tests/run-release-e2e.sh @@ -49,7 +49,7 @@ tar -tzf "$archive" | sed 's#^smokeping/##' | grep -v '/$' | sort > "$WORK/files tar -xzf "$archive" -C "$WORK/unpacked" # Only runtime files, the POT, and the documentation. -unexpected=$(grep -Ev '^(INFO|LICENSE|LICENSES/GPL-2\.0-or-later\.txt|REUSE\.toml|README\.md|CHANGELOG\.md|SECURITY\.md|[A-Za-z0-9_]+\.php|include/.+|lib/[A-Za-z0-9]+\.php|cli/[a-z_]+\.php|scripts/[a-z_]+\.php|templates/[a-z-]+\.xml|images/[a-z_]+\.(gif|php)|docs/.+\.md|docs/research/.+|docs/images/[a-z_-]+\.(png|svg)|locales/index\.php|locales/po/cacti\.pot|locales/po/[a-z]{2}-[A-Z0-9]{2,3}\.po|locales/LC_MESSAGES/[a-z]{2}-[A-Z0-9]{2,3}\.mo)$' "$WORK/files.txt" || true) +unexpected=$(grep -Ev '^(INFO|LICENSE|LICENSES/GPL-2\.0-or-later\.txt|REUSE\.toml|README\.md|CHANGELOG\.md|SECURITY\.md|[A-Za-z0-9_]+\.php|include/.+|lib/[A-Za-z0-9]+\.php|cli/[a-z_]+\.php|scripts/[a-z_]+\.php|templates/[a-z-]+\.xml|images/[a-z_]+\.(gif|php)|docs/.+\.md|docs/i18n/manifest\.json|docs/research/.+|docs/images/[a-z_-]+\.(png|svg)|locales/index\.php|locales/po/cacti\.pot|locales/po/[a-z]{2}-[A-Z0-9]{2,3}\.po|locales/LC_MESSAGES/[a-z]{2}-[A-Z0-9]{2,3}\.mo)$' "$WORK/files.txt" || true) [ -z "$unexpected" ] && result PASS archive-only-runtime-pot-docs "$(wc -l < "$WORK/files.txt" | tr -d ' ') files, every one runtime, POT, or documentation" || result FAIL archive-only-runtime-pot-docs "$(echo "$unexpected" | head -5 | tr '\n' ' ')" missing=