diff --git a/alived-notify b/alived-notify index 214ec9a0224efeb769006e1798291d5e8f4b0ff4..a05fcd8f3a63233aae00e3bc958068aa0bdf41ab 100755 --- a/alived-notify +++ b/alived-notify @@ -45,8 +45,14 @@ def main(args): # Alive XML page alive_xml_url = "http://bcda.xray.aps.anl.gov/cgi-bin/alivexml.cgi" - # Parse args - name, ip, state, mess = args + ### Parse args + # The following line only works if the number of args is exactly four + #!name, ip, state, mess = args + # The following lines allow Dohn to add arguments without breaking the script + name = args[0] + ip = args[1] + state = args[2] + mess = args[3] # Get the XLM file try: @@ -96,7 +102,7 @@ def main(args): if __name__ == '__main__': - if len(sys.argv) != 5: + if len(sys.argv) < 5: print "Usage: an_hook.py <iocname> <ip> <status> <user_args>" #!print sys.argv else: diff --git a/alived-notify-test b/alived-notify-test new file mode 100755 index 0000000000000000000000000000000000000000..2605dc4ec6ab3d076bb45e3c632742b019951d24 --- /dev/null +++ b/alived-notify-test @@ -0,0 +1,5 @@ +#!/bin/bash + +echo "I was called:" >> /home/beams/KPETERSN/notifiy-log.txt +echo " $*" >> /home/beams/KPETERSN/notifiy-log.txt +