pwillard
Posts: 19
Joined: Wed Aug 22, 2012 1:55 pm

Re: Cacti Pi

Wed Dec 26, 2012 7:04 pm

Fresh Install - raspbian 1216, followed instructions... installed OK (I guess) and everything seems to be working... but no graphs... ever.

Any ideas?

User avatar
Un4Seen
Posts: 330
Joined: Wed Oct 31, 2012 8:43 am
Location: Cluj-Napoca, Romania
Contact: Website

Re: Cacti Pi

Wed Dec 26, 2012 10:10 pm

Go to Console -> Graph Management -> Click on one of your graphs -> Turn on graph debug mode. See what error message you get there...
Andras
http://iqjar.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Thu Dec 27, 2012 10:00 pm

pwillard wrote:Fresh Install - raspbian 1216, followed instructions... installed OK (I guess) and everything seems to be working... but no graphs... ever.

Any ideas?
Hey pwillard,

Please check the cacti log (Console > System Utilities > Cacti log) and advise if the log is in your local time...you may be graphing in UTC...I ran into a similar issue...

http://n00blab.com/correcting-cacti-timezone/

Otherwise, advise if the log shows any errors.
n00badmin
CCNA JNCIA
www.n00blab.com

yenoromp
Posts: 1
Joined: Tue Jan 22, 2013 7:47 am

Re: Cacti Pi

Tue Jan 22, 2013 7:53 am

Hi
I notice you dont use Sudo in you posts of the commands to get this running.

Do you recomend logging in as root or using the default PI account ?

PAul

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Thu Jun 13, 2013 12:56 pm

yenoromp wrote:Hi
I notice you dont use Sudo in you posts of the commands to get this running.

Do you recomend logging in as root or using the default PI account ?

PAul
On installs like this with many config changes I can't be bothered to continually add sudo to the commands...just my preference.
n00badmin
CCNA JNCIA
www.n00blab.com

User avatar
Un4Seen
Posts: 330
Joined: Wed Oct 31, 2012 8:43 am
Location: Cluj-Napoca, Romania
Contact: Website

Re: Cacti Pi

Mon Dec 02, 2013 2:34 pm

Hi Guys!

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):
Image
And this is what I'm attempting on the second Pi:
Image

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?

Thank you!
Andras
http://iqjar.com

User avatar
Un4Seen
Posts: 330
Joined: Wed Oct 31, 2012 8:43 am
Location: Cluj-Napoca, Romania
Contact: Website

Re: Cacti Pi

Tue Dec 03, 2013 11:02 pm

I managed to solve the mystery. It seems that things are far from being as simple as I thought. You can't just simply run a script on a remote machine through Cacti. While it's simple to do it locally (on the machine onto which Cacti is installed), it has to be done through some protocol on a remote machine. Cacti's protocol of choice for accomplishing this is SNMP. Unfortunately SNMP is overly complicated and it's quite hard to figure out how to customize the snmpd.conf file in order to be able to run remote scripts. But there is a more simple approach. You can run the scripts on the remote machine through SSH. First you need to make sure that the two machines can communicate every time without a password being required. This is achieved through the use of private and public RSA keys. After that the Cacti machine logs onto the remote machine using SSH and executes the script on the remote machine. There is a great tutorial about this here:

http://forums.cacti.net/viewtopic.php?p=130433

Note that this tutorial assumes that the Cacti cron job runs under the user "cacti". In my case this was not true, my cacti does its job through the linux user "www-data". It could be your case too if you followed the installation guide from n00blab.

I hope this can help somebody one day :) Have fun!
Andras
http://iqjar.com

--JayJay--
Posts: 23
Joined: Sat Dec 21, 2013 12:39 pm

Re: Cacti Pi

Sun Jan 26, 2014 4:56 pm

n00badmin wrote:
I hope to cover more topics soon including more snmp polling tips as well as covering some very useful plugins. (ie Nectar & Thold. )

Let me know if anyone has installed successfully.

Thanks!
I have cacti on pi with several plugins (settings, discover, monitor, mobile, thold). It is running fine but not yet fully configured.

I want to add syslog plugin, which is challenging......
I wan to use cacti database for the syslog plugin, but I can not find tutorial on how to confgure this.....

http://forums.cacti.net/viewtopic.php?f=5&t=51806

mcgyver83
Posts: 361
Joined: Fri Oct 05, 2012 11:49 am

Re: Cacti Pi

Fri Mar 28, 2014 5:51 pm

great guide!

Only one question ( newbie :shock: )
I followed this guide http://kimondo.co.uk/plotting-cpu-temperature-ghost/ and from what I understood there is already a db used by rrd.
Why you install mysql server in you guide?

mcgyver83
Posts: 361
Joined: Fri Oct 05, 2012 11:49 am

Re: Cacti Pi

Fri Apr 04, 2014 8:08 pm

up :D

MaliMrav
Posts: 1
Joined: Thu Feb 01, 2018 6:06 am

Re: Cacti Pi

Thu Feb 01, 2018 6:12 am

Hi there,

I seem to be losing my historical data.

I've installed Cacti on my RPi 2 several months ago and it all works fine.

It seems though that for some unknown reason, the only historical data left is a couple of days worth. :o

The only thing I know that has happened to that RPi is that I had rebooted it on that day, using the standard "sudo shutdown -r now" command. Could this have anything to do with losing historical data (and why?)?

Regards,
MM

Return to “Networking and servers”