Deer PRTG KB,
I have tried your link how SENDING OUT PRTG SMS NOTIFICATIONS USING A GSM MODEM AND THE MWCONN FREEWARE TOOL as below link.
https://www.paessler.com/blog/sending-out-prtg-sms-gsm-modem-mwconn
Could you please let me know as I have now a question as mentioned subject?
Many thanks, Huan
Article Comments
You don't need to add a 2nd phone number to the notification parameter field. The phone number has to be added in the user account, in the notification contacts tab ("Add SMS contact") :)
Sep, 2016 - Permalink
Many thanks Stephan. But my purpose that I can send a SMS notification to both of phone number at the same time once my state trigger occurred. Is this possible?
Sep, 2016 - Permalink
That will happen automatically if you send it to the user that has the two phone numbers configured. You can also configure multiple numbers in the notification setup itself, in the send to number field (comma seperated, starting with + and the corresponding country code).
Sep, 2016 - Permalink
Yes, I just added the second SMS contact to the user A, but I do not see the option "send to User A" by SMS notification -Execute program (with MWconn.bat) as other send SMS options.
Sep, 2016 - Permalink
Ah, my bad - I didn't see that, even though you wrote it in caps ;) It seems like mwconn can't handle multiple numbers. Are't push notifications a viable option here?
Sep, 2016 - Permalink
That seems does not make sence :-( since I am trying with execute program by SMS notification that have no "send to number" field nor "send to the user" as well.
Sep, 2016 - Permalink
Yeah, since it's a custom exe notification which doesn't rely on users or groups as it's always simply executed. When you execute it using PowerShell, you could do something like this:
param( [string[]]$numbers, [string]$sitename, [string]$device, [string]$name, [string]$status, [string]$message ) $Date = (Get-Date -Format "ddMMyyyy-HHmmss") $sms_content = ([string]::Format("[{0}] {1} {2} {3} {4}", $sitename, $device, $name, $status, $message Foreach($number in $numbers) { $sms_content | Out-File -Path "c:\mwconn\sms_send\$($Date)_$($number)"; }
Call this with the following parameters instead of the default batch file (save it as mwconn.ps1):
-Numbers @(1555123456,12212212,1212121) -SiteName '%sitename' -Device '%device' -Name '%name' -Status '%status' -Message '%message)'
It will create text files for every given number in the $numbers parameter and mwconn will read the single text files.
Note Remember to execute Set-ExecutionPolicy RemoteSigned in an administrative PowerShell on the PRTG Core Server. Otherwise, the script will not work properly. Also make sure to have the latest PowerShell, at least v4.0, installed.
Sep, 2016 - Permalink
Dear Stephan,
Many thanks for your instruction but I do not know why the script does not work at my side.
It did not generated any sms file in sms_send folder.
But I have success to clone primary sms file to second one by a Windows script once the PRTG sms notification trigger occurred.
I wish you good health and all the best.
Sep, 2016 - Permalink
yes, now I and my colleague could receive a PRTG SMS notification at the same time. Cheer :-)
Sep, 2016 - Permalink
Hi,
thanks Stephan for sharing your powershell script with us, it helped me a lot. But I had to change it a bit to get it to work, so I thought it would be a good idea to share it with all the prtg users who are in the same position as me.
I had to change the parameters as well as the .txt encoding because powershell did not save the output in a text file readable by mwconn. Therefore I had to change the encoding to "default" or "ascii". My system is a Windows Server 2012 R2 machine.
Here's the code:
param( [string[]]$numbers, [string]$sms_content ) $date = (Get-Date -Format "ddMMyyyy-HHmmss") $path = "c:\mwconn\sms_send" Foreach($number in $numbers){ $sms_content | Out-File -Encoding default -FilePath "$path\sms_PRTG-$($date)__$($number).txt" start-sleep -s 5 }
With now only 1 parameter for the sms content, the prtg values can be written into one single parameter. You can now call the powershell with this, for examlple:
-numbers @("49123456789","49987654321","4911111111") -sms_content '%device: Sensor %shortname is %status since %statesince !!!'
Please note that the numbers are in double quotes whereas the sms content is in single quotes - otherwise the parameter would be cut off after the first space.
I hope this helps!
Nov, 2017 - Permalink
What I mean that at step 8 "ADD PRTG NOTIFICATION" from above link, how can I add a 2nd phone number in the "Parameter" field. For example, enter: 1555123456 "[%sitename] %device %name %status %down (%message)"
I already try by - or ; or , between 2 phone numbers but does not work at all.
Anyone can help me pls?
Sep, 2016 - Permalink