diff --git a/src/fr/devinsy/statoolinfos/cli/StatoolInfosCLI.java b/src/fr/devinsy/statoolinfos/cli/StatoolInfosCLI.java index 545c41b..1053e3a 100644 --- a/src/fr/devinsy/statoolinfos/cli/StatoolInfosCLI.java +++ b/src/fr/devinsy/statoolinfos/cli/StatoolInfosCLI.java @@ -109,7 +109,7 @@ public final class StatoolInfosCLI message.appendln(" statoolinfos clear remove property files from conf"); message.appendln(" statoolinfos crawl crawl all file from conf and input"); message.appendln(" statoolinfos htmlize generate web pages from conf"); - message.appendln(" statoolinfos probe generate metrics files from conf"); + message.appendln(" statoolinfos probe [|] generate metrics files from conf"); message.appendln(" statoolinfos uptime update uptime journal"); message.appendln(); message.appendln(" statoolinfos format format property files in tiny way"); @@ -386,14 +386,34 @@ public final class StatoolInfosCLI else if (isMatching(args, "probe", "\\s*.+\\.conf\\s*")) { File configurationFile = new File(StringUtils.trim(args[1])); - try + + if (configurationFile.isDirectory()) { - StatoolInfos.probe(configurationFile); + Files inputs = FilesUtils.searchEndingWith(configurationFile, ".conf"); + for (File input : inputs) + { + try + { + StatoolInfos.probe(input); + } + catch (Exception exception) + { + logger.error("Error with [{}]: {}", input.getAbsoluteFile(), exception.getMessage()); + exception.printStackTrace(); + } + } } - catch (Exception exception) + else { - logger.error("Error with [{}]: {}", configurationFile.getAbsoluteFile(), exception.getMessage()); - exception.printStackTrace(); + try + { + StatoolInfos.probe(configurationFile); + } + catch (Exception exception) + { + logger.error("Error with [{}]: {}", configurationFile.getAbsoluteFile(), exception.getMessage()); + exception.printStackTrace(); + } } } else if (isMatching(args, "stat", "ip", "\\s*\\S+\\s*"))