您好,登錄后才能下訂單哦!
#!/bin/bash exec <22.txt while read line do ############################# echo 'define host {' >>ping.host echo ' use linux-server' >>ping.host echo " host_name `echo $line|awk '{print $1}'`" >>ping.host echo " alias `echo $line|awk '{print $1}'` " >>ping.host echo " address `echo $line|awk '{print $2}'` " >>ping.host echo ' register 1' >>ping.host echo ' contact_groups MISAdmin' >>ping.host echo "}" >>ping.host ########################################## #P I N G echo 'define service {' >>ping.host echo ' use generic-service' >>ping.host echo " host_name `echo $line|awk '{print $1}'`" >>ping.host echo " service_description linux_PING " >>ping.host echo " check_command check_ping!100.0,20%!500.0,60% " >>ping.host echo 'register1' >>ping.host echo 'contact_groupsMISAdmin' >>ping.host echo "}" >>ping.host ########################### #C P U ###################################### ######################################### #Memory #$ echo 'define service {' >>ping.host # echo ' use generic-service' >>ping.host # echo " host_name `echo $line|awk '{print $1}'`" >>ping.host # echo " service_description ESXi Memory Usage" >>ping.host # echo ' check_command check_nrpe_memory' >>ping.host # echo 'register1' >>ping.host # echo 'contact_groupsMISAdmin' >>ping.host # echo "}" >>ping.host ########################################## #Network echo 'define service {' >>ping.host echo ' use generic-service' >>ping.host echo " host_name `echo $line|awk '{print $1}'`" >>ping.host echo " service_description linux_http" >>ping.host echo ' check_command check_http' >>ping.host echo 'register1' >>ping.host echo 'contact_groupsMISAdmin' >>ping.host echo "}" >>ping.host ######################################### echo 'define service {' >>ping.host echo ' use generic-service' >>ping.host echo " host_name `echo $line|awk '{print $1}'`" >>ping.host echo " service_description linux_ssh" >>ping.host echo ' check_command check_ssh' >>ping.host echo 'register1' >>ping.host echo 'contact_groupsMISAdmin' >>ping.host echo "}" >>ping.host ########################################### #io_read echo 'define service {' >>ping.host echo ' use generic-service' >>ping.host echo " host_name `echo $line|awk '{print $1}'`" >>ping.host echo " service_description linux_swap" >>ping.host echo ' check_command check_local_swap!20!10' >>ping.host echo 'register1' >>ping.host echo 'contact_groupsMISAdmin' >>ping.host echo "}" >>ping.host ########################################### echo 'define service {' >>ping.host echo ' use generic-service' >>ping.host echo " host_name `echo $line|awk '{print $1}'`" >>ping.host echo " service_description linux-disk" >>ping.host echo ' check_command check_local_disk!20%!10%!/' >>ping.host echo 'register1' >>ping.host echo 'contact_groupsMISAdmin' >>ping.host echo "}" >>ping.host ########################################### echo 'define service {' >>ping.host echo ' use generic-service' >>ping.host echo " host_name `echo $line|awk '{print $1}'`" >>ping.host echo " service_description linux_users" >>ping.host echo ' check_command check_local_users!20!50' >>ping.host echo 'register1' >>ping.host echo 'contact_groupsMISAdmin' >>ping.host echo "}" >>ping.host ############################################### done
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。