SOURCES: cacti-plugin-lighttpd.patch - merge code from cacti source for ss ...
glen
glen at pld-linux.org
Sun Oct 5 19:13:27 CEST 2008
Author: glen Date: Sun Oct 5 17:13:27 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- merge code from cacti source for ss scripts
---- Files affected:
SOURCES:
cacti-plugin-lighttpd.patch (1.4 -> 1.5)
---- Diffs:
================================================================
Index: SOURCES/cacti-plugin-lighttpd.patch
diff -u SOURCES/cacti-plugin-lighttpd.patch:1.4 SOURCES/cacti-plugin-lighttpd.patch:1.5
--- SOURCES/cacti-plugin-lighttpd.patch:1.4 Sun Oct 5 19:06:24 2008
+++ SOURCES/cacti-plugin-lighttpd.patch Sun Oct 5 19:13:21 2008
@@ -1,11 +1,11 @@
--- lighttpd_stats_1.0.orig/ss_lighttpd_stats.php 2007-02-13 23:47:00.000000000 +0200
-+++ lighttpd_stats_1.0/ss_lighttpd_stats.php 2008-10-05 20:05:31.714708441 +0300
++++ lighttpd_stats_1.0/ss_lighttpd_stats.php 2008-10-05 20:11:44.391167671 +0300
@@ -1,3 +1,4 @@
+#!/usr/bin/php
<?php
//
// +----------------------------------------------------------------------+
-@@ -16,13 +17,10 @@
+@@ -16,15 +17,19 @@
// ss_lighttpd_stats.php <hostname>
//
// As a script server object:
@@ -16,11 +16,20 @@
-/* display no errors */
-error_reporting(0);
--
++/* do NOT run this script through a web browser */
++if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD']) || isset($_SERVER['REMOTE_ADDR'])) {
++ die("<br><strong>This script is only meant to run at the command line.</strong>");
++}
++
++$no_http_headers = true;
+
if (!isset($called_by_script_server)) {
- include_once(dirname(__FILE__) . "/../include/config.php");
+- include_once(dirname(__FILE__) . "/../include/config.php");
++ include_once(dirname(__FILE__) . "/../include/global.php");
array_shift($_SERVER["argv"]);
-@@ -47,8 +45,8 @@
+ print call_user_func_array("ss_lighttpd_stats", $_SERVER["argv"]);
+ }
+@@ -47,8 +52,8 @@
$status = lighttpdStatus::getStatus($host);
$return = '';
@@ -31,7 +40,7 @@
$return .= sprintf('%s:%s ', $cacti_var, $status[$status_var]);
}
}
-@@ -84,7 +82,7 @@
+@@ -84,7 +89,7 @@
throw new Exception('Host not found');
}
@@ -40,7 +49,7 @@
if(!$fh || !is_resource($fh)){
throw new Exception($errstr, $errno);
-@@ -112,20 +110,24 @@
+@@ -112,20 +117,24 @@
throw new Exception('');
}
@@ -70,7 +79,7 @@
$vars[$matches[1]] = intval($matches[2]);
}
}
-@@ -137,5 +139,3 @@
+@@ -137,5 +146,3 @@
}
}
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/cacti-plugin-lighttpd.patch?r1=1.4&r2=1.5&f=u
More information about the pld-cvs-commit
mailing list