Verlihub Stats (user count and sharesize)

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

Moderators: Developers, Moderators

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

Verlihub Stats (user count and sharesize)

Post by cyberwolf »

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 1185 times
verlihub_share_size.xml
the template for share size
(7.06 KiB) Downloaded 1326 times
verlihub_user_count.xml
the template for user count
(7.06 KiB) Downloaded 1458 times
the sharesize looks like this
the sharesize looks like this
graph_image_sharesize.png (16.31 KiB) Viewed 11332 times
the user count looks like this
the user count looks like this
graph_image_usercount.png (15.1 KiB) Viewed 11332 times
hgd26
Posts: 25
Joined: Fri Oct 06, 2006 5:36 am

Re: Verlihub Stats (user count and sharesize)

Post by hgd26 »

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

Post by enzake »

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

Who is online

Users browsing this forum: No registered users and 0 guests