OpenNetAdmin

Track. Automate. Configure.

Home About Features Community Develop
Download this project as a tar.gz file

Version check via HTTP proxy server

davidb

18-04-2010 20:30:48

I've just installed ONA and am working through populating it and convincing people here it can replace the broken spreadsheets they are so in love with.

I had a minor annoyance with the version check failing because of lack of proxy server support. The patch below fixes this (requires PHP5), although doesn't include the logic to test whether a proxy server should be used - it could be in the global config as a parameter.

$ diff main.inc.php main.inc.php-orig
15,16d14
< $opts = array('http' => array('proxy' => 'tcp://wwwproxy:8080', 'request_fulluri' => true));
< $context = stream_context_create($opts);
22,23c20,21
< //$fsock = @fsockopen("tcp://{$onachkserver}", 80, $errNo, $errString, 2);
< //if ($fsock) {
---
> $fsock = @fsockopen("tcp://{$onachkserver}", 80, $errNo, $errString, 2);
> if ($fsock) {
25c23
< $file = @fopen("http://{$onachkserver}/check_version.php", "r",false,$context);
---
> $file = @fopen("http://{$onachkserver}/check_version.php", "r");
27c25
< //}
---
> }

Matt

20-04-2010 17:53:41

Hope you can convince them to use a real tool to manage the network there! :)

I'll have a look at the patch. certainly improves on the ability of the test and will serve handy for the new plugins to be able to check for their own updates.

Thanks for the patch!

davidb

09-05-2010 18:42:36

Thanks Matt.

Making good progress on acceptance of ONA. An excellent set of capabilities for IPAM.

I updated my patch to use sys_config variable 'http_proxy' and posted code in a feature request in bug tracking system.