Tags

, ,


svcmon-online

svcmon-report

I managed to set up the svcmon to monitor the V7000. Here is my how to:

1) Create passwordless SSH user svcmon
Use ssh-keygen to generate a key pair, then create a new user named svcmon (in the admin group) in V7000 and grant the public key.

2) Install the svcmon, I wrote a bash script to do it.

#!/bin/bash

# Intalled in CentOS 6.5

# Install perl and its modules
yum -y install perl-5.* perl-Compress-Zlib-* perl-BSD-Resource-* mod_perl-* perl-Digest-SHA1-* perl-Digest-HMAC-* perl-Socket6-* \
perl-IO-Zlib-* perl-GD-* perl-String-CRC32-* perl-HTML-Parser-* perl-Net-DNS-* perl-Net-SSLeay-* perl-XML-Simple-* \
perl-HTML-Tagset-* perl-Net-IP-* perl-SGMLSpm-* perl-DBI-* perl-DBD-MySQL-* perl-XML-Parser-* perl-GD-Graph-* \
perl-IO-Socket-INET6-* newt-perl-* perl-Archive-Tar-* perl-DBD-Pg-* perl-GDTextUtil-* perl-URI-* perl-libwww-perl-* \
perl-IO-Socket-SSL-* perl-Time-Piece-* perl-GD*

# Install postgresql
yum -y install postgresql postgresql-server* && service postgresql initdb && service postgresql start && chkconfig postgresql on

# Configure postgresql
sed -i ‘s/host/#host/g’ /var/lib/pgsql/data/pg_hba.conf
sed -i ‘s/local/#local/g’ /var/lib/pgsql/data/pg_hba.conf
echo “local all all trust” >> /var/lib/pgsql/data/pg_hba.conf
echo “host all all 127.0.0.1/32 trust” >> /var/lib/pgsql/data/pg_hba.conf
service postgresql restart

# Install XML style transformation library
yum -y install libxslt-*

# Create working directories
mkdir /svcmon /svcmon/backup /svcmon/bin /svcmon/config /svcmon/iostats /svcmon/report && chmod 777 /svcmon/report

# Download the svcmon scripts (Written by Yoshimichi Kosuge)
cd /svcmon/bin && wget “https://www.ibm.com/developerworks/mydeveloperworks/blogs/svcmon/resource/Download/svcmon_V0.8.zip” && unzip * && rm -rf *zip*

# Create svc DB
perl /svcmon/bin/svcdb.pl –create –dbhost 127.0.0.1 –dbname svcdb –dbuser postgres –dbpwd password

# Replace the admin user with svcmon in the svcperf.pl script
sed -i ‘s/admin/svcmon/g’ /svcmon/bin/svcperf.pl

3) Now you are ready to use it:

# Collect performance data from V7000
# interval can be 1-60 minutes, V7000-SVC1 is the V7000 DNS name or IP address
perl /svcmon/bin/svcperf.pl –svc V7000-SVC1 -interval 5 –dir /svcmon/iostats/ –dbhost 127.0.0.1

# Check the performance time rang
perl /svcmon/bin/svcdb.pl –list –dbhost 127.0.0.1

# Generate Report, V7000-01 is the cluster name, 60 means 60 minutes since the starting time
perl /svcmon/bin/svcreport.pl –cluster V7000-01 –from \”2014-01-01 00:00:00\” –for 60 –dir /svcmon/report/ –dbhost 127.0.0.1

The script can be downloaded here.

References:

http://pic.dhe.ibm.com/infocenter/storwize/ic/index.jsp?topic=%2Fcom.ibm.storwize.v7000.doc%2Fsvc_clicommandscontainer_229g0r.html

https://www.ibm.com/developerworks/community/blogs/svcmon/?lang=en

 

Advertisements