GithubHelp home page GithubHelp logo

troglobit / mini-snmpd Goto Github PK

View Code? Open in Web Editor NEW
67.0 8.0 36.0 275 KB

A minimal SNMP agent implementation

Home Page: https://troglobit.com/projects/mini-snmpd/

License: GNU General Public License v2.0

Makefile 1.80% C 89.60% Java 1.97% Shell 0.03% M4 3.16% Roff 3.43%
snmp-daemon embedded-systems mini-snmp snmp snmpd

mini-snmpd's Introduction

Mini SNMP Daemon

License Badge Travis Status Coverity Status

The latest release is always available from GitHub. Download only versioned tarballs, mini-snmpd-X.Y.tar.gz. See below for instructions on how to build.

Table of Contents

Introduction

The Mini SNMP daemon is a minimal implementation of an SNMP daemon. It is primarily targeted at embedded systems with limited disk and memory resources. All configuration can be done using command line arguments, or using the optional /etc/mini-snmp.conf file. It supports basic CPU, memory, disk, and network interface statistics.

mini-snmpd is not as flexibible as, and does not support the same features as, the de-facto standard net-snmp, but this also means it does not have the same footprint and overhead.

Supported features:

  • SNMP version 1 and 2c
  • Community string authentication when using 2c or explicitly configured
  • Read-only access (writing is not supported)
  • Includes basic system info like CPU load, memory, disk and network interfaces
  • Does not need a configuration file, but one is supported
  • Supports UDP and TCP (thus supports SSH tunneling of SNMP connections)
  • Supports Linux kernel versions 2.4, 2.6, and later
  • Supports FreeBSD (needs procfs mounted using "mount_linprocfs procfs /proc")

mini-snmpd has been tested on x86 and ARM platforms in Ubuntu Linux, Alpine Linux, and FreeBSD, using net-snmp and SnmpB as clients. Big endian may not work.

  • For info about licensing, see the file COPYING
  • For info about using the program, see the file mini-snmpd.8
  • For info about how to (cross)compile the program, see the file Makefile
  • For info about how to extend the MIB, see the file README.develop

Examples

Start the daemon:

./mini-snmpd -n -p 16161 -D "My laptop" -L "Batcave" \
             -C "Ops <[email protected]>" -d '/' -i wlp3s0

Check uptime, useful to "ping" a device over SNMP:

snmpget -c public -v2c 127.0.0.1:16161 system.sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (93103) 0:15:31.03

Complete walk:

snmpwalk -v2c -c public 127.0.0.1:16161
SNMPv2-MIB::sysDescr.0 = STRING: My laptop
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (93103) 0:15:31.03
SNMPv2-MIB::sysContact.0 = STRING: Ops <[email protected]>
SNMPv2-MIB::sysName.0 = STRING: luthien
SNMPv2-MIB::sysLocation.0 = STRING: Batcave
IF-MIB::ifNumber.0 = INTEGER: 1
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifDescr.1 = STRING: wlp3s0
IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifMtu.1 = INTEGER: 1500
IF-MIB::ifSpeed.1 = Gauge32: 1000000000
IF-MIB::ifPhysAddress.1 = STRING: 6c:88:14:48:57:1c
IF-MIB::ifAdminStatus.1 = INTEGER: up(1)
IF-MIB::ifOperStatus.1 = INTEGER: up(1)
IF-MIB::ifLastChange.1 = Timeticks: (0) 0:00:00.00
IF-MIB::ifInOctets.1 = Counter32: 207845364
IF-MIB::ifInUcastPkts.1 = Counter32: 154221
IF-MIB::ifInDiscards.1 = Counter32: 0
IF-MIB::ifInErrors.1 = Counter32: 0
IF-MIB::ifOutOctets.1 = Counter32: 13323787
IF-MIB::ifOutUcastPkts.1 = Counter32: 88071
IF-MIB::ifOutDiscards.1 = Counter32: 0
IF-MIB::ifOutErrors.1 = Counter32: 0
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (454155) 1:15:41.55

Check load average:

snmpwalk -v2c -c public 127.0.0.1:16161 UCD-SNMP-MIB::laLoad
UCD-SNMP-MIB::laLoad.1 = STRING: 0.56
UCD-SNMP-MIB::laLoad.2 = STRING: 0.46
UCD-SNMP-MIB::laLoad.3 = STRING: 0.36

Check monitored disks:

snmpwalk -v2c -c public 127.0.0.1:16161 UCD-SNMP-MIB::dskTable
UCD-SNMP-MIB::dskIndex.1 = INTEGER: 1
UCD-SNMP-MIB::dskPath.1 = STRING: /
UCD-SNMP-MIB::dskTotal.1 = INTEGER: 245084448
UCD-SNMP-MIB::dskAvail.1 = INTEGER: 38953552
UCD-SNMP-MIB::dskUsed.1 = INTEGER: 206130896
UCD-SNMP-MIB::dskPercent.1 = INTEGER: 85
UCD-SNMP-MIB::dskPercentNode.1 = INTEGER: 10

Build & Install

The GNU Configure & Build system use /usr/local as the default install prefix. Usually this is sufficient, the below example installs to /usr instead:

tar xf mini-snmpd-X.Y.tar.xz
cd mini-snmpd-X.Y/
./configure --prefix=/usr
make -j5
sudo make install-strip

To use the /etc/mini-snmpd.conf support, both the pkgconfig and libConfuse packages must be installed. Installing from pre-built packages differ between systems, check naming and suffix (-dev) to match your system.

Note: mini-snmpd-X.Y.tar.gz is not an actual release. See the releases page on GitHub for the latest versioned release.

Building from GIT

If you want to contribute, or simply want to try out the latest but still unreleased features, then you need to know a few things about the GNU Configure & Build system:

  • configure.ac and a per-directory Makefile.am are key files
  • configure and Makefile.in are generated from autogen.sh, they are not stored in GIT but automatically generated for the release tarballs
  • Makefile is generated by configure script

To build from GIT you first need to clone the repository and run the autogen.sh script. This requires automake and autoconf to be installed on your system.

git clone https://github.com/troglobit/mini-snmpd.git
cd mini-snmpd/
./autogen.sh
./configure && make

GIT sources are a moving target and are not recommended for production systems, unless you know what you are doing!

Origin & References

mini-snmpd is an effort by Joachim Nilsson to create a focal point for patches and development of the original mini_snmpd project by Robert Ernst, since the original site now has gone dark.

The new project is maintained at GitHub. Use its issue tracker and pull request functions to report bugs or contribute new features.

mini-snmpd's People

Contributors

bmork avatar ffontaine avatar haeretiker avatar inste avatar javiplx avatar prauscher avatar rampagex avatar sverdlin avatar tofurky avatar troglobit avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mini-snmpd's Issues

Add support for privilige separation

For increased security it would be beneficial to mini-snmpd if it supported --priv-sep. Where a forked-off child runs the main (possibly Internet-facing) daemon part with dropped privileges and the parent remains with root privileges communicating statfs() results and the likes to the daemon over a UNIX domain socket.

This is quite a lot of work.

Network interfaces to monitor add Dynamic list of interface

Hi i have system with dynamic add vlans and need to get statistic when new interface config

i run :
mini-snmpd ....... -i eth0,eth1,vlan*

but vlan* not recognized.
I have small system that automatic add new interface when see from network request to server.
or is there options to list all interface

Add support for SNMPv3 user-based security

First of all thank you for your effort put into maintaining this project!

I've got a question regarding your plans for the future. Is there any chance they would include implementing SNMPv3 User-Based Security (RFC 2574) and possibly more of v3? I realize it's not a simple matter, especially in a program focused on such a small footprint, but any extra security is always welcome :}.

I also think that your decision, whatever it may be, would be worth noting somewhere in the project docs (roadmap, perhaps).

Best regards!

Can not compile on macos

When trying to make in macOS, I get this error:

/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
CC mini_snmpd-mini-snmpd.o
mini-snmpd.c:506:13: warning: 'daemon' is deprecated: first deprecated in macOS 10.5 - Use posix_spawn APIs instead. [-Wdeprecated-declarations]
if (-1 == daemon(0, 0)) {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:297:6: note: 'daemon' has been explicitly marked deprecated here
int daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
mini-snmpd.c:592:51: error: no member named 'ifr_ifrn' in 'struct ifreq'
snprintf(ifreq.ifr_ifrn.ifrn_name, sizeof(ifreq.ifr_ifrn.ifrn_name), "%s", g_bind_to_device);
~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:57:34: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), VA_ARGS)
^~~
mini-snmpd.c:592:18: error: no member named 'ifr_ifrn' in 'struct ifreq'
snprintf(ifreq.ifr_ifrn.ifrn_name, sizeof(ifreq.ifr_ifrn.ifrn_name), "%s", g_bind_to_device);
~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:57:29: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), VA_ARGS)
^~~
mini-snmpd.c:592:18: error: no member named 'ifr_ifrn' in 'struct ifreq'
snprintf(ifreq.ifr_ifrn.ifrn_name, sizeof(ifreq.ifr_ifrn.ifrn_name), "%s", g_bind_to_device);
~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:57:56: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), VA_ARGS)
^~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h:39:54: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
^~~~~~
mini-snmpd.c:593:44: error: use of undeclared identifier 'SO_BINDTODEVICE'
if (setsockopt(g_udp_sockfd, SOL_SOCKET, SO_BINDTODEVICE, (char *)&ifreq, sizeof(ifreq)) == -1) {
^
mini-snmpd.c:609:51: error: no member named 'ifr_ifrn' in 'struct ifreq'
snprintf(ifreq.ifr_ifrn.ifrn_name, sizeof(ifreq.ifr_ifrn.ifrn_name), "%s", g_bind_to_device);
~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:57:34: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), VA_ARGS)
^~~
mini-snmpd.c:609:18: error: no member named 'ifr_ifrn' in 'struct ifreq'
snprintf(ifreq.ifr_ifrn.ifrn_name, sizeof(ifreq.ifr_ifrn.ifrn_name), "%s", g_bind_to_device);
~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:57:29: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), VA_ARGS)
^~~
mini-snmpd.c:609:18: error: no member named 'ifr_ifrn' in 'struct ifreq'
snprintf(ifreq.ifr_ifrn.ifrn_name, sizeof(ifreq.ifr_ifrn.ifrn_name), "%s", g_bind_to_device);
~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:57:56: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), VA_ARGS)
^~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h:39:54: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
^~~~~~
mini-snmpd.c:610:44: error: use of undeclared identifier 'SO_BINDTODEVICE'
if (setsockopt(g_tcp_sockfd, SOL_SOCKET, SO_BINDTODEVICE, (char *)&ifreq, sizeof(ifreq)) == -1) {
^
1 warning and 8 errors generated.
make[1]: *** [mini_snmpd-mini-snmpd.o] Error 1
make: *** [all] Error 2

Encoding of Counter32-value can be invalid

According to X.690, all Integers (which Counter32 is internally) must be transmitted signed. In the current implementation, a value of 33000 will be encoded as 0x80e8, which will be parsed as a signed int on the client, resulting in -32536 and failing with a ValueRangeConstraint (PySNMP) or Net-SNMP first expanding 0x80e8 to 0xffff80e8 (as it should contain 32 bits and the first bit indicates a negative value) and then parsing the value as unsigned int for no obvious reason, resulting in 4294934760.
Therefore, mini-snmpd must encode values like 33000 with a leading zero-byte: 0x0080e8.

Traditional bandwidth data?

Hello Joachim,

I see your reference to IF-MIB::ifTable, and do get interface specific data, however I am wonder is there a way to get the more traditional traffic / bandwidth data from mini-snmpd?

Thanks for your time and help!

External script support

Another nice option would be the ability to specify an external command/script and OID, like snmpd.

mini-snmpd not running in terminal

Hi

"The program does not put itself into the background or detach itself from the controlling terminal. This is not included on purpose since normally the program is started from the init process, where running in background is not desired."

I run the executable and it is running in the background. I tried a snmpwalk and it worked.
But the only way to kill it, is with the pid.

OS : ubuntu:16.04

How to reproduce:
I cloned the project and configured it:

$ ./autogen.sh
./autogen.sh
autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force --warnings=portability autoreconf: configure.ac: tracing autoreconf: configure.ac: not using Libtool autoreconf: running: /usr/bin/autoconf --force --warnings=portability autoreconf: running: /usr/bin/autoheader --force --warnings=portability autoreconf: running: automake --add-missing --force-missing --warnings=portability configure.ac:9: installing './compile' configure.ac:2: installing './install-sh' configure.ac:2: installing './missing' Makefile.am: installing './depcomp' autoreconf: no config.status: cannot re-make autoreconf: Leaving directory .

$ ./configure
$ make
$ ./mini_snmpd -i enp0s31f6,wlp1s0
--->Running in the background

I tried it another way:
$ autoreconf -i
configure.ac:9: installing './compile'
configure.ac:2: installing './install-sh'
configure.ac:2: installing './missing'
Makefile.am: installing './depcomp'

$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for unistd.h... (cached) yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for sys/types.h... (cached) yes
checking net/if.h usability... yes
checking net/if.h presence... yes
checking for net/if.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for strstr... yes
checking for strtod... yes
checking for strtoul... yes
checking for strtok... yes
checking for getopt... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands

$ make
make all-am
make[1]: Entering directory '/home/jova/Libs/SNMP/mini-snmpd'
CC mini_snmpd.o
CC linux.o
CC freebsd.o
CC mib.o
CC globals.o
CC protocol.o
CC utils.o
CCLD mini_snmpd

$ ./mini_snmpd -i enp0s31f6,wlp1s0
--->Also running in the background

big endian / little endian issue

Hello,

I could compile correctly mini-snmp from git and run on my PC.

Then I cross compiled the same project to a NIOS processor gcc. The compilation was successful and the binary ran on my target board.

But when I tried to capture the information using snmpwalk command remotely, the binary crashes at the target.

I have the following message:

Listening on port 161/udp and 161/tcp
Failed creating PID file: No such file or directory


Failed UDP request from 192.168.100.10:45810: Invalid argument
Failed updating OID '.1.3.6.1.4.1.2021.10.1.5.1': OID not found

The same command on PC works fine.

I believe that this issue is related to little endian and big endian bytes management for TLV parsing.

Does anybody had similar problems and what should I have to do to solve it?

Add support for IfXTable and Counter64

Hello
Well, I thought that this project had disappeared ... It's really great news that is not. Thank you for continuing to maintain the program.

I have mini_snmpd running on a router: my problem is that statistics do not work well when I use this router to its maximum capacity; network counters (ifOutOctets, ifInOctets) currently work with Counter32, and it overflows.

In OpenWrt there is a patch (https://dev.openwrt.org/ticket/13597) for the old version, 2b, which implements Counter64. I tried to rebase the patch but it is very difficult to do for me.

Is possible to implement Counter64 support in the project?

Regards!

Help in implementing SET commands

Looking at the code, I saw that the SET implemetation is not supported.

I can understand that.

But, is there any guideline that I could follow to implement that?

trap support is missing

The README states that traps are supported - but there is only a command line option with capital case T that is not handled further in any way.

Is there a plan to support them ?

Regards

1.5 not work

I use mini-snmpd work with Networx to monitor my router's ppp0 flow.

It's worked well with version 1.4 on router running Tomato firmware:
Linux netgear 2.6.36.4brcmarm #1 SMP PREEMPT Sat Feb 1 10:33:05 CST 2020 armv7l GNU/Linux

But it's failed when i update to version 1.5, Networx cant get any data from mini-snmpd.

I use SNMP Tester try to finger out what's wrong, both with same config but port:
mini-snmpd -D Netgear -i ppp0 -n -p 162 -P 162

  1. with 1.4:
    1 4
    full log:
----------------------- New Test -----------------------
Paessler SNMP Tester 3.1f
Device: 192.168.2.1

Scanning Standard Interfaces...
2020/2/4 16:50:31 Start Scan
2020/2/4 16:50:31 SNMP Version: V2
2020/2/4 16:50:31 Delay: 0
2020/2/4 16:50:31 Force32: No
2020/2/4 16:50:31 Single Get: No
2020/2/4 16:50:31 GET: 1.3.6.1.2.1.2.1.0
2020/2/4 16:50:31 Try 1
2020/2/4 16:50:31 Start 93537392
2020/2/4 16:50:31 Done 93537392 Status=0
2020/2/4 16:50:31 0 ASN_INTEGER,ASN_GAUGE: 1
2020/2/4 16:50:31 Test 64bit
2020/2/4 16:50:31 GET NEXT: 1.3.6.1.2.1.31.1.1.1.6
2020/2/4 16:50:31 Start 93537440
2020/2/4 16:50:31 Done 93537440 Status=0
2020/2/4 16:50:31 0 ASN_INTEGER,ASN_GAUGE: 255616
2020/2/4 16:50:31 64bit NOT available
2020/2/4 16:50:31 GET NEXT: 1.3.6.1.2.1.2.2.1.2
2020/2/4 16:50:31 Start 93537776
2020/2/4 16:50:31 Done 93537776 Status=0
2020/2/4 16:50:31 0 ASN_OCTET_STR: ppp0
2020/2/4 16:50:31 Current: 1.3.6.1.2.1.2.2.1.2.1
2020/2/4 16:50:31 Description: ppp0
2020/2/4 16:50:31 GET List: 1.3.6.1.2.1.2.2.1.10.1,1.3.6.1.2.1.2.2.1.3.1,1.3.6.1.2.1.2.2.1.8.1,1.3.6.1.2.1.2.2.1.5.1
2020/2/4 16:50:31 Try 1
2020/2/4 16:50:31 Start 93537584
2020/2/4 16:50:31 Done 93537584 Status=0
2020/2/4 16:50:31 0 ASN_COUNTER,ASN_TIMETICKS: 2679234164
2020/2/4 16:50:31 1 ASN_INTEGER,ASN_GAUGE: 6
2020/2/4 16:50:31 2 ASN_INTEGER,ASN_GAUGE: 1
2020/2/4 16:50:31 3 ASN_INTEGER,ASN_GAUGE: 1000000000
2020/2/4 16:50:31 Testing...
2020/2/4 16:50:31 32bit: 0,2679234164
2020/2/4 16:50:31 Ok
2020/2/4 16:50:31 GET: 1.3.6.1.2.1.31.1.1.1.18.1
2020/2/4 16:50:31 Try 1
2020/2/4 16:50:31 Start 93537296
2020/2/4 16:50:31 Done 93537296 Status=0
2020/2/4 16:50:31 0 SNMP_ERR_NOSUCHOBJECT
2020/2/4 16:50:31 ifAlias: 
2020/2/4 16:50:31 GET NEXT: 1.3.6.1.2.1.2.2.1.2.1
2020/2/4 16:50:31 Start 93537536
2020/2/4 16:50:31 Done 93537536 Status=0
2020/2/4 16:50:31 0 ASN_INTEGER,ASN_GAUGE: 6
2020/2/4 16:50:31 GetNext=1.3.6.1.2.1.2.2.1.3.1
2020/2/4 16:50:31 Second number Fix
2020/2/4 16:50:31 Current: 1.3.6.1.2.1.2.2.1.3.1
2020/2/4 16:50:31 GET NEXT: 1.3.6.1.2.1.2.2.1.3.1
2020/2/4 16:50:31 Start 93537872
2020/2/4 16:50:31 Done 93537872 Status=0
2020/2/4 16:50:31 0 ASN_INTEGER,ASN_GAUGE: 1500
2020/2/4 16:50:31 GetNext=1.3.6.1.2.1.2.2.1.4.1
2020/2/4 16:50:31 Second number Fix
2020/2/4 16:50:31 Current: 1.3.6.1.2.1.2.2.1.4.1
2020/2/4 16:50:31 GET NEXT: 1.3.6.1.2.1.2.2.1.4.1
2020/2/4 16:50:31 Start 93537464
2020/2/4 16:50:31 Done 93537464 Status=0
2020/2/4 16:50:31 0 ASN_INTEGER,ASN_GAUGE: 1000000000
2020/2/4 16:50:31 GetNext=1.3.6.1.2.1.2.2.1.5.1
2020/2/4 16:50:31 Second number Fix
2020/2/4 16:50:31 Current: 1.3.6.1.2.1.2.2.1.5.1
2020/2/4 16:50:31 GET NEXT: 1.3.6.1.2.1.2.2.1.5.1
2020/2/4 16:50:31 Start 93537248
2020/2/4 16:50:31 Done 93537248 Status=0
2020/2/4 16:50:31 0 ASN_OCTET_STR: ?钷?
2020/2/4 16:50:31 GetNext=1.3.6.1.2.1.2.2.1.6.1
2020/2/4 16:50:31 Second number Fix
2020/2/4 16:50:31 Current: 1.3.6.1.2.1.2.2.1.6.1
2020/2/4 16:50:31 GET NEXT: 1.3.6.1.2.1.2.2.1.6.1
2020/2/4 16:50:31 Start 93537536
2020/2/4 16:50:31 Done 93537536 Status=0
2020/2/4 16:50:31 0 ASN_INTEGER,ASN_GAUGE: 1
2020/2/4 16:50:31 GetNext=1.3.6.1.2.1.2.2.1.7.1
2020/2/4 16:50:31 Second number Fix
2020/2/4 16:50:31 Current: 1.3.6.1.2.1.2.2.1.7.1
2020/2/4 16:50:31 GET NEXT: 1.3.6.1.2.1.2.2.1.7.1
2020/2/4 16:50:31 Start 93537224
2020/2/4 16:50:31 Done 93537224 Status=0
2020/2/4 16:50:31 0 ASN_INTEGER,ASN_GAUGE: 1
2020/2/4 16:50:31 GetNext=1.3.6.1.2.1.2.2.1.8.1
2020/2/4 16:50:31 Second number Fix
2020/2/4 16:50:31 Current: 1.3.6.1.2.1.2.2.1.8.1
2020/2/4 16:50:31 GET NEXT: 1.3.6.1.2.1.2.2.1.8.1
2020/2/4 16:50:31 Start 93537752
2020/2/4 16:50:31 Done 93537752 Status=0
2020/2/4 16:50:31 0 ASN_COUNTER,ASN_TIMETICKS: 0
2020/2/4 16:50:31 GetNext=1.3.6.1.2.1.2.2.1.9.1
2020/2/4 16:50:32 Second number Fix
2020/2/4 16:50:32 Current: 1.3.6.1.2.1.2.2.1.9.1
2020/2/4 16:50:32 GET NEXT: 1.3.6.1.2.1.2.2.1.9.1
2020/2/4 16:50:32 Start 93537872
2020/2/4 16:50:32 Done 93537872 Status=0
2020/2/4 16:50:32 0 ASN_COUNTER,ASN_TIMETICKS: 2679234164
2020/2/4 16:50:32 GetNext=1.3.6.1.2.1.2.2.1.10.1
2020/2/4 16:50:32 Second number Fix
2020/2/4 16:50:32 Current: 1.3.6.1.2.1.2.2.1.10.1
2020/2/4 16:50:32 GET NEXT: 1.3.6.1.2.1.2.2.1.10.1
2020/2/4 16:50:32 Start 93537152
2020/2/4 16:50:32 Done 93537152 Status=0
2020/2/4 16:50:32 0 ASN_COUNTER,ASN_TIMETICKS: 6045013
2020/2/4 16:50:32 GetNext=1.3.6.1.2.1.2.2.1.11.1
2020/2/4 16:50:32 Second number Fix
2020/2/4 16:50:32 Current: 1.3.6.1.2.1.2.2.1.11.1
2020/2/4 16:50:32 GET NEXT: 1.3.6.1.2.1.2.2.1.11.1
2020/2/4 16:50:32 Start 93537128
2020/2/4 16:50:32 Done 93537128 Status=0
2020/2/4 16:50:32 0 ASN_COUNTER,ASN_TIMETICKS: 0
2020/2/4 16:50:32 GetNext=1.3.6.1.2.1.2.2.1.13.1
2020/2/4 16:50:32 Second number Fix
2020/2/4 16:50:32 Current: 1.3.6.1.2.1.2.2.1.13.1
2020/2/4 16:50:32 GET NEXT: 1.3.6.1.2.1.2.2.1.13.1
2020/2/4 16:50:32 Start 93537176
2020/2/4 16:50:32 Done 93537176 Status=0
2020/2/4 16:50:32 0 ASN_COUNTER,ASN_TIMETICKS: 0
2020/2/4 16:50:32 GetNext=1.3.6.1.2.1.2.2.1.14.1
2020/2/4 16:50:32 Second number Fix
2020/2/4 16:50:32 Current: 1.3.6.1.2.1.2.2.1.14.1
2020/2/4 16:50:32 GET NEXT: 1.3.6.1.2.1.2.2.1.14.1
2020/2/4 16:50:32 Start 93537464
2020/2/4 16:50:32 Done 93537464 Status=0
2020/2/4 16:50:32 0 ASN_COUNTER,ASN_TIMETICKS: 1278447795
2020/2/4 16:50:32 GetNext=1.3.6.1.2.1.2.2.1.16.1
2020/2/4 16:50:32 Second number Fix
2020/2/4 16:50:32 Current: 1.3.6.1.2.1.2.2.1.16.1
2020/2/4 16:50:32 GET NEXT: 1.3.6.1.2.1.2.2.1.16.1
2020/2/4 16:50:32 Start 93537872
2020/2/4 16:50:32 Done 93537872 Status=0
2020/2/4 16:50:32 0 ASN_COUNTER,ASN_TIMETICKS: 3953336
2020/2/4 16:50:32 GetNext=1.3.6.1.2.1.2.2.1.17.1
2020/2/4 16:50:32 Second number Fix
2020/2/4 16:50:32 Current: 1.3.6.1.2.1.2.2.1.17.1
2020/2/4 16:50:32 GET NEXT: 1.3.6.1.2.1.2.2.1.17.1
2020/2/4 16:50:32 Start 93537224
2020/2/4 16:50:32 Done 93537224 Status=0
2020/2/4 16:50:32 0 ASN_COUNTER,ASN_TIMETICKS: 0
2020/2/4 16:50:32 GetNext=1.3.6.1.2.1.2.2.1.19.1
2020/2/4 16:50:32 Second number Fix
2020/2/4 16:50:32 Current: 1.3.6.1.2.1.2.2.1.19.1
2020/2/4 16:50:32 GET NEXT: 1.3.6.1.2.1.2.2.1.19.1
2020/2/4 16:50:32 Start 93537584
2020/2/4 16:50:32 Done 93537584 Status=0
2020/2/4 16:50:32 0 ASN_COUNTER,ASN_TIMETICKS: 0
2020/2/4 16:50:32 GetNext=1.3.6.1.2.1.2.2.1.20.1
2020/2/4 16:50:32 Second number Fix
2020/2/4 16:50:32 Current: 1.3.6.1.2.1.2.2.1.20.1
2020/2/4 16:50:32 GET NEXT: 1.3.6.1.2.1.2.2.1.20.1
2020/2/4 16:50:32 Start 93537872
2020/2/4 16:50:32 Done 93537872 Status=0
2020/2/4 16:50:32 0 ASN_COUNTER,ASN_TIMETICKS: 25811283
2020/2/4 16:50:32 GetNext=1.3.6.1.2.1.25.1.1.0
2020/2/4 16:50:32 Second number Fix
Result: 

Found standard interfaces:
1: (001) ppp0,Connected,1 GBit/s,Ethernet,

Testing standard interfaces...
Test 1 (1.3.6.1.2.1.2.2.1.10.1,1.3.6.1.2.1.2.2.1.16.1): in=2679234164  out=1278447795
  1. with 1.5:
    1 5
    full log:
----------------------- New Test -----------------------
Paessler SNMP Tester 3.1f
Device: 192.168.2.1

Scanning Standard Interfaces...
2020/2/4 16:54:38 Start Scan
2020/2/4 16:54:38 SNMP Version: V2
2020/2/4 16:54:38 Delay: 0
2020/2/4 16:54:38 Force32: No
2020/2/4 16:54:38 Single Get: No
2020/2/4 16:54:38 GET: 1.3.6.1.2.1.2.1.0
2020/2/4 16:54:38 Try 1
2020/2/4 16:54:38 Start 93537248
2020/2/4 16:54:38 Done 93537248 Status=0
2020/2/4 16:54:38 0 ASN_INTEGER,ASN_GAUGE: 1
2020/2/4 16:54:38 Test 64bit
2020/2/4 16:54:38 GET NEXT: 1.3.6.1.2.1.31.1.1.1.6
2020/2/4 16:54:38 Start 93537440
2020/2/4 16:54:38 Done 93537440 Status=0
2020/2/4 16:54:38 0 ASN_COUNTER64: 0
2020/2/4 16:54:38 64bit available
2020/2/4 16:54:38 GET NEXT: 1.3.6.1.2.1.31.1.1.1.1
2020/2/4 16:54:38 Start 93537128
2020/2/4 16:54:38 Done 93537128 Status=0
2020/2/4 16:54:38 0 ASN_OCTET_STR: ppp0
2020/2/4 16:54:38 Current: 1.3.6.1.2.1.31.1.1.1.1.1
2020/2/4 16:54:38 Description: ppp0
2020/2/4 16:54:38 GET List: 1.3.6.1.2.1.2.2.1.10.1,1.3.6.1.2.1.2.2.1.3.1,1.3.6.1.2.1.2.2.1.8.1,1.3.6.1.2.1.2.2.1.5.1,1.3.6.1.2.1.31.1.1.1.15.1,1.3.6.1.2.1.31.1.1.1.6.1
2020/2/4 16:54:38 Try 1
2020/2/4 16:54:38 Start 93537512
2020/2/4 16:54:38 Done 93537512 Status=0
2020/2/4 16:54:38 0 ASN_COUNTER,ASN_TIMETICKS: 0
2020/2/4 16:54:38 1 ASN_INTEGER,ASN_GAUGE: 0
2020/2/4 16:54:38 2 ASN_INTEGER,ASN_GAUGE: 0
2020/2/4 16:54:38 3 ASN_INTEGER,ASN_GAUGE: 0
2020/2/4 16:54:38 4 ASN_INTEGER,ASN_GAUGE: 0
2020/2/4 16:54:38 5 ASN_COUNTER64: 0
2020/2/4 16:54:38 Testing...
Result: List index out of bounds (6)

Found standard interfaces:
No standard interfaces found

RFE: Support custom responses e.g. to emulate HP JetDirect print server

mini-snmpd is mentioned in p910nd print server guide in OpenWRT documentation:
https://openwrt.org/docs/guide-user/services/print_server/p910nd.server#mini_snmpd

However, it's not useful without the patch mentioned there. Obviously, the solution documented there is printer model-specific, but it could be generalized, e.g. in form of text string specified in mini-snmpd configuration, i.e.

custom_response = { OID, response }

which could be set like below to emulate a HP JetDirect print server.

custom_response = { '0.1.3.6.1.4.1.11.2.3.9.1.1.7.0', "MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CLS:PRINTER;DES:HP LaserJet 1020;SN:XXXXXXX;" }

Better yet, the response could be synthesized from USB scan, but I guess that's too specific.

References:

WiFi statistics support

Would be nice if this supported stuff like WiFi TX/RX power, bitrate, etc.

There's an old patch here but it's very outdated and IIRC was rejected from OpenWrt due to the approach used to get the stats.

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.