Cacti Polling Host
Moderators: Developers, Moderators
Re: Cacti Polling Host
To delete thanks
Re: Cacti Polling Host
php /var/www/cacti-0.8.7g/scripts/cacti_user_stats.php
valid:0 invalid:0 active:U sleeping:U garbage:U uactive:U usleeping:U
this is what i get while i'am logged in.
why are there Results "U" and why is my active session unrecognized please?
valid:0 invalid:0 active:U sleeping:U garbage:U uactive:U usleeping:U
this is what i get while i'am logged in.
why are there Results "U" and why is my active session unrecognized please?
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Cacti Polling Host
At least some of those scripts do fail in our installation due to missing permissions (which we won't resolve due to security policies)
R.
R.
Re: Cacti Polling Host
Hello Gandalf, I have a question, on one of my installation of cacti i have the same result when i launch the php script with www-data user :
sudo -u www-data /usr/bin/php -q /usr/share/cacti/site/scripts/cacti_user_stats.php
valid:0 invalid:0 active:U sleeping:U garbage:U uactive:U usleeping:U
And the same command with root privilege :
sudo /usr/bin/php -q /usr/share/cacti/site/scripts/cacti_user_stats.php
valid:0 invalid:0 active:1 sleeping:0 garbage:0 uactive:1 usleeping:0
my ls -all on the script :
sudo ls -all /usr/share/cacti/site/scripts/cacti_user_stats.php
-rwxr-xr-x 1 root root 5010 2011-02-13 00:21 /usr/share/cacti/site/scripts/cacti_user_stats.php
I don't understand why my www-data user have this answer when he launch your script :/
Do you have a track on which I run to find the fault ?
And i have a question in your ss_poller.php, when the poller time exceed 300 seconds, the value isn't graph.
Why ?
Thanks in advance
sudo -u www-data /usr/bin/php -q /usr/share/cacti/site/scripts/cacti_user_stats.php
valid:0 invalid:0 active:U sleeping:U garbage:U uactive:U usleeping:U
And the same command with root privilege :
sudo /usr/bin/php -q /usr/share/cacti/site/scripts/cacti_user_stats.php
valid:0 invalid:0 active:1 sleeping:0 garbage:0 uactive:1 usleeping:0
my ls -all on the script :
sudo ls -all /usr/share/cacti/site/scripts/cacti_user_stats.php
-rwxr-xr-x 1 root root 5010 2011-02-13 00:21 /usr/share/cacti/site/scripts/cacti_user_stats.php
I don't understand why my www-data user have this answer when he launch your script :/
Do you have a track on which I run to find the fault ?
And i have a question in your ss_poller.php, when the poller time exceed 300 seconds, the value isn't graph.
Why ?
Thanks in advance
Cacti Version - 0.8.8a
Plugin Architecture - 3.1
Poller Type - spine
Server Info - Linux
Web Server - Apache/2.2.22 (Ubuntu)
PHP - 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli)
MySQL - 5.5.29-0ubuntu0.12.04.2
RRDTool - 1.4.7
Plugin Architecture - 3.1
Poller Type - spine
Server Info - Linux
Web Server - Apache/2.2.22 (Ubuntu)
PHP - 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli)
MySQL - 5.5.29-0ubuntu0.12.04.2
RRDTool - 1.4.7
Re: Cacti Polling Host
Try this test code (borrowed from cacti_user.stats.php)tosage wrote:sudo -u www-data /usr/bin/php -q /usr/share/cacti/site/scripts/cacti_user_stats.php
valid:0 invalid:0 active:U sleeping:U garbage:U uactive:U usleeping:U
Code: Select all
<?php
echo get_session_save_path();
function get_session_save_path() {
if(session_save_path() !== "") {
return realpath(session_save_path());
}elseif(function_exists('sys_get_temp_dir')) {
return realpath(sys_get_temp_dir());
}elseif($temp=getenv('TMP') | $temp=getenv('TEMP') | $temp=getenv('TMPDIR') ) {
return $temp;
}else{
return "cannot be determined";
}
}
?>
# sudo -u www-data /usr/bin/php -q /tmp/test.php
(In my environment, its result is "/var/tmp".)
Then,
1) Is your poller running as www-data?
2) In that directory, is there any sess_* file which www-data can read? (And is it created most recently?)
Re: Cacti Polling Host
re Hello noname
I have test your code and the result in my Ubuntu Server system is /var/lib/php5
In this folder i have files prefixed sess_xxxxxxxxxxxxxxxx with www-data:www-data in permission with a rw only for www-data
My Poller is execute from www-data user
I have found my problem, right on the /var/lib/php5 is incorrect.
sudo ls -all /var/lib/ | grep php5
drwx-wx-wt 2 root root 143360 2011-08-01 11:17 php5
I have grant r for others on this folder as my other server which the script function and now it's function perfectly
Thnaks you again for your Help
I have test your code and the result in my Ubuntu Server system is /var/lib/php5
In this folder i have files prefixed sess_xxxxxxxxxxxxxxxx with www-data:www-data in permission with a rw only for www-data
My Poller is execute from www-data user
Code: Select all
MAILTO=root
*/5 * * * * www-data php /usr/share/cacti/site/poller.php >/dev/null 2>/var/log/cacti/poller-error.log
sudo ls -all /var/lib/ | grep php5
drwx-wx-wt 2 root root 143360 2011-08-01 11:17 php5
I have grant r for others on this folder as my other server which the script function and now it's function perfectly
Thnaks you again for your Help
Cacti Version - 0.8.8a
Plugin Architecture - 3.1
Poller Type - spine
Server Info - Linux
Web Server - Apache/2.2.22 (Ubuntu)
PHP - 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli)
MySQL - 5.5.29-0ubuntu0.12.04.2
RRDTool - 1.4.7
Plugin Architecture - 3.1
Poller Type - spine
Server Info - Linux
Web Server - Apache/2.2.22 (Ubuntu)
PHP - 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli)
MySQL - 5.5.29-0ubuntu0.12.04.2
RRDTool - 1.4.7
Who is online
Users browsing this forum: No registered users and 0 guests