Associate
Hey guys, I'm having slight issues with a script I'm working on. You'll have to forgive my "noobness", I don't do a lot of work with Linux.
I currently run Zabbix as a monitoring server for a few machines, lets say for example a server goes down, it'll pick up on this and send a text message to a primary support phone
I have a secondary support phone, I want the same alert to go there IF primary support hasn't replied to the first alert (via text)
The problem comes in that Zabbix thinks the script has died during the "sleep 300" and retires the script another 2 times, so 3 duplicate messages get sent out.
Script is as follows (I've chopped out 90% of this code to keep it simple):
I've tried launching a separate script to do the sleeping like:
sh /blah/blah/secondaryscript.sh
sh (/blah/blah/secondaryscript.sh)&
sh /blah/blah/secondaryscript.sh &
Any other way to have a script launch from within a script but run completely separately?
Thanks
I currently run Zabbix as a monitoring server for a few machines, lets say for example a server goes down, it'll pick up on this and send a text message to a primary support phone
I have a secondary support phone, I want the same alert to go there IF primary support hasn't replied to the first alert (via text)
The problem comes in that Zabbix thinks the script has died during the "sleep 300" and retires the script another 2 times, so 3 duplicate messages get sent out.
Script is as follows (I've chopped out 90% of this code to keep it simple):
Code:
#!/bin/sh
#Sends SMS message to primary
echo $TRIGGER $DESCRIPTION | /usr/bin/gammu --sendsms TEXT $NUMBER
#Wait for SMS reply from primary support to disable secondary alerts
sleep 300
#if statement here (reply received?), send message to secondary phone.
echo $TRIGGER $DESCRIPTION | /usr/bin/gammu --sendsms TEXT $secondarynumber
I've tried launching a separate script to do the sleeping like:
sh /blah/blah/secondaryscript.sh
sh (/blah/blah/secondaryscript.sh)&
sh /blah/blah/secondaryscript.sh &
Any other way to have a script launch from within a script but run completely separately?
Thanks
Last edited: