mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
add poller-wrapper
This commit is contained in:
committed by
Paul Gear
parent
04ceb53be6
commit
b403921398
34
config_to_json.php
Normal file
34
config_to_json.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
Observium configuration to JSON converter
|
||||
Written by Job Snijders <job.snijders@atrato.com)
|
||||
|
||||
*/
|
||||
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
// 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));
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user