zonemaster-cli - run Zonemaster tests from the command line
zonemaster-cli nic.se
zonemaster-cli --test=delegation --level=debug --no-time afnic.fr
zonemaster-cli --list_tests
zonemaster-cli is a command-line interface to the Zonemaster test
engine. It does nothing itself except take the instructions the user
provides as command line arguments, transform them into suitable API calls
to the engine, run the requested test and print the resulting messages. The
messages will be translated by the engine's translation module, and possibly
have a timestamp and a module name prepended when printed.
- -h -? --usage --help
- Any of these print a rather too long summary of the command line switches,
then quits the program.
- --version
- Prints the versions of this program, the Zonemaster framework and the
loaded test modules.
- --level=LEVEL
- Specify the minimum level that a message needs to have in order to be
printed. That is, messages with this level or higher will be printed. The
levels are, in order from highest to lowest, CRITICAL, ERROR, WARNING,
NOTICE, INFO, DEBUG, DEBUG2 and DEBUG3. The lowest two levels show some of
the internal workings of the test engine, and are probably not useful for
ordinary users.
- --locale=LOCALE
- Specifies which locale to tell the translation system to use. If not
given, the translation system itself will look at environment variables to
try to guess. If the requested translation does not exist, it will
fallback to the local locale, and if that doesn't exist either to
English.
- --json
- Print results as JSON instead of human language.
- --json_stream,
--json-stream
- Stream the results as JSON objects, useful to follow the progress in a
machine readable way.
- --json_translate,
--json-translate
- For streaming JSON output, include the translated message of the tag.
- --raw, --no-raw
- Print messages as raw dumps instead of passing them through the
translation system.
- --time, --no-time
- Turn the printing of timestamps on or off (default on).
- --show_level,
--no-show_level, --show-level, --no-show-level
- Turn the printing of the message severity level on or off (default
on).
- --show_module,
--no-show_module, --show-module, --no-show-module
- Turn the printing of which module produced a message on or off (default
off).
- --show_testcase,
--no-show_testcase, --show-testcase, --no-show-testcase
- Turn the printing of which test case produced a message on or off (default
off).
- --ns=NAME[/IP]
- Provide information about a nameserver, for undelegated tests. The
argument must be either a domain name and an IP address (v4 or v6)
separated by a single slash character (/), or only a name, in which case a
lookup for A and AAAA records for that name will be done in the live
global DNS tree and the results of that lookup used.
This switch can (and probably should) be given multiple times.
As long as any of these switches are present, their aggregate content
will be used as the entirety of the parent-side delegation
information.
- --hints=FILENAME
- Name of a root hints file to override the defaults.
- --save=FILENAME
- After the entire test has finished running, write the contents of the
accumulated packet cache to a file with the given name.
- --restore=FILENAME
- Before starting the test, prime the packet cache with the contents from
the file with the given name. The format of the file should be that
produced by the save functions.
- --ipv4, --no-ipv4
- Allow or disallow the sending of IPv4 packets (default on).
- --ipv6, --no-ipv6
- Allow or disallow the sending of IPv6 packets (default on).
- --list_tests,
--list-tests
- Instead of running a test, list all the tests presented by the testing
modules.
- --test=MODULE,
--test=MODULE/METHOD
- Run only the specified tests. You can either give the name of a testing
module, in which case that module will be asked to run all its tests, or
you can give the name of a module followed by a slash and the name of a
method in that module. The specified method will be called with a zone
object as its single argument. It's up to the user to make sure that that
is the kind of argument the method expects.
- --stop_level=LEVEL,
--stop-level=LEVEL
- As soon as a message of the given level or higher is logged, terminate the
testing process.
- --profile=FILE
- Override the Zonemaster Engine default profile data with values from the
given profile JSON file.
- --ds=KEYTAG,ALGORITHM,TYPE,DIGEST
- Provide a DS record for undelegated testing (that is, a test where the
delegating nameserver information is given via --ns switches). The four
pieces of data should be in the same format they would have in a zone
file.
- --count,
--no-count
- After the test run is finished, turn on or off the printing of a summary
with the numbers of messages of the various levels that were logged during
the run (default off).
- --progress,
--no-progress
- Turn on or off the printing of a "spinner" showing that
something is happening during the test run. The default is to print it if
the process' standard output is a TTY, and to not print otherwise.
- --encoding=ENCODING
- Specify the character encoding that is used for command line arguments.
This will be used to convert non-ASCII names to IDNA format, on which the
tests will then be run.
The default value will be taken from the
"LC_CTYPE" environment variable if
possible, and set to UTF-8 if not.
- --sourceaddr=IPADDR
- Source IP address used to send queries. Setting an IP address not
correctly configured on a local network interface causes cryptic error
messages.
The testing and result analysis performed by Zonemaster Engine is
always guided by a profile. Zonemaster Engine has a default profile with
sensible defaults. Zonemaster CLI allows users to override the default
profile data with values from a profile JSON file with the
"--profile" option. For details on
profiles and how they're respresented in files, see
Zonemaster::Engine::Profile.
If there is a readable file /etc/zonemaster/cli.args (Linux
style), each line in that file will be prepended as an argument on the
command line. If no /etc/zonemaster/cli.args is found (or is not
readable) but /usr/local/etc/zonemaster/cli.args (FreeBSD style) is
found and readable then that file will be used instead. Only one global file
is loaded.
If there is a readable file .zonemaster/cli.args in the
user's home directory, it will be used in the same way even when a global
file has been loaded. Any argument in user's cli.args will override
the same argument in the global config file.
For example, if one would like to by default run with the log
level set to DEBUG and with translation to human-readable messages turned
off, one could put this in the config file:
--raw
--level=DEBUG
Only one argument per line. If the argument has a value there must
be a "=" between argument and value. A line starting with
"#" is a comment. Comments cannot be added on lines with
arguments.
Any arguments actually given on the command line will override
what is in any of the loaded config files.
Calle Dybedahl <calle@init.se> and others from the
Zonemaster project