[SOLVED] Poller isn't polling.

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

hosierd
Posts: 19
Joined: Wed Jun 09, 2004 10:55 am
Location: Rockville, Maryland

Post by hosierd »

gandalf wrote:???
You've found the current workaround already. What are you missing now?
Reinhard
Yes, the workaround allows me to access the cacti application. I was wondering if the workaround was at all related to the current showstopper I have. Essentially, the cactiuser does not seem to update or create rrd's or the cacti log. If I su to the cactiuser I can create, modify, and delete files in the /rra & /log directories. But when the crontab for the cacti user runs, devices are polled but rrds are not updated and the cactilog is not updated. If I run the same command as root instead of cactiuser, the rrds get updated and the log is updated. I then su to the cactiuser and I can manually modify and delete these rrds and the cacti.log file. I should also point out that if I create a new device or graphs in the console, the rrds are not created until I run the poller as root. Again, the cactiuser has the necessary permissions to all relevant directories, in fact the cactiuser is the owner of the entire cacti directory structure. Additionally, when using the system utilities to view the cacti log I can't purge. An error is returned. If I then ssh to the server, su to the cactiuser, I can delete the cacti.log file. If I next try to view the log (that I just deleted) via the system utility, it errors out saying that it can't touch cacti.log. Again, when SUd to cactiuser in the cacti/log directory I can touch cacti.log and create the empty file.

I am at a standstill. This is a clean install. The server is running sles 9. I've run cacti 0.8.6 on a sles 9 box in the past without having this problem.

It seems like a rights issue but when I su to cactiuser I have the rights to everything but the rrds and the log are not modified. The crontab (and the poller settings in cacti) are set for 1 minute polling. According to my /var/log/messages file, the polling commands are being exeuted without error. If I run the commands as cactiuser to stdout I don't have errors retrieving data but I see no entries for updating rrds. Time stamps on the rrds and cacti.log indicate cacti is only updating these files when I've run cacti as root.

What am I doing wrong ?

Sorry for the long post. I welcome any suggestions.

Doug
mickh
Posts: 33
Joined: Tue Mar 11, 2008 12:50 pm

Post by mickh »

I expect you have defined graphs for the devices and the devices appear as "up" in the devices list.

I don't know why, but the problems I had got sloved when I double check the cactiuser access-rights and also made shure, that the group-id was the same as the www-user. I'm not shure if this had solved my problems, but it works now.

(M)
hosierd
Posts: 19
Joined: Wed Jun 09, 2004 10:55 am
Location: Rockville, Maryland

[SOLVED] POller isn't polling - Major Progress !

Post by hosierd »

I've made significant progress.

Per mickh's suggestion (thanks), I changed the group ownership of the cacti directory structure to www (the apache2 user group on this box) and things really took off. I also modified the syntax I was using in the cactiuusers (cactiu) crontab file. I had used a -q instead of -f. The cactiu crontab entry is now:

*/1 * * * * /usr/local/bin/php -f /usr/local/cacti/v0.8.7b/poller.php > /usr/local/cacti/v0.8.7b/log/poller.log 2>&1

I still have a strange problem.

Specifically, I am unable to use the system utilities to look at the cacti.log file. When I try to view it from the system utilities I get the following error message:

Warning: touch() [function.touch]: Unable to create file ./log/rrd.log because Permission denied in /usr/local/cacti/v0.8.7b/lib/functions.php on line 526

Strange given the fact that I can su to cactiu and issue the command touch log/rrd.log and it works.

Anyone else run into this issue ?

Doug
cacti@superdoper.net
Posts: 1
Joined: Fri Apr 25, 2008 3:27 am

Same problem but with complications

Post by cacti@superdoper.net »

I have exatly the same problem but in my case I am trying to get cacti to work on my NAS box:

There is NO root account in /etc/passwd (or anywhere else)
Apache is run as admin
The PGRP apache runs as is 10886
I have done
chown -R admin.10886 rra (as well as other combinations)
chmod 6777 rra (again with the other combinations)
php poller.php (and tested the other varoius flags mentioned here)

I still cant get any graphs to be created in rra. I also have the problem with the log file not being created.

Can anyone help me out?
charlielamm
Posts: 19
Joined: Mon Feb 26, 2018 3:37 pm

Re: [SOLVED] Poller isn't polling.

Post by charlielamm »

Hi there:
I had the same issue...I chmod 777'd all the cacti files, and then followed the symlinks for rra and logs and did the same. Works now.

So if you are doing this on a VM then snap it and try this. If it fixes, revert and then try narrowing down the issue. I am still trying to narrow it down but at least I've isolated the issue to file;/folder rights.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: [SOLVED] Poller isn't polling.

Post by netniV »

That is quite bad as you've basically given read/write/delete access to everything and everyone.

The website needs read permissions to any files under the cacti folder, with write access to the log/cache folders. The poller user (via cron) needs the same sort of access plus write to the rra folder.

If you have selinux installed that can cause issues too.

During installation, the website actually details what permissions are needed for the website. Unfortunately, it doesn't check the permissions as the poller user since it doesn't actually know what user the poller will be run is (it's outside of its control).

Code: Select all

drwxrwxr-x   6 root cacti   4096 Feb 11 17:40 cache
drwxrwxr-x   2 root cacti   4096 Mar  2 00:00 log
drwxrwxr-x   5 root cacti   4096 Feb 11 17:40 resource
drwxrwxr-x 488 root cacti  20480 Mar  1 07:42 rra
drwxrwxr-x   2 root cacti   4096 Feb 16 05:47 scripts
These folders need to be writeable by cacti during installation if you are importing templates, etc. You should make the scripts/resource readonly to the website afterwards.

For a remote poller, cacti needs read/write access to all files because it synchronises the files via the database.

The poller is normally run via cron and on systems where the packages are used, there is a cacti user created which is also used in the /etc/cron.d/cacti file. On my test system, where I built cloned from github and created the poller cron manually, I use www-data because that's what apache runs as on Ubuntu. That user should be able to write to the above folders so it can create the rra/*.rrd files.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests