Giter VIP home page Giter VIP logo

librenms-snmpsim's Introduction

librenms-snmpsim

Be sure to install snmpsim first by: Making sure pip is installed For CentOS 7 sudo yum install epel-release sudo yum -y install python-pip sudo pip install snmpsim

snmpwalk and snmprec files for simulating devices

Using snmpsim

Add localhost aliases

Edit your /etc/hosts file

127.0.0.1 localhost snmpsim

You may add more if you would like to add multiple test devices to LibreNMS.

Starting snmpsim

Use the provided script

./snmpsim.sh

Or run by hand

snmpsimd.py --data-dir=./captures --agent-udpv4-endpoint=127.0.0.1:1161

systemd automation

Using systemd, we can automatically start snmpsimd.py whenever a connection is started to udp:1161 and restart it whenever a capture file is changed, added, or removed.

  • Copy the systemd files to /etc/systemd/system
cp scripts/systemd/* /etc/systemd/system/
  • Edit snmpsimd.service and snmpsim-watch.path and put in the correct paths and user.

  • Enable and start the proper units:

systemctl enable --now snmpsimd.socket snmpsim-watch.path

Add a new host to LibreNMS

Use either the command line or the webui to add a new host to LibreNMS.

Hostname: snmpsim (or anything you added to hosts) Community:

./addhost.php snmpsim ucd v2c 1161

Changing the simulated device

You may either remove then re-add the device or simply change the SNMP community string. Re-run discovery and poller.

Alternatively, you could add multiple hostname alias' to the /etc/hosts file.

Creating capture files

Two formats are allowed snmprec and snmpwalk. Try to review files for private information before submitting to this repository.

Snmprec

Basic usage

snmprec.py --agent-udpv4-endpoint=HOSTNAME --community=COMMUNITY

See the snmpsim documentation for details on capturing snmprec files.

Snmpwalk

Snmpwalk files must be in number only format (-On), otherwise, snmpsim will not start.
translate-snmpwalk.py is provide to convert user provide snmpwalks to a number only format.

librenms-snmpsim's People

Contributors

laf avatar murrant avatar theherodied avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.