Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


[solved] poller opens ss_host_cpu.php in editor

 
Post new topic   Reply to topic    Cacti Forum Index -> Help: Windows Specific
Author Message
Mr_Smoke



Joined: 01 Sep 2008
Posts: 4

PostPosted: Mon Sep 01, 2008 3:56 am    Post subject: [solved] poller opens ss_host_cpu.php in editor Reply with quote

Good morning everyone,

I have an almost fully-working install of Cacti 0.8.7b running on Windows 2003 Server :
- Apache 2.2.8 (Win32)
- PHP 5.2.5
- MySQL 5.0.51a
- Net-SNMP 5.4.1.2-1
- rrdtool 1.2.15-cygwin-1.5.20

I'm happily graphing disk usage, bandwidth etc. However, using the Host MIB CPU usage template yields strange results.
Everytime the poller runs (5 mins), it will open the file ss_host_cpu.php in an editor (notepad++ in this case) as many times as there are CPUs to monitor.
The scheduled task will then wait for me to close the editor (twice in my case, two CPUs on that host), and then resume normal operations.
Needless to say, CPU is not getting graphed, since that script is obviously never run.

Wild guess : it looks like the command that is passed to the system (probably some kind of php -q c:\cacti\scripts\ss_host_cpu.php) is actually broken into two tasks, the second one being just the script name, and therefore opens it in the associated editor.
I have no idea why though, and that's where your help would be appreciated.

Cheers,

Romain
Back to top
BSOD2600
Cacti Moderator


Joined: 08 May 2004
Posts: 6769
Location: WA, USA

PostPosted: Mon Sep 01, 2008 8:07 pm    Post subject: Reply with quote

I would only have the scheduled task run poller.php.

I'd guess its opening up textpad since .php is associated with that program, instead of php.exe (as it should).

If you don't want to see those popup windows every 5 min, then don't have the scheduled task run under your user account which is logged into the PC.
Back to top
Mr_Smoke



Joined: 01 Sep 2008
Posts: 4

PostPosted: Tue Sep 02, 2008 7:27 am    Post subject: Reply with quote

BSOD2600 wrote:
I would only have the scheduled task run poller.php.

I'd guess its opening up textpad since .php is associated with that program, instead of php.exe (as it should).

Oh so poller.php is directly calling whatever script it needs to call then ? That would indeed explain the observed behaviour. I admit I was too lazy to track it down through the code ... Will try your suggestion.

BSOD2600 also wrote:

If you don't want to see those popup windows every 5 min, then don't have the scheduled task run under your user account which is logged into the PC.

Ok that makes sense indeed, and I was about to investigate that issue as well. Thanks for the tip. I might have it run under the SYSTEM account.

Cheers,

Romain
Back to top
Mr_Smoke



Joined: 01 Sep 2008
Posts: 4

PostPosted: Tue Sep 02, 2008 8:31 am    Post subject: Reply with quote

Working with windows is just great ...

Associating PHP files with php.exe is not enough, you need to edit the association and make sure it reads
Code:
C:\path\to\php.exe "%1" %*

otherwise your script parameters will just get lost in the process.
Oh, and if you had a previous association before that, you need to restore to the original association, otherwise you won't see the "Advanced" button. Yay.

So now, using the script from the command line works. Meaning if I type this in the command prompt :
Code:
C:\cacti\scripts\ss_host_cpu.php host.name.here 7 2:161:500:public:::MD5::DES: get usage 1
I get an integer answer that is consistent with the CPU load.
Why then would Spine be unable to get the same data ? I get the classic "Empty result" and subsequent "Result from SCRIPT not valid." in the logs.
Of course, I will shortly test reverting to cmd.php poller instead, but why shouldn't it work with spine ?

Thanks for your help,

Romain
Back to top
BSOD2600
Cacti Moderator


Joined: 08 May 2004
Posts: 6769
Location: WA, USA

PostPosted: Tue Sep 02, 2008 12:52 pm    Post subject: Reply with quote

Yes, poller.php is the only thing a user needs to run under normal circumstances. It'll fire off the scripts, etc which are needed to run.

Spine should work, but can be a lot more finicky than cmd.php. You using its latest version? I hope that path to php doesn't contain any spaces, otherwise that'll be another source of headache.
Back to top
Mr_Smoke



Joined: 01 Sep 2008
Posts: 4

PostPosted: Wed Oct 01, 2008 9:27 am    Post subject: Reply with quote

Okay so poller.php works fine.

As far as spine is concerned, all the paths are correct. However, since it's workign ok with the php poller, I'm probably going to leave it as is. If it isn't broken ...

Thanks
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: Windows Specific All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group