The Comprehensive Guide To SNMP
The Comprehensive Guide To SNMP
E-BOOK
The
Comprehensive
Guide to SNMP
By Steve Francis, Founder and
Chief Product Officer
E-BOOK
The Comprehensive
Guide to SNMP
What is SNMP?
SNMP stands for Simple Network Management Protocol. In real life,
it is often not simple; does not only apply to network devices; and
often cannot be used for management of devices, only monitoring.
It is definitely a protocol, however. :-)
SNMP is mainly used for the collection of data about devices, such
as CPU load, memory usage, etc. SNMP is supported on practically
all network equipment (switches, routers, load balancers, for
example), but also on most server operating systems, some storage
devices, and even some server application software. However, the
extent of what supporting SNMP really means can vary wildly, but
more on that later.
If youre reading this, you are probably responsible for the
performance, availability and capacity of some IT infrastructure. (If
Understanding SNMP
SNMP stands for Simple
Network Management
Protocol. SNMP provides a
standard message format that
devices being monitored and
monitoring systems can all
you are reading this because you thought it was the complete guide
to the State of New Mexico Police - this is not for you.) If you have a
systems
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
For example, you can see the OID .1.3.6.1.2 refers to the
Management node in the diagram below.
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
You can see a complete list of enterprises that have been assigned
private OID numbers at http://www.iana.org/assignments/
enterprise-numbers/enterprise-numbers.
An example of a MIB file is this extract from the RFC1213 MIB
below:
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
This long text file extract above defines the object .1.3.6.1.2.1.1.1.0
to be the sysDescr object, and specifies that when an SNMP agent
is queried for this OID, it should return a textual description of the
system.
To make this all a little less abstract, we can perform this query using
a simple tool snmpwalk, that is included in most Linux packages:
Here, we query a Linux server for the OID .1.3.6.1.2.1.1.1.0:
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
Versions of SNMP
There are three commonly used versions of SNMP.
SNMP version 1: the oldest flavor. Easy to set up it only requires
(and only supports) a plaintext community. The biggest downsides
are that it does not support 64 bit counters, only 32 bit counters,
and that it has little security.
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
E-BOOK
The Comprehensive
Guide to SNMP
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
Using either traps or polling, you could receive an alert about the
fact that CPU utilization has exceeded 80%. But if you are solely
relying on traps for your data, you would not have any further
information. One system seems to need immediate action - the CPU
usage started growing rapidly. The other system has been growing
its usage slowly and steadily for a week, so most likely has at least a
few more days before calamity. Relying on traps, which would not
provide this data, would not allow you to make an informed decision
about how to react differently to these two systems.
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
For example, a UPS device should report on things like the time it
has been running on battery; the reason for the switch to battery;
the runtime remaining on battery before battery exhaustion; the
state of the battery packs, etc. A storage array should report things
like drive health; free/unprovisioned space; the latency of read/write
requests by volume or LUN, etc.
The fact that a device vendor may provide a MIB that has lots of
useful information in it does not necessarily solve your problems. For
example, while APC does provide very powerful SNMP agents, and
a detailed private MIB - their MIB has over 4500 objects in it - not all
objects are supported by all APC devices; and most are not
meaningful to ordinary use of the devices (e.g.
1.3.6.1.4.1.318.1.1.9.4.2.2.1.4: the rectifier physical address (the
address on the bus).).
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
Easily define what OIDs to query. Ideally, this isnt something you
even need to think about. An NMS with true SNMP support will
discover the kind of device; then have knowledge of which OIDs
are appropriate to query for that device; and also periodically
check to see if there are changes in the devices configuration
requiring new different OIDs to check. (For example, enabling
Power-over Ethernet in a switch will turn on a whole new section
of the MIB tree that should be queried.) The worst case is an NMS
that requires you to manually define what OIDs to check. Yes, its
technically supporting SNMP, but its not making your life any
easier if you have to go through the 4500 objects in the APC MIB,
just to ensure your UPSs are correctly monitored.
Easily define how to interpret the data that is returned. SNMP
data can be returned as gauges (e.g. the current temperature in
Celsius); counters (how many packets have passed through the
interface since the system started); strings, bitmaps, etc. Counters
need to be converted to a rate, in most cases, by subtracting the
prior counter value from the current, and dividing by the time
interval between samples. This should be automatically handled
by the NMS.
Easily define the thresholds that should trigger alerts. Again,
ideally the NMS should take away a lot of the need for this, and
have pre-defined alerts for everything that could impact
production systems, but there will always be customization
required - either for systems that are not mission-critical, and so
have a greater tolerance for performance issues; or for custom
metrics that are not pre-defined. This tuning should be an easy
task.
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
Youll notice that the items above all focus on ease of use - which
should be the main goal of using an NMS - to make the job of
ensuring the operational availability, capacity and performance of
the systems easier. NMS systems that require you to modify text or
XML files, or pore through thousands of MIB files and configure all
the SNMP OIDs to query, may technically be NMS systems - but
only in the loosest sense of the word.
There are many other things that an NMS may do in this regard,
which will be of differing utility to different organizations:
graph the variables being collected, so you can see the historical
trend of the objects being collected.
route and deliver the alerts via different mechanisms (chat,
email, sms, voice calls) to different people, and escalate through
different people and teams. This can alternatively be done by a
separate tool.
discover devices to be monitored via different mechanisms.
map devices logically at different OSI layers, or geographically.
use different data collection mechanisms other than SNMP, to
support devices that do not provide any, or limited, support of
SNMP. An NMS that can also collect data via other protocols such
as WMI, JMX, and various other APIs can be used to consolidate
and replace multiple tools into one, and provide a more cohesive
view of the whole environment.
and so on.
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
There are many options to configure snmpd - you can limit the hosts
that can query it by IP address; you can enable encryption and
authentication for use with SNMP v3; you can even limit which OIDs
the agent will respond to, when queried by different IP addresses,
communities, or users.
However, in most uses, a simple configuration is reasonable
(assuming the host is behind a firewall, and not exposed to the
Internet.). The simplest configuration is to simply set the contents of
/etc/snmp/snmpd.conf to this:
This will allow any device to query this system by SNMP, if they know
the community MyCommunity. SNMP will not be enabled for any
write, or set, operations, however.
You should then ensure SNMP is set to start automatically on system
boot, and start it now, with these commands:
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
If you find that SNMP is not responding to your queries from other
hosts, some troubleshooting steps to check are:
if you are running a firewall, such as iptables, on the server,
ensure it is set to allow SNMP queries (UDP port 161) through.
similarly, if there are any other firewalls between the NMS and
the server, ensure they are configured to allow SNMP queries
through. You can see if the requests are arriving at the server by
running tcpdump port 161. (If you have multiple interfaces, you
will need to specify the correct one via the -i flag.) Note that this
will show if you if the SNMP queries are arriving at the system - it
will not show you if the local systems firewall is rejecting the
packets.
Ready to try
LogicMonitor?
Try LogicMonitor free for 14
SIGN UP FREE
Working at Scale
If you have more than one server to manage, you will need to set up
SNMP access on all your devices. This is easily done with any of the
popular configuration management tools (Ansible, Chef, Puppet,
CFEngine, etc).
LogicMonitor.com
E-BOOK
The Comprehensive
Guide to SNMP
This is not specific to SNMP - the same practices should be used for
the management of any configuration across more than one server.
But ensuring that your SNMP configuration files are managed by a
configuration management tool makes it easy to ensure it is
correctly deployed to all servers; and allows easy changing of SNMP
communities; adoption of SNMP v3, etc.
Conclusion
Hopefully youve gained an understanding of what SNMP is: why it
is used; how it is configured; the type of systems that use it; and
some of the pitfalls in talking about SNMP support. SNMP is the
most widely deployed management protocol; it is simple to
understand (although not always to use), and enjoys ubiquitous
support. While some systems have alternate management systems most notably Windows, which uses WMI in preference - a good
knowledge of SNMP will take you a long way in being equipped to
monitor a variety of devices and servers.
Deliver optimal
performance to
the people you
serve.
LogicMonitors SaaS-based
performance monitoring
platform helps top IT teams
deliver optimal performance
across their deployment.
Visit us online:
www.logicmonitor.com
Share This Content:
"
LogicMonitor.com
LogicMonitor.com
"