Rename from govpp-snmp-exmaple to govpp-snmp-agentx; Also rename the binary + README

This commit is contained in:
Pim van Pelt
2025-06-10 13:41:14 +02:00
parent 467975b9d6
commit 478168584d
8 changed files with 26 additions and 27 deletions

3
.gitignore vendored
View File

@ -1,3 +1,2 @@
vpp-snmp-agent
govpp-snmp-example
govpp-snmp-agentx
vppcfg.yaml

View File

@ -29,7 +29,7 @@ The application consists of four main components:
### Development Build
```bash
go build -o vpp-snmp-agent .
go build -o govpp-snmp-agentx .
```
### Static Binary Build
@ -38,11 +38,11 @@ For deployment without Go runtime dependencies:
```bash
# Linux static binary
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o vpp-snmp-agent .
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o govpp-snmp-agentx .
# Cross-compile for different architectures
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o vpp-snmp-agent-linux-amd64 .
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -ldflags '-extldflags "-static"' -o vpp-snmp-agent-linux-arm64 .
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o govpp-snmp-agentx-linux-amd64 .
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -ldflags '-extldflags "-static"' -o govpp-snmp-agentx-linux-arm64 .
```
### Release Build with Version Info
@ -50,7 +50,7 @@ CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -ldflags '-extldflags "-static
```bash
VERSION=$(git describe --tags --always --dirty)
BUILD_TIME=$(date -u '+%Y-%m-%d_%H:%M:%S')
CGO_ENABLED=0 go build -ldflags "-X main.version=${VERSION} -X main.buildTime=${BUILD_TIME}" -o vpp-snmp-agent .
CGO_ENABLED=0 go build -ldflags "-X main.version=${VERSION} -X main.buildTime=${BUILD_TIME}" -o govpp-snmp-agentx .
```
## Usage
@ -59,13 +59,13 @@ CGO_ENABLED=0 go build -ldflags "-X main.version=${VERSION} -X main.buildTime=${
```bash
# Run with default settings
./vpp-snmp-agent
./govpp-snmp-agentx
# Run with custom AgentX address
./vpp-snmp-agent -agentx.addr 127.0.0.1:705
./govpp-snmp-agentx -agentx.addr 127.0.0.1:705
# Run with Unix socket AgentX connection
./vpp-snmp-agent -agentx.addr /var/agentx/master
./govpp-snmp-agentx -agentx.addr /var/agentx/master
```
### Command Line Flags
@ -95,22 +95,22 @@ CGO_ENABLED=0 go build -ldflags "-X main.version=${VERSION} -X main.buildTime=${
```bash
# Enable debug logging
./vpp-snmp-agent -debug
./govpp-snmp-agentx -debug
# Custom polling interval (5 seconds)
./vpp-snmp-agent -vppstats.period 5
./govpp-snmp-agentx -vppstats.period 5
# Custom VPP stats socket
./vpp-snmp-agent -vppstats.addr /custom/path/stats.sock
./govpp-snmp-agentx -vppstats.addr /custom/path/stats.sock
# Custom interface index offset (start at 2000)
./vpp-snmp-agent -vppstats.ifindex-offset 2000
./govpp-snmp-agentx -vppstats.ifindex-offset 2000
# With VPP configuration file for interface descriptions
./vpp-snmp-agent -vppcfg /etc/vpp/vppcfg.yaml
./govpp-snmp-agentx -vppcfg /etc/vpp/vppcfg.yaml
# Full configuration
./vpp-snmp-agent \
./govpp-snmp-agentx \
-agentx.addr /var/agentx/master \
-debug \
-vppcfg /etc/vpp/vppcfg.yaml \

View File

@ -7,8 +7,8 @@ import (
"github.com/posteo/go-agentx"
"govpp-snmp-example/ifmib"
"govpp-snmp-example/logger"
"govpp-snmp-agentx/ifmib"
"govpp-snmp-agentx/logger"
)
var (

2
go.mod
View File

@ -1,4 +1,4 @@
module govpp-snmp-example
module govpp-snmp-agentx
go 1.23.8

View File

@ -12,8 +12,8 @@ import (
"go.fd.io/govpp/api"
"gopkg.in/yaml.v3"
"govpp-snmp-example/logger"
"govpp-snmp-example/vppstats"
"govpp-snmp-agentx/logger"
"govpp-snmp-agentx/vppstats"
)
// IF-MIB OID bases:

View File

@ -6,7 +6,7 @@ import (
"path/filepath"
"runtime"
"govpp-snmp-example/config"
"govpp-snmp-agentx/config"
)
// logf logs a message with automatic caller information (file:function)

View File

@ -4,10 +4,10 @@ import (
"flag"
"log"
"govpp-snmp-example/agentx"
"govpp-snmp-example/config"
"govpp-snmp-example/ifmib"
"govpp-snmp-example/vppstats"
"govpp-snmp-agentx/agentx"
"govpp-snmp-agentx/config"
"govpp-snmp-agentx/ifmib"
"govpp-snmp-agentx/vppstats"
)
func main() {

View File

@ -9,7 +9,7 @@ import (
"go.fd.io/govpp/api"
"go.fd.io/govpp/core"
"govpp-snmp-example/logger"
"govpp-snmp-agentx/logger"
)
type StatsCallback func(*api.InterfaceStats)