External Commands

From OpenNMS

Using Sendpage

The default notificationCommands.xml uses "qpage" as an example. Qpage is a bit crusty, so here is the configuration changes to "notificationCommands.xml" to allow use of the "sendpage" package (included in Debian) to send pages.

On my Debian server, the sendpage package installs /usr/bin/snpp.

I assume you've been able to send manual pages using this binary. If not, go back and verify that you can send pages manually. The rest of this gets very frustrating if your underlying paging system isn't functional!


Within the file 'notificationCommands.xlm, there are several definitions of notification commands in the form:

<command binary=.....>
    <name> [name of notification method] </name>
    [notification command definition]
</command>

I found the original definition for "textPage" (as distributed in OpenNMS packaging):

    <command binary="true">
        <name>textPage</name>
        <execute>/usr/bin/qpage</execute>
        <comment>text paging program</comment>
        <argument streamed="false">
            <switch>-p</switch>
        </argument>
        <argument streamed="false">
            <switch>-t</switch>
        </argument>
    </command>

This block was replaced with a new version:

    <command binary="true">
        <name>textPage</name>
        <execute>/usr/bin/snpp</execute>
        <comment>text paging program</comment>
        <argument streamed="false">
                <switch>-tp</switch>
        </argument>
        <argument streamed="true">
                <switch>-tm</switch>
        </argument>
    </command>

This calls the new paging binary (/usr/bin/snpp) with the arguments "-tp" which expands to the value stored in "Text PIN:" for the user. The "-tm" expands into the "text message" that's defined by the "Event Notification".

The documentation of these parameters was found here: http://www.opennms.org/index.php/FAQ-Configuration#Q:_How_Do_I_Add_Custom_Notification_Commands.3F


The "PIN" needs to match a name of a recipient defined in /etc/sendpage/sendpage.cf:

    [recip:NAME_HERE]
    dest = 4x4x1x1@pageservice


After making the change, OpenNMS needs to be restarted to realize the change.

Personal tools
DevJam 2008 Sponsors
DevJam 2008 Sponsor: Google
DevJam 2008 Sponsor: Netregistry
DevJam 2008 Sponsor: Papa John's
NewEdge Networks
OpenNMS takes home the gold award!
Join the Free Software Foundation
Support This Project Commercial OpenNMS Support OpenNMS Italia Get OpenNMS at SourceForge.net. Fast, secure and Free Open Source software downloads Our Network Simulator Our Java Profiler