xymon-ext-scripts

Hex Artifact Content
Login

Artifact 48ca5691100c106ec060bebac4a4f5788d830dc0b2849f36e3c0e9434aa9e9fa:


0000: 23 21 2f 62 69 6e 2f 73 68 0a 23 2d 0a 23 20 43  #!/bin/sh.#-.# C
0010: 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 30 31  opyright (c) 201
0020: 35 20 4d 61 72 6b 20 46 65 6c 64 65 72 0a 23 20  5 Mark Felder.# 
0030: 41 6c 6c 20 72 69 67 68 74 73 20 72 65 73 65 72  All rights reser
0040: 76 65 64 0a 23 0a 23 20 52 65 64 69 73 74 72 69  ved.#.# Redistri
0050: 62 75 74 69 6f 6e 20 61 6e 64 20 75 73 65 20 69  bution and use i
0060: 6e 20 73 6f 75 72 63 65 20 61 6e 64 20 62 69 6e  n source and bin
0070: 61 72 79 20 66 6f 72 6d 73 2c 20 77 69 74 68 20  ary forms, with 
0080: 6f 72 20 77 69 74 68 6f 75 74 0a 23 20 6d 6f 64  or without.# mod
0090: 69 66 69 63 61 74 69 6f 6e 2c 20 61 72 65 20 70  ification, are p
00a0: 65 72 6d 69 74 74 65 64 20 70 72 6f 76 69 64 69  ermitted providi
00b0: 6e 67 20 74 68 61 74 20 74 68 65 20 66 6f 6c 6c  ng that the foll
00c0: 6f 77 69 6e 67 20 63 6f 6e 64 69 74 69 6f 6e 73  owing conditions
00d0: 0a 23 20 61 72 65 20 6d 65 74 3a 0a 23 20 31 2e  .# are met:.# 1.
00e0: 20 52 65 64 69 73 74 72 69 62 75 74 69 6f 6e 73   Redistributions
00f0: 20 6f 66 20 73 6f 75 72 63 65 20 63 6f 64 65 20   of source code 
0100: 6d 75 73 74 20 72 65 74 61 69 6e 20 74 68 65 20  must retain the 
0110: 61 62 6f 76 65 20 63 6f 70 79 72 69 67 68 74 0a  above copyright.
0120: 23 20 20 20 20 6e 6f 74 69 63 65 2c 20 74 68 69  #    notice, thi
0130: 73 20 6c 69 73 74 20 6f 66 20 63 6f 6e 64 69 74  s list of condit
0140: 69 6f 6e 73 20 61 6e 64 20 74 68 65 20 66 6f 6c  ions and the fol
0150: 6c 6f 77 69 6e 67 20 64 69 73 63 6c 61 69 6d 65  lowing disclaime
0160: 72 2e 0a 23 20 32 2e 20 52 65 64 69 73 74 72 69  r..# 2. Redistri
0170: 62 75 74 69 6f 6e 73 20 69 6e 20 62 69 6e 61 72  butions in binar
0180: 79 20 66 6f 72 6d 20 6d 75 73 74 20 72 65 70 72  y form must repr
0190: 6f 64 75 63 65 20 74 68 65 20 61 62 6f 76 65 20  oduce the above 
01a0: 63 6f 70 79 72 69 67 68 74 0a 23 20 20 20 20 6e  copyright.#    n
01b0: 6f 74 69 63 65 2c 20 74 68 69 73 20 6c 69 73 74  otice, this list
01c0: 20 6f 66 20 63 6f 6e 64 69 74 69 6f 6e 73 20 61   of conditions a
01d0: 6e 64 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67  nd the following
01e0: 20 64 69 73 63 6c 61 69 6d 65 72 20 69 6e 20 74   disclaimer in t
01f0: 68 65 0a 23 20 20 20 20 64 6f 63 75 6d 65 6e 74  he.#    document
0200: 61 74 69 6f 6e 20 61 6e 64 2f 6f 72 20 6f 74 68  ation and/or oth
0210: 65 72 20 6d 61 74 65 72 69 61 6c 73 20 70 72 6f  er materials pro
0220: 76 69 64 65 64 20 77 69 74 68 20 74 68 65 20 64  vided with the d
0230: 69 73 74 72 69 62 75 74 69 6f 6e 2e 0a 23 0a 23  istribution..#.#
0240: 20 54 48 49 53 20 53 4f 46 54 57 41 52 45 20 49   THIS SOFTWARE I
0250: 53 20 50 52 4f 56 49 44 45 44 20 42 59 20 54 48  S PROVIDED BY TH
0260: 45 20 41 55 54 48 4f 52 20 60 60 41 53 20 49 53  E AUTHOR ``AS IS
0270: 27 27 20 41 4e 44 20 41 4e 59 20 45 58 50 52 45  '' AND ANY EXPRE
0280: 53 53 20 4f 52 0a 23 20 49 4d 50 4c 49 45 44 20  SS OR.# IMPLIED 
0290: 57 41 52 52 41 4e 54 49 45 53 2c 20 49 4e 43 4c  WARRANTIES, INCL
02a0: 55 44 49 4e 47 2c 20 42 55 54 20 4e 4f 54 20 4c  UDING, BUT NOT L
02b0: 49 4d 49 54 45 44 20 54 4f 2c 20 54 48 45 20 49  IMITED TO, THE I
02c0: 4d 50 4c 49 45 44 0a 23 20 57 41 52 52 41 4e 54  MPLIED.# WARRANT
02d0: 49 45 53 20 4f 46 20 4d 45 52 43 48 41 4e 54 41  IES OF MERCHANTA
02e0: 42 49 4c 49 54 59 20 41 4e 44 20 46 49 54 4e 45  BILITY AND FITNE
02f0: 53 53 20 46 4f 52 20 41 20 50 41 52 54 49 43 55  SS FOR A PARTICU
0300: 4c 41 52 20 50 55 52 50 4f 53 45 0a 23 20 41 52  LAR PURPOSE.# AR
0310: 45 20 44 49 53 43 4c 41 49 4d 45 44 2e 20 20 49  E DISCLAIMED.  I
0320: 4e 20 4e 4f 20 45 56 45 4e 54 20 53 48 41 4c 4c  N NO EVENT SHALL
0330: 20 54 48 45 20 41 55 54 48 4f 52 20 42 45 20 4c   THE AUTHOR BE L
0340: 49 41 42 4c 45 20 46 4f 52 20 41 4e 59 0a 23 20  IABLE FOR ANY.# 
0350: 44 49 52 45 43 54 2c 20 49 4e 44 49 52 45 43 54  DIRECT, INDIRECT
0360: 2c 20 49 4e 43 49 44 45 4e 54 41 4c 2c 20 53 50  , INCIDENTAL, SP
0370: 45 43 49 41 4c 2c 20 45 58 45 4d 50 4c 41 52 59  ECIAL, EXEMPLARY
0380: 2c 20 4f 52 20 43 4f 4e 53 45 51 55 45 4e 54 49  , OR CONSEQUENTI
0390: 41 4c 0a 23 20 44 41 4d 41 47 45 53 20 28 49 4e  AL.# DAMAGES (IN
03a0: 43 4c 55 44 49 4e 47 2c 20 42 55 54 20 4e 4f 54  CLUDING, BUT NOT
03b0: 20 4c 49 4d 49 54 45 44 20 54 4f 2c 20 50 52 4f   LIMITED TO, PRO
03c0: 43 55 52 45 4d 45 4e 54 20 4f 46 20 53 55 42 53  CUREMENT OF SUBS
03d0: 54 49 54 55 54 45 20 47 4f 4f 44 53 0a 23 20 4f  TITUTE GOODS.# O
03e0: 52 20 53 45 52 56 49 43 45 53 3b 20 4c 4f 53 53  R SERVICES; LOSS
03f0: 20 4f 46 20 55 53 45 2c 20 44 41 54 41 2c 20 4f   OF USE, DATA, O
0400: 52 20 50 52 4f 46 49 54 53 3b 20 4f 52 20 42 55  R PROFITS; OR BU
0410: 53 49 4e 45 53 53 20 49 4e 54 45 52 52 55 50 54  SINESS INTERRUPT
0420: 49 4f 4e 29 0a 23 20 48 4f 57 45 56 45 52 20 43  ION).# HOWEVER C
0430: 41 55 53 45 44 20 41 4e 44 20 4f 4e 20 41 4e 59  AUSED AND ON ANY
0440: 20 54 48 45 4f 52 59 20 4f 46 20 4c 49 41 42 49   THEORY OF LIABI
0450: 4c 49 54 59 2c 20 57 48 45 54 48 45 52 20 49 4e  LITY, WHETHER IN
0460: 20 43 4f 4e 54 52 41 43 54 2c 0a 23 20 53 54 52   CONTRACT,.# STR
0470: 49 43 54 20 4c 49 41 42 49 4c 49 54 59 2c 20 4f  ICT LIABILITY, O
0480: 52 20 54 4f 52 54 20 28 49 4e 43 4c 55 44 49 4e  R TORT (INCLUDIN
0490: 47 20 4e 45 47 4c 49 47 45 4e 43 45 20 4f 52 20  G NEGLIGENCE OR 
04a0: 4f 54 48 45 52 57 49 53 45 29 20 41 52 49 53 49  OTHERWISE) ARISI
04b0: 4e 47 0a 23 20 49 4e 20 41 4e 59 20 57 41 59 20  NG.# IN ANY WAY 
04c0: 4f 55 54 20 4f 46 20 54 48 45 20 55 53 45 20 4f  OUT OF THE USE O
04d0: 46 20 54 48 49 53 20 53 4f 46 54 57 41 52 45 2c  F THIS SOFTWARE,
04e0: 20 45 56 45 4e 20 49 46 20 41 44 56 49 53 45 44   EVEN IF ADVISED
04f0: 20 4f 46 20 54 48 45 0a 23 20 50 4f 53 53 49 42   OF THE.# POSSIB
0500: 49 4c 49 54 59 20 4f 46 20 53 55 43 48 20 44 41  ILITY OF SUCH DA
0510: 4d 41 47 45 2e 0a 0a 23 0a 23 20 50 6c 61 63 65  MAGE...#.# Place
0520: 20 74 68 69 73 20 66 69 6c 65 20 69 6e 20 2f 75   this file in /u
0530: 73 72 2f 6c 6f 63 61 6c 2f 77 77 77 2f 78 79 6d  sr/local/www/xym
0540: 6f 6e 2f 63 6c 69 65 6e 74 2f 65 78 74 2f 0a 23  on/client/ext/.#
0550: 20 54 68 65 6e 2c 20 74 6f 20 61 63 74 69 76 61   Then, to activa
0560: 74 65 20 73 69 6d 70 6c 79 20 61 70 70 65 6e 64  te simply append
0570: 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 74   the following t
0580: 6f 0a 23 20 74 68 65 20 2f 75 73 72 2f 6c 6f 63  o.# the /usr/loc
0590: 61 6c 2f 77 77 77 2f 78 79 6d 6f 6e 2f 63 6c 69  al/www/xymon/cli
05a0: 65 6e 74 2f 65 74 63 2f 63 6c 69 65 6e 74 6c 61  ent/etc/clientla
05b0: 75 6e 63 68 2e 63 66 67 20 66 69 6c 65 3a 0a 23  unch.cfg file:.#
05c0: 0a 23 5b 73 6d 61 72 74 5d 0a 23 20 20 20 20 20  .#[smart].#     
05d0: 20 20 20 45 4e 56 46 49 4c 45 20 24 58 59 4d 4f     ENVFILE $XYMO
05e0: 4e 43 4c 49 45 4e 54 48 4f 4d 45 2f 65 74 63 2f  NCLIENTHOME/etc/
05f0: 78 79 6d 6f 6e 63 6c 69 65 6e 74 2e 63 66 67 0a  xymonclient.cfg.
0600: 23 20 20 20 20 20 20 20 20 43 4d 44 20 24 58 59  #        CMD $XY
0610: 4d 4f 4e 43 4c 49 45 4e 54 48 4f 4d 45 2f 65 78  MONCLIENTHOME/ex
0620: 74 2f 73 6d 61 72 74 2e 73 68 0a 23 20 20 20 20  t/smart.sh.#    
0630: 20 20 20 20 4c 4f 47 46 49 4c 45 20 24 58 59 4d      LOGFILE $XYM
0640: 4f 4e 43 4c 49 45 4e 54 4c 4f 47 53 2f 73 6d 61  ONCLIENTLOGS/sma
0650: 72 74 2e 6c 6f 67 0a 23 20 20 20 20 20 20 20 20  rt.log.#        
0660: 49 4e 54 45 52 56 41 4c 20 35 6d 0a 23 0a 23 20  INTERVAL 5m.#.# 
0670: 59 6f 75 20 6d 61 79 20 61 6c 73 6f 20 6e 65 65  You may also nee
0680: 64 20 74 6f 20 61 64 64 20 73 6f 6d 65 74 68 69  d to add somethi
0690: 6e 67 20 6c 69 6b 65 20 74 68 69 73 20 74 6f 20  ng like this to 
06a0: 79 6f 75 72 20 73 75 64 6f 65 72 73 20 66 69 6c  your sudoers fil
06b0: 65 3a 0a 23 20 0a 23 20 43 6d 6e 64 5f 41 6c 69  e:.# .# Cmnd_Ali
06c0: 61 73 20 53 4d 41 52 54 43 54 4c 20 3d 20 2f 75  as SMARTCTL = /u
06d0: 73 72 2f 6c 6f 63 61 6c 2f 73 62 69 6e 2f 73 6d  sr/local/sbin/sm
06e0: 61 72 74 63 74 6c 0a 23 20 78 79 6d 6f 6e 20 41  artctl.# xymon A
06f0: 4c 4c 3d 53 4d 41 52 54 43 54 4c 2c 20 4e 4f 50  LL=SMARTCTL, NOP
0700: 41 53 53 57 44 3a 20 53 4d 41 52 54 43 54 4c 0a  ASSWD: SMARTCTL.
0710: 23 0a 23 20 4e 6f 77 20 72 65 73 74 61 72 74 20  #.# Now restart 
0720: 74 68 65 20 78 79 6d 6f 6e 20 63 6c 69 65 6e 74  the xymon client
0730: 20 74 6f 20 73 74 61 72 74 20 75 73 69 6e 67 20   to start using 
0740: 69 74 2e 0a 0a 23 20 58 79 6d 6f 6e 20 64 6f 65  it...# Xymon doe
0750: 73 6e 27 74 20 68 61 76 65 20 2f 75 73 72 2f 6c  sn't have /usr/l
0760: 6f 63 61 6c 20 69 6e 20 50 41 54 48 0a 50 41 54  ocal in PATH.PAT
0770: 48 3d 24 7b 50 41 54 48 7d 3a 2f 75 73 72 2f 6c  H=${PATH}:/usr/l
0780: 6f 63 61 6c 2f 62 69 6e 3a 2f 75 73 72 2f 6c 6f  ocal/bin:/usr/lo
0790: 63 61 6c 2f 73 62 69 6e 0a 0a 43 4f 4c 55 4d 4e  cal/sbin..COLUMN
07a0: 3d 73 6d 61 72 74 0a 0a 4d 53 47 3d 24 28 66 6f  =smart..MSG=$(fo
07b0: 72 20 69 20 69 6e 20 24 28 73 79 73 63 74 6c 20  r i in $(sysctl 
07c0: 2d 6e 20 6b 65 72 6e 2e 64 69 73 6b 73 20 7c 20  -n kern.disks | 
07d0: 73 65 64 20 27 73 2c 6e 76 64 2c 6e 76 6d 65 2c  sed 's,nvd,nvme,
07e0: 67 27 20 7c 20 74 72 20 27 20 27 20 27 5c 6e 27  g' | tr ' ' '\n'
07f0: 20 7c 20 73 6f 72 74 20 7c 20 65 67 72 65 70 20   | sort | egrep 
0800: 2d 76 20 27 5e 28 63 64 7c 6e 76 64 29 27 29 3b  -v '^(cd|nvd)');
0810: 20 64 6f 0a 0a 09 23 20 53 6b 69 70 20 69 66 20   do...# Skip if 
0820: 6c 69 73 74 65 64 20 69 6e 20 6b 65 72 6e 2e 64  listed in kern.d
0830: 69 73 6b 73 20 62 75 74 20 6e 6f 20 64 65 76 69  isks but no devi
0840: 63 65 20 6e 6f 64 65 20 65 78 69 73 74 73 0a 09  ce node exists..
0850: 69 66 20 5b 20 21 20 2d 65 20 2f 64 65 76 2f 24  if [ ! -e /dev/$
0860: 7b 69 7d 20 5d 3b 20 74 68 65 6e 0a 09 09 63 6f  {i} ]; then...co
0870: 6e 74 69 6e 75 65 3b 0a 09 66 69 0a 0a 09 4f 55  ntinue;..fi...OU
0880: 54 50 55 54 3d 24 28 73 75 64 6f 20 73 6d 61 72  TPUT=$(sudo smar
0890: 74 63 74 6c 20 2d 61 20 2f 64 65 76 2f 24 7b 69  tctl -a /dev/${i
08a0: 7d 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 5b  });.        if [
08b0: 20 24 3f 20 2d 65 71 20 31 20 5d 3b 20 74 68 65   $? -eq 1 ]; the
08c0: 6e 0a 20 20 20 20 20 20 20 20 20 20 23 20 53 4d  n.          # SM
08d0: 41 52 54 20 73 74 61 74 75 73 20 6e 6f 74 20 61  ART status not a
08e0: 76 61 69 6c 61 62 6c 65 20 66 6f 72 20 74 68 69  vailable for thi
08f0: 73 20 64 69 73 6b 0a 20 20 20 20 20 20 20 20 20  s disk.         
0900: 20 63 6f 6e 74 69 6e 75 65 0a 20 20 20 20 20 20   continue.      
0910: 20 20 66 69 0a 09 53 45 52 49 41 4c 3d 24 28 65    fi..SERIAL=$(e
0920: 63 68 6f 20 22 24 7b 4f 55 54 50 55 54 7d 22 20  cho "${OUTPUT}" 
0930: 7c 20 61 77 6b 20 27 2f 53 65 72 69 61 6c 2f 20  | awk '/Serial/ 
0940: 7b 70 72 69 6e 74 20 24 33 7d 27 29 0a 20 20 20  {print $3}').   
0950: 20 20 20 20 20 69 66 20 5b 20 22 78 24 7b 53 45       if [ "x${SE
0960: 52 49 41 4c 7d 22 20 3d 3d 20 22 78 22 20 5d 3b  RIAL}" == "x" ];
0970: 20 74 68 65 6e 20 53 45 52 49 41 4c 3d 22 6e 75   then SERIAL="nu
0980: 6c 6c 22 3b 20 66 69 0a 09 4d 4f 44 45 4c 3d 24  ll"; fi..MODEL=$
0990: 28 65 63 68 6f 20 22 24 7b 4f 55 54 50 55 54 7d  (echo "${OUTPUT}
09a0: 22 20 7c 20 61 77 6b 20 27 2f 44 65 76 69 63 65  " | awk '/Device
09b0: 20 4d 6f 64 65 6c 2f 20 7b 70 72 69 6e 74 20 24   Model/ {print $
09c0: 33 2c 24 34 7d 27 29 0a 20 20 20 20 20 20 20 20  3,$4}').        
09d0: 69 66 20 5b 20 22 78 24 7b 4d 4f 44 45 4c 7d 22  if [ "x${MODEL}"
09e0: 20 3d 3d 20 22 78 22 20 5d 3b 20 74 68 65 6e 20   == "x" ]; then 
09f0: 4d 4f 44 45 4c 3d 22 6e 75 6c 6c 22 3b 20 66 69  MODEL="null"; fi
0a00: 0a 09 52 45 41 4c 4c 4f 43 41 54 45 44 3d 24 28  ..REALLOCATED=$(
0a10: 65 63 68 6f 20 22 24 7b 4f 55 54 50 55 54 7d 22  echo "${OUTPUT}"
0a20: 20 7c 20 61 77 6b 20 27 2f 52 65 61 6c 6c 6f 63   | awk '/Realloc
0a30: 61 74 65 64 5f 53 65 63 74 6f 72 2f 20 7b 70 72  ated_Sector/ {pr
0a40: 69 6e 74 20 24 31 30 7d 27 29 0a 20 20 20 20 20  int $10}').     
0a50: 20 20 20 69 66 20 5b 20 22 78 24 7b 52 45 41 4c     if [ "x${REAL
0a60: 4c 4f 43 41 54 45 44 7d 22 20 3d 3d 20 22 78 22  LOCATED}" == "x"
0a70: 20 5d 3b 20 74 68 65 6e 20 52 45 41 4c 4c 4f 43   ]; then REALLOC
0a80: 41 54 45 44 3d 30 3b 20 66 69 0a 09 54 45 4d 50  ATED=0; fi..TEMP
0a90: 3d 24 28 65 63 68 6f 20 22 24 7b 4f 55 54 50 55  =$(echo "${OUTPU
0aa0: 54 7d 22 20 7c 20 61 77 6b 20 27 2f 54 65 6d 70  T}" | awk '/Temp
0ab0: 65 72 61 74 75 72 65 5f 43 65 6c 73 69 75 73 2f  erature_Celsius/
0ac0: 20 7b 70 72 69 6e 74 20 24 31 30 7d 27 29 0a 20   {print $10}'). 
0ad0: 20 20 20 20 20 20 20 69 66 20 5b 20 22 78 24 7b         if [ "x${
0ae0: 54 45 4d 50 7d 22 20 3d 3d 20 22 78 22 20 5d 3b  TEMP}" == "x" ];
0af0: 20 74 68 65 6e 20 54 45 4d 50 3d 30 3b 20 66 69   then TEMP=0; fi
0b00: 0a 0a 09 69 66 20 5b 20 22 24 7b 52 45 41 4c 4c  ...if [ "${REALL
0b10: 4f 43 41 54 45 44 7d 22 20 2d 67 74 20 30 20 5d  OCATED}" -gt 0 ]
0b20: 20 3b 20 74 68 65 6e 0a 09 09 48 45 41 4c 54 48   ; then...HEALTH
0b30: 3d 22 46 41 49 4c 45 44 22 0a 09 65 6c 69 66 20  ="FAILED"..elif 
0b40: 5b 20 22 24 7b 54 45 4d 50 7d 22 20 2d 67 74 20  [ "${TEMP}" -gt 
0b50: 34 35 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20  45 ] ; then.    
0b60: 20 20 20 20 20 20 20 20 20 20 20 20 48 45 41 4c              HEAL
0b70: 54 48 3d 22 4f 56 45 52 48 45 41 54 45 44 22 0a  TH="OVERHEATED".
0b80: 09 65 6c 73 65 0a 09 09 48 45 41 4c 54 48 3d 24  .else...HEALTH=$
0b90: 28 65 63 68 6f 20 22 24 7b 4f 55 54 50 55 54 7d  (echo "${OUTPUT}
0ba0: 22 20 7c 20 67 72 65 70 20 22 6f 76 65 72 61 6c  " | grep "overal
0bb0: 6c 2d 68 65 61 6c 74 68 22 29 0a 09 66 69 0a 0a  l-health")..fi..
0bc0: 20 20 20 20 20 20 20 20 63 61 73 65 20 22 24 7b          case "${
0bd0: 48 45 41 4c 54 48 7d 22 20 69 6e 0a 09 09 2a 50  HEALTH}" in...*P
0be0: 41 53 53 45 44 29 0a 09 09 09 65 63 68 6f 20 22  ASSED)....echo "
0bf0: 26 67 72 65 65 6e 20 24 7b 69 7d 20 50 41 53 53  &green ${i} PASS
0c00: 45 44 20 5b 20 53 65 72 69 61 6c 3a 20 24 7b 53  ED [ Serial: ${S
0c10: 45 52 49 41 4c 7d 20 4d 6f 64 65 6c 3a 20 24 7b  ERIAL} Model: ${
0c20: 4d 4f 44 45 4c 7d 20 52 65 61 6c 6c 6f 63 61 74  MODEL} Reallocat
0c30: 65 64 3a 20 24 7b 52 45 41 4c 4c 4f 43 41 54 45  ed: ${REALLOCATE
0c40: 44 7d 20 54 65 6d 70 3a 20 24 7b 54 45 4d 50 7d  D} Temp: ${TEMP}
0c50: 20 5d 22 0a 09 09 09 3b 3b 0a 09 09 22 22 29 0a   ]"....;;..."").
0c60: 09 09 09 65 63 68 6f 20 22 26 79 65 6c 6c 6f 77  ...echo "&yellow
0c70: 20 24 7b 69 7d 20 50 41 53 53 45 44 20 5b 20 53   ${i} PASSED [ S
0c80: 65 72 69 61 6c 3a 20 24 7b 53 45 52 49 41 4c 7d  erial: ${SERIAL}
0c90: 20 4d 6f 64 65 6c 3a 20 24 7b 4d 4f 44 45 4c 7d   Model: ${MODEL}
0ca0: 20 52 65 61 6c 6c 6f 63 61 74 65 64 3a 20 24 7b   Reallocated: ${
0cb0: 52 45 41 4c 4c 4f 43 41 54 45 44 7d 20 54 65 6d  REALLOCATED} Tem
0cc0: 70 3a 20 24 7b 54 45 4d 50 7d 20 5d 22 0a 09 09  p: ${TEMP} ]"...
0cd0: 09 3b 3b 0a 09 09 4f 56 45 52 48 45 41 54 45 44  .;;...OVERHEATED
0ce0: 29 0a 09 09 09 65 63 68 6f 20 22 26 72 65 64 20  )....echo "&red 
0cf0: 24 7b 69 7d 20 4f 56 45 52 48 45 41 54 45 44 20  ${i} OVERHEATED 
0d00: 5b 20 53 65 72 69 61 6c 3a 20 24 7b 53 45 52 49  [ Serial: ${SERI
0d10: 41 4c 7d 20 4d 6f 64 65 6c 3a 20 24 7b 4d 4f 44  AL} Model: ${MOD
0d20: 45 4c 7d 20 52 65 61 6c 6c 6f 63 61 74 65 64 3a  EL} Reallocated:
0d30: 20 24 7b 52 45 41 4c 4c 4f 43 41 54 45 44 7d 20   ${REALLOCATED} 
0d40: 54 65 6d 70 3a 20 24 7b 54 45 4d 50 7d 20 5d 22  Temp: ${TEMP} ]"
0d50: 0a 09 09 09 3b 3b 0a 09 09 2a 29 0a 09 09 09 65  ....;;...*)....e
0d60: 63 68 6f 20 22 26 72 65 64 20 24 7b 69 7d 20 46  cho "&red ${i} F
0d70: 41 49 4c 45 44 20 5b 20 53 65 72 69 61 6c 3a 20  AILED [ Serial: 
0d80: 24 7b 53 45 52 49 41 4c 7d 20 4d 6f 64 65 6c 3a  ${SERIAL} Model:
0d90: 20 24 7b 4d 4f 44 45 4c 7d 20 52 65 61 6c 6c 6f   ${MODEL} Reallo
0da0: 63 61 74 65 64 3a 20 24 7b 52 45 41 4c 4c 4f 43  cated: ${REALLOC
0db0: 41 54 45 44 7d 20 54 65 6d 70 3a 20 24 7b 54 45  ATED} Temp: ${TE
0dc0: 4d 50 7d 20 5d 22 0a 09 09 09 3b 3b 0a 09 65 73  MP} ]"....;;..es
0dd0: 61 63 0a 64 6f 6e 65 29 0a 0a 53 54 41 54 55 53  ac.done)..STATUS
0de0: 3d 22 24 28 68 6f 73 74 6e 61 6d 65 29 20 53 4d  ="$(hostname) SM
0df0: 41 52 54 20 68 65 61 6c 74 68 20 73 74 61 74 75  ART health statu
0e00: 73 22 0a 0a 63 61 73 65 20 22 24 7b 4d 53 47 7d  s"..case "${MSG}
0e10: 22 20 69 6e 0a 09 2a 27 26 72 65 64 27 2a 29 0a  " in..*'&red'*).
0e20: 09 09 43 4f 4c 4f 52 3d 72 65 64 0a 09 09 3b 3b  ..COLOR=red...;;
0e30: 0a 09 2a 27 26 79 65 6c 6c 6f 77 27 2a 29 0a 09  ..*'&yellow'*)..
0e40: 09 43 4f 4c 4f 52 3d 79 65 6c 6c 6f 77 0a 09 09  .COLOR=yellow...
0e50: 3b 3b 0a 09 2a 29 0a 09 09 43 4f 4c 4f 52 3d 67  ;;..*)...COLOR=g
0e60: 72 65 65 6e 0a 09 09 3b 3b 0a 65 73 61 63 0a 0a  reen...;;.esac..
0e70: 24 7b 58 59 4d 4f 4e 7d 20 24 7b 58 59 4d 53 52  ${XYMON} ${XYMSR
0e80: 56 7d 20 22 73 74 61 74 75 73 20 24 7b 4d 41 43  V} "status ${MAC
0e90: 48 49 4e 45 7d 2e 24 7b 43 4f 4c 55 4d 4e 7d 20  HINE}.${COLUMN} 
0ea0: 24 7b 43 4f 4c 4f 52 7d 20 24 28 64 61 74 65 29  ${COLOR} $(date)
0eb0: 0a 0a 24 7b 53 54 41 54 55 53 7d 0a 0a 24 7b 4d  ..${STATUS}..${M
0ec0: 53 47 7d 0a 22 0a                                SG}.".