This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
simple_snmp [2007/08/28 23:58] adam |
simple_snmp [2016/11/25 22:38] (current) |
||
---|---|---|---|
Line 11: | Line 11: | ||
Most networking devices such as routers (even home consumer routers) and managed switches offer SNMP support. The most common usage of SNMP is in querying for system status information as described above, but it is also possible to write values to a system using SNMP and using certain types of system events as what are called SNMP traps, which are sent to a monitoring system which will generate alerts for the system administrators. Neither SNMP writes or SNMP traps are discussed here. Perhaps they will be in an update at some point. | Most networking devices such as routers (even home consumer routers) and managed switches offer SNMP support. The most common usage of SNMP is in querying for system status information as described above, but it is also possible to write values to a system using SNMP and using certain types of system events as what are called SNMP traps, which are sent to a monitoring system which will generate alerts for the system administrators. Neither SNMP writes or SNMP traps are discussed here. Perhaps they will be in an update at some point. | ||
- | Information is stored in a tree like structure as far as SNMP is concerned. MIBs (Management Information Bases) are essentially like branches on the tree, they are groups of related SNMP data, such as system data, interface data. OIDs (object identifiers) are leaves on the tree, that is, they are individual items of queryable data. Phew. Technical. OIDs are normally numeric values, but thankfully most have human memorable names. MIBs are stored as text files under / | + | Information is stored in a tree like structure as far as SNMP is concerned. MIBs (Management Information Bases) are essentially like branches on the tree, they are groups of related SNMP data, such as system data, interface data etc. OIDs (object identifiers) are leaves on the tree, that is, they are individual items of queryable data, as defined in the MIBs. Phew. Technical. OIDs are normally numeric values, but thankfully most have human memorable names. MIBs are stored as text files under / |
Many network hardware vendors provide MIBs which map their specific hardware information (temperatures, | Many network hardware vendors provide MIBs which map their specific hardware information (temperatures, | ||
Line 91: | Line 91: | ||
==== Set Up Your SNMP Query Host ==== | ==== Set Up Your SNMP Query Host ==== | ||
- | You need a machine to make requests from and this should be the machine which you have in your SNMP configuration on the other machines. For Windows, I don't know what you're going to do, I don't use Windows for anything network related, so you're on your own. You'll probably have to pay someone money for some software, but you could try starting with the snmp command or look at PRTG for graphing, | + | You need a machine to make requests from and this should be the machine which you have in your SNMP configuration on the other machines. For Windows, I don't know what you're going to do, I don't use Windows for anything network related, so you're on your own. You'll probably have to pay someone money for some software, but you could try starting with the snmp command or look at PRTG for graphing, |
On Fedora: | On Fedora: | ||
Line 100: | Line 100: | ||
apt-get install snmp | apt-get install snmp | ||
+ | |||
==== Running SNMP Queries ==== | ==== Running SNMP Queries ==== | ||
Line 107: | Line 108: | ||
snmpwalk -c < | snmpwalk -c < | ||
- | ...where < | + | ...where < |
You can do the same but specify a subset of OIDs to query: | You can do the same but specify a subset of OIDs to query: | ||
Line 117: | Line 118: | ||
snmpwalk -c < | snmpwalk -c < | ||
- | Good huh? | + | for system related OIDs. Good huh? |
==== Graphing Your Output ==== | ==== Graphing Your Output ==== | ||
Line 123: | Line 125: | ||
So, you want to do something useful with your SNMP output, because it's just a great big list of crap? On Linux, use [[http:// | So, you want to do something useful with your SNMP output, because it's just a great big list of crap? On Linux, use [[http:// | ||
- | The following example details how to get bandwidth usage graphs. You can take it further by reading [[http:// | + | The following example details how to get bandwidth usage graphs. You can take it further by reading [[http:// |
=== Install MRTG === | === Install MRTG === | ||
Line 135: | Line 137: | ||
yum install mrtg | yum install mrtg | ||
- | Your distro will probably create you a directory under /var/www for mrtg so try http:// | + | Your distro will probably create you a directory under /var/www for mrtg so try http:// |
Next you need to create some MRTG config files for the hosts you will query: | Next you need to create some MRTG config files for the hosts you will query: | ||
Line 161: | Line 163: | ||
Add the following line to the crontab of a user which is able to write to your web server' | Add the following line to the crontab of a user which is able to write to your web server' | ||
- | | + | '' |
+ | |||
+ | This will make MRTG collect stats via SNMP every 5 minutes. Do the same for any other hosts you wish to graph. Note that I have redirected all standard output and errors to /dev/null, so I don't have to hear about it if it doesn' | ||
+ | |||
+ | And that, my friend, is it. | ||
- | This will make MRTG collect stats via SNMP every 5 minutes. Do the same for any other hosts you wish to graph. | + | ==== Going Further ==== |
- | And that, my friend, is it. You should try graphing CPU, disk and memory usage, system load, component temperatures and so on. MRTG is able to graph anything which you pass it information for and SNMP can make most of that information available over a network. | + | You should try graphing |
TODO: | TODO: | ||
Links | Links |