1. Go to this page and download the library: Download nawasara/alerting library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nawasara / alerting example snippets
use Nawasara\Alerting\Facades\Alerter;
use Nawasara\Alerting\Models\AlertRule;
public function boot(): void
{
Alerter::registerRule(AlertRule::make([
'key' => 'proxmox.node.disk_critical',
'severity' => 'critical',
'category' => 'infrastructure',
'cooldown_minutes' => 60,
'description' => 'Node disk usage ≥ 95%',
'subject_template' => '[CRITICAL] Disk hampir penuh di {context.node}: {context.disk_pct}%',
]));
}