/export/home/system/system/tmp/ppp set pts = `awk -f: '{print $2}' /export/home/system/system/tmp/p" /> /export/home/system/system/tmp/ppp set pts = `awk -f: '{print $2}' /export/home/system/system/tmp/p" /> /export/home/system/system/tmp/ppp set pts = `awk -f: '{print $2}' /export/home/system/system/tmp/p"/>

I have a question about running Linux csh multiple scripts

30 Views Asked by At
#!/bin/csh

while(1)
ps | grep -v "PID" | head -1 > /export/home/system/system/tmp/ppp
set pts = `awk -f: '{print $2}' /export/home/system/system/tmp/ppp`
echo $pts[1] > /export/home/system/system/tmp/ppp1
set ww = `cut -c5-6 /export/home/system/system/qtmp/ppp1`
clear

@ a = 0
echo "############################ "
echo " <  C3svr2 Quick-Check  >  "
echo "############################ "
echo " < Application count = 46 , Modify DATE = 2023.09.14 >  "
echo "------------------------------------------------------------------ "
echo " 9700/8700/7700/9300/8300 "
echo " 7300/gwchopan/ex_txt2chulpand/yunmon/m_embargod "
echo " rtf2chulgod/ex_xml2archived/newsis_con/newsis_rcv/newsis_reg "
echo " bloom_reg/get_bloom/pdf_rcv/ynewsml_reg/ex_jdistd.ns "
echo " ex_jdistd.ww/youtubed/smartx/logmond/snd_dotcom "
echo " im_photod/im_myphotod/img2chopan/im_dbd/im_sportsd "
echo " im_onlinephotod/im_arcphotod/im_newsisd/im_news1d/im_ftpd "
echo " im_getpicd/im_yond/ex_image2biz/ex_img2archived/get_pool "
echo " im_poold/tomcat/nmbd/smbd/sp1agentd/sp1mon "
echo " ----------------------------------------------------------------- "

ps -ef|grep nccs > /export/home/system/system/qtmp/qtmp.$ww
        foreach DDD( 9700 8700 7700 9300 8300 7300 gwchopan ex_txt2chulpand yunmon m_embargod rtf2chulgod ex_xml2archived newsis_con newsis_rcv newsis_reg bloom_reg get_bloom pdf_rcv ynewsml_reg ex_jdistd.ns ex_jdistd.ww youtubed smartx logmond snd_dotcom im_photod im_myphotod img2chopan im_dbd im_sportsd im_onlinephotod im_arcphotod im_newsisd im_news1d im_ftpd im_getpicd im_yond ex_image2biz ex_img2archived get_pool im_poold tomcat )
       cat /export/home/system/system/qtmp/qtmp.$ww | grep -w $DDD > /export/home/system/system/qtmp/qtmp1.$ww
      if ( $status == 1 ) then
           cat /export/home/system/system/qtmp/qtmp1.$ww | grep -v $DDD
           echo -n "$DDD""(Down)"
      else
           echo -n "! "
           @ a++
      sleep 0.3
      endif
      end

ps -ef|grep mbd > /export/home/system/system/qtmp1/qtmp.$ww

foreach DDD(nmbd smbd)

cat /export/home/system/system/qtmp1/qtmp.$ww | grep -w $DDD > /export/home/system/system/qtmp1/qtmp1.$ww

      if ( $status == 1 ) then
          cat /export/home/system/system/qtmp1/qtmp1.$ww | grep -v $DDD
           echo -n "$DDD""(Down)"
      else
           echo -n "! "
           @ a++
      sleep 0.3
      endif
      end

ps -ef|grep siem > /export/home/system/system/qtmp2/qtmp.$ww

foreach DDD(sp1agentd sp1mon)

cat /export/home/system/system/qtmp2/qtmp.$ww | grep -w $DDD > /export/home/system/system/qtmp2/qtmp1.$ww

      if ( $status == 1 ) then
        cat /export/home/system/system/qtmp2/qtmp1.$ww | grep -v $DDD
        echo -n "$DDD""(Down)"
      else
           echo -n "! "
           @ a++
      sleep 0.3
      endif
      end
echo " "
sleep 3
end

I created a script to check for daemons, but when I run the script on multiple PCs, sometimes it says that daemons that aren't dead are dead. Why is that so?

enter image description here

0

There are 0 best solutions below