Verlihub Stats (user count and sharesize)

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Post Reply
Author
Message
cyberwolf
Posts: 1
Joined: Wed Mar 21, 2007 6:01 am
Location: Romania

Verlihub Stats (user count and sharesize)

#1 Post by cyberwolf » Wed Mar 21, 2007 6:17 am

Hy.

I've managed to make my first script/template for Cacti.
It shows the current user count and share size from Verlihub. You must have STATS plugin loaded and running in verlihub for this to work.

To make it work follow this steps :
1. edit the 2 perl scripts and enter a username and password that can access the verlihub table in mySQL (it must be a mySQL user, not a linux user :D ).
2. copy the 2 Perl scripts to your cacti/plugins folder.
3. import the 2 XML templates
4. create the graphs, and you should be set.

NOTE : look in the XML file, you might need to change the path to perl according to your system's settings (for me it's /usr/bin/perl but on other systems might be /usr/local/bin/perl)

Happy "graphing" :-)
Attachments
VerliHub_Stats.zip
the scripts
(973 Bytes) Downloaded 1139 times
verlihub_share_size.xml
the template for share size
(7.06 KiB) Downloaded 1281 times
verlihub_user_count.xml
the template for user count
(7.06 KiB) Downloaded 1414 times
graph_image_sharesize.png
the sharesize looks like this
graph_image_sharesize.png (16.31 KiB) Viewed 10778 times
graph_image_usercount.png
the user count looks like this
graph_image_usercount.png (15.1 KiB) Viewed 10778 times

hgd26
Posts: 25
Joined: Fri Oct 06, 2006 5:36 am

Re: Verlihub Stats (user count and sharesize)

#2 Post by hgd26 » Wed Mar 21, 2007 8:02 am

My suggestion

Little fix to perl scripts to use remote DB and diferent DB:

Code: Select all

my $db_user = 'user_name';
my $db_pass = 'password';

my $dbh = DBI->connect('DBI:mysql:verlihub', $db_user, $db_pass)
    or die "Couldn't connect to database: " . DBI->errstr;

replace with

Code: Select all

my $db = 'verlihub_db';
my $host = 'db_host';
my $user = 'verlihub_user';
my $pass = 'verlihub_password';

# Connect to the database.
my $dbh = DBI->connect("DBI:mysql:database=$db;host=$host",
                                         $user, $pass,
                                         {'RaiseError' => 1});


enzake
Posts: 1
Joined: Sat Oct 18, 2008 5:43 pm

#3 Post by enzake » Sat Oct 18, 2008 5:44 pm

can you do also a script for bandwitdh consumed included? thx!

Post Reply