smtc0097 / mysql-cacti-templates

Automatically exported from code.google.com/p/mysql-cacti-templates
GNU General Public License v2.0
0 stars 0 forks source link

Add ability to get stats by Curl #120

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
See

http://groups.google.com/group/better-cacti-templates/browse_thread/thread/ae829
754ac16952e

Summary:

My changes:
- add curl collector for apache (ssh is not solution for me)
- separate reusable code from scripts ss_get_*, simpler work with new
collect scripts
- add collect script for xml statistics from statistics-channels bind
9.5, alredy without usable templates but collector works
- change cache management, simpler usage (dedicated function)

Original issue reported on code.google.com by baron.schwartz on 20 Jan 2010 at 3:08

GoogleCodeExporter commented 8 years ago

Original comment by baron.schwartz on 20 Jan 2010 at 3:10

GoogleCodeExporter commented 8 years ago
Most of the changes are copy/paste.  In the last release I re-implemented the
cache-file functionality and changed things a lot, so most of it doesn't apply
anymore and/or I've already duplicated the work :-(  However, getting stats by 
curl
is something I want to integrate.

Summary was: Integrate changes from Artur Kaszuba

Original comment by baron.schwartz on 21 Mar 2010 at 3:44

GoogleCodeExporter commented 8 years ago
The main bit of code here is this:

function get_url_by_curl($url, $auth=null) {

   $c = curl_init();
   if ($auth) {
      curl_setopt($c, CURLOPT_USERPWD, $auth);
      curl_setopt($c, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
   }
   curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 30);
   curl_setopt($c, CURLOPT_URL, $url);
   curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
   $ret = curl_exec($c);
   curl_close($c);

   return $ret;
}

Original comment by baron.schwartz on 21 Mar 2010 at 4:00

GoogleCodeExporter commented 8 years ago
Removing unused labels.

Original comment by baron.schwartz on 16 Apr 2010 at 2:14