HardDisk Capacity Monitoring with MRTG

Harddisk

At times, our lack of attention to what is the amount of disk usage is used by our server. Based on experience, a lot of admin Diskspace ignored this problem. Usually the only monitor traffic in and out that could be "captured" through the existing Ethernet. And if you note, actually we really need information about how the rest of our hard disk capacity, or how much is already in use. Monitoring capacity is necessary if we are using the machines we make, requires hard drive capacity is not to run out. For example for a proxy server, database server, and so on.

We could monitor our hard disk capacity, with the entry into our system and enter the command:

# df -k

With results like the following:

Disk Space

But this will be very difficult for ourselves. Well, to facilitate the monitoring of our hard disk capacity, we can use MRTG. To monitor disk capacity by using MRTG, first we must first determine which partition to be monitored. Here, I will monitor / cache and / cache1 which is a place to store the proxy data. After determining where the partitions to be monitored, we enter the parameters in our snmpd.conf. Here I use the FreeBSD OS.

# nano /usr/local/share/snmp/snmpd.conf

Then enter the parameters:

 
disk /cache
disk /cache1
 

Then restart the snmp, and enter the following command to see the options that can be used:

#snmpwalk -v1 -c public localhost .1.3.6.1.4.1.2021.9

The result will be like this:

SNMP Code

There seemed the parameters that we have put in snmpd.conf (in the yellow box), the writer wants to monitor how much disk capacity that has been used. We already have the required parameters, ie Total Disk Space (red box) and the capacity used terlah (orange box). Here, the author uses 2 (two) pieces of the partition / cache and / cache1. Armed with these parameters, we can create a config file for MRTG.

 
### Global Config Options

#  for UNIX
WorkDir: /other/www/mrtg
LoadMIBs: /usr/local/share/snmp/mibs/UCD-SNMP-MIB.txt,/usr/local/share/snmp/mibs/TCP-MIB.txt,/usr/local/share/snmp/mibs/HOST-RESOURCES-MIB.txt

AddHead[^]: <style><!-- body { text-align: left; background-color: #FFFFFF; font-size: 10pt; font-family: arial, verdana; } --></style>
EnableIPv6: no
Language: indonesia

######################################################################
# System: MustNofee
# Description: Proxy Server
# Contact: NoFee
# Location:
######################################################################


### Cache Space ###
Title[cache]: /cache Space
MaxBytes[cache]: 22296942
PNGTitle[cache]: /cache
Unscaled[cache]: ymwd
Options[cache]: growright, unknaszero, gauge, nopercent
Target[cache]: dskUsed.2&dskUsed.2:public@localhost:
PageTop[cache]: <H1><B>/Cache used on Proxy</B></H1><br>
YLegend[cache]: Megabyte
LegendI[cache]: /cache :
kmg[cache]: KB,MB,GB
LegendO[cache]:
ShortLegend[cache]:

### Cache1 Space ###
Title[cache1]: /cache1 Space
PNGTitle[cache1]: /cache1
MaxBytes[cache1]: 60931274
Unscaled[cache1]: ymwd
Options[cache1]: growright, unknaszero, gauge, nopercent
Target[cache1]: dskUsed.3&dskUsed.3:public@localhost:
PageTop[cache1]: <H1><B>/Cache1 used on Proxy</B></H1><br>
YLegend[cache1]: Megabyte
LegendI[cache1]: /cache1 :
kmg[cache1]: KB,MB,GB
LegendO[cache1]:
ShortLegend[cache1]:

### Cache Total Space ###
Title[cache2]: Total Proxy Space
PNGTitle[cache2]: Total Proxy Space
MaxBytes[cache2]: 83228216
Unscaled[cache2]: ymwd
Options[cache2]: growright, unknaszero, gauge, nopercent
Target[cache2]: dskUsed.2&dskUsed.2:public@localhost: + dskUsed.3&dskUsed.3:public@localhost:
PageTop[cache2]: <H1><B>Total Cache Space used on Proxy</B></H1><br>
YLegend[cache2]: Megabyte
LegendI[cache2]: Space :
kmg[cache2]: KB,MB,GB
LegendO[cache2]:
ShortLegend[cache2]:

 

Noteworthy is, this MRTG config file requires mibs files that must be included in it.

 
LoadMIBs: /usr/local/share/snmp/mibs/UCD-SNMP-MIB.txt,/usr/local/share/snmp/mibs/TCP-MIB.txt,/usr/local/share/snmp/mibs/HOST-RESOURCES-MIB.txt
 

Then, we save this file to hdd.cfg, then run MRTG config file with hdd.cfg:

#mrtg hdd.cfg

We can enter into a crontab, so that the command was executed automatically.

The result can be seen as follows:

Total Cache Proxy :

Total

Cache 1 Proxy :

Cache 1

Cache 2 Proxy :

Cache 2

By using this MRTG facility, we will not be any more trouble to monitor the use of hard drives that have been used by our system.

Hopefully useful ...



Add this page to your favorite Social Bookmarking

Comments  

 
0 # bolon 2010-03-14 09:19
hey nice metode...i've tips to hide some hard disk quoto just visit my blog...you'll find it..leave some comments
Reply | Reply with quote | Quote
 
 
0 # We are specialize in 2010-06-21 08:06
We are specialize in Nike shox: www.sportshoes007.com/.../ kind of shoes : www.sportshoes007.comare suitable for sport ,when we do some outside execises ,we can prepare one ,it’s the newest fashion : www.sportshoes007.com/.../ star like it vey much ,if you like sport , if you are pursuing fashion ,we are the best ,and we have a lots styles for you to choose , Nike Air Max 90 : www.sportshoes007.com/.../ Nike Air Max 2009 and so on …the high quality cheap max ,,there are a lot of air max wholesaler : www.sportshoes007.com/..its worthy to purchase
Reply | Reply with quote | Quote
 

Add comment

Thanks for your comment


Security code
Refresh

About You :

IP Address :
38.107.191.85
United States United States
Browser :
Unknown Unknown
Operating System :
Unknown Unknown

Keep This Site Alive

Your Comment On Tutorial:

Banner
Copyright © 2010 MustNoFee
This blog is 966 days since Jan, 12 2008