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

--port2 does not work with the "apache" graph type. #129

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run Apache on a port other than 80.
2. # su - cacti -c 'env -i php /var/www/cacti/scripts/ss_get_by_ssh.php --
type apache --host 127.0.0.1 --port2 8080 --items a0,a1'

What is the expected output? What do you see instead?

Expected: a0:545349 a1:11648000
Actually got: a0:-1 a1:-1

What version of the product are you using? On what operating system?

Version 1.1.6 on CentOS 5.3.

Please provide any additional information below.

I made this work by adding the variable in to the get_stats_apache() 
function as shown below.

--- /usr/share/cacti/scripts/ss_get_by_ssh.bak  2010-03-09 
15:57:03.000000000 +0000
+++ /usr/share/cacti/scripts/ss_get_by_ssh.php  2010-03-09 
15:57:13.000000000 +0000
@@ -483,7 +483,8 @@
    $user = isset($options['http-user'])     ? $options['http-user']     : 
$http_user;
    $pass = isset($options['http-password']) ? $options['http-password'] : 
$http_pass;
    $auth = ($user ? "--http-user=$user" : '') . ' ' . ($pass ? "--http-
password=$pass" : '');
-   $cmd = "$cmd wget $auth -U Cacti/1.0 -q -O - -T 5 'http://$srv$url?
auto'";
+   $port2 = isset($options['port2']) ? ':'.$options['port2'] : '';
+   $cmd = "$cmd wget $auth -U Cacti/1.0 -q -O - -T 5 
'http://$srv$port2$url?auto'";
    $str = `$cmd`;

--port2 seems to only be used in get_stats_memcached(). It is probably not 
relevant for OpenVZ but Apache and Nginx could both benefit from having it 
available and Sphinx will definitely benefit from this when that graph is 
implemented.

Original issue reported on code.google.com by ladadad...@gmail.com on 9 Mar 2010 at 4:10

GoogleCodeExporter commented 8 years ago
Thanks, and confirmed.  I wish I'd named the options --ssh-port and
--application-port but I don't want to break backwards compatibility :-(

Original comment by baron.schwartz on 21 Mar 2010 at 12:59

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r431.

Original comment by baron.schwartz on 21 Mar 2010 at 1:30