diff --git a/README.md b/README.md new file mode 100644 index 0000000..0e5e8c9 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# nagios-bootstrap # +This is a Bash script meant to aid system administrators to quickly get a +Nagios instance up and running. The script scans through a specified host for +open services and matches those services to avaliable Nagios checks/plugins +found on the system. If the open service has a matching plugin it is added to +the config file. Once every open service has been found (using Nmap) and +matched to a plugin the script creates a config file with all the data. If the +-o option is omitted, the config file will be printed to stdout. + +## Usage ## +To create a config file for the the host _host1.example.com_ and save the +config in _host1.cfg_ issue the following +command `./nagios-bootstrap.sh -H host1.example.com -o host1.cfg`. If the -o +option is ommited the output will be printed to stdout instead. diff --git a/nagios-bootstrap.sh b/nagios-bootstrap.sh index 1141c8a..dcfa428 100755 --- a/nagios-bootstrap.sh +++ b/nagios-bootstrap.sh @@ -21,7 +21,6 @@ ################################################################################ # nagios-bootstrap -# Version 0.1 # Binaries Which="/bin/which" @@ -29,6 +28,7 @@ Binaries=(nmap sed awk printf ls grep egrep cut tr head) # Variables Version="0.1" +Author="Jack-Benny Persson " Plugindir="dummy_checks/" @@ -49,14 +49,17 @@ done # Define functions print_usage() { - $Printf "Usage: `basename $0` -H -o -h (help)\n" + $Printf "\n`basename $0`\nVersion $Version\n" + $Printf "$Author\n\n" + $Printf "Usage: `basename $0` -H -o -h (help)\n\n" } print_help() { + print_usage $Printf "-h This help screen\n" $Printf "-H Host to scan and bootstrap for Nagios\n" - $Printf "-o Output file to save the configuration file in\n" + $Printf "-o Output file to save the configuration file in\n\n" } # Parse options and arguments