From 9b1dba8fdf699f233b2c31c50f0fa8eaa1d85466 Mon Sep 17 00:00:00 2001 From: Eric Loyd Date: Sat, 24 Aug 2024 09:36:18 -0400 Subject: [PATCH] Added --- create_host.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 create_host.sh diff --git a/create_host.sh b/create_host.sh new file mode 100755 index 0000000..8232c03 --- /dev/null +++ b/create_host.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Create a basic hosts.cfg file given hostname, ip/dns, and potentially a template list + +myIP="" +myHost="" +myGroup="" +myUse="generic-host" + +while [ -n "$1" ]; do + case "$1" in + -h|--host) myHost="$2"; shift 2;; + -i|--ip) myIP="$2"; shift 2;; + -g|--group) myGroup="$2"; shift 2;; + -t) myUse="$2"; shift 2;; + *) shift 1;; + esac +done + + +#define host { +# host_name SKSLSW001-L3-Srv1 +# use xiwizard_switch_host +# address 10.189.4.129 +# hostgroups network-devices +# max_check_attempts 5 +# check_interval 5 +# retry_interval 1 +# check_period xi_timeperiod_24x7 +# contacts vmpanait +# contact_groups IT Network +# notification_interval 60 +# notification_period xi_timeperiod_24x7 +# icon_image switch.png +# statusmap_image switch.png +# _xiwizard switch +# register 1 +#} + + +echo "define host {" +echo " host_name $mHost" +echo " address $myIP" +[ -n "$myUse" ] && echo " use $myUse" +[ -n "$myGroup" ] && echo " hostgroups $myGroup" +echo "}"