填写cfg文件

#!/bin/bash
x=$(cat /usr/local/nagios/etc/hosts/avaya/log)
i=0
for e in $x;do
i=`expr $i + 1`
cat  <<EOF >> ./avaya.cfg
define host{
host_name AvayaServer-$i
use zhuji
alias $e
address $e
hostgroups AVAYA servers
}
EOF
done

你可能感兴趣的:(centos)