![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| GUI applications on SunSolaris and RedHat Linux | shafi2all | High Level Programming | 4 | 04-16-2008 02:43 AM |
| Find cmd working in Linux and not in SunSolaris 5.8 | navjotbaweja | SUN Solaris | 4 | 11-28-2007 10:21 AM |
| SunSolaris-v5.9: Default Security Settings | eysheikah | SUN Solaris | 1 | 09-29-2005 07:59 AM |
| Where can I download a DigitalUnix | 91service | UNIX for Dummies Questions & Answers | 1 | 02-12-2003 08:09 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
how to monitor 25 different digitalUnix and Sunsolaris machines
Hi
I am a new Junior System Administartor..currently in our team we have around 25 different machines comprising of Sun-Solaris and digital Unix machines...and every morning we telent into the system to check 1)all demons are workin fine 2)all cpus are up 3)the memory is okay But telnetting into 25 machines is a pain..i am planning to write a shell script taht will automatically sned out a mail to me incase there is a problem with any of the above..any ideas on how to start this..i would just need a pointer or an idea..then i would convert the idea into a shell script...or is there any better way to do it.. Hi i tried swatch..but unfortunately there are some perl modules which i am unable to compile because of gcc problems on sun solaris.. so somebody has a precompiled version of swatch for sun solaris regards Hrishy Last edited by xiamin; 12-24-2002 at 05:49 AM. |
| Forum Sponsor | ||
|
|
|
||||
|
For constant monitoring and no cost, check out Big Brother . You can monitor processes, cpu, disk...fantastic product.
You would still need something to check some other things (you could implement into BB but it's up to you). This was written back in 1995 - not too many changes since then. Give you a quick snapshot of what has happened in the last 24 hours (runs once every 24 hours). Could be improved but one does not always have the time! Sorry it's in csh - but it's more for knowledge then use - all the servers (over 60) send the snapshot report to one server - a cron job collects all the info - if it doesn't find a report from a server in it's list, it reports that too. This is the script that runs on each server - if nothing is wrong it sends a zero byte file (which proves the network connection is working). If you want the other script, post back. This works on Solaris 2.6 - does not have to run as root. Also have one for HP. #!/bin/csh -f # Created 09/21/95 HOG A script file to gather info from all Unix Systems # ========SET UP SYMBOLS=========================== set defdir="/tmp" set node="`hostname`" set today="`date '+%m%d%y'`" set theday="`date +'%d'`" set thedate="`date +'%b %e'`" set themonth="`date +'%m'`" set theyear="`date +'%Y'`" set tmpfile = "$defdir/SI$node.$today" set y2kfile = "/opt/Y2K/sunscan.$node-$theyear.$themonth.$theday-*/README.$node" set dailycopy = "oven:/usr/local/sysconfigs/daily" set monthcopy = "oven:/usr/local/sysconfigs" set fsmin = "5000" /usr/bin/rm $defdir/SI$node.* /usr/bin/touch $tmpfile # # ========RUN FOLLOWING COMMANDS ON ALL SYSTEMS==== # Check uptime set lastboot = `/usr/bin/who -b | awk '{print $4" "$5}'` if ("$lastboot" == "$thedate") echo "`/usr/bin/who -b`" >> $tmpfile # Check space on local filesystems set filesys = `df -bl |grep dsk|grep -v vol|/usr/bin/awk '{print $1}'` foreach fs ($filesys) set fs1 = `/usr/bin/df -kl $fs|grep dsk|/usr/bin/awk '{print $4}'` set fson = `/usr/bin/df -kl $fs|grep dsk|/usr/bin/awk '{print $6}'` if ($fs1 < $fsmin) then echo "$fson is at $fs1 kilobytes" >> $tmpfile endif end # Check for OV status if (-e /opt/OV/bin/ovstatus) then if ("$node" == "casc-nms128") then # do nothing - loaded but not running else set ovstat = `/opt/OV/bin/ovstatus |/usr/bin/grep -c RUNNING` if ($ovstat < 5) echo "Only $ovstat OV processes running. Please check." >> $tmpfile endif endif # Check on meta disks if (-e /usr/opt/SUNWmd/sbin/metastat) then set mdstat = `/usr/opt/SUNWmd/sbin/metastat|/usr/bin/grep "State:"|awk ' {print $2}'|/usr/bin/grep -cv "Okay"` if ($mdstat > 0) then /usr/bin/echo "$mdstat errors found in metastat" >> $tmpfile endif endif # Check on volume manager disks - normal user can't run vxdisk if (-e /usr/sbin/vxprint) then set vxstat = `/usr/sbin/vxprint |grep -ic "recover"` if ($vxstat > 0) then /usr/bin/echo "$vxstat errors found in vxprint" >> $tmpfile endif endif # Check prtdiag for errors if (-e /usr/platform/`uname -i`/sbin/prtdiag) then set prtdiag = "/usr/platform/`uname -i`/sbin/prtdiag" set prtdiagstat = `$prtdiag | grep -c "No failures found in System"` if ($prtdiagstat < 1) then /usr/bin/echo "Prtdiag shows system errors" >> $tmpfile endif endif # /usr/bin/rcp $tmpfile $dailycopy if ("$theday" == "01" && "$node" != "oven") then if (-e /opt/Y2K) then /usr/bin/rcp $y2kfile $monthcopy endif endif if (-e /tmp/$node.all) then /usr/bin/rcp /tmp/$node.all $monthcopy /usr/bin/mv /tmp/$node.all /tmp/$node.old endif # ================================================== exit |
|
||||
|
Quote:
|
||||
| Google UNIX.COM |