标签:监控主机
#!/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
本文出自 “星空” 博客,请务必保留此出处http://liuxiaolan.blog.51cto.com/7789055/1621689
标签:监控主机
原文地址:http://liuxiaolan.blog.51cto.com/7789055/1621689