Well, it depends on what you consider healthy. If you only need to check if the process is responding, a simple "oneuser show" would be enough.
Or you could check the number of Hosts or VMs in 'fail' state to get a quick warning about a problem in your cloud. Regards -- Carlos Martín, MSc Project Engineer OpenNebula - The Open-source Solution for Data Center Virtualization www.OpenNebula.org | cmar...@opennebula.org | @OpenNebula<http://twitter.com/opennebula><cmar...@opennebula.org> On Wed, Aug 29, 2012 at 5:35 PM, 杨燚 <yang...@neusoft.com> wrote: > Hi**** > > I want to write a shell script to monitor oned process to check if oned is > running and healthy.**** > > my script only can count the number of process. and it can’t check if it > is really healthy.**** > > could you please give me some ideas? thank you very much.**** > > ** ** > > $ ps -fu oneadmin**** > > UID PID PPID C STIME TTY TIME CMD**** > > oneadmin 5096 1 0 14:46 ? 00:00:46 /opt/nebula/ONE/bin/oned -f > **** > > oneadmin 5097 1 0 14:46 ? 00:00:11 > /opt/nebula/ONE/bin/mm_sched**** > > oneadmin 5120 5096 0 14:47 ? 00:01:12 ruby > /opt/nebula/ONE/lib/mads/one_vmm_exec.rb -t 15 -r 0 kvm**** > > oneadmin 5131 5096 0 14:47 ? 00:00:33 ruby > /opt/nebula/ONE/lib/mads/one_im_exec.rb -r 0 -t 15 kvm**** > > oneadmin 5141 5096 0 14:47 ? 00:00:24 ruby > /opt/nebula/ONE/lib/mads/one_tm.rb tm_ssh/tm_ssh.conf**** > > oneadmin 5155 5096 0 14:47 ? 00:00:18 ruby > /opt/nebula/ONE/lib/mads/one_hm.rb**** > > oneadmin 5166 5096 0 14:47 ? 00:00:18 ruby > /opt/nebula/ONE/lib/mads/one_image.rb fs -t 15**** > > oneadmin 5176 5096 0 14:47 ? 00:00:18 ruby > /opt/nebula/ONE/lib/mads/one_auth_mad.rb --authn > ssh,x509,ldap,server_cipher,server_x509**** > > ** ** > > ** ** > > checkrun(){**** > > _num=`ps -ef|grep 'ONE' |grep -v grep |wc -l`**** > > if [ $_num -eq 8 ]; then**** > > RETVAL=0**** > > return $RETVAL**** > > elif [ $_num -eq 0 ]; then**** > > RETVAL=1**** > > return $RETVAL**** > > fi**** > > ** ** > > Best Regards,**** > > Yang Yi **** > > ** ** > > > --------------------------------------------------------------------------------------------------- > Confidentiality Notice: The information contained in this e-mail and any > accompanying attachment(s) > is intended only for the use of the intended recipient and may be > confidential and/or privileged of > Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader > of this communication is > not the intended recipient, unauthorized use, forwarding, printing, > storing, disclosure or copying > is strictly prohibited, and may be unlawful.If you have received this > communication in error,please > immediately notify the sender by return e-mail, and delete the original > message and all copies from > your system. Thank you. > > --------------------------------------------------------------------------------------------------- > > _______________________________________________ > Users mailing list > Users@lists.opennebula.org > http://lists.opennebula.org/listinfo.cgi/users-opennebula.org > >
_______________________________________________ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org