Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!-- translations:start -->
[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)
<!-- translations:end -->

<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/images/logo_dark.png">
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions docs/PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.
4 changes: 2 additions & 2 deletions docs/backup-restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down Expand Up @@ -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

Expand Down
Loading
Loading