Sending SMS via OMi in BSM 9.10? (1745 Views)
Reply
Frequent Advisor
switchblaze
Posts: 66
Registered: ‎03-22-2012
Message 1 of 23 (1,745 Views)
Accepted Solution

Sending SMS via OMi in BSM 9.10?

[ Edited ]

Hi Experts,

 

I have a problem in configuring SMS notification through OMi in BSM 9.10. My client has an SMS gateway server that is not using the mail server suffix like it was stated in the help menu (how to add SMS provider manually). And my client actually has a script that is dumping all events from the OM server into a text file and sending the SMSes to the recipients based on the text file.

 

My question is, Could it be possible to integrate the existing script to the OMi, so all events from the OMi can be dumped into the text file, and send the SMS based on it? Or do I have to create a custom script in "Custom Actions" tab (Admin > Operations Management > Tune Operations Management > Custom Actions)?

 

Thanks

Please use plain text.
HP Expert
Dmitry Shevchenko
Posts: 4,785
Registered: ‎01-30-2008
Message 2 of 23 (1,734 Views)

Re: Sending SMS via OMi in BSM 9.10?

Custom actions are created to simplify recurring operator tasks. Do you want your operators to manually select a custom action for every individual event to write it into a text file? It doesn't make any sense.

 

First of all, in the OMi Event browser you have an option to Export Event List into a file (csv and xls formats are supported). That may meet your requirement.

 

If not, consider using either EPI scripts from where you could execute the existing script that you use with OM (if you are okay to to dump an event into the text file almost immediately once it was received). Or consider using TBEA functionality that can also execute some script (if you need to wait some time before dumping an event into the text file).

Please use plain text.
Frequent Advisor
switchblaze
Posts: 66
Registered: ‎03-22-2012
Message 3 of 23 (1,728 Views)

Re: Sending SMS via OMi in BSM 9.10?

Hi Dmitry,

 

Thank you so much for your reply and insight. Is there any EPI script example for executing another script?

 

Thanks

Please use plain text.
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 4 of 23 (1,687 Views)

Re: Sending SMS via OMi in BSM 9.10?

What kind of script are you looking for? What kind of script you want to execute? What exactly you want to achieve?

 

--Sujith

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Please use plain text.
Frequent Advisor
switchblaze
Posts: 66
Registered: ‎03-22-2012
Message 5 of 23 (1,667 Views)

Re: Sending SMS via OMi in BSM 9.10?

[ Edited ]

Hi Sujith, 

 

I want to send an SMS if there is a critical event.. the SMS sending mechanism is handled by a .bat script. I have created a .bat script that's just creating a text file in drive C:\ called "omites2.bat" (just for testing the EPI script). My point is, if the text file created by this omites.bat script, then the SMS sending mechanism will be done correctly. But I found out that If I run the EPI script via "custom action" in the OMi, it can be done correctly, the text file was created. But if I enter the script via Admin > Tune Operations Management > Event Processing Customization > Before storing events, the text file cannot be created.. (I assume the .bat file wasn't even executed)

 

this is the EPI script :

 

import java.util.List;
import com.hp.opr.api.scripting.Event;
class GroovyScriptSkeleton
{
def init()
{

}

def destroy()
{

}

def process(List events)
  {
   events.each{
    event -> ("cmd.exe /c C:\\omites2.bat").execute().text
  }

}
}

 

 

any idea what is going on??

 

 

Thanks a lot

Please use plain text.
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 6 of 23 (1,650 Views)

Re: Sending SMS via OMi in BSM 9.10?

So you are saying the SMS sending mechanism is being handled by a custom script written by your client by reading a text file located in a directory (assuming it is in BSM). Correct me if I am wrong

 

So now you are having problems in creating the text file which contains the event details like severity and so on. Is this right?

 

Write a filter in time based automation tab under admin>operations management. So in that EPI script replace the line "cmd.exe /c C:\\omites2.bat with "cmd.exe /c C:\\omites2.bat > test.txt (assuming this file contains the event details which is generated by your omites2.bat file). Then add this text.txt file path in your client's custom SMS batch file to read the contents so that it can generate SMS.

 

You just have to play here with right command to route the output to text file.

 

I am still thinking, you cant you use the inbuilt notifications in admin>operations management to trigger SMS/email alerts based on event filter.

 

--Sujith

 

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Please use plain text.
Frequent Advisor
switchblaze
Posts: 66
Registered: ‎03-22-2012
Message 7 of 23 (1,646 Views)

Re: Sending SMS via OMi in BSM 9.10?

Hi Sujith, 

 

Thanks for your quick response.. 


So you are saying the SMS sending mechanism is being handled by a custom script written by your client by reading a text file located in a directory (assuming it is in BSM). Correct me if I am wrong

 

Yes, this one is right

 

So now you are having problems in creating the text file which contains the event details like severity and

so on. Is this right?

 

No, the text file supposed to be created by the "omites2.bat" testing script.. the problem now is the omites2.bat seems cannot even be triggered by the EPI script..

I created this omites2.bat script to simulate the sms sending mechanism (it will call a script called "SendSMS.bat" which is already created by my customer)

 

I am still thinking, you cant you use the inbuilt notifications in admin>operations management to trigger SMS/email alerts based on event filter.

 

Unfortunately, My customer has already created this script and they want it to be used.. Besides they got a lot of recipients (over a hundred) which would take more time to add the recipients manually in the BSM

 

Write a filter in time based automation tab under admin>operations management. So in that EPI script replace the line "cmd.exe /c C:\\omites2.bat with "cmd.exe /c C:\\omites2.bat > test.txt (assuming this file contains the event details which is generated by your omites2.bat file). Then add this text.txt file path in your client's custom SMS batch file to read the contents so that it can generate SMS.

 

I cant use the time based automation, because the customer need the SMS sent immediately as the event comes up.. I have also tried to copy-paste the script to the time based option just to see if my script was right, I set the time interval into 1 minutes but still didn't work out

Please use plain text.
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 8 of 23 (1,633 Views)

Re: Sending SMS via OMi in BSM 9.10?

Its becoming complex for me as BSM has to interact file at system level ( I forgot this earlier). I am not sure this is going to work or not. Let me tell this might take time and effort. Copy the omites2.bat file on a remote server and add the commands in EPI script to call this file remotely (fingers crossed).

 

At the same time, the SMS file should be able to read the text file being generated by omites2.bat to send the SMS.

 

I know this is complex but you are asking for it.

 

If you ask me, using SMS module in BSM is really easy. Adding email is just one time activity. Think again!

 

--Sujith

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Please use plain text.
Frequent Advisor
switchblaze
Posts: 66
Registered: ‎03-22-2012
Message 9 of 23 (1,625 Views)

Re: Sending SMS via OMi in BSM 9.10?

Hi Sujith,

 

At the same time, the SMS file should be able to read the text file being generated by omites2.bat to send the SMS.

 

No, the SMS doesnt contain any text from omites2.bat result. omites2.bat is just a testing script, I think if the omites2.bat can be run successfully, so does the sendSMS.bat

Actually the main problem if I use the BSM's SMS module notification function is I have to add my country's provider manually and I found a problem.. here I copy-pasted the help menu :

 

 

To add a provider that uses an email gateway:

  1. 1.Open the NOTIFICATION_PROVIDERS table in the management database.
  2. 1.In the NP_NOTIFICATION_PROVIDER_NAME column, add the name of the provider to the bottom of the list.
  3. Add the name exactly as you want it to appear in the provider list that opens in the SMS tab of the Recipient Properties wizard. For details, see SMS Tab.
  4. Note the ID number that is automatically assigned to the provider.
  5. 1.Close the NOTIFICATION_PROVIDERS table, and open the NOTIFPROVIDER_NOTIFTYPE table.
  6. 1.In the NN_NOTIF_PROVIDER_ID column, add the ID number that was assigned to the new provider in step 2.
  7. 1.In the NN_NOTIF_TYPE_ID column, assign the provider one of the following notification types:
  8. •102 – for pager service provider
  9. •101 – for SMS service provider
  10. 1.Close the NOTIFPROVIDER_NOTIFTYPE table, and open the NOTIFICATION_PROVIDER_PROP table.
  11. 1.In the NPP_NOTIFICATION_PROVIDER_ID column, add the ID number that was assigned to the new provider in step 2.
  12. Note that you add the ID number to two consecutive rows.
  13. 1.In the NPP_NPROVIDER_PROP_NAME and NPP_NPROVIDER_PROP_VALUE columns, add the following new property names and values for the provider, one beneath the other (for examples, see existing entries):
  14.  Property Name  Property Value  Description  
  15. EMAIL_SUFFIX  <email_suffix>  The gateway's email suffix. For example, if the gateway email address is 12345@xyz.com, enter xyz.com as the property value for EMAIL_SUFFIX.  
  16. EMAIL_MAX_LEN  <max_length>  The maximum message length, in characters, of the body of the email message. For example, 500.
  17. When determining this value, take into consideration the maximum length limit imposed by your service provider, as well as limitations to your pager or mobile phone.  
  18. 1.In the NPP_NPROVIDER_PROP_DATATYPE_ID column, specify an ID value as follows:
  19. •for EMAIL_SUFFIX, specify: 1
  20. •for EMAIL_MAX_LEN, specify: 2
  21. 1.Restart BSM.

at step 15, my customer doesnt have an email Suffix.. They dont use email gateway server to send the SMS.

 

Any suggestion?

 

Thank you very much

Please use plain text.
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 10 of 23 (1,617 Views)

Re: Sending SMS via OMi in BSM 9.10?

Yep. That is the reason I was telling you this is complex as BSM has to interact with a system. This takes time and effort. Then am afraid if it is not possible to use inbuilt SMS module if they dont have their own SMS gateway server. Else, use the available service providers. Your customer has to pay some amount to HP to activate this service.

 

-- Sujith

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Please use plain text.
Frequent Advisor
switchblaze
Posts: 66
Registered: ‎03-22-2012
Message 11 of 23 (1,591 Views)

Re: Sending SMS via OMi in BSM 9.10?

[ Edited ]

regardless of the complexity of this task, is it a bug or defect from the BSM? because the script can be run via custom actions.. it means that there is no error in my script, isnt it? but it can never be runned via TBEA..

 

just to confirm, do I need to raise a case ticket for this?

 

Thanks

Please use plain text.
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 12 of 23 (1,580 Views)

Re: Sending SMS via OMi in BSM 9.10?

This is neither a bug nor a defect. Yes, you better aproach HP support as they can tell you the possibility. Do not forget to update this thread when you get an answer from them.

 

--Sujith 

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Please use plain text.
Established Member
wilsongao
Posts: 2
Registered: ‎10-13-2010
Message 13 of 23 (1,563 Views)

Re: Sending SMS via OMi in BSM 9.10?

where is your bat file? For custom action, the script is executed on the GW server, but for EPI, it is executed on the DPS server. So you need to have bat file on the DPS server if you want to use EPI. That might be the reason why it works in custom action as I assume you have this file on the GW server.

Please use plain text.
Frequent Advisor
switchblaze
Posts: 66
Registered: ‎03-22-2012
Message 14 of 23 (1,559 Views)

Re: Sending SMS via OMi in BSM 9.10?

Hi Wilsongao,

Yes, the script is in the GW server.. Thank you so much for giving me such an enlightment.. I will try it today and I'll post the outcome ASAP on this thread
Please use plain text.
Frequent Advisor
switchblaze
Posts: 66
Registered: ‎03-22-2012
Message 15 of 23 (1,544 Views)

Re: Sending SMS via OMi in BSM 9.10?

Thank you for all the experts here.. Its working now!!
Please use plain text.
Advisor
mangement
Posts: 30
Registered: ‎06-29-2011
Message 16 of 23 (1,348 Views)

Re: Sending SMS via OMi in BSM 9.10?

Hi ,

 

I need your help for SMS configuration.

 

Our customer is having their own SMS gateway.

 

Can you please share the omites2.bat scipt to me so that i can check the feasability how we can send sms for OMi events.

 

With Regards,

KR.

Please use plain text.
Frequent Advisor
switchblaze
Posts: 66
Registered: ‎03-22-2012
Message 17 of 23 (1,341 Views)

Re: Sending SMS via OMi in BSM 9.10?

Hi Mangement,

 

I am currently in another customer site and almost impossible to retrieve the omites2.bat file for you. Let me send it to you via email once I get back to my country.

Please use plain text.
Advisor
mangement
Posts: 30
Registered: ‎06-29-2011
Message 18 of 23 (1,277 Views)

Re: Sending SMS via OMi in BSM 9.10?

Hi,

 

Thanks for your reply.

 

I could able to manage with the batch script. but now i'm able to send sms with event title and i'm using 'event.title' to get the title information of the event. we have a requirement to pass the HPSM incident number also for the respective event from OMi(OMi is integrated with HPSM for auto incident generation).

 

So in this case which argument i need to use. When i'm using 'event.externalid' it is throwing and error as issue with groovy script.

 

Thanks.

Please use plain text.
Advisor
mangement
Posts: 30
Registered: ‎06-29-2011
Message 19 of 23 (1,276 Views)

Re: Sending SMS via OMi in BSM 9.10?

 
Please use plain text.
Advisor
mangement
Posts: 30
Registered: ‎06-29-2011
Message 20 of 23 (1,251 Views)

Re: Sending SMS via OMi in BSM 9.10?

Hi switchblaze,

 

Did you get a chance to get the batch script?

 

Thanks.

Please use plain text.
Frequent Advisor
switchblaze
Posts: 66
Registered: ‎03-22-2012
Message 21 of 23 (1,239 Views)

Re: Sending SMS via OMi in BSM 9.10?

Hi Managmnt,

 

Please find attached zip file

Please use plain text.
Advisor
mangement
Posts: 30
Registered: ‎06-29-2011
Message 22 of 23 (1,236 Views)

Re: Sending SMS via OMi in BSM 9.10?

Hi,

 

thanks for your reply.

 

What are all 5 arguments you are passing in to that text file from the OMi EPI script?

Please use plain text.
Frequent Advisor
switchblaze
Posts: 66
Registered: ‎03-22-2012
Message 23 of 23 (1,216 Views)

Re: Sending SMS via OMi in BSM 9.10?

sorry for the delay. I dont remember exactly but as I remembered, it was a parameter. for example:

 

%1 : recipient's initial

%2 : phone number

etc

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation