OpenWrt Forum Archive

Topic: snmpd

The content of this topic has been archived on 1 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi body
I just download this
snmpd_5.4.4-1_ramips_24kec.ipk.
Installing libnetsnmp (5.4.4-1) to root...
Downloading

and my OS is
BusyBox v1.23.2 (2016-09-27 07:54:34 CEST) built-in shell (ash)
CHAOS CALMER (15.05.1, r49203)
-----

my question is how to use snmpd ???
Anyone can teach me? any example for me

#snmpd  -v
NET-SNMP version:  5.4.4
Web:         
Email:             net-snmp-coders@lists.sourceforge.net

Thank you body!

Hi,
default OpenWRT config is in /etc/config/snmpd and OpenWRT scripts build the /etc/snmp/snmpd.conf. < this is symlink into /tmp dir

After instalation is there a default configuration and daemon should be started automatically after instalation.

You can test it, if is working by snmpwalk from your computer
Default community for reading is public
snmpwalk -c public -v 2c LAN_IP_OF_ROUTER .  < dont forget the dot at the end of command. It mean LIST ALL OIDS

(Last edited by milankocvara on 17 Mar 2017, 08:53)

Hello milankocvara
First,thank you for your reply!
Could you teach me what is must be set to conf?
And when I use Windows OS,what software have be install to watch snmp?

And I try to do your tell me
It's show:
-ash: snmpwalk: not found

--------------
root@mylinkit:~# snmpd -h

Usage:  snmpd [OPTIONS] [LISTENING ADDRESSES]

        Version:  5.4.4
        Web:      http://www.net-snmp.org/
        Email:    net-snmp-coders@lists.sourceforge.net

  -a                    log addresses
  -A                    append to the logfile rather than truncating it
  -c FILE[,...]         read FILE(s) as configuration file(s)
  -C                    do not read the default configuration files
  -d                    dump sent and received SNMP packets
  -D[TOKEN[,...]]       turn on debugging output for the given TOKEN(s)
                          (try ALL for extremely verbose output)
                          Don't put space(s) between -D and TOKEN(s).
  -f                    do not fork from the shell
  -g GID                change to this numeric gid after opening
                          transport endpoints
  -h, --help            display this usage message
  -H                    display configuration file directives understood
  -I [-]INITLIST        list of mib modules to initialize (or not)
                          (run snmpd with -Dmib_init for a list)
  -L <LOGOPTS>          toggle options controlling where to log to
        e:           log to standard error
        o:           log to standard output
        n:           don't log at all
        f file:      log to the specified file
        s facility:  log to syslog (via the specified facility)

        (variants)
        [EON] pri:   log to standard error, output or /dev/null for level 'pri' and above
        [EON] p1-p2: log to standard error, output or /dev/null for levels 'p1' to 'p2'
        [FS] pri token:    log to file/syslog for level 'pri' and above
        [FS] p1-p2 token:  log to file/syslog for levels 'p1' to 'p2'
  -m MIBLIST            use MIBLIST instead of the default MIB list
  -M DIRLIST            use DIRLIST as the list of locations
                          to look for MIBs
  -p FILE               store process id in FILE
  -q                    print information in a more parsable format
  -r                    do not exit if files only accessible to root
                          cannot be opened
  -u UID                change to this uid (numeric or textual) after
                          opening transport endpoints
  -v, --version         display version information
  -V                    verbose display

Deprecated options:
  -l FILE               use -Lf <FILE> instead
  -P                    use -p instead
  -s                    use -Lsd instead
  -S d|i|0-7            use -Ls <facility> instead

you can download net-snmp utils for windows from here

http://www.net-snmp.org/download.html

there you can find a link to the sourceforge for downloading windows binary.
It is command-line tool and after installation/unpacking directly from snmp directory you can run command above.
snmpwalk is client. It is not part of snmpd, you have installed on your router.

And I try to do your tell me
It's show:
-ash: snmpwalk: not found

In default OpenWRT settings of SNMPD you will see all important data.
For what you want these information (from snmp)?

OpenWRT/LEDE have in luci web good working and good looking tools using collectd and rrdtool (statistic blurb)

snmp is useless without other implementation (zabbix etc)

My guess is that you wish to monitor something using SNMP?  If so, what would you like to have monitored? It matters because the SNMP agent is very lean and only offers a limited amount of MIBS (Management Information Base).

SNMP works by Polling the agent (running on the router) on a schedule using a client. The results are usually stored in a database for graphing purposes. Alerts can also be set up on the client when a threshold is reached.

General Syntax for a snmp.  #snmpwalk -c public -v2c "Router_IP"  "MIB"

Example mib(s)  "system" "ifmib"

milankocvara,davidc502  Thank you for reply me!!!
I have problem for that!
1. I want to look storage status and I use command
snmpwalk -v 2c -c public 192.168.5.136 1.3.6.1.4.1.2021.9.1.6.1
but that was show " iso.3.6.1.4.1.2021.9.1.6.1 = No Such Instance currently exists at this OID "
Is it not support my machine?? or I should set any on conf?
I have try to look CPU Load
1 minute Load: .1.3.6.1.4.1.2021.10.1.3.1
5 minute Load: .1.3.6.1.4.1.2021.10.1.3.2
15 minute Load: .1.3.6.1.4.1.2021.10.1.3.3
And memory
Total memory:.1.3.6.1.4.1.2021.4.5.0
Free memory:.1.3.6.1.4.1.2021.4.11.0
All of that was show to me!
Just storage was trouble.............

and another problem is....
I setting to /etc/snmp/snmp.conf
But when I command: /etc/init.d/snmpd restart
any setting was clean.
That is back default setting
I don't what is wrong.........

leonids23 wrote:

milankocvara,davidc502  Thank you for reply me!!!
I have problem for that!
1. I want to look storage status and I use command
snmpwalk -v 2c -c public 192.168.5.136 1.3.6.1.4.1.2021.9.1.6.1
but that was show " iso.3.6.1.4.1.2021.9.1.6.1 = No Such Instance currently exists at this OID "
Is it not support my machine?? or I should set any on conf?
I have try to look CPU Load
1 minute Load: .1.3.6.1.4.1.2021.10.1.3.1
5 minute Load: .1.3.6.1.4.1.2021.10.1.3.2
15 minute Load: .1.3.6.1.4.1.2021.10.1.3.3
And memory
Total memory:.1.3.6.1.4.1.2021.4.5.0
Free memory:.1.3.6.1.4.1.2021.4.11.0
All of that was show to me!
Just storage was trouble.............

See if the host resource mib is available.      1.3.6.1.2.1.25.2.3.1.1   < hrstorageindex

If it is you can take a look at storageSize and storageUsed to calculate how much is free.

http://www.oidview.com/mibs/0/HOST-RESOURCES-MIB.html

leonids23 wrote:

and another problem is....
I setting to /etc/snmp/snmp.conf
But when I command: /etc/init.d/snmpd restart
any setting was clean.
That is back default setting
I don't what is wrong.........

As I wrote before, /etc/snmp/snmp.conf is symlink into TMP, where script /etc/init.d/snmpd build a configuration from Owrt confing /etc/config/snmp

Here you have to do changes to build snmpd config with your own settings

(Last edited by milankocvara on 23 Mar 2017, 08:15)

The discussion might have continued from here.