Apache template does not use SSH at all. But depending from vars specified it could use the different hostnames in wget command.
So cacti user does not require ssh or password and you did everything right.
Are you using the latest PMP version?
cat /usr/share/cacti/scripts/ss_get_by_ssh.php|grep version
$version = ‘1.0.3’;
If not it won’t work with ‘–items gg,gh’ as all items were renamed in 1.0.3.
I had the same problem as SU, and found that this line in ss_get_by_ssh.php was the culprit:
$status_server = 'localhost';
Since I’m trying to monitor a remote server, replacing this with the server’s IP addresses made the graphs work. This is OK for now since I’m only monitoring one server with this plugin, but could prove problematic if I setup monitoring for another server.
Seems like it would be ideal to have this added to the data source template so it could be a per-graph value.
I came here with the same doubt, becouse my servers do not answer to http requests at the address 127.0.0.1 due to the load ballance configuration. I had do restrict the arp response to the interface it came from so as to use IPVSADM to manage the load ballancing.
As bfdonny said, if you change the variable " $status_server = ‘localhost’;", inside the script ss_get_by_ssh.php, to the IP address of the host you want to check, it will work. But this is not a good solution, since I wanted to graph more than one host.
After messing around and reading a lot, I am not a programmer, I came to the simple solution. You just need to edit the “Data Input Methods” of the templates, so as you can insert the option “–use-ssh 0” on the calling command line.
This this the example of what I did for “Percona Get Apache Stats/Apache Bytes IM”
I’m a little late to this discussion but figured I could try and help anyone else that has this same issue. Like others have said the issue is with the localhost being hard coded in the script. When in reality it should be using the --host value supplied from the command line. I am using version 1.1.5 of the script. On line 963 inside the function apache_cmdline there is a line of code:
[PHP]$srv = $status_server;[/PHP]
This is where it is pulling the value from the top section of the script. Which is why if you change it from localhost to your server IP it works. But as Carlos pointed out it will then only work for one host. An alternative to editing every single Data Input Method, I opted to edit the script and change this line to:
[PHP]$srv = $options[‘host’];[/PHP]
This way it will pull the --host value passed in when the script is ran and will work for all your hosts.