fix poller.php with missing -h (#9621)

This commit is contained in:
Tony Murray
2019-01-07 21:26:57 -06:00
committed by GitHub
parent 5d63fe6647
commit d303174e7a

View File

@@ -21,6 +21,7 @@ echo $config['project_name_version']." Poller\n";
$options = getopt('h:m:i:n:r::d::v::a::f::q');
if (isset($options['h'])) {
if ($options['h'] == 'odd') {
$options['n'] = '1';
$options['i'] = '2';
@@ -43,6 +44,7 @@ if ($options['h'] == 'odd') {
$doing = $options['h'];
}
}
}
if (isset($options['i']) && $options['i'] && isset($options['n'])) {
$where = true;
@@ -58,7 +60,7 @@ if (isset($options['i']) && $options['i'] && isset($options['n'])) {
$doing = $options['n'].'/'.$options['i'];
}
if (!$where) {
if (empty($where)) {
echo "-h <device id> | <device hostname wildcard> Poll single device\n";
echo "-h odd Poll odd numbered devices (same as -i 2 -n 0)\n";
echo "-h even Poll even numbered devices (same as -i 2 -n 1)\n";