Tried that but it looks as if the modem does not support GSM

 

Need to do it with a regular modem.

 

Thanks Kevin

 

From: Robin Williams [mailto:r.williams@lancs.ac.uk]
Sent: Monday, June 14, 2010 3:53 AM
To: General OpenNMS Discussion
Subject: Re: [opennms-discuss] smsclient

 

Hi Kevin,

What OS are you using? We've got a gsm gateway modem, and we use the smstools package (which is in apt) and the sendsms script (by default in /usr/local/bin/sendsms which puts it's texts data in /var/spool/sms/).  The script just takes an argument of a tel num and a text message.  Add that to your opennms notificationCommands.xml and configure a destination path to point to it, and you're away:

    <command binary="true">
      <name>smsgw</name>
      <execute>/usr/local/bin/sendsms</execute>
      <comment>Class for sending GSM SMS notifications</comment>
      <argument streamed="false">
        <switch>-np</switch>
      </argument>
      <argument streamed="false">
        <switch>-tm</switch>
      </argument>
    </command>

You'll need to put something in /etc/smsd.conf along the lines of (as well as the default stuff)

devices = GSM1

[GSM1]
device = /dev/ttyS0
incoming = yes
baudrate = 19200
report = no
rtscts = yes
mode = new
memory_start = 1

##

Robin.



Kevin Roberts wrote:

Does anybody have opennms sending txt pages if so how?

 

From: Kevin Roberts [mailto:KevinR@firstpac.com]
Sent: Thursday, June 10, 2010 11:33 AM
To: opennms-discuss@lists.sourceforge.net
Subject: [opennms-discuss] smsclient

 

Does any know where to get smsclient from for ? (looks like both links are not valid any more)

 

Trying to do:

Q: How Do I Add Custom Notification Commands?

A: Written by Hamadoun Diall from the OpenNMS Discuss List.

 

As a follow-up to one of my previous questions, some other from other people, I am providing my notificationCommands.xml file to whomever might want to do the same thing.

 

To enable OpenNMS to send notifications to cellular GSM phones through SMS messages add the following XML to the notificationCommands.xml file. Additionally you must have sms_client (available at http://www.smsclient.org or the original site http://www.styx.demon.co.uk/) properly configured with a GSM modem (or a regular analog modem if your GSM provider supports such a service).

 

Define the destination mobile phone number in Numeric PIN (-np switch below) field in the user properties. Obviously, it could be better to create a wrapper script to truncate the notification messages down to 160 characters or something else.

 

<command>

  <name>mobilePhoneSMS</name>

  <execute>/usr/bin/sms_client</execute>

  <comment>for sending GSM messages (SMS)</comment>

  <argument streamed="false">

     <switch>-np</switch>

  </argument>

  <argument streamed="true">

     <switch>-tm</switch>

  </argument>

</command>

For sending Windows Pop-Up messages (eg. "net send") add the following XML lines. The destination Windows PC name is defined in the Pager Email field, -pemail, (of course it can be changed), and you must have samba installed - smbclient.

 

<command>

  <name>windowsPopup</name>

  <execute>/usr/bin/smbclient</execute>

  <comment>for sending messages to Windows with Samba</comment>

  <argument streamed="false">

    <substitution>-U OpenNMS</substitution>

  </argument>

  <argument streamed="false">

    <substitution>-M</substitution>

    <switch>-pemail</switch>

  </argument>

  <argument streamed="true">

    <switch>-tm</switch>

  </argument>

</command>

Here are some substitution fields you can use from the user properties defined in OpenNMS (from Jose Vicente Nunez Zuleta's post which includes an excerpt from the source code - the NotificationManager.java file:

 

/*Some paramter identification strings*/

public static final String PARAM_TYPE              = "-t";

public static final String PARAM_DESTINATION = "-d";

public static final String PARAM_TEXT_MSG    = "-tm";

public static final String PARAM_NUM_MSG     = "-nm";

public static final String PARAM_RESPONSE    = "-r";

public static final String PARAM_NODE        = "-nodeid";

public static final String PARAM_INTERFACE   = "-interface";

public static final String PARAM_SERVICE     = "-service";

public static final String PARAM_SUBJECT     = "-subject";

public static final String PARAM_EMAIL       = "-email";

public static final String PARAM_PAGER_EMAIL         "-pemail";

public static final String PARAM_TEXT_PAGER_PIN      = "-tp";

public static final String PARAM_NUM_PAGER_PIN       = "-np";

In the list above, the following parameters come from the user configuration: destination, -d; email, -email; pager email, -pemail; xmpp address, -xmpp; text pager pin, -tp; num pager pin, -np. All other switches (-t, -tm, -nm, -r, -nodeid, -interface, -service, -subject) seem to come from the notifications.xml configuration and/or the event itself.

 

Do not overlook the README.notification (in /opt/OpenNMS/etc), for some more info about the configuration of the notification subsystem.

 

Finally, don't forget to restart opennms. Good luck!

 



Confidentiality Notice: This page and any accompanying documents contain information that is confidential, privileged, or exempt from disclosure under applicable law and is intended for the exclusive use of the addressee. This information is private and protected by law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the contents of this information in any manner is strictly prohibited.