I'm wondering if there could be a solution with gsmlib - 
http://www.pxh.de/fs/gsmlib/
If your GSM modem is supported then you can easily replace the pager 
functionality with sms.
It should works just with a packup/replace of the content of 
$ZENHOME/bin/zensnpp with this script:
(I don't have the modem right now to test it, feedback/comments welcomed)


Code:
#! /usr/bin/env python
### This uses gsmsmsd from gsmlib - http://www.pxh.de/fs/gsmlib/
### It is a drop-in replacement for zensnnp to use SMS instead of pager.
### gsmsmsd must be up and running! Give zenoss user write access to SPOOLDIR.
### Require a compatible GSM modem.

import os.path
import sys
import time

# where is spool dir to write the sms to be send ?
SPOOLDIR = "/var/spool/sms" 

def main():
    try:
        # only the third argument from zensnpp is used
        rcpt = sys.argv[3]
    except:
        
        print "Invalid arguments! Usage: zensnmp <garbage> <garbage> 
<recipient>"
        sys.exit(1)

    # set unique sms file path
    smsfile = SPOOLDIR + "/" + "zen-" + str(time.time())
    
    # Read message from standard in
    msg = sys.stdin.read()
    
    FILE = open(smsfile, "w")
    # first line: phone number.
    FILE.writelines(rcpt + '\n')
    # then the content of the sms
    FILE.writelines(msg)
    
    FILE.close()
    # the sms file will be processed by gsmsmsd within 5s.
    # it should then be deleted or moved to a 'sent' directory.
    print "SMS writen to file '%s'!" % smsfile
    
main()







-------------------- m2f --------------------

Read this topic online here:
http://community.zenoss.com/forums/viewtopic.php?p=21909#21909

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to