mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	* Mock fping for module tests, there is no need. Removes some wait time. * fixup some rrd disabling code * oops
		
			
				
	
	
		
			40 lines
		
	
	
		
			753 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			753 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env php
 | 
						|
<?php
 | 
						|
 | 
						|
use App\Jobs\PingCheck;
 | 
						|
use LibreNMS\Data\Store\Datastore;
 | 
						|
 | 
						|
$init_modules = ['alerts', 'laravel', 'nodb'];
 | 
						|
require __DIR__ . '/includes/init.php';
 | 
						|
 | 
						|
$options = getopt('hdvrg:');
 | 
						|
 | 
						|
if (isset($options['h'])) {
 | 
						|
    echo <<<'END'
 | 
						|
ping.php: Usage ping.php [-d] [-v] [-r] [-g group(s)]
 | 
						|
  -d enable debug output
 | 
						|
  -v enable verbose debug output
 | 
						|
  -r do not create or update RRDs
 | 
						|
  -g only ping devices for this poller group, may be comma separated list
 | 
						|
 | 
						|
END;
 | 
						|
    exit;
 | 
						|
}
 | 
						|
 | 
						|
set_debug(isset($options['d']));
 | 
						|
 | 
						|
if (isset($options['v'])) {
 | 
						|
    global $vdebug;
 | 
						|
    $vdebug = true;
 | 
						|
}
 | 
						|
 | 
						|
Datastore::init($options);
 | 
						|
 | 
						|
if (isset($options['g'])) {
 | 
						|
    $groups = explode(',', $options['g']);
 | 
						|
} else {
 | 
						|
    $groups = [];
 | 
						|
}
 | 
						|
 | 
						|
PingCheck::dispatch($groups);
 |