Option -r for ping.php. community-10946 (#11161)

This commit is contained in:
Danislav 2020-02-26 03:32:14 +01:00 committed by GitHub
parent fe9deb9b9c
commit ecd57ff34f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,13 +6,14 @@ use App\Jobs\PingCheck;
$init_modules = ['alerts', 'laravel', 'nodb'];
require __DIR__ . '/includes/init.php';
$options = getopt('hdvg:');
$options = getopt('hdvrg:');
if (isset($options['h'])) {
echo <<<'END'
ping.php: Usage ping.php [-d] [-v] [-g group(s)]
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;
@ -26,6 +27,10 @@ if (isset($options['v'])) {
$vdebug = true;
}
if (isset($options['r'])) {
Config::set('norrd', true);
}
if (isset($options['g'])) {
$groups = explode(',', $options['g']);
} else {