Problem with poller.php under Solaris

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

Moderators: Developers, Moderators

Post Reply
Einstein
Posts: 5
Joined: Mon Jun 09, 2008 10:17 am

Problem with poller.php under Solaris

Post by Einstein »

Hi guys,
I've got a problem with cacti under Solaris 10 with Sun Webserver 7U2 and the php-plugin

If I run the poller.php manually or with cron I get everytime the same result.

on the one hand this

Code: Select all

root@t1000 /opt/webdocs/cacti # /opt/sunwebserver7/plugins/php/bin/php poller.php
X-Powered-By: PHP/5.2.0, Sun add-on 1.0
Content-type: text/html
and then a black screen

on the other hand there appear these line

Code: Select all

root@t1000 /opt/webdocs/cacti # /opt/sunwebserver7/plugins/php/bin/php poller.php  --force
sh: /usr/local/php/bin/test: nicht gefunden
sh: /usr/local/php/bin/rrdtool: nicht gefunden
X-Powered-By: PHP/5.2.0, Sun add-on 1.0
Content-type: text/html

06/09/2008 05:24:41 PM - POLLER: Poller[0] Maximum runtime of 298 seconds exceeded. Exiting.
06/09/2008 05:24:41 PM - SYSTEM STATS: Time:298.0887 Method:cmd.php Processes:1 Threads:N/A Hosts:5 HostsPerProcess:5 DataSources:133 RRDsProcessed:0
<br />
<b>Warning</b>:  pclose(): 55 is not a valid stream resource in <b>/opt/webdocs/cacti/lib/rrd.php</b> on line <b>57</b><br />
"nicht gefunden" = not found

I hope anybody got an idea.


MFG Einstein
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

From the error, it would seem the poller cannot find rrdtool. You have rrdtool installed don't you?
[b]Cacti Version[/b] - 0.8.7d
[b]Plugin Architecture[/b] - 2.4
[b]Poller Type[/b] - Cactid v
[b]Server Info[/b] - Linux 2.6.18-128.1.6.el5
[b]Web Server[/b] - Apache/2.2.3 (CentOS)
[b]PHP[/b] - 5.2.9
[b]MySQL[/b] - 5.0.45-log
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.3.2.2
[b]Plugins[/b]PHP Network Managing v0.6.1, Global Plugin Settings v0.6,thold v0.4.1,XMLPort v0.3.5,CactiCam v0.1.5,NetTools v0.1.5,pollperf v0.32,RRD Cleaner v1.1,sqlqueries v0.2,superlinks v0.8,syslog v0.5.2,update v0.4,discovery v0.9,zond v0.34a,hostinfo v0.2,Bloom v0.6.5,mactrack v1.1,weathermap v0.96a,mobile v0.1
Einstein
Posts: 5
Joined: Mon Jun 09, 2008 10:17 am

Post by Einstein »

yes i've installed rrdtool-1.2.19 from sunfreeware.com and the actual mysql database from mysql.org

php version: 5.2.0
mysql version: 5.0.51a

Einstein
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

Einstein wrote:yes i've installed rrdtool-1.2.19 from sunfreeware.com and the actual mysql database from mysql.org

php version: 5.2.0
mysql version: 5.0.51a

Einstein
But is it along this path:

sh: /usr/local/php/bin/rrdtool: nicht gefunden

it's telling you that it cannot find the tool in the path given.
[b]Cacti Version[/b] - 0.8.7d
[b]Plugin Architecture[/b] - 2.4
[b]Poller Type[/b] - Cactid v
[b]Server Info[/b] - Linux 2.6.18-128.1.6.el5
[b]Web Server[/b] - Apache/2.2.3 (CentOS)
[b]PHP[/b] - 5.2.9
[b]MySQL[/b] - 5.0.45-log
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.3.2.2
[b]Plugins[/b]PHP Network Managing v0.6.1, Global Plugin Settings v0.6,thold v0.4.1,XMLPort v0.3.5,CactiCam v0.1.5,NetTools v0.1.5,pollperf v0.32,RRD Cleaner v1.1,sqlqueries v0.2,superlinks v0.8,syslog v0.5.2,update v0.4,discovery v0.9,zond v0.34a,hostinfo v0.2,Bloom v0.6.5,mactrack v1.1,weathermap v0.96a,mobile v0.1
Einstein
Posts: 5
Joined: Mon Jun 09, 2008 10:17 am

Post by Einstein »

after i have set a symbolic link to my rrdtool there will only be the problem with

Code: Select all

sh: /usr/local/php/bin/test: nicht gefunden 

and i dont know what 'test' is
tamnais
Posts: 3
Joined: Mon Jun 30, 2008 5:44 am

Post by tamnais »

Einstein[/quote]

But is it along this path:

sh: /usr/local/php/bin/rrdtool: nicht gefunden

it's telling you that it cannot find the tool in the path given.[/quote]

One thing to check is php.ini settings, if you keep your binaries outside of you open_basedir or safe_mode_exec_dir:

safe_mode = Off
safe_mode_exec_dir =
open_basedir =

This naturally poses a serious security threat. However, I have created a dedicated vhost instaed for cacti and set these within vhost definition:

<VirtualHost _default_:8080>
Port 8080
DocumentRoot "/u/httpd/htdocs1"
...
<IfModule mod_php4.c>
php_admin_flag safe_mode off
php_admin_value safe_mode_exec_dir none
php_admin_value open_basedir none
</IfModule>
</VirtualHost>

Thats's because I'm running cacti for home use, not corporate or something. Or better so, create a cacti vhost and set your open_basedir path to cacti root, put needed executables in safe_mode_exec_dir and check whether the owner is the same as the apache user, to satisfy safe_mode on setting. All withing httpd.conf vhost section, to create specific php local settings, overriding php.ini globals on a vhost basis. Note that running poller from a crontab, will use defaults in php.ini, so to be able to use alternate php.ini, you should set PHPRC system variable to point to your modified php.ini before running the polling script or loosen-up restrictions in default php.ini and strenghtem them afterwards within your httpd.conf for each vhost defined. However, I'm not yet sure, what other security implications this approach may have.

Just a suggestion, but that was a real problem that I've stumbled upon.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest