Script for reading mod_watch statistics

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

Moderators: Moderators, Developers

Post Reply
Author
Message
crieur.com
Posts: 19
Joined: Fri Mar 11, 2005 3:35 pm
Contact:

Script for reading mod_watch statistics

#1 Post by crieur.com » Fri Mar 11, 2005 3:42 pm

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
ws_apachevirtualhosts.php.txt
ws_apachevirtualhosts.php.txt
(1.03 KiB) Downloaded 958 times

adrianmak
Posts: 7
Joined: Thu Jul 17, 2003 6:31 pm

#2 Post by adrianmak » Mon Aug 15, 2005 9:05 am

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 ?

crieur.com
Posts: 19
Joined: Fri Mar 11, 2005 3:35 pm
Contact:

Script for reading mod_watch statistics version II

#3 Post by crieur.com » Tue Sep 13, 2005 11:18 am

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
cacti_data_template_webserver_apache_virtualhost_v2.xml
template
(4.04 KiB) Downloaded 993 times
ws_apachevirtualhosts2.php.txt
script php (rename it as php)
(1.21 KiB) Downloaded 850 times

Post Reply