Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu Jun 20, 2019 8:15 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Verlihub Stats (user count and sharesize)
PostPosted: Wed Mar 21, 2007 6:17 am 
Offline

Joined: Wed Mar 21, 2007 6:01 am
Posts: 1
Location: Romania
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:
File comment: the user count looks like this
graph_image_usercount.png
graph_image_usercount.png [ 15.1 KiB | Viewed 10732 times ]
File comment: the sharesize looks like this
graph_image_sharesize.png
graph_image_sharesize.png [ 16.31 KiB | Viewed 10732 times ]
File comment: the template for user count
verlihub_user_count.xml [7.06 KiB]
Downloaded 1410 times
File comment: the template for share size
verlihub_share_size.xml [7.06 KiB]
Downloaded 1270 times
File comment: the scripts
VerliHub_Stats.zip [973 Bytes]
Downloaded 1134 times
Top
 Profile  
 
 Post subject: Re: Verlihub Stats (user count and sharesize)
PostPosted: Wed Mar 21, 2007 8:02 am 
Offline

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

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

Code:
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:
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});



Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 18, 2008 5:44 pm 
Offline

Joined: Sat Oct 18, 2008 5:43 pm
Posts: 1
can you do also a script for bandwitdh consumed included? thx!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group