Table of Contents

Name

scanhosts -- run checkhosts against a large number of hosts

Synopsis

scanhosts [-BHIPSh] [-A authmode] [-n num] [-o dir] [-p script] [-s suffix] -f file -r script

Description

The scanhosts utility is used to run checkhosts(1) against a large number of hosts. It is normally invoked via autopw(1) by scanslave(1) . It splits the input and then invokes checkhosts(1) on the individual files in the background, eventually waiting for them all to complete. It then invokes the optionally provided post-processing command, passing it the name of the output directory as the single argument.

The following options are supported:

-A authmode
Specify the authentication mode. Valid options are “all", “password” and “pubkey". This is passed on to the checkhosts(1) command.

-B
Do not background checkhosts(1) . This option is required if the command run on the remote host invokes sudo(8) (or does any other interactive prompting) and will necessarily result in a significant performance decrease, since jobs no longer are executed in parallel but sequentially.

-H
Do not use the headless user for ssh connections. This is passed on to the checkhosts(1) command.

-I
Do not use IP addresses to ssh to. This is passed on to the checkhosts(1) command.

-P
Do not try to ping the hosts. This is passed on to the checkhosts(1) command.

-S
Do not check if sshd is listening on port 22 on the hosts. This is passed on to the checkhosts(1) command.

-f file
Take input from this file. Multiple -f file may be given. The format of the file is exactly one host per line. Lines starting with a # are treated as comments and ignored until the end of the line.

-h
Print a usage message and exit.

-n num
Split the input into this many files and thus run num instances of checkhosts(1) in parallel.

-o dir
Put the output files into dir. Per default, output is generated in TMPDIR.

-p cmd
Invoke the specified command for post-processing of the output. This command is passed as a single argument the directory where the output was collected in.

-r script
Specify the file that contains the script to run on the remote side. Passed through to checkhosts(1) .

-s suffix
Use given suffix instead of default date for all output.

Output

Output is generated in the directory “output” under the directory specified via -o dir. In that directory, N subdirectories will be created (where N is the number of files the input was split into), into which the checkhosts(1) instance will generate output.

Examples

The following examples illustrate common usage of this tool.

This runs the scans without checking if a host pings, reads input from the file /tmp/input, splits the input into files of 20 lines each and puts the output into the directory ./output/20070227 under the current working directory:

$ autopw scanhosts -P -n 20 -f /tmp/input -o ./output/20070227 \ -r /tmp/remote.sh

Exit Status

The scanhosts utility exits 0 on success, and >0 if an error occurs.

See Also

autopw(1) , checkhosts(1) , scanslave(1) , scanmaster(1)

History

The scanhosts utility was originally written by Jan Schaumann <jschauma@yahoo-inc.com> in January 2007. It’s original task was to check hosts if they were able to deal with the new Daylight Saving Time instituted in the USA in 2007.

Bugs

Please reports bugs or feature requests to the author.


Table of Contents