Appearance
Scheduling
NetVuln Tool ships two ways to run scans on a recurring basis: a cron-backed wrapper (scheduled_scan.sh) plus a set of monitoring helpers, and a persistent scheduling daemon (netvuln_daemon.sh) that replaces cron entirely. The daemon is the recommended path for fleet deployments because it manages multiple configs, retries failures, and reports heartbeats back to the portal. For its internal architecture, see Daemon Mode.
Scheduled Scan
scripts/scheduled_scan.sh is an automated scan wrapper that reads a config file, runs the recon pipeline against its TARGETS, and optionally installs itself as a cron job.
scheduled_scan.sh -c <config.conf> [options]
Required:
-c <file> Report config file (must define TARGETS)
Options:
--install-cron Install a cron job using SCAN_SCHEDULE from the config
--remove-cron Remove the existing netvuln-tool cron job
--daemon Run in daemon mode (used internally by netvuln_daemon.sh)
--dry-run Show what would be executed without running
-h, --help Show helpThe relevant config settings:
| Setting | Default | Purpose |
|---|---|---|
TARGETS | (required) | Comma-separated scan targets |
SCAN_SCHEDULE | 0 2 * * 0 (Sunday 2am) | Cron schedule expression |
SCAN_PROFILE | full_recon | Scan profile to run |
REPORT_VALIDITY_DAYS | 30 | Days before the report is considered expired |
bash
# Run a scheduled scan once, now
./scripts/scheduled_scan.sh -c ~/netvuln-tool/configs/client.conf
# Install it as a weekly cron job (uses SCAN_SCHEDULE)
./scripts/scheduled_scan.sh -c ~/netvuln-tool/configs/client.conf --install-cron
# Preview the command without running
./scripts/scheduled_scan.sh -c ~/netvuln-tool/configs/client.conf --dry-runThe --daemon flag skips cron management and is used by the daemon when it owns the schedule itself.
Schedule Monitor
scripts/schedule_monitor.sh detects missed scheduled scans by comparing the expected cadence against the sessions on disk, and can raise alerts when a scan is overdue.
schedule_monitor.sh -c <config.conf> [options]
Required:
-c <file> Config file (must define TARGETS and SCAN_SCHEDULE)
Options:
--alert Send alert notifications for missed scans
--dry-run Show what would happen without sending alerts
--json Output results as JSON
--tolerance <hours> Hours of tolerance before marking a scan missed (default: 2)
-h, --help Show helpThe exit code is 0 when the schedule is on track or unknown, and 2 when a missed scan is detected, which makes it convenient in cron or CI wrappers.
bash
# Alert if a scan is more than four hours overdue
./scripts/schedule_monitor.sh -c scan.conf --alert --tolerance 4
# Machine-readable status
./scripts/schedule_monitor.sh -c scan.conf --jsonSchedule List
scripts/schedule_list.sh enumerates every registered scheduled-scan config and reports its cron status. It auto-discovers config files in ~/netvuln-tool/configs/*.conf.
schedule_list.sh [--json] [--configs-dir <dir>] [--no-cron-check] [-h]| Flag | Purpose |
|---|---|
--json | Output the list as a JSON array |
--configs-dir <dir> | Override the config directory (default ~/netvuln-tool/configs) |
--no-cron-check | Skip crontab inspection (for hosts without cron) |
bash
./scripts/schedule_list.sh
./scripts/schedule_list.sh --json
./scripts/schedule_list.sh --configs-dir /etc/netvuln/configsSchedule Status
scripts/schedule_status.sh gives a combined health view across every discovered config, aggregating schedule_monitor results into one report.
schedule_status.sh [--json] [--alert] [--dry-run] [--configs-dir <dir>] [--tolerance <hours>] [-h]| Flag | Purpose |
|---|---|
--json | Output aggregate results as JSON |
--alert | Send alerts for any missed schedules |
--dry-run | Show which alerts would be sent without sending them |
--configs-dir <dir> | Override the config directory |
--tolerance <hours> | Override tolerance for all schedules (default per-config, else 2) |
bash
./scripts/schedule_status.sh --json
./scripts/schedule_status.sh --alert --dry-run
./scripts/schedule_status.sh --configs-dir /etc/netvuln/configs --tolerance 4Daemon Mode
scripts/netvuln_daemon.sh is a persistent scheduling daemon (v3.0.0) that replaces cron-based scheduling. It manages multiple configs, runs a built-in cron engine, retries failed scans with exponential backoff, and posts heartbeats to the portal.
netvuln_daemon.sh [--configs-dir <dir>] [--foreground] [-h]| Flag | Purpose |
|---|---|
--configs-dir <dir> | Config directory (default ~/netvuln-tool/configs) |
--foreground | Run in the foreground (the default; no self-daemonization) |
-h, --help | Show help |
A config is scheduled by the daemon only when it sets DAEMON_ENABLED="true". The daemon responds to signals so its lifecycle can be managed without a restart:
| Signal | Effect |
|---|---|
SIGHUP | Reload all config files |
SIGTERM | Graceful shutdown (finishes the current scan) |
SIGINT | Graceful shutdown (finishes the current scan) |
SIGUSR1 | Dump status to ~/netvuln-tool/logs/daemon_status.json |
See Daemon Mode for heartbeats, system-info reporting, retry tuning, and the remote-override mechanism.
Daemon Control
scripts/netvuln_daemon_ctl.sh is the lifecycle CLI for the daemon, including optional systemd integration on Linux.
netvuln_daemon_ctl.sh <command> [options]| Command | Action |
|---|---|
start | Start the daemon in the background |
stop | Stop the running daemon gracefully |
restart | Stop and then start the daemon |
reload | Send SIGHUP to reload configuration |
status | Show daemon status and a schedule summary |
install-service | Install the systemd service unit (Linux only) |
uninstall-service | Remove the systemd service unit (Linux only) |
Any arguments after start or restart are forwarded to the daemon process, so you can point it at an alternate config directory.
bash
./scripts/netvuln_daemon_ctl.sh start
./scripts/netvuln_daemon_ctl.sh status
./scripts/netvuln_daemon_ctl.sh restart -c ~/netvuln-tool/configs/client.conf
./scripts/netvuln_daemon_ctl.sh install-serviceCron or daemon?
Use scheduled_scan.sh --install-cron for a single host with one or two schedules. Use the daemon when you run several configs, want automatic retries and portal heartbeats, or manage a fleet of agents through Command and Control.
