Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Apr 19, 2019 7:33 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Script for reading mod_watch statistics
PostPosted: Fri Mar 11, 2005 3:42 pm 
Offline

Joined: Fri Mar 11, 2005 3:35 pm
Posts: 19
Hi all,

I have done this little script to read mod_watch statistics because I couldn't find it here and elsewhere on the web.

If you want to make it better, do as you feel.
I didn't export my templates because they are specific and I don't know how to make them generic.


Attachments:
File comment: ws_apachevirtualhosts.php.txt
ws_apachevirtualhosts.php.txt [1.03 KiB]
Downloaded 881 times
Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 15, 2005 9:05 am 
Offline

Joined: Thu Jul 17, 2003 6:31 pm
Posts: 7
then what is your template look like ?
I'm still new on using cacti. At this moment I don't know how to create my own graph template

could you please post it out ?


Top
 Profile  
 
 Post subject: Script for reading mod_watch statistics version II
PostPosted: Tue Sep 13, 2005 11:18 am 
Offline

Joined: Fri Mar 11, 2005 3:35 pm
Posts: 19
Hello,

here's the script I use to graph virtual hosts on apache 1.3


Install the script ws_apachevirtualhosts2.php in your scripts dir
chown +x
chmod cactiuser.cactiuser

Go in Data Input Methods
Create a new "Data Input Methods"

Name : WebServer - Apache -- VirtualHost v2
Type : Script/Command
Input String : <path_php_binary> -q <path_cacti>/scripts/ws_apachevirtualhosts.php <hostname> <virtual>

Click Create to create it

Click On add Input fields

Choose Hostname :
friendly name : hostname
Choose virtual :
friendly name : virtual

Click On add Output fields
Add virtual nammed virtual
friendly name virtual

Click "save"

Go in Data Template
Add
Name : WebServer - Apache -- VirtualHost v2 : check Use Per-Data Source Value (Ignore this Value)
Data Input Method : Choose WebServer - Apache -- VirtualHost v2 in the drop down list

Name : WebServer - Apache -- VirtualHost v2
Internal Data Source Name : VirtualBW

Click Create, the system shows you the fields you can enter.
For me, I will specify hostname and virtual in each of my data Sources, so I enter localhost and SERVER here but itwill be overridden in each data-source.
I Check the checkbox named "Use Per-Data Source Value (Ignore this Value)" for hostname and virtual


For each of your virtualhost Add a DataSource using the template
It is a good idea to set a nice name to the rrd file...

Once done, check in the rra directory if your rrd files are created


Cretae or import a graph template, add inside a Graph Item Inputs of type Data Source

Then for each of your virtuals you can create a graph using this template


Attachments:
File comment: script php (rename it as php)
ws_apachevirtualhosts2.php.txt [1.21 KiB]
Downloaded 808 times
File comment: template
cacti_data_template_webserver_apache_virtualhost_v2.xml [4.04 KiB]
Downloaded 914 times
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 3 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