I have a cacti installation on a RPI for about a year now and it works very well
The tutorial put together by n00badmin helped me a lot with that, it's a great tutorial.
Recently I've embarked on a project of monitoring a second raspberry Pi with the cacti that is installed on the first Pi that I have. In other words the first Pi has all the heavy stuff on it (MySQL, PHP, Cacti, etc.) and I use it to collect data from itself, but now I want to use it also to collect data from the second Pi.
I have successfully added the second Pi as a host and the first Pi is able to collect and graph data from it which is obtained through SNMP. I've done this by installing and configuring snmp and snmpd on the second Pi. But I just don't seem to be able to collect data through bash scripts that should run on the second Pi (on which Cacti is not installed). The fundamental problem is that I don't even know how this should be possible. What is the protocol used by Cacti to run scripts on another Linux machine (in this case on the second Pi)? What user does it use to run those scripts? Can it run those scripts at all?
Let me give you an example. I want to run a bash script on the second Pi to read a temperature value from a DS18B20 temperature sensor. This works like a charm on the first Pi, because the script runs on the same machine onto which Cacti is installed (note that on the first Pi it's actually not a bash script, but a Perl script, but that shouldn't make any difference):
And this is what I'm attempting on the second Pi:
While the first is OK, the second never puts any value on its graph (the graph is always empty). I suspect that the script is never executed on the second Pi. I made sure that the absolute path is correct and also that everybody has rights to read it and to execute it. Still nothing.
Can anybody help me understand what needs to be done in order to be able to run shell scripts on a Pi which does not have Cacti installed, run by the Cacti installed on another Pi?