#!/usr/local/bin/php -f 60*60*6) || (count(file($tmp_filename))>2) ) { //echo "need new remote file\n"; if(download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/home/nagios/{$g['product_name']}_version", 'read_body', 5, 5) === true) { sleep (5); $remote_version = trim(@file_get_contents("/home/nagios/{$g['product_name']}_version")); } if ( (count(file($tmp_filename))>2) ) { $static_text = gettext("UNKNOWN - unable to check for updates.") . "\n"; $exitcode = 3; $remote_version = "Error"; if(isset($curcfg['alturl']['enable'])) $static_text .= gettext("Could not contact custom update server.") . "\n"; else $static_text .= sprintf(gettext('Could not contact %1$s update server %2$s%3$s'), $g['product_name'], $updater_url, "\n"); } } if ($static_text !== "") { $additional_info = $static_text; } /* elseif ( pfs_version_compare($current_installed_buildtime, $current_installed_version, $remote_version) == -1) { $additional_info = "WARNING - new version available\n" ; $exitcode = 1; } else { $additional_info = "OK - already at latest version\n" ; $exitcode = 0; } */ $additional_info .= "Current version: ".$current_installed_version." / ".$current_installed_buildtime; #$additional_info .= "Current version: ".$current_installed_version."\n"; #$additional_info .= "Built on: ".$current_installed_buildtime; #$additional_info .= "Remote version: ".$remote_version."\n"; echo $additional_info; #exit ($exitcode); ?>