Hi!

 

Instead of messing with rights on the tty you could try running gammu as a 
deamon (-smsd option) and then use the queing script (smsqueue.pl iirc - 
located somewhere in the gammu sources). 

 

This only requires permissions on the queue directory (/var/spool/sms - or 
something like that).

 

/Allan

 

Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Simon Welch
Sendt: 23. marts 2007 15:11
Til: Dinçer Kavraal; [email protected]
Emne: Re: [Nagios-users] SMS notification with gammu - Solved

 

The problem was due to the /dev/ttyACM0 device that was created when the mobile 
was connected via USB not having rw access for other user.  Is there a way to 
make these permissions persistent on a reboot or disconnection of a hot plug 
device? 

Many thanks

Simon

On 3/23/07, Dinçer Kavraal <[EMAIL PROTECTED]> wrote:

Hello Simon, 
Probably, it is so. Otherwise, I don't have anything sensible in my mind about 
this. Could you check (if possible pass to Nagios user and try to execute) 
/usr/bin/printf
/usr/local/bin/gammu
can be readable and executable by Nagios user?

you can simply add 
# chmod +x /usr/bin/printf
# chmod +x /usr/local/bin/gammu

however, one more problem can occur. gammu also could be able to read its 
resources as nagios user. Anyway, let's try to execute the command as Nagios 
user. Waiting for your reply... 

Dinçer



2007/3/23, Simon Welch <[EMAIL PROTECTED]>: 

        Dinçer 
        
        I did as you suggested and echoed the command into a temporary file 
(output below), so the notification is been triggered.  Again if I run the 
output of the text file manually then the sms is sent as expected but not as 
part of the notification command.  Could it be due to permissions? 
        
        /usr/bin/printf "%b" "Svc:HTTP ++Host:Abs Self Service Server 2 ++ 
Addr:MailScanner warning: numerical links are often malicious: 89.50.35.113 
<http://89.50.35.113>  ++ State:CRITICAL ++Date:23-03-2007 11:53:08" | 
/usr/local/bin/gammu --sendsms TEXT 00000000 
        
        Regards
        
        Simon

         

        On 3/18/07, Dinçer Kavraal < [EMAIL PROTECTED] <mailto:[EMAIL 
PROTECTED]> > wrote:

        Hi Simon,
        Let Nagios to write the action into a file. This is because you should 
be sure that Nagios runs the command exactly as yours. There can be some 
exceptions (bugs, some missed escape chars, ...).
        Thus, see the difference. 
        
        First of all, let it write into a file. For instance, change the 
command like,
        echo '/usr/bin/printf "%b" "Svc:$SERVICEDESC$ ++Host:$HOSTALIAS$ ++ 
Addr:$HOSTADDRESS$ ++ State:$SERVICESTATE$ ++Date:$SHORTDATETIME$" | 
/usr/local/bin/gammu --sendsms TEXT $CONTACTPAGER$' >> /tmp/someTempFile
        
        After you're sure a notification is done, open that temporary file and 
get a random line (first, last or any) then try to execute it. Result? Same? 
        
        This makes difference. Waiting for your reply.
        
        Dinçer

        2007/3/17, Simon Welch < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >:

        Please can someone help or point me in the direction of a log I can 
interrogate, I am using gammu to attempt to send sms notifications (command 
definition below, as detailed on gammu web site).  The nagios.log reports that 
the notification has been sent sucessfully but the message is never received, 
if I run the command manually the sms is received.  Any ideas? 
        
        Details FC6 PPC, Gammu version 1.10.1 (compliled from source), Nagios 
2.7 yum repository install.
        
        define command{
               command_name    notify-by-sms-direct
               command_line    /usr/bin/printf "%b" "Svc:$SERVICEDESC$ 
++Host:$HOSTALIAS$ ++ Addr:$HOSTADDRESS$ ++ State:$SERVICESTATE$ 
++Date:$SHORTDATETIME$" | /usr/local/bin/gammu --sendsms TEXT $CONTACTPAGER$ 
        }
        
        Thanks in advance
        
        Simon

        
-------------------------------------------------------------------------
        Take Surveys. Earn Cash. Influence the Future of IT
        Join SourceForge.net's Techsay panel and you'll get the chance to share 
your 
        opinions on IT & business topics through brief surveys-and earn cash
        
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
        _______________________________________________
        Nagios-users mailing list
        [email protected]
        https://lists.sourceforge.net/lists/listinfo/nagios-users 
        ::: Please include Nagios version, plugin version (-v) and OS when 
reporting any issue.
        ::: Messages without supporting info will risk being sent to /dev/null

         

        
        
        

        -- 
        <a href=" 
http://www.nintendo-europe.com/NOE/en/GB/register/index.jsp?a=SimpleSimon&m=b 
<http://www.nintendo-europe.com/NOE/en/GB/register/index.jsp?a=SimpleSimon&m=b> 
" target="_blank"> <img 
src=http://welch-family.strangled.net/~swelch/images/banner_2_full.gif/ 
<http://welch-family.strangled.net/%7Eswelch/images/banner_2_full.gif/> ></a> 

 




-- 
<a 
href="http://www.nintendo-europe.com/NOE/en/GB/register/index.jsp?a=SimpleSimon&m=b
 " target="_blank"> <img 
src=http://welch-family.strangled.net/~swelch/images/banner_2_full.gif/></a> 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Reply via email to