Ad Widget

Collapse

Script that send sms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dimka779
    Junior Member
    • Mar 2014
    • 22

    #1

    Script that send sms

    Hello. I want to make zabbix send SMS when the trigger is activated .
    FreeBSD 8 , Zabbix 1.8, SMSTools

    Trying to implement it with a script that uses zabbix:

    /usr/local/etc/zabbix/externalscripts /sms_send.sh

    #! / bin / sh

    to = $ 1
    subject = "$ 2"
    body = "$ 3"
    sendsms $ to "$ subject" "$ body"
    The problem is that the /var/spool/sms/outgoing file is created with the owner zabbix:dialer and permission are read / write by owner and nothing sending out .
    If I give more permissions give or just change the owner to uucp then messages sends immediately .
    How to make that script create a file with the owner uucp:dialer?

    I'm add user 'zabbix' to the uucp group and dialer groupr, restart zabbix_server, but the file is still have owner zabbix:dialer


    inspection # pw groupmod uucp-m zabbix
    inspection # pw groupmod dialer-m zabbix
    inspection # pw groupshow dialer
    dialer: *: 68 : zabbix
    inspection # pw groupshow uucp
    uucp: *: 66 : zabbix
    inspection # rehash
    inspection # /usr/local/etc/rc.d/zabbix_server restart
    in a file /usr/local/share/smstools/sendsms:

    smsd_user = "uucp"
    file smsd.conf:

    devices = huaweiE150
    loglevel = 7
    # loglevel 7 - maximum output for debugging

    USER = uucp
    GROUP = dialer

    PIDFILE = / var / run / smsd / smsd.pid
    INFOFILE = / var / run / smsd / smsd.working
    outgoing = / var / spool / sms / outgoing
    checked = / var / spool / sms / checked
    incoming = / var / spool / sms / incoming
    failed = / var / spool / sms / failed
    sent = / var / spool / sms / sent
    autosplit = 3

    [huaweiE150]
    device = / dev/cuaU4.0
    baudrate = 115200
    rtscts = no
    init = at + cpms = "sm", "sm", ""
    incoming = yes
    incoming = high
    pin = 0000
    memory_start = 0
    # Cat / tmp / zabbix_server.log

    chown: / tmp / smsd_foCFRN: Operation not permitted
    mv: / var/spool/sms/outgoing/send_ZF3g6E: set owner / group (was: 122/ 0 ): Operation not permited
    SMS sends fine from the command line (root)
    I think to try run a script via sudo with user uucp, but maybe there is another way to solve this?

    Thanks and sorry for english.
Working...