A software application that collects metrics from network devices through SNMP, exporting them into InfluxDB.
The metrics are collected periodically and simultaneously from a set of network devices configured by the user.
Gofetch-SNMP can poll five types of devices:
- The
genericdevice is an abstraction that encompasses most network devices, but is limited on the metrics collected. - The
ios-xrdevice corresponds to a CISCO switch or router with the IOS-XR operating system. - The
iosdevice corresponds to a CISCO switch or router with the IOS operating system. - The
mrvdevice corresponds to a MRV-LX console server. - The
opengeardevice corresponds to an Opengear console server.
Through SNMP it is possible to obtain a series of metrics, by choosing which features to monitor.
- The
Uptimefeature gets the elapsed time in seconds since the device was booted. - The
InterfaceCountersfeature gets the number of inbound and outbound packets that are accepted, discarded or have errors, for each of the device's interface. - The
NetworkACLfeature gets the number of bytes permitted or dropped for each Access Control List (ACL). - The
NetworkPolicyfeature gets the number of bytes permitted or dropped for each Policy Map. - The
BgpPeersfeature gets the number of accepted, dropped and limit route prefixes for each BGP connection. - The
CellInfofeature gets data related to the cellular modem. - The
Memoryfeature gets the amount of used and free memory. - The
Cpufeature gets the data related to the CPU utilization. - The
Sensorsfeature gets data related to the device's sensors.
| Generic | IOS-XR | IOS | MRV | Opengear | |
|---|---|---|---|---|---|
| Uptime | ✓ | ✓ | ✓ | ✓ | ✓ |
| InterfaceCounters | ✓ | ✓ | ✓ | ✓ | ✓ |
| NetworkACL | ✕ | ✓ | ✓ | ✕ | ✕ |
| NetworkPolicy | ✕ | ✓ | ✕ | ✕ | ✕ |
| BGPPeers | ✕ | ✓ | ✓ | ✕ | ✕ |
| CellInfo | ✕ | ✕ | ✕ | ✓ | ✓ |
| Memory | ✕ | ✓ | ✓ | ✕ | ✓ |
| CPU | ✕ | ✓ | ✓ | ✕ | ✓ |
| Sensors | ✕ | ✓ | ✓ | ✓ | ✓ |
The functioning of the application can be configured through YAML files. There must be three different files, for the Application, InfluxDB and Devices respectively.
This configuration file defines the general functioning of the application.
- The
versionfield indicates the version of Gofetch. - The
intervalfield indicates the time between consecutive collections of metrics. - The
timeoutfield indicates the maximum amount of time the application waits for the response from a device. - The
maxroutinesfield indicates the maximum number of routines the application may create.
version: v1.1.0
interval: 1m
timeout: 55s
maxroutines: 2
This configuration file defines the InfluxDB instance to which the collected metrics are exported.
- The
serverfield indicates the address where the InfluxDB instance is running. - The
usernameandpasswordfields are used as credentials to access the InfluxDB. - The
databasefield indicates the database where the metrics are stored. - The
pingfield indicates the duration of the ping that determines whether the InfluxDB instance is available.
server: http://my.database.net:8086
username: myusername
password: mypassword
database: mydatabase
ping: 2s
This configuration file defines the devices from which the metrics are collected. Multiple devices can be queried simultaneously if included in the configurations file.
- There must be a
Hostsfield, with a list ofHostelements. - The
IPfield indicates the device's IP address. - The
Typefield indicates the type of the device being monitored. - In the
SnmpConfig, theVersion,Port,Timeout,RetriesandCommunityfields should match the SNMP configurations of the device in order to have access to it. - In the
Features, theUptime,InterfaceCounters,NetworkACL,NetworkPolicy,BgpPeers,CellInfo,Memory,CpuandSensorsindicatetrueif the feature is monitored andfalse(or ommitted) otherwise.
Hosts:
- Host:
IP: 192.1.1.1
Type: cisco-ios-xr
SnmpConfig:
Version: 3
Port: 161
Timeout: 6
Retries: 1
Community: mycommunity
Features:
Uptime: true
InterfaceCounters: true
- Host:
IP: 192.1.1.2
Type: cisco-ios
SnmpConfig:
Version: 2
Port: 161
Timeout: 6
Retries: 1
Community: mycommunity
Features:
Uptime: true
InterfaceCounters: true
The application must be provided with the appropriately structured configuration files.
- The
-cflag indicates the path to the Application configuration file. - The
-dflag indicates the path to the InfluxDB configuration file. - The
-hflag indicates the path to the Devices configuration file.
gofetch -c config.yml -d db.yml -h hosts.yml