[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Nokia 6021 - smsd and mysql - pulls out Inbox messages but not Sent
From: |
Jan Derfinak |
Subject: |
RE: Nokia 6021 - smsd and mysql - pulls out Inbox messages but not Sent items messages |
Date: |
Fri, 30 Dec 2011 17:02:20 +0100 (CET) |
User-agent: |
Alpine 2.00 (LNX 1167 2008-08-23) |
On Fri, 30 Dec 2011, Andrew Thompson wrote:
> Basically I have a problem where nagios can flood the phone with sms
> alerts to send out and they all appear to be sent out at the exact same
> second according to Nagios. When this happens no texts are ever received
> even though Nagios says they were sent.
>
> So I would pointed off to using the smsd with mysql to manage the
> congestion issues and it should send any messages that are in the tables
> that are not marked as sent.
The advise you got was right, sql server can accept sms messages in much higher
rate than phone.
>
> So in light of what you said I just need to get Nagios to send its messages
> to the sql first instead of directly out to the contacts and then sql sends
> the message back to the phone to send out?
Right, but not SQL but smsd will send messages stored in database.
>
> Do you have any info on how to manage this as I currently have nagios
> commands to send directly to mobile phone number
>
> Define command{
> Command_name host-server-by-sms
> Command_line /usr/bin/printf "%b" "***Nagios***\n\n
> $NOTIFICATIONTYPE$\n\n $HOSTALIAS$ is $HOSTSTATE$" ¦ /usr/bin/gnokii
> --sendsms $CONTACTPAGER$
> }
I'm not Nagios expert so somebody can find better integration with Nagios.
Try to use something like this:
Command_line /usr/bin/printf "INSERT INTO outbox (number, text)
values ('$CONTACTPAGER$', '%b ***Nagios***\n $NOTIFICATIONTYPE$\n $HOSTALIAS$
is $HOSTSTATE$');" ¦ mysql [mysql_parameters] smsd_db_name
It works for me from command line but it is not tested with Nagios. Maybe
you will need to play with " and '. I don't know what %b is for.
Jan
>
> -----Original Message-----
> From: address@hidden [mailto:address@hidden On Behalf Of Jan Derfinak
> Sent: 30 December 2011 13:18
> To: Discussion forum for gnokii users.
> Subject: Re: Nokia 6021 - smsd and mysql - pulls out Inbox messages but not
> Sent items messages
>
> On Fri, 30 Dec 2011, Andrew Thompson wrote:
>
> Hello.
>
> > It moves any items out of the Inbox to the sql table but still leaves
> > behind anything in the sent items folder on the phone.
>
> Smsd doesn't care about phone's sent folder. It checks only phone's inbox
> folder.
>
> > Do I have to leave the smsd command running all the time instead of
> > manually stopping it with CTRL+C?
>
> Yes, you can if you want.
>
> >
> > How do I get the Sent Items off of the phone as these are the ones I want.
> >
> > The phone will not ever receive any inbox messages its purely going to
> > be sending out texts from Nagios and that’s it.
>
> I don't understand why is Sent folder important for you. It contains messages
> you sent from phone. If I remember right, you can set in phone's messages
> settings if want to save sent messages.
>
> For nagios use, the sent folder is not important. All what you need is to set
> nagios to insert new messages to outbox table. Smsd will periodicaly checks
> outbox table and will sent new messages from this table to recepients.
>
> Jan
>
>
--