Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
hi,
I had cacti running, no problems.
I wanted to install it on drive D and then problems came.
Now, desperately I tried to install it back to c: but get this error when turning debug mode on:
Warning: exec(): Unable to fork [c:\php\php.exe -q c:\inetpub\wwwroot\cacti\scripts\query_host_cpu.php 192.168.0.134 public 1 index] in c:\inetpub\wwwroot\cacti\lib\functions.php on line 777
What nice to reply to your own questions
I'm master in writing monologues
The problem is the permissions of IIS. I changed the account from IUSR_DIETER to \\DIETER\Admin and now it works!
Is IUSR standing for internet user? Then I understand why it didn't work... Users from the internet should'nt be able to run shell commands on my pc...
I want to see who the 5 top users of bandwidth are. I use a program called windump to do it. So I open a pipe with popen to windump.exe and capture the output. Since this is a never ending stream of packets I put the fread() in an endless loop. Thought my CPU would go to 100 % but this does not seem to be the case. BUT, it seems like he waits to have an amount of packets before processing them. This is bad because I want to update a database every 10 seconds.
Is there a way to have immediate processing? It must be somewhere a buffer value that can be changed I think, but i tried a PHP function but it is only for output buffering
Maybe this info from Windump FAQ solves your problem:
Q-10: Why WinDump hangs for some seconds while capturing? How can I avoid it?
A: The cause of the slowness is that is that gethostbyaddr(), used by Windump to resolve the host names, on Windows actually uses more than just DNS and hosts files to translate IP addresses to names: it also tries using NetBIOS-over-TCP to do the translation. The translation of an IP address to a NetBIOS name requires to send a NetBIOS Name Service Node Status Request (see section 4.2.17 of RFC 1002) to the IP address, and wait for a reply: the reply will have the machine's NetBIOS name. However, if the machine in question isn't running any NetBIOS name service code (most non-Windows boxes don't), no reply will come back. An ICMP Port Unreachable might get sent out, but that might not cause an error to get delivered to the socket on which the request was sent. Therefore, the machine trying to get the name might have to wait for the request to time out before concluding that it can't get the name for that IP address using NetBIOS. That could take a significant amount of time.
You can use the -n switch to avoid name resolution and speed-up the display process.
I already use the -n option. The problem is that if I run windump alone then I get immediate results on the screen. When i call windump in a PHP page via popen() and I capture the output then he only works with blocks of lines. He waits till enough lines and start processing then.
Ok... then let me try again. Windump uses normal I/O functions by default which buffers certain amount characters before actual writting them to the output (it's 4096 characters in Windows I guess). If you capture the output it is good idea to force Windump to turn on line buffering - as a result your application should see incoming data line by line. The option is "-l".
But this must have something to do with PHP and popen since windump itself is displaying packets right away. Only when capturing with popen the lines come out in buffered groups.