-
Notifications
You must be signed in to change notification settings - Fork 25
SNMP Quickstart
Validate you have docker
installed and running (docs)
docker version --format '{{.Server.Version}}'
Validate you have a non-root user available in the docker
group (docs)
/etc/group -e "docker"
Download the ktranslate image from dockerhub:
docker pull kentik/ktranslate:v2
Copy the SNMP config file to your local $HOME
directory for your docker user and discard the container:
cd .
id=$(docker create kentik/ktranslate:v2)
docker cp $id:/etc/snmp-base.yaml .
docker rm -v $id
Edit the SNMP config file (snmp-base.yaml
) with your preferred text editor, setting cidrs:
and default_communities:
to appropriate values for your network
Run a discovery on SNMP devices based on the CIDR and Community String values you've configured:
docker run -ti --name ktranslate --rm --net=host \
-v `pwd`/snmp-base.yaml:/snmp-base.yaml \
kentik/ktranslate:v2 \
-snmp /snmp-base.yaml \
-log_level info \
-snmp_discovery=true
Towards the end of the discovery process, you should see a log line similar to:
[Info] KTranslate Adding 3 new snmp devices to the config, 0 replaced from 3
The above example indicates discovery found 3 new devices
If nothing is discovered, increase the timeout value timeout_ms:
in the config file and re-run discovery.
If still nothing is discovered, set the cidrs:
blocks to be only /32
length. This forces the discovery process into a more in depth mode which should work as long as the device is reachable via SNMP.
After successful discovery, devices are listed in the snmp-base.yaml
file. By default, only the mib IF-MIB
is polled. Add other mibs here as your devices support them.
Lastly, start ktranslate
to run in background and poll target devices:
docker run -ti --name ktranslate --rm --net=host \
-v `pwd`/snmp-base.yaml:/snmp-base.yaml \
kentik/ktranslate:v2 \
-snmp=/snmp-base.yaml \
-log_level=info \
-format=json
This will require you have your New Relic Account ID and Insights Insert Key, replacing $NR_INSIGHTS_INSERT_KEY
and $NR_ACCOUNT_ID
in this command, respectively
docker run -d --name ktranslate --net=host \
-e NEW_RELIC_API_KEY=$NR_INSIGHTS_INSERT_KEY \
-v `pwd`/snmp-base.yaml:/snmp-base.yaml \
kentik/ktranslate:v2 \
-snmp /snmp-base.yaml \
-compression=gzip \
-sinks=new_relic \
-nr_account_id=$NR_ACCOUNT_ID \
-log_level=info \
-format=new_relic_metric
Get logs with docker logs ktranslate