sort of information you can read from your
sort of information you can read from your system. Index Numbers Now let’s look at something that frequently confuses new SNMP users. Take the following snippet of snmpwalk output describing the disks on our system. Remember: snmpwalk reads the SNMP information available from a server; this is a small chunk of output from the complete listing of information available from snmpd. ………………………………………………………………………………………. enterprises.ucdavis.dskTable.dskEntry.dskIndex.1 = 1 enterprises.ucdavis.dskTable.dskEntry.dskIndex.2 = 2 enterprises.ucdavis.dskTable.dskEntry.dskIndex.3 = 3 enterprises.ucdavis.dskTable.dskEntry.dskPath.1 = /usr enterprises.ucdavis.dskTable.dskEntry.dskPath.2 = / enterprises.ucdavis.dskTable.dskEntry.dskPath.3 = /var enterprises.ucdavis.dskTable.dskEntry.dskDevice.1 = /dev/ad0s1f enterprises.ucdavis.dskTable.dskEntry.dskDevice.2 = /dev/ad0s1a enterprises.ucdavis.dskTable.dskEntry.dskDevice.3 = /dev/ad0s1e ………………………………………………………………………………………. All the partitions listed in snmpd.conf appear here. In the first three lines of the preceding example, we see that the dksIndex is a number from 1 to 3. Using snmptranslate, we learn that these are the reference numbers for the disk partitions we’re monitoring; each partition has been assigned a unique index number. In the next three rows, dskPath, we map the index 1 to /usr, index 2 to /, and index 3 to /var. Then, in our next three entries, dskDevice, we see that there are three entries yet again. How do we use these disparate entries? By working backwards. For example, we see that dskDevice.1 is /dev/ad0s1f. We know that entry 1 is /usr, which tells us that /usr is on this physical device. Because MIB trees are based on the information you want to pull, not the device that you want to access, a partition’s information appears on nonconsecutive lines, making things slightly more difficult to read. But with a little patience, you’ll be able to put it all together. You’ll see index numbers in anything SNMP reports that comes in multiple units. While disk partitions are the first one everyone stumbles across, you’ll find that you’ll get indexes for just about anything. Just look around for a key to these indexes; it’ll be at the top of the section. [3]Enjoyment is not a requirement, merely capability. Long-Term Monitoring with MRTG For long-term monitoring, we’ll use a program that will query SNMP at specific intervals and record the answers it gathers. The most popular programs for this purpose are cricket and MRTG. Both are included in the FreeBSD ports collection and install cleanly on FreeBSD. We’ll discuss MRTG (/usr/ports/net/mrtg) here. MRTG, the Multi-Router Traffic Grapher, uses SNMP data to automatically generate reports on a Web page with nicely labeled graphs. MRTG can run as a daemon, but is traditionally a cron job run 441
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services