Replace poller-wrapper with exact version from https://github.com/Atrato/observium-poller-wrapper

This commit is contained in:
Paul Gear
2013-11-26 06:30:31 +10:00
parent 9effac039f
commit 58620f5a9d
2 changed files with 39 additions and 83 deletions

View File

@@ -6,29 +6,26 @@
*/
$defaults_config_file = 'includes/defaults.inc.php';
$config_file = 'config.php';
// move to observium install dir
chdir(dirname($argv[0]));
function is_cli()
{
if (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']))
{
return TRUE;
} else {
return FALSE;
}
function iscli() {
if(php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
return true;
} else {
return false;
}
}
// check if we are running throw the CLI, otherwise abort
if (is_cli())
{
require_once($defaults_config_file);
require_once($config_file);
print(json_encode($config));
if ( iscli() ) {
require_once($config_file);
print(json_encode($config));
}
?>