Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
1
answers
47
views
Send monit alert at most once in Linux?
My script to send sms #send-sms.sh curl "http://10.10.10.10:1084/somerandomhexcode&username=username@goes.here&password=passwordgOesHere&countryCode=countrycodegoeshere&mobileNumber=%2bphone_number_with_country_code_goes_here&message=message_goes_here" I've tested this script independently and it se...
My script to send sms
#send-sms.sh
curl "http://10.10.10.10:1084/somerandomhexcode&username=username@goes.here&password=passwordgOesHere&countryCode=countrycodegoeshere&mobileNumber=%2bphone_number_with_country_code_goes_here&message=message_goes_here "
I've tested this script independently and it sends SMS successfully.
My monit config to check if a certain glassfish domain is down:
check host DOMAIN_I_WANT_TO_CHECK with address 127.0.0.1
if failed port 10080 then exec "/root/send-sms.sh"
send-sms.sh
is executable with chmod 777
.
Imagine a scenario where the server goes down at 11 PM till 5AM, and alert keeps going every 60 seconds. It'll be an absolute nightmare. How do I avoid such scenarios?
achhainsan
(543 rep)
Mar 10, 2024, 03:18 PM
• Last activity: Feb 15, 2025, 01:11 PM
0
votes
2
answers
103
views
How to get SMS 2FA verification on PC using Linux Mint
I do not like having a mobile cellphone and having to carry it around all the time and do 2FA by SMS, but many services I use require it, as does my school. I also lost my phone and cannot afford a new one at the moment. I do have a SIM card with a mobile plan; is there any way I can get the SMS mes...
I do not like having a mobile cellphone and having to carry it around all the time and do 2FA by SMS, but many services I use require it, as does my school. I also lost my phone and cannot afford a new one at the moment. I do have a SIM card with a mobile plan; is there any way I can get the SMS messages on my PC?
OS: Linux Mint
PC: Thinkpad X220
Carrier: Koodo
Location: Canada
Thank you
Logan Yu
(1 rep)
Feb 12, 2024, 08:20 PM
• Last activity: Feb 13, 2024, 03:41 AM
1
votes
1
answers
688
views
ModemManager - Unable to to send SMS with curly braces
I'm stuck on a problem using ModemManager (mmcli 1.14.2) to programmatically send SMS which contains a certain combination of special characters which I have yet to identify. The SMS I'm trying to send is the following: OK({ yRgK1DNXQKo4C7uK43WnHArW1XbNekn6JJ80qgMTRcPM8pgGTJMwYDgseRRYOEA6NdCgQNgiSoh...
I'm stuck on a problem using ModemManager (mmcli 1.14.2) to programmatically send SMS which contains a certain combination of special characters which I have yet to identify.
The SMS I'm trying to send is the following:
OK({ yRgK1DNXQKo4C7uK43WnHArW1XbNekn6JJ80qgMTRcPM8pgGTJMwYDgseRRYOEA6NdCgQNgiSoheRZnK0czZy5P0GTny3rRrSEE9HTiFepFnhDxM6B2J3bpbHnHJiYbSQt40rt0dwIoZYeiEYyo7glw1kswTrg7He5Ojl8ysyxF4X54SCQomZrKRPsrEHpT2vLjCLfGn9pDGHxodwXbbKADm8j4waiGVnZfRBJBDSx8VUO28Yit068aM32t9a91NC0eUVkyUEGkNsm75cVQ7KJ0rpzucTRSudO7DJLxrgetz })
*I'm using a random string here just to simulate a large payload. In reality, the payload between curly braces is a more structured model*.
**The problem is that whenever I use the curly braces to encapsulate the payload, the message is not delivered to the recipient.**
I'm facing this issue using the following send methods.
Using MMCLI
------------
Sending SMS using mmcli with:
mmcli -m 1 --messaging-create-sms="number=,text='OK({yRgK1DNXQKo4C7uK43WnHArW1XbNekn6JJ80qgMTRcPM8pgGTJMwYDgseRRYOEA6NdCgQNgiSoheRZnK0czZy5P0GTny3rRrSEE9HTiFepFnhDxM6B2J3bpbHnHJiYbSQt40rt0dwIoZYeiEYyo7glw1kswTrg7He5Ojl8ysyxF4X54SCQomZrKRPsrEHpT2vLjCLfGn9pDGHxodwXbbKADm8j4waiGVnZfRBJBDSx8VUO28Yit068aM32t9a91NC0eUVkyUEGkNsm75cVQ7KJ0rpzucTRSudO7DJLxrgetz})'"
and then
mmcli -m 1 --sms --send
Which gives the following result:
> successfully sent the SMS
Using DBUS
----------
I use the Messaging DBUS interface to create a new SMS , set its "number" and "text" (UTF8 string) properties and then send it using its
Send()
method.
I use C# and Tmds.Dbus to interact with the bus.
## The problem ##
Using both methods, I'm unable to receive the message on the recipient's phone.
If I try to send the same message **without** curly braces, it gets delivered without any problme.
If I try to send another message **with** curly braces (something like "*OK({Test})*" it still gets delivered without any problem.
If I try to send any of the above messages from a phone to the device I'm using (with modem manager) they get received without any problem (with or without curly braces, long and short version).
It seems like there's a special combination of chars which causes problem to ModemManager and therefore does not get sent.
The fact the same message can be sent from a phone to ModemManager makes me think there isn't any problem on the mobile operator side.
Unluckly, since the actual payload contains a JSON encoded model, curly braces are important.
Andrew
(11 rep)
Jun 4, 2021, 02:00 PM
• Last activity: Nov 3, 2022, 12:10 PM
-1
votes
3
answers
248
views
Extracting SMS data from a XML
I have a large xml file of my SMS messages. I want to put them into an easily accessible csv format. I've been trying to extract the 'address', 'messageBody' and 'messageTime' sections specifically but with no luck. ``` 1 1624297248761 null null null null 1 50 447917504050 Yeah mate let's do lunch a...
I have a large xml file of my SMS messages. I want to put them into an easily accessible csv format. I've been trying to extract the 'address', 'messageBody' and 'messageTime' sections specifically but with no luck.
11624297248761nullnullnullnull150447917504050Yeah mate let's do lunch and catch up.11629944007697nullnullnullnull150447917563330You going now mate
I've had minor success with:
SMS.xml | awk -F'address' '{print $2}'
But this only takes the first 'address' from the line, ignoring the others.
Any ideas on how to get this data in to a readable csv format?
Any help interpretting the number in the 'messageTime' section would be greatly appreciated too.
EDIT: The actual xml file does have balanced open and close tags and is formatted properly. I have just included a small excerpt here.
Luke
(1 rep)
Nov 2, 2022, 01:19 PM
• Last activity: Nov 2, 2022, 03:02 PM
0
votes
1
answers
194
views
How to send text file content with xmppc command?
In the [Termux][1] app on Android I get a text file with all the SMSs like this: termux-sms-list >sms.txt And I need to send its content over xmpp automatically by script. The available command is xmppc, but it doesn't seem to support file uploads. I tried these ways and it didn't work: xmppc -j use...
In the Termux app on Android I get a text file with all the SMSs like this:
termux-sms-list >sms.txt
And I need to send its content over xmpp automatically by script. The available command is xmppc, but it doesn't seem to support file uploads.
I tried these ways and it didn't work:
xmppc -j usersender@domain.tld -p "UserPassword" -m message chat userreceiver@domain.tld $(cat sms.txt)
cat sms.txt | xmppc -j usersender@domain.tld -p "UserPassword" -m message chat userreceiver@domain.tld -
Any idea?
Ueliton Alves Dos Santos
(13 rep)
Aug 4, 2022, 03:33 PM
• Last activity: Aug 5, 2022, 01:41 AM
2
votes
0
answers
950
views
Can’t send sms with ModemManager “GDBus…: Unknown error”
I have an internal mobile modem well detected and currently working for 4G internet. BTW, ModemManager also detect it: ``` % mmcli -L /org/freedesktop/ModemManager1/Modem/0 [Hewlett-Packard] MU736 ``` So, when I try to send, I start by creating an sms: ``` % mmcli -m 0 --messaging-create-sms="text=T...
I have an internal mobile modem well detected and currently working for 4G internet. BTW, ModemManager also detect it:
% mmcli -L
/org/freedesktop/ModemManager1/Modem/0 [Hewlett-Packard] MU736
So, when I try to send, I start by creating an sms:
% mmcli -m 0 --messaging-create-sms="text=Test,number=002127…"
Successfully created new SMS: /org/freedesktop/ModemManager1/SMS/3
The SMS is correctly set:
% mmcli -s 3 -----------------------------
General | dbus path: /org/freedesktop/ModemManager1/SMS/3
-----------------------------
Content | number: 002127…
| text: Test
-----------------------------
Properties | pdu type: submit
| delivery report: not requested
But, when I try to send it, it failed:
% mmcli -s 3 --send
[06 mars 2022, 07:50:31] [Debug] Assuming '3' is the SMS index
[06 mars 2022, 07:50:31] [Debug] ModemManager process found at ':1.15'
[06 mars 2022, 07:50:31] [Debug] SMS found at '/org/freedesktop/ModemManager1/SMS/3'
error: couldn't send the SMS: 'GDBus.Error:org.freedesktop.ModemManager1.Error.MobileEquipment.Unknown: Unknown error'
### Edit
Sometimes I also can get this kind of error message:
% mmcli -s 4 --send
error: couldn't send the SMS: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Connected: No AT port available to run command'
So, what does it mean and how could I solve it?
fauve
(1529 rep)
Mar 6, 2022, 06:51 AM
• Last activity: Mar 6, 2022, 06:16 PM
6
votes
2
answers
4091
views
Why does my USB modem produce multiple /dev/ttyUSB* files?
I have a single Sierra Wireless USB 308 modem we are using for sending SMS message to, and receiving SMS messages from, customers. When this single device is plugged in, the system creates multiple device files: `/dev/ttyUSB0`, `/dev/ttyUSB1`, `/dev/ttyUSB2`, `/dev/ttyUSB3`. I read somewhere that th...
I have a single Sierra Wireless USB 308 modem we are using for sending SMS message to, and receiving SMS messages from, customers.
When this single device is plugged in, the system creates multiple device files:
/dev/ttyUSB0
, /dev/ttyUSB1
, /dev/ttyUSB2
, /dev/ttyUSB3
. I read somewhere that the sending of SMSes must use the third device file (/dev/ttyUSB2
). I'm using SMS tools .
Questions:
1. Why does a single device produce multiple device files in the /dev
directory?
2. I want to be able to symlink /dev/ttyUSB2
to /dev/sms-sierra
. When running udevadm info -a /dev/ttyUSBXXX
on each device file (where "XXX" is "0", "1", "2" or "3"), the information for each "device" is almost identical. Because the device numberings are not always the same, how can I write a udev
rule to detect the appropriate device number to use?
For question 1, I have no idea. For question 2, is there a program required in order to probe the device file as to whether it can send SMS (e.g., by seeing if it responds to the appropriate modem "AT" commands)?
Magnus
(101 rep)
Apr 1, 2015, 12:48 AM
• Last activity: Nov 27, 2020, 10:08 PM
11
votes
6
answers
15575
views
Possible to get SMS/text message notification when process ends or is killed?
There are scripts that will send an e-mail when a server process is finished. However, I do not want to check my email every so often just to see whether a job has finished. Therefore I'd like to get an SMS message. My question is similar to this one, just exchange SMS with all occurrences of "e-mai...
There are scripts that will send an e-mail when a server process is finished.
However, I do not want to check my email every so often just to see whether a job has finished. Therefore I'd like to get an SMS message.
My question is similar to this one, just exchange SMS with all occurrences of "e-mail": Is there a program that can send me a notification e-mail when a process finishes?
Can you think of any workaround / app / script / whatever that would enable an SMS to be sent when a job is finished (or prematurely ended?)
The Unfun Cat
(3451 rep)
Jul 13, 2013, 03:27 PM
• Last activity: Sep 14, 2020, 06:29 PM
0
votes
0
answers
47
views
logging into the system using one time passwords which are sent via SMS
I have to implement an additional layer of protection in the system. The user has to log in to the system with the password he received in the text message. I don't know which module I should look for and how to configure it. Has any of you implemented a similar solution and can you tell me how to s...
I have to implement an additional layer of protection in the system. The user has to log in to the system with the password he received in the text message. I don't know which module I should look for and how to configure it. Has any of you implemented a similar solution and can you tell me how to solve this task?
The solution can be implemented on any linux distribution.
bot
(1 rep)
May 1, 2020, 10:22 AM
0
votes
2
answers
104
views
Is there a program to pair my phone with my computer for SMS messaging?
Sometimes I have to manage a conversations over SMS through my phone. This is especially frustrating when I'm trying to get work done on my computer. I don't mind holding a conversation but there is a considerable amount of mental and physical task-switching by picking up the phone, turning it on, u...
Sometimes I have to manage a conversations over SMS through my phone. This is especially frustrating when I'm trying to get work done on my computer.
I don't mind holding a conversation but there is a considerable amount of mental and physical task-switching by picking up the phone, turning it on, unlocking it, responding, deciding whether to keep holding it or set it down again and then repeat.
It would be very convenient if I could manage these conversations from my computer when I'm logged in.
Before anyone asks, I cannot ignore these messages and they often require a response. It is unreasonable to ask all of my contacts to instead contact me through an alternate preferred messaging app as SMS is already viewed as the lowest common denominator between platforms.
My phone is running Android. My workstation is Fedora running MATE Desktop.
Brownie points if there is a solution that integrates with Pidgin.
Zhro
(2831 rep)
Sep 12, 2019, 06:26 PM
• Last activity: Sep 12, 2019, 06:47 PM
12
votes
3
answers
15982
views
How to read SMS stored on a SIM card?
I have an old phone with a telephone card (SIM card) inside. The telephone has an infrared interface on the side. I want to read out my contacts and stored SMS messages from the phone, either via infrared, or by connecting the SIM to the computer by means of some kind of card reader. I once managed...
I have an old phone with a telephone card (SIM card) inside. The telephone has an infrared interface on the side.
I want to read out my contacts and stored SMS messages from the phone, either via infrared, or by connecting the SIM to the computer by means of some kind of card reader.
I once managed to read the data via infrared, but I cannot recreate the needed setup because I have no computer with irda interface anymore. So I've bought a card reader, which unfortunately only works on Windows. The application that comes with it is absolute trash and does not allow saving of data (WTF?!?! Who designed THIS?). Whatever, this reader has a credit-card sized plastic card where you can plug in the SIM card, so I plug the SIM into any kind of card reader. So my question:
- How can I get the stored data from the SIM using this Adapter? I have access to a computer that contains an integrated card reader, but I would have to check how to do it beforehand.
- If I get hold of an infrared interface somehow, which program is the best choice to read out stored SMS messages and pohonebooks? How is this done? (cmd-lines/link to howto preferred).
I hope someone can help, since the phone starts to die, and I want to save all my SMS which don't all fit on the SIM (I would have to copy them from phone memory to the SIM, delete them and copy the next batch, since the SIM can only store 10 messages ...).
hochl
(457 rep)
Jan 5, 2012, 02:29 PM
• Last activity: Apr 26, 2019, 04:58 PM
0
votes
2
answers
1029
views
How can I setup two factor auth (sms) via ssh connection
I am writing a bash script on ubuntu 16.04 and I want to setup **Two factor authentification via SMS on SSH connection** to the server. I saw that there is a way to do it with a google authentication system. But for that the client must download an app first. I want to send a SMS (simple text that c...
I am writing a bash script on ubuntu 16.04 and I want to setup **Two factor authentification via SMS on SSH connection** to the server. I saw that there is a way to do it with a google authentication system. But for that the client must download an app first. I want to send a SMS (simple text that contain a code) to a cell phone that the user will use plus his password to gain access to the server. Even if I can use a service or a non-free gateway via an api to send the SMS.
Could you help me please?? Thanks you.
Jospy
(1 rep)
Mar 12, 2018, 10:06 AM
• Last activity: Oct 12, 2018, 05:18 PM
1
votes
0
answers
72
views
Cause Code Not Implemented for Heirloom-Mailx
I am attempting to send an message with an attachment from my RP3 to my phone, which uses Sprint. I have Exim4 setup as a MTA and the Heirloom-MailX configured so I can send an attachment. I am using gmail to send the text messages. I am able to send text messages from my RP3 to my phone without any...
I am attempting to send an message with an attachment from my RP3 to my phone, which uses Sprint. I have Exim4 setup as a MTA and the Heirloom-MailX configured so I can send an attachment. I am using gmail to send the text messages. I am able to send text messages from my RP3 to my phone without any issues. However, when I try to send an attachment (for example, a .png), my phone simply says "cause code not implemented". It does not give any other information or error code with this message.
I am using the gateway for media/pictures (XXXXXXXXXXX@pm.sprint.com rather than XXXXXXXXXX@messaging.sprintpcs.com) when I send the attachment. The attachment itself is fine, as I can log directly into gmail and send an e-mail to my phone with the same attachment. This leads me to believe that the issue lies with Heirloom itself. Does anyone know how I can resolve this issue? I'd appreciate any help. Thanks!
nightmare637
(111 rep)
Nov 4, 2017, 07:06 PM
1
votes
1
answers
541
views
Unable to run a .py file in cgi-bin by using ajax call from my .php file
Hi guys:) I am using a Beagle Bone Black with Debian Wheezy to make a project. I have a small problem:I have my index.php in /var/www from there I call a python file called send_email.php using ajax: `$.ajax({ url:"/cgi-bin/send_email.py" });` It works properly (it sends me an email and I receive it...
Hi guys:) I am using a Beagle Bone Black with Debian Wheezy to make a project. I have a small problem:I have my index.php in /var/www from there I call a python file called send_email.php using ajax:
`$.ajax({
url:"/cgi-bin/send_email.py"
});`
It works properly (it sends me an email and I receive it).
But when I try to do the same thing with send_sms.py which has the following code inside
`import nexmo
client = nexmo.Client(key='XXXXX', secret='XXXXXXXXX')
client.send_message({'from': 'Nexmo number', 'to': 'My own number', 'text': 'Hello World'})`
When I run it from the terminal using: python send_sms.py, it works properly but when I call it using ajax it does not. I am confused as I thought that by calling any .py file in cgi-bin by using ajax, it would execute them (and it works for my send_email.py) but with send_sms.py it does not.
Thank you for your help, it is appreciated!
Juan Jose Jaramillo
(11 rep)
Apr 4, 2017, 10:04 PM
• Last activity: Apr 11, 2017, 03:10 AM
5
votes
2
answers
32016
views
Is there any way to send sms to a mobile number using shell script?
I want to send sSMS periodically to certain Mobile numbers (Indian mobile numbers.) Is there a way I can send an SMS with my own cellphone number or by creating an account on a site like `way2sms`?
I want to send sSMS periodically to certain Mobile numbers (Indian mobile numbers.) Is there a way I can send an SMS with my own cellphone number or by creating an account on a site like
way2sms
?
Deepak K M
(127 rep)
May 16, 2015, 08:01 AM
• Last activity: Dec 24, 2016, 02:39 PM
2
votes
1
answers
340
views
How to install SMS Servers and Phone Servers?
If we want our servers to email, we know that we should install `sendmail` or `qmail`. If we want our servers to send SMS or robot calling (e.g voice confirmation [insecure method] ), what should we install on our servers?
If we want our servers to email, we know that we should install
sendmail
or qmail
. If we want our servers to send SMS or robot calling (e.g voice confirmation [insecure method] ), what should we install on our servers?
Spacez Ly Wang
(123 rep)
Oct 30, 2012, 03:37 PM
• Last activity: Sep 27, 2016, 07:38 PM
3
votes
3
answers
2011
views
How to fetch and process mail in order to execute commands?
I administer a home server, and sometimes when I'm out, I need to execute some simple commands on the server. 3G + SSH is not an option because it's too expensive from my phone (here in Argentina). It is easier to send an SMS to my mail account. I want to fetch the mails I send to my server, and pro...
I administer a home server, and sometimes when I'm out, I need to execute some simple commands on the server. 3G + SSH is not an option because it's too expensive from my phone (here in Argentina). It is easier to send an SMS to my mail account.
I want to fetch the mails I send to my server, and process the text surrounded by
**
as bash commands.
What approach would you recommend?
Tomas
(1064 rep)
Jun 9, 2011, 03:33 AM
• Last activity: Sep 27, 2016, 07:32 PM
2
votes
1
answers
3851
views
How can I send SMS messages from my mobile/router? (Linux/Textmode)
I love mails sent to me from my own system, but I want more... I want... for instance, texts about my system, and a little web-based SMS sender too. So, I buy a GSM (3G) router. This router can also send SMS messages, and here is my question: Is there some (_commandline_) utility to use from Perl/Ba...
I love mails sent to me from my own system, but I want more...
I want... for instance, texts about my system, and a little web-based SMS sender too. So, I buy a GSM (3G) router. This router can also send SMS messages, and here is my question:
Is there some (_commandline_) utility to use from Perl/Bash/PHP scripts to do so?
And no, I do _not_ want to rely on a script that calls a free web-based SMS sender. I want to use _my_ router, _my_ number.
D4RIO
(1596 rep)
Jun 8, 2011, 12:58 AM
• Last activity: Sep 27, 2016, 06:41 PM
3
votes
1
answers
1242
views
What is the difference between Minicom and gammu-smsd?
My understanding of Minicom: Minicom is a text-based modem control program (allows you to communicate with modem via AT commands on a text-based terminal) using serial port communications. Therefore, you can configure a modem using Minicom and even have the modem send SMS messages: at+CMGS=954xxxxxx...
My understanding of Minicom:
Minicom is a text-based modem control program (allows you to communicate with modem via AT commands on a text-based terminal) using serial port communications. Therefore, you can configure a modem using Minicom and even have the modem send SMS messages:
at+CMGS=954xxxxxxx
> Hello World
+CMGS: 8
My understanding of gammu-smsd:
gammu-smsd
is a program that periodically scans modem for received messages, stores them in defined storage (e.g. postgresql
/mysql
database) and also sends messages enqueued (stored in a queue) in this storage.
So both programs can send SMS messages using a modem. Both need to be configured to listen to the /dev/ttyS0
(assuming the modem is attached to first serial port) and both use the AT command set and baud rates.
So are both needed or can you just use gammu-smsd
without having to use Minicom?
JohnMerlino
(6491 rep)
Oct 7, 2013, 08:07 PM
• Last activity: Sep 27, 2016, 05:47 PM
3
votes
1
answers
809
views
Unable to use GSM and GPRS with 3G USB Dongle on BeagleBone Black at the same time
I'm working on BeagleBone Black (Debian running on it) and I have connected a 3G USB dongle (Huawei E173u-2) with it for GPRS and sending SMS. Now I am facing a problem when I am booting my board (dongle attached). I can access GPRS service, but cannot send SMS at the same time (using AT commands fr...
I'm working on BeagleBone Black (Debian running on it) and I have connected a 3G USB dongle (Huawei E173u-2) with it for GPRS and sending SMS.
Now I am facing a problem when I am booting my board (dongle attached). I can access GPRS service, but cannot send SMS at the same time (using AT commands from MINICOM). If GPRS service is on and I am sending AT command to 3G USB dongle, I am getting a reply
Service Temporarily Unavailable.
If I run command on terminal
ifdown gprs(service name)
ie. GPRS service is OFF, now I am able to send SMS.
In SMS mode if I run command in terminal
ifup gprs(service name)
I am not able to get GPRS connection until I close MINICOM connection used to send AT commands to 3G USB Dongle.
As I have searched about this issue, I have read a blog which says each service locks the port at which dongle is connected. Until service releases the port, other service cannot access the same port.
I have tried this on Windows and found that I can access both services at the same time.
What is the actual cause of this issue and how to resolve it?
Saad Rafey
(323 rep)
Aug 1, 2015, 12:33 PM
• Last activity: Sep 27, 2016, 05:08 PM
Showing page 1 of 20 total questions