OVERVIEW
--------
This is cacti templates for creating IO graphs .
INSTALLATION
------------
Prerequisite:
sysstat and net-snmp-util package must install on host which you will be monitor
Package can be download from following link.
https://github.com/markround/Cacti-iostat-templates
1.) CRON JOB
On the server to be monitored, copy scripts/iostat.pl to /usr/local/bin.
Then, define a cron job that creates the iostat.cache file. For example, on
most Linux systems, you should be able to create a file called
/etc/cron.d/iostat with the following contents :
#vim /etc/cron.d/iostat
* * * * * root cd /tmp && iostat -xkd 30 2 | sed 's/,/\./g' > io.tmp && mv io.tmp iostat.cache
This will create the cache file once every minute, and will sample for 30
seconds. You can adjust this figure as necessary, but avoid the trap of setting
it to sample for 60 seconds - as the command will take slightly longer than 1
minute to run, you'll end up with multiple processes running.
2.) SNMPD MODIFICATION
Edit your NET-SNMPD snmpd.conf file to include the following (adjusting the OID
if necessary, see above) :
#vim /etc/snmp/snmpd.conf
pass_persist .1.3.6.1.3.1 /usr/bin/perl /usr/local/bin/iostat-persist.pl
executable permission
#chown root.root /usr/local/bin/iostat-persist.pl
#chmod 755 /usr/local/bin/iostat-persist.pl
Then restart your snmpd process.
#/etc/init.d/snmpd restart
After the cron job has run (check for the existence of the /tmp/iostat.cache file), you should be able to test the script
returns data, using a snmpwalk command similar to the following :
#snmpwalk -v1 -c monitor ca1115 .1.3.6.1.3.1.2
SNMPv2-SMI::experimental.1.2.1 = STRING: "cciss/c0d0"
SNMPv2-SMI::experimental.1.2.2 = STRING: "dm-0"
SNMPv2-SMI::experimental.1.2.3 = STRING: "dm-1"
SNMPv2-SMI::experimental.1.2.4 = STRING: "dm-2"
SNMPv2-SMI::experimental.1.2.5 = STRING: "dm-3"
SNMPv2-SMI::experimental.1.2.6 = STRING: "dm-4"
SNMPv2-SMI::experimental.1.2.7 = STRING: "dm-5"
Or if you have snmp version 2
#snmpwalk -v2c -c monitor ca1115 .1.3.6.1.3.1.2
If you do not see output, go back and double check the previous two steps.
3.) CACTI INSTALLATION
For Linux, copy snmp_queries/linux/iostat.xml to your Cacti server, and place it
under /opt/cacti/resource/snmp_queries/
Next, log into your Cacti web interface, and click on "Import Templates". Import
all of the templates under the templates directory for your OS.
You should then be able to go to the host device you want to monitor, and add
the new data queries. Then, click on "Create Graphs for this Host", and
select the devices you want to graph.
4) Screen Shot
--------
This is cacti templates for creating IO graphs .
INSTALLATION
------------
Prerequisite:
sysstat and net-snmp-util package must install on host which you will be monitor
Package can be download from following link.
https://github.com/markround/Cacti-iostat-templates
1.) CRON JOB
On the server to be monitored, copy scripts/iostat.pl to /usr/local/bin.
Then, define a cron job that creates the iostat.cache file. For example, on
most Linux systems, you should be able to create a file called
/etc/cron.d/iostat with the following contents :
#vim /etc/cron.d/iostat
* * * * * root cd /tmp && iostat -xkd 30 2 | sed 's/,/\./g' > io.tmp && mv io.tmp iostat.cache
This will create the cache file once every minute, and will sample for 30
seconds. You can adjust this figure as necessary, but avoid the trap of setting
it to sample for 60 seconds - as the command will take slightly longer than 1
minute to run, you'll end up with multiple processes running.
2.) SNMPD MODIFICATION
Edit your NET-SNMPD snmpd.conf file to include the following (adjusting the OID
if necessary, see above) :
#vim /etc/snmp/snmpd.conf
pass_persist .1.3.6.1.3.1 /usr/bin/perl /usr/local/bin/iostat-persist.pl
executable permission
#chown root.root /usr/local/bin/iostat-persist.pl
#chmod 755 /usr/local/bin/iostat-persist.pl
Then restart your snmpd process.
#/etc/init.d/snmpd restart
After the cron job has run (check for the existence of the /tmp/iostat.cache file), you should be able to test the script
returns data, using a snmpwalk command similar to the following :
#snmpwalk -v1 -c monitor ca1115 .1.3.6.1.3.1.2
SNMPv2-SMI::experimental.1.2.1 = STRING: "cciss/c0d0"
SNMPv2-SMI::experimental.1.2.2 = STRING: "dm-0"
SNMPv2-SMI::experimental.1.2.3 = STRING: "dm-1"
SNMPv2-SMI::experimental.1.2.4 = STRING: "dm-2"
SNMPv2-SMI::experimental.1.2.5 = STRING: "dm-3"
SNMPv2-SMI::experimental.1.2.6 = STRING: "dm-4"
SNMPv2-SMI::experimental.1.2.7 = STRING: "dm-5"
Or if you have snmp version 2
#snmpwalk -v2c -c monitor ca1115 .1.3.6.1.3.1.2
If you do not see output, go back and double check the previous two steps.
3.) CACTI INSTALLATION
For Linux, copy snmp_queries/linux/iostat.xml to your Cacti server, and place it
under /opt/cacti/resource/snmp_queries/
Next, log into your Cacti web interface, and click on "Import Templates". Import
all of the templates under the templates directory for your OS.
You should then be able to go to the host device you want to monitor, and add
the new data queries. Then, click on "Create Graphs for this Host", and
select the devices you want to graph.
4) Screen Shot
No comments:
Post a Comment