Main Pollor unknown/Down

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

Moderators: Developers, Moderators

Post Reply
thulan
Posts: 8
Joined: Tue Oct 17, 2017 1:18 am

Main Pollor unknown/Down

Post by thulan »

Hi All,

I have installed cacti version 1.1.35 and 1.1.36.
Then I added some devices and added some graphs. I have set the pollor interval for 5 minutes.
And cron job also for 5 minutes.

*/5 * * * * php /path/cacti/poller.php

But non of the graphs didn't start drawing any thing. Graph was empty. Even it did not start drawing local machine graphs.

I set user and group to www-data for all the files in cacti directory. Re-built SNMP and Pollor(by running pollor.php) few times. But non of them worked. And restarted all service and changed cron job user for root and cacti and www-data. But graph were empty.


Then I removed all the files belong cacti 1.1.35 and dropped the cacti database and db user. Then I installed version 1.1.27 and imported the cacti database and created user.

Then I restarted all serveries and re-built SNMP cache and pollor. Then I change user and group to www-data for all files in Cacti directory.

Then I added new device and new graphs. This was the same device I tried for 1.1.35 and 1.1.36 versions.
And re-built the pollor(by running pollor.php). I have set the pollor interval for 5 minutes.
And cron job also for 5 minutes. same cron job as early situations.

Then graphs were created. And started drawing. Everything showing OK. But Still Main Poller status is unknown/down.

Can anyone explain what is the wrong here? and any advice?
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Main Pollor unknown/Down

Post by netniV »

You have specified 'php' as a user because you have missed off the user I suspect.
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
thulan
Posts: 8
Joined: Tue Oct 17, 2017 1:18 am

Re: Main Pollor unknown/Down

Post by thulan »

Without 'php' part we cannot run 'poller.php', right?
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Main Pollor unknown/Down

Post by netniV »

Actually, most PHP files in cacti that are designed to run from the command line, will also have a 'shbang' at the top of the file to tell the system to use PHP to run it.

So even without the PHP before the scriptname if the script was +x it will run directly, be parsed by the shell to use PHP, call PHP with the script name as a parameter.

The cron is wrong though because of this is the normal syntax most people use with the poller cron:

Code: Select all

*/5 * * * * <user> php /path/cacti/poller.php > /dev/null &2>1
You are missing the user.
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
thulan
Posts: 8
Joined: Tue Oct 17, 2017 1:18 am

Re: Main Pollor unknown/Down

Post by thulan »

Ok, So I should mention the user here. It is www-data or root or cacti? how can I decide it?

So is this the problem that Main poller is in "unknown/down" status?
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Main Pollor unknown/Down

Post by netniV »

Yes, it is because you are missing the user. What OS are you running under?
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
thulan
Posts: 8
Joined: Tue Oct 17, 2017 1:18 am

Re: Main Pollor unknown/Down

Post by thulan »

It is Ubuntu 16.04 server. I think it should be www-data, right?
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Main Pollor unknown/Down

Post by netniV »

That would be correct to run the poller as your website user.
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
thulan
Posts: 8
Joined: Tue Oct 17, 2017 1:18 am

Re: Main Pollor unknown/Down

Post by thulan »

It did not work. I changed the user to www-data, cacti and root. But non of them worked as you mention. It cause to stop drawing the graph.

Then again I changed cron job to previous one. (without defining a user). Then it started drawing the graph. But still main poller is unkwon/down status.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Main Pollor unknown/Down

Post by netniV »

Root should never stop the graphing, because root has full access to all files. I am assuming that you are doing this in a file in /etc/cron.d and not via crontab right?
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
thulan
Posts: 8
Joined: Tue Oct 17, 2017 1:18 am

Re: Main Pollor unknown/Down

Post by thulan »

No I am doing it in crontab.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Main Pollor unknown/Down

Post by netniV »

Ah, that would explain the difference then. What user are you specifying for the crontab? If you are using Crontab you don't need to specify the user as you've done that at command line.
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
thulan
Posts: 8
Joined: Tue Oct 17, 2017 1:18 am

Re: Main Pollor unknown/Down

Post by thulan »

Yes, I am using crontab with root permission. Do I need to change it? and How?
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Main Pollor unknown/Down

Post by netniV »

The recommended route is to use a cron file in /etc/cron.d/ normally called cacti. That would use the format that I specified where it runs as a user other than root. Quite often people recommend using the website user to ensure that the permissions and files are readable by both the poller and website.

Using Crontab forces the commands to be run only as root.
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: aminrr24 and 0 guests