$opts = getopt('', $params = ['ogrn:','inn:','kpp::','host:','port:','user:','pass:','path:','pattern:']) + ['kpp' => 0,'port' => 21,'path' => '/','pattern' => '.+\.dbf'];
array_map(function ($param) use ($opts) {
$matches = [];
if ((bool)preg_match('/(?<param>[^:\s]+)\b:$/sU', $param, $matches)
&& (!array_key_exists($matches['param'], $opts) || empty($opts[$matches['param']])))
die(sprintf('<prtg><error>1</error><text>%s not set</text></text></error></prtg>', $matches['param']));
}, $params);