Home
Name Modified Size InfoDownloads / Week
Archive 2013-04-26
Screenshots 2011-12-12
svcfront_0.8_beta.zip 2013-04-26 1.4 MB
README.txt 2013-04-26 8.9 kB
Totals: 4 Items   1.4 MB 0
===== SVCMON PHP Frontend =====
Copyright (C) 2011, 2012, 2013
	Gudmundur Orn Ingvarsson (gudm00@gmail.com)
	Sveinn Gudni Gunnarsson (sveinng@gmail.com)

* SVCMON by Yoshimichi Kosuge
at <https://www.ibm.com/developerworks/mydeveloperworks/blogs/svcmon/>

* D3js by Mike Bostock
at <https://github.com/mbostock>

* NVD3 by Novus Partners
at <http://nvd3.org/>

* TinyBox 2 by Michael
at <http://www.scriptiny.com/2011/03/javascript-modal-windows/>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Version 0.8 beta

This mess is written as a frontend to SVCMON
It is incomplete and created only with SVC in mind as we don't use StoreWize.
To implement this fully you may need to change some of SVCFRONT behavior

Currently the graphs only work in Chrome and I'm working on that issue.

===== REQUIREMENTS ======

Required Software includes (And possible others I don't know about)
Apache Web Server
PHP Module for Apache
mb_string module for PHP
short_open_tag = On in php.ini
php postgresql modules

Of course you will need SVCMON 0.6d (https://www.ibm.com/developerworks/mydeveloperworks/blogs/svcmon/) 
!!!! You have to install SVCMON successfully before installing the Frontend !!!!

===== INSTALLING ======

By default the crontab entries below assume you are unpacking the tarball into /usr/local where it will be
installed in /usr/local/svcfront so just edit the lines to suit your needs.

First you'll need to create the extra DB tables needed by running the install_svcfront.sql script
with the psql command "psql < install_svcfront.sql" as the postgres user.

Many tables will not populate correctly until the "extra_tables.pl" has run successfully.

Replace the svcperf.pl file with the one found in this distribution under the bin directory.
It's a good idea to backup your svcperf.pl file before doing this. 

And example crontab for the user that can connect to the svc/storwize devices.
(The aggregates can be run by any user that can execute them. And it might be prudent to comment out the
prune script until you've verified everything works as intended or if you don't want to prune all your sql
tables.)

# m h  dom mon dow   command

# Custom Fillin Data for SVCFRONT
15 */6 * * * cd /usr/local/svcmon/bin; ./extra_tables.pl >> ../log/extra_tables.log 2>&1		
5 02 * * * cd /usr/local/svcmon/bin; ./prune.pl >> ../log/prune.log 2>&1

# VDISK Aggregates
0,10,20,30,40,50 * * * * cd /usr/local/svcmon/bin;./aggregate.pl vdsk day >> ../log/aggregate.log 2>&1
7 0,6,12,18 * * * cd /usr/local/svcmon/bin;./aggregate.pl week vdsk >> ../log/aggregate.log 2>&1
8 */3 * * * cd /usr/local/svcmon/bin;./aggregate.pl month vdsk >> ../log/aggregate.log 2>&1
24 2,14 * * * cd /usr/local/svcmon/bin;./aggregate.pl year vdsk >> ../log/aggregate.log 2>&1

# MDISK Aggregates
1,11,21,31,41,51 * * * * cd /usr/local/svcmon/bin;./aggregate.pl mdsk day >> ../log/aggregate.log 2>&1
8 0,6,12,18 * * * cd /usr/local/svcmon/bin;./aggregate.pl mdsk week >> ../log/aggregate.log 2>&1
12 */3 * * * cd /usr/local/svcmon/bin;./aggregate.pl mdsk month >> ../log/aggregate.log 2>&1
26 2,14 * * * cd /usr/local/svcmon/bin;./aggregate.pl mdsk year >> ../log/aggregate.log 2>&1

# Port Aggregates
2,12,22,32,42,52 * * * * cd /usr/local/svcmon/bin;./aggregate.pl port day >> ../log/aggregate.log 2>&1
*/60 * * * * cd /usr/local/svcmon/bin;./aggregate.pl port week >> ../log/aggregate.log 2>&1
14 */3 * * * cd /usr/local/svcmon/bin;./aggregate.pl port month >> ../log/aggregate.log 2>&1
28 2,14 * * * cd /usr/local/svcmon/bin;./aggregate.pl port year >> ../log/aggregate.log 2>&1

# CPU Aggregates
2,12,22,32,42,52 * * * * cd /usr/local/svcmon/bin;./aggregate.pl cpu day >> ../log/aggregate.log 2>&1
*/60 * * * * cd /usr/local/svcmon/bin;./aggregate.pl cpu week >> ../log/aggregate.log 2>&1
16 */3 * * * cd /usr/local/svcmon/bin;./aggregate.pl cpu month >> ../log/aggregate.log 2>&1
32 2,14 * * * cd /usr/local/svcmon/bin;./aggregate.pl cpu year >> ../log/aggregate.log 2>&1

# DRIVE Aggregates
4,14,24,34,44,54 * * * * cd /usr/local/svcmon/bin;./aggregate.pl drive day >> ../log/aggregate.log 2>&1
9 0,6,12,18 * * * cd /usr/local/svcmon/bin;./aggregate.pl drive week >> ../log/aggregate.log 2>&1
18 */3 * * * cd /usr/local/svcmon/bin;./aggregate.pl drive month >> ../log/aggregate.log 2>&1
34 2,14 * * * cd /usr/local/svcmon/bin;./aggregate.pl drive year >> ../log/aggregate.log 2>&1

# NODE Aggregates
5,15,25,35,45,55 * * * * cd /usr/local/svcmon/bin;./aggregate.pl node day >> ../log/aggregate.log 2>&1
*/60 * * * * cd /usr/local/svcmon/bin;./aggregate.pl node week >> ../log/aggregate.log 2>&1
10 */3 * * * cd /usr/local/svcmon/bin;./aggregate.pl node month >> ../log/aggregate.log 2>&1
36 2,14 * * * cd /usr/local/svcmon/bin;./aggregate.pl node year >> ../log/aggregate.log 2>&1

# CACHE Aggregates
6,16,26,36,46,56 * * * * cd /usr/local/svcmon/bin;./aggregate.pl cache day >> ../log/aggregate.log 2>&1
*/60 * * * * cd /usr/local/svcmon/bin;./aggregate.pl cache week >> ../log/aggregate.log 2>&1
22 */3 * * * cd /usr/local/svcmon/bin;./aggregate.pl cache month >> ../log/aggregate.log 2>&1
38 2,14 * * * cd /usr/local/svcmon/bin;./aggregate.pl cache year >> ../log/aggregate.log 2>&1

# PARTITION Aggregates
6,16,26,36,46,56 * * * * cd /usr/local/svcmon/bin;./aggregate.pl partition day >> ../log/aggregate.log 2>&1
*/60 * * * * cd /usr/local/svcmon/bin;./aggregate.pl partition week >> ../log/aggregate.log 2>&1
22 */3 * * * cd /usr/local/svcmon/bin;./aggregate.pl partition month >> ../log/aggregate.log 2>&1
38 2,14 * * * cd /usr/local/svcmon/bin;./aggregate.pl partition year >> ../log/aggregate.log 2>&1

===== CONFIGURATION =====

Check the config/svcfront.cfg file for configuration items, including database config.

The final step is to update the www/include/db.php with the correct PostGREsql access information
Create a symbolic link or change your apache configuration to access the www folder and try it out.

Under config there is a svcfront.apache file which can be used to create the configuration on your
apache server needed to respond to and accuratly display as <http://svcfront> (Yes I assume this DNS name)

As a last item on the menu you will need to chown and chmod everything so the perl scripts can run (+x flag)
and the php files can be read by anyone and you should be all set.

===== EXTRA =====

By default the aggregate scripts only look through the _sub tables which only display the alst 26 hours.
If you want to populate an aggregate table with all your data (First time install perhaps) you can run the
aggregate.pl script manuall with the table you want to use, the timerange and add "populate" to the end of 
the line. Word of warning, this will truncate the table in question (The aggregate table) and fully populate
it with everything from your main svcmon table. This can be very time consuming and but quite a bit of load
on your machine, depending the amount of data. Also it can quickly fill your disk if there is alot of data.
In the install folder is a script to fully populate all tables called populate_aggregates.pl -- This will
truncate all aggregate tables and fully populate them with all available data.

p.s. - It's not a terrible idea to run svcperf.pl in a screen and inside a while loop

Example:
while :;do /usr/bin/perl /svcmon/bin/svcperf.pl --svc YOUR_SVC --interval 5 > /svcmon/log/svcperf.log;sleep 20;done

There is a set of scripts to run this automaticly for every SVC you have in your config file. 
Run initcollectors.pl under the bin folder or you can create a link to startcollectors.sh from your init.

Just remember that there are absolute paths in many scripts, if you deviate from the default /usr/local/svcfront
folder things will stop working.

===== PROBLEMS =====

On a Ubuntu machine I had little problems setting this up, but on another Centos I had some problems with the PHP
configuration and quotes. It was resolved by replacing the php.ini with the one from the Ubuntu server. We were
in a hurry and didn't have too much time to spend on finding the configuration in question.

You absolutely need PostGres 8.4 for this installation, Centos comes by default with 8.1 and it doesn't work 
for many reasons. Please upgrade.

Sometimes the pages display negative numbers. That means there is an INSERT in progress, just wait a few secons
and refresh the page.
Source: README.txt, updated 2013-04-26