AnsweredAssumed Answered

Send Alarm message via SMS URL

Question asked by SusSatriyoAdiSuryo4211615 on Nov 15, 2018
Latest reply on Nov 21, 2018 by SusSatriyoAdiSuryo4211615

Hi,

 

My customer requests us to send the UIM alarm to sms gateway through the provided SMS URL.

Here is the SMS URL:

http://***.***.***.***/cauim_dev/Sendsms?param="..cmd1.."^&toNumber=0812800XXXX^&apiKey=X******

 

I have created a script in NAS alarm like this:

function space(s)
return s:gsub("","+")
end

function equals(s)
return s:gsub("=",":")
end

a = alarm.get()

cmd1 = equals(a.hostname.."("..a.source.."), Severity:"..a.severity..", Message:"..a.message)
cmd2 = "start "..space("http://***.***.***.***/cauim_dev/Sendsms?param="..cmd1.."^&toNumber=0812800XXXXX^&apiKey=ShinhANnegaBaro")

action.command(cmd2)

 

After I executed that script, there was an activity was logged in Activity Log like this:

http://***.***.***.***/cauim_dev/Sendsms?param=Severity:+Testmajor,+Message:QOS_INTERFACE_UTILIZATION+=+1176110.94+from+source+JAKARTA+targeting+eix0(eix0)+has+crossed+the+major+static+threshold+of+>95.0^&tonumber=0812800XXXX^&apiKey=X******

 

Waiting for more than 5 minutes, but I was not receiving a SMS from the executed script.

 

Then, I tried to run the activity value  in browser and here is the return value:

Once I executed it from browser, I received the SMS as expected.

 

Can somebody advise me, why the alarm was not sending SMS once I executed it from NAS alarm? What I missed in my script?

 

Regards

Rio

Outcomes