Skip to content

Commit bfe469a

Browse files
committed
feat: rename binary and update references to 'nodepulse' in configuration and documentation
1 parent 69420a0 commit bfe469a

File tree

5 files changed

+286
-63
lines changed

5 files changed

+286
-63
lines changed

.goreleaser.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
project_name: pulse
1+
project_name: nodepulse
22

33
before:
44
hooks:
55
- go mod tidy
66

77
builds:
8-
- id: pulse
9-
binary: pulse
8+
- id: nodepulse
9+
binary: nodepulse
1010
env:
1111
- CGO_ENABLED=0
1212
goos:
@@ -21,7 +21,7 @@ builds:
2121
- -X main.date={{.Date}}
2222

2323
archives:
24-
- id: pulse
24+
- id: nodepulse
2525
format: tar.gz
2626
name_template: >-
2727
{{ .ProjectName }}-

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PHONY: build clean test install dev release fmt lint deps help push
22

33
# Binary name
4-
BINARY_NAME=pulse
4+
BINARY_NAME=nodepulse
55
BUILD_DIR=build
66

77
# Build the binary

README.md

Lines changed: 59 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A lightweight Prometheus forwarder written in Go. It scrapes metrics from `node_
1616
-**Simpler**: No custom metrics collection
1717
-**Standard**: Uses Prometheus text format
1818
-**Buffered**: Write-Ahead Log pattern for reliability
19-
-**No TUI**: `pulse watch` command removed
19+
-**No TUI**: `nodepulse watch` command removed
2020
-**No JSON**: Prometheus text format only
2121

2222
**Why Prometheus?**
@@ -92,39 +92,39 @@ Download the latest release for your architecture:
9292

9393
```bash
9494
# For amd64
95-
wget https://github.com/node-pulse/agent/releases/latest/download/pulse-linux-amd64.tar.gz
96-
tar -xzf pulse-linux-amd64.tar.gz
97-
sudo mv pulse /usr/local/bin/
98-
sudo chmod +x /usr/local/bin/pulse
95+
wget https://github.com/node-pulse/agent/releases/latest/download/nodepulse-linux-amd64.tar.gz
96+
tar -xzf nodepulse-linux-amd64.tar.gz
97+
sudo mv nodepulse /usr/local/bin/
98+
sudo chmod +x /usr/local/bin/nodepulse
9999

100100
# For arm64
101-
wget https://github.com/node-pulse/agent/releases/latest/download/pulse-linux-arm64.tar.gz
102-
tar -xzf pulse-linux-arm64.tar.gz
103-
sudo mv pulse /usr/local/bin/
104-
sudo chmod +x /usr/local/bin/pulse
101+
wget https://github.com/node-pulse/agent/releases/latest/download/nodepulse-linux-arm64.tar.gz
102+
tar -xzf nodepulse-linux-arm64.tar.gz
103+
sudo mv nodepulse /usr/local/bin/
104+
sudo chmod +x /usr/local/bin/nodepulse
105105
```
106106

107107
### From Source
108108

109109
```bash
110110
git clone https://github.com/node-pulse/agent.git
111111
cd agent
112-
go build -o pulse
113-
sudo mv pulse /usr/local/bin/
114-
sudo chmod +x /usr/local/bin/pulse
112+
go build -o nodepulse
113+
sudo mv nodepulse /usr/local/bin/
114+
sudo chmod +x /usr/local/bin/nodepulse
115115
```
116116

117117
## Usage
118118

119119
### Initialize Configuration (First Time Setup)
120120

121121
```bash
122-
sudo pulse setup --yes --endpoint-url https://dashboard.nodepulse.io/metrics/prometheus --server-id <your-uuid>
122+
sudo nodepulse setup --yes --endpoint-url https://dashboard.nodepulse.io/metrics/prometheus --server-id <your-uuid>
123123
```
124124

125125
Quick setup wizard that:
126126

127-
- Creates necessary directories (`/etc/node-pulse`, `/var/lib/node-pulse`)
127+
- Creates necessary directories (`/etc/nodepulse`, `/var/lib/nodepulse`)
128128
- Creates configuration file with your settings
129129
- Uses provided server ID (assigned by dashboard when adding server)
130130

@@ -135,7 +135,13 @@ Quick setup wizard that:
135135
#### Foreground Mode (Development/Testing)
136136

137137
```bash
138-
pulse start
138+
nodepulse start
139+
```
140+
141+
Or run without subcommand (equivalent):
142+
143+
```bash
144+
nodepulse --config /etc/nodepulse/nodepulse.yml
139145
```
140146

141147
Runs the agent in the foreground (blocks the terminal). Best for development and testing.
@@ -146,16 +152,16 @@ Runs the agent in the foreground (blocks the terminal). Best for development and
146152
#### Daemon Mode (Background - Development Only)
147153

148154
```bash
149-
pulse start -d
155+
nodepulse start -d
150156
```
151157

152158
Runs the agent in the background for quick testing. **Not recommended for production.**
153159
- Detaches from terminal and runs in background
154160
- Creates PID file for process management
155-
- Stop with: `pulse stop`
161+
- Stop with: `nodepulse stop`
156162

157163
```bash
158-
pulse stop
164+
nodepulse stop
159165
```
160166

161167
Stops the background daemon agent:
@@ -169,22 +175,22 @@ Stops the background daemon agent:
169175
For production deployments, use systemd service management:
170176

171177
```bash
172-
sudo pulse service install
173-
sudo pulse service start
178+
sudo nodepulse service install
179+
sudo nodepulse service start
174180
```
175181

176182
Benefits:
177183
- Automatic restart on failure
178184
- Starts on system boot
179185
- Managed by systemd (no PID file needed)
180-
- Stop with: `sudo pulse service stop`
186+
- Stop with: `sudo nodepulse service stop`
181187

182-
**Important**: `pulse stop` will not stop systemd-managed agents. Use `pulse service stop` instead.
188+
**Important**: `nodepulse stop` will not stop systemd-managed agents. Use `nodepulse service stop` instead.
183189

184190
### Check Agent Status
185191

186192
```bash
187-
pulse status
193+
nodepulse status
188194
```
189195

190196
Shows comprehensive agent status including server ID, configuration, service status, buffer state, and logging.
@@ -196,60 +202,60 @@ Node Pulse Agent Status
196202
=====================
197203
198204
Server ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890
199-
Persisted at: /var/lib/node-pulse/server_id
205+
Persisted at: /var/lib/nodepulse/server_id
200206
201-
Config File: /etc/node-pulse/nodepulse.yml
207+
Config File: /etc/nodepulse/nodepulse.yml
202208
Endpoint: https://dashboard.nodepulse.io/metrics/prometheus
203209
Interval: 15s
204210
205211
Agent: running (via systemd)
206212
207-
Buffer: 3 report(s) pending in /var/lib/node-pulse/buffer
213+
Buffer: 3 report(s) pending in /var/lib/nodepulse/buffer
208214
209-
Log File: /var/log/node-pulse/agent.log
215+
Log File: /var/log/nodepulse/agent.log
210216
```
211217

212218
### Service Management
213219

214220
#### Install as systemd service
215221

216222
```bash
217-
sudo pulse service install
223+
sudo nodepulse service install
218224
```
219225

220226
#### Start the service
221227

222228
```bash
223-
sudo pulse service start
229+
sudo nodepulse service start
224230
```
225231

226232
#### Check service status
227233

228234
```bash
229-
sudo pulse service status
235+
sudo nodepulse service status
230236
```
231237

232238
#### Stop the service
233239

234240
```bash
235-
sudo pulse service stop
241+
sudo nodepulse service stop
236242
```
237243

238244
#### Restart the service
239245

240246
```bash
241-
sudo pulse service restart
247+
sudo nodepulse service restart
242248
```
243249

244250
#### Uninstall the service
245251

246252
```bash
247-
sudo pulse service uninstall
253+
sudo nodepulse service uninstall
248254
```
249255

250256
## Configuration
251257

252-
Configuration file at `/etc/node-pulse/nodepulse.yml`:
258+
Configuration file at `/etc/nodepulse/nodepulse.yml`:
253259

254260
```yaml
255261
server:
@@ -266,15 +272,15 @@ prometheus:
266272
timeout: 3s
267273

268274
buffer:
269-
path: "/var/lib/node-pulse/buffer"
275+
path: "/var/lib/nodepulse/buffer"
270276
retention_hours: 48
271277
batch_size: 5
272278

273279
logging:
274280
level: "info" # Options: debug, info, warn, error
275281
output: "stdout" # Options: stdout, file, both
276282
file:
277-
path: "/var/log/node-pulse/agent.log"
283+
path: "/var/log/nodepulse/agent.log"
278284
max_size_mb: 10
279285
max_backups: 3
280286
max_age_days: 7
@@ -327,8 +333,8 @@ The server ID uniquely identifies your server in the NodePulse system:
327333

328334
- **Dashboard Assignment**: When you add a server in the dashboard, it assigns a UUID
329335
- **Ansible Deployment**: Pass the UUID as `server_id` variable
330-
- **Persistence**: The agent stores the ID in `/var/lib/node-pulse/server_id`
331-
- **Fallback Locations**: `/etc/node-pulse/server_id`, `~/.node-pulse/server_id`, `./server_id`
336+
- **Persistence**: The agent stores the ID in `/var/lib/nodepulse/server_id`
337+
- **Fallback Locations**: `/etc/nodepulse/server_id`, `~/.nodepulse/server_id`, `./server_id`
332338

333339
## Metrics Collected
334340

@@ -388,7 +394,7 @@ When HTTP forwarding fails (timeout or error):
388394

389395
1. **Metrics are saved to buffer first** (before sending)
390396
2. **Background goroutine drains buffer continuously** with random jitter
391-
3. **Format**: `/var/lib/node-pulse/buffer/YYYYMMDD-HHMMSS-<server_id>.prom`
397+
3. **Format**: `/var/lib/nodepulse/buffer/YYYYMMDD-HHMMSS-<server_id>.prom`
392398
4. **Batch processing**: Sends up to 5 reports per request (configurable)
393399
5. **Oldest first**: Processes files in chronological order
394400
6. **Cleanup**: Files older than 48 hours are automatically deleted
@@ -431,7 +437,7 @@ make release
431437
make build
432438
433439
# Or using go directly
434-
go build -o build/pulse .
440+
go build -o build/nodepulse .
435441
436442
# For Linux amd64
437443
make build-linux-amd64
@@ -446,8 +452,8 @@ make build-linux-arm64
446452
- **Architectures**: amd64, arm64
447453
- **Dependencies**: `node_exporter` running on `localhost:9100`
448454
- **Permissions**:
449-
- Normal user for `pulse start`, `pulse start -d`, `pulse stop`
450-
- Root (sudo) for `pulse service` commands and `pulse setup`
455+
- Normal user for `nodepulse start`, `nodepulse start -d`, `nodepulse stop`
456+
- Root (sudo) for `nodepulse service` commands and `nodepulse setup`
451457

452458
## Data Retention
453459

@@ -473,39 +479,39 @@ make build-linux-arm64
473479
- New buffer format stores Prometheus text format (`.prom` files)
474480

475481
3. **Commands removed:**
476-
- `pulse watch` no longer exists (TUI removed)
482+
- `nodepulse watch` no longer exists (TUI removed)
477483

478484
### Migration Steps
479485

480486
1. **Install node_exporter** (see Prerequisites above)
481487
2. **Stop old agent:**
482488
```bash
483-
sudo pulse service stop
484-
sudo pulse service uninstall
489+
sudo nodepulse service stop
490+
sudo nodepulse service uninstall
485491
```
486492
3. **Update agent binary:**
487493
```bash
488-
sudo pulse update
494+
sudo nodepulse update
489495
# Or manually download v2.0
490496
```
491497
4. **Update config file:**
492498
```bash
493-
sudo nano /etc/node-pulse/nodepulse.yml
499+
sudo nano /etc/nodepulse/nodepulse.yml
494500
# Add prometheus section, change interval to 15s
495501
```
496502
5. **Clear old buffer** (optional):
497503
```bash
498-
sudo rm -rf /var/lib/node-pulse/buffer/*
504+
sudo rm -rf /var/lib/nodepulse/buffer/*
499505
```
500506
6. **Reinstall service:**
501507
```bash
502-
sudo pulse service install
503-
sudo pulse service start
508+
sudo nodepulse service install
509+
sudo nodepulse service start
504510
```
505511
7. **Verify:**
506512
```bash
507-
sudo pulse status
508-
sudo journalctl -u node-pulse -f
513+
sudo nodepulse status
514+
sudo journalctl -u nodepulse -f
509515
```
510516

511517
## Development
@@ -555,7 +561,7 @@ go run . start
555561
556562
# Or build and run
557563
make build
558-
./build/pulse start
564+
./build/nodepulse start
559565
```
560566

561567
## License

cmd/root.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ var (
1212

1313
// rootCmd represents the base command
1414
var rootCmd = &cobra.Command{
15-
Use: "pulse",
16-
Short: "NodePulse Agent - Monitor Linux server metrics",
17-
Long: `NodePulse Agent monitors Linux server health metrics including CPU,
18-
memory, network I/O, and uptime, reporting them to a central server.`,
15+
Use: "nodepulse",
16+
Short: "NodePulse Agent - Prometheus forwarder for server metrics",
17+
Long: `NodePulse Agent scrapes Prometheus metrics from node_exporter and forwards them to a central dashboard.
18+
19+
When called without a subcommand, it runs in foreground mode (equivalent to 'nodepulse start').`,
20+
RunE: func(cmd *cobra.Command, args []string) error {
21+
// If no subcommand provided, default to 'start' command
22+
// This allows systemd to call: /opt/nodepulse/nodepulse --config /path
23+
return runAgent(cmd, args)
24+
},
1925
}
2026

2127
// Execute runs the root command
@@ -28,5 +34,5 @@ func Execute() {
2834

2935
func init() {
3036
// Global flags
31-
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default: /etc/node-pulse/nodepulse.yml)")
37+
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default: /etc/nodepulse/nodepulse.yml)")
3238
}

0 commit comments

Comments
 (0)