Common Command-Line Arguments
For the most part, the Net-SNMP commands follow a similar command structure; they share many options and use roughly the same syntax. For example, in the abstract, an snmpget command looks like this:
snmpget options hostname community objectID...In other words, the command name is followed by a series of options,
the hostname of the system you want to poll, the community string,
and one or more object IDs. (Note that you can use the
-c community option instead of placing the
community string after the hostname. You can also provide a default
hostname in your snmp.conf file.) The syntax of
snmpset is only slightly different; because
snmpset changes object values, it requires you to
specify the object’s datatype and the new value:
snmpset options hostname community objectID type value...Table C-1 summarizes some of the most useful options that are common to all Net-SNMP commands. See the snmpcmd(1) manpage for a complete list.
Table C-1. Summary of Command-Line Options
|
Option |
Description |
|---|---|
|
-m |
Specifies
which MIB modules you would like the command to load. If you want the
command to parse the MIB file for a particular vendor, copy the MIB
file to |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access