error when running poller.php from the command line
Moderators: Developers, Moderators
-
- Posts: 23
- Joined: Mon Nov 21, 2005 4:28 am
- Location: Spain
error when running poller.php from the command line
This is quite strange, since it is telling me to run it from the command line, which is exactly what I am doing!!!
C:\cacti>c:\cacti\poller.php
Content-type: text/html
X-Powered-By: PHP/4.3.8
<br><strong>This script is only meant to run at the command line.</strong>
C:\cacti>php.exe c:\cacti\poller.php
Content-type: text/html
X-Powered-By: PHP/4.3.8
<br><strong>This script is only meant to run at the command line.</strong>
C:\cacti>
I am running it with the following configuration:
Windows 2003 Server
IIS 6.0 all SPs applied
php 4.3.8 (as shown in the errors)
cacti-0.8.6g
cacti-cactid-0.8.6f-1
Any ideas? I'm not updating my rrds because of this, please help.
C:\cacti>c:\cacti\poller.php
Content-type: text/html
X-Powered-By: PHP/4.3.8
<br><strong>This script is only meant to run at the command line.</strong>
C:\cacti>php.exe c:\cacti\poller.php
Content-type: text/html
X-Powered-By: PHP/4.3.8
<br><strong>This script is only meant to run at the command line.</strong>
C:\cacti>
I am running it with the following configuration:
Windows 2003 Server
IIS 6.0 all SPs applied
php 4.3.8 (as shown in the errors)
cacti-0.8.6g
cacti-cactid-0.8.6f-1
Any ideas? I'm not updating my rrds because of this, please help.
-
- Posts: 23
- Joined: Mon Nov 21, 2005 4:28 am
- Location: Spain
As you can see I have been doing 2 tests, one calling directly to poller.php (i have already set windows to start php.exe to run it) and another try with php.exe c:\cacti\poller.php. None of them works.
C:\cacti>c:\cacti\poller.php
Content-type: text/html
X-Powered-By: PHP/4.3.8
<br><strong>This script is only meant to run at the command line.</strong>
C:\cacti>php.exe c:\cacti\poller.php
Content-type: text/html
X-Powered-By: PHP/4.3.8
<br><strong>This script is only meant to run at the command line.</strong>
C:\cacti>
Any idea on the subject?
C:\cacti>c:\cacti\poller.php
Content-type: text/html
X-Powered-By: PHP/4.3.8
<br><strong>This script is only meant to run at the command line.</strong>
C:\cacti>php.exe c:\cacti\poller.php
Content-type: text/html
X-Powered-By: PHP/4.3.8
<br><strong>This script is only meant to run at the command line.</strong>
C:\cacti>
Any idea on the subject?
Possibly a user rights problem. I suggest you read the guide in my signature. Does it work under an admin account?
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
-
- Posts: 23
- Joined: Mon Nov 21, 2005 4:28 am
- Location: Spain
Yes I'm using an admin account, so permissions should not be a problem. I have read the guide in your signature. There were some points that I had missed, such as:
8. Give the user who will be running the scheduled task, modify rights to:
If using PHP 4: c:\php\mibs\.index
but it still does not work. I still get the same error telling me to use the command line which is what I am doing.
Maybe the problem resides in the way Windows throws the execution of poller.php. I have had a look at the code in poller.php and found the following:
if (!isset($_SERVER["argv"][0])) {
die("<br><strong>This script is only meant to run at the command line.</strong>");
}
What is the meaning of the first line? I have commented the whole 3 lines and then tried again. The execution of poller.php continues and it runs another window called cactiplus in which cactid is ran. Is this the behaviour expected? Even though poller.php seems to throw the execution of cactid, the RRAs are not updated either. There must be an issue in the way Windows/PHP manage to communicate 'argv' variable.
Any ideas after this comments?
8. Give the user who will be running the scheduled task, modify rights to:
If using PHP 4: c:\php\mibs\.index
but it still does not work. I still get the same error telling me to use the command line which is what I am doing.
Maybe the problem resides in the way Windows throws the execution of poller.php. I have had a look at the code in poller.php and found the following:
if (!isset($_SERVER["argv"][0])) {
die("<br><strong>This script is only meant to run at the command line.</strong>");
}
What is the meaning of the first line? I have commented the whole 3 lines and then tried again. The execution of poller.php continues and it runs another window called cactiplus in which cactid is ran. Is this the behaviour expected? Even though poller.php seems to throw the execution of cactid, the RRAs are not updated either. There must be an issue in the way Windows/PHP manage to communicate 'argv' variable.
Any ideas after this comments?
- TheWitness
- Developer
- Posts: 17061
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
It keeps people from spawning your poller process from the web server. Please verify that safe mode if off. Also, make sure the following is set in your PHP.INI file "register_argc_argv = On"
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
-
- Posts: 23
- Joined: Mon Nov 21, 2005 4:28 am
- Location: Spain
Yes, you were right. I had my php.ini set as
register_argc_argv = Off
I have just changed it to 'On' and it seems to work now. Calling poller.php updates my RRAs, but not all of them. I'll have a look at the error messages more deeply and try to solve the issues myself before posting anything else ;)
Thanks a lot for your help, and good work.
register_argc_argv = Off
I have just changed it to 'On' and it seems to work now. Calling poller.php updates my RRAs, but not all of them. I'll have a look at the error messages more deeply and try to solve the issues myself before posting anything else ;)
Thanks a lot for your help, and good work.
hi
i also have thiss error:
C:\wwwroot>cacti.cmd
C:\wwwroot>C:\php\php.exe C:\wwwroot\cacti\poller.php
X-Powered-By: PHP/4.4.1
Content-type: text/html
<br><strong>This script is only meant to run at the command line.</strong>
C:\wwwroot>
Register Argc Argv: on
PHP Safe mode: on
thanks if someone can help...
i also have thiss error:
C:\wwwroot>cacti.cmd
C:\wwwroot>C:\php\php.exe C:\wwwroot\cacti\poller.php
X-Powered-By: PHP/4.4.1
Content-type: text/html
<br><strong>This script is only meant to run at the command line.</strong>
C:\wwwroot>
Register Argc Argv: on
PHP Safe mode: on
thanks if someone can help...
Visit my web site: http://www.websat-telecom.com
And did you follow the same advice we gave jagbarcelo?
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
- TheWitness
- Developer
- Posts: 17061
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Please edit include/config.php, then goto line 137 or so. You will see an array that contains things like "poller.php", "cmd.php", etc. Please add "script_server.php", "ss_fping.php" to that list, save and then retry. Please post your results.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Re: error when running poller.php from the command line
Hi, I have the same problem here. I am using the latest Cacti verstion 0.8.7h.
I have check and make sure that my php.ini has these:
register_argc_argv = On
safe_mode = Off
But, I still get the same error.
I checked the include/config.php. There are no line 137, no section where it has cmd.php/poller.php.
Can anybody help?
Thanks in advance.
I have check and make sure that my php.ini has these:
register_argc_argv = On
safe_mode = Off
But, I still get the same error.
I checked the include/config.php. There are no line 137, no section where it has cmd.php/poller.php.
Can anybody help?
Thanks in advance.
- TheWitness
- Developer
- Posts: 17061
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: error when running poller.php from the command line
Please post a fresh post. This one is a bit old. In that post, please include screen shot's of what you are attempting to describe.
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Who is online
Users browsing this forum: No registered users and 3 guests