ITI's "CarrierSMS" Gateway for "PHP Server Monitor"
CarrierSMS v2.0.0 for PHP Server Monitor v3.1.1, Last updated: January 3rd, 2016
SMS Messaging About the Gateway
The SMS Gateway's ported with the "PHP Server Monitor" are all of a "pay-per-use" nature. But...
Most Mobile Phone Carriers have an "sms gateway" that can be used to send "text messages" to their cell/mobile phone customers.
CarrierSMS was written to implement the free sms text messaging available from your mobile carrier.
The first version of CarrierSMS was v1.0.0 and was really more of a "proof of concept".
I decided not to release it and instead created v2.0.0 which is complete with all the appropriate new fields,
setup info, notifications and associated error messages.
This Gateway was written for "PHP Server Monitor" version "v3.1.1" and the current "phpservermon-develop" branch.PHP Server Monitor is an "Open source tool to monitor your servers and websites" and is available from PHP Server MonitorDetermining your Mobile email address
To use this Gateway you will need to determine your mobile's "email gateway address", which is usually in the form of
"<cellnumber>@<mobilecarrier>".
For example, I'm with Bell Mobility in Canada. You can send txt messages to Bell customers by emailing them at
<10-digit-phone>@bell.ca, or <10-digit-phone>@bellmobility.ca.
To get your address, first try sending a text message from your mobile device to an email account.
Then open the email and have a look at the "From" address.
Test this "From" address in your "PHP Server Monitor" Config > Email setup.
You can also check this site to see if your Carrier is listed AVTECH.
(Apparently AVTECH's database is actively maintained and updated whenever they are made aware of new a carrier gateway.)
If the first two methods don't work contact your provider and/or perform your own internet searches.
CarrierSMS uses email to send text messages to your device.
If you are unable to send an email in the "Config > Email" section, CarrierSMS will not work for you.
You do not have to have "Email" enabled but the email settings must still be configured correctly.
Modifications / InstallationModifications
All the changes made to the "PHP Server Monitor" core files are in an arrays in the installation file.
If you want to know what has been change and where, have a look through the "CarrierSMS-Install.php" file.
The modifications do not prevent you from using one of the other pay-per-use gateways and has no affect on the installation if not selected as the SMS gateway.
Installation
I have tested the installation file on a Windows 2003 server and a CentOS 7 (linux) server.
The install file will run in either a browser or from the command line but may fail in the browser if it can't write to the folder/files.
The install file can also be run on a "phpservermon-develop" branch installations and the correct files will be selected/edited.
"CarrierSMS.class.php" will be renamed "CarrierSMS.php"
Download and unzip CarrierSMS.zip into the root directory of your monitor installation.
Or unzip it locally and upload "CarrierSMS-Install.php" to your installation root and "CarrierSMS.class.php" to the "src/psm/Txtmsg/" directory
Run "CarrierSMS-Install.php" with Administrative / root permissions. [ # php CarrierSMS-Install.php ]
Accepting the default settings will create "*.carriersms.bak" files.
Login to your PHP Server Monitor.
Add your gateway email addresses to your user profiles.
Go to Config > Email and configure the Email settings.
Go to Config > SMS and select "CarrierSMS" from the dropdown list.
Optionally enter an alternative "from" address in the "Sender's phone number" field.
The default installation settings will add the CarrierSMS language variables to "en_US" and your currently select language files.
If you change languages after the install you can re-run the install to automatically add the CarrierSMS vars to it, or manually copy them from the "en_US" file.
After the installation has completed (and there were no errors), you can use your browser to see the list of modified files since there shouldn't be any write operations.
http://your.servermonitor.dom/CarrierSMS-Install.php
Download
Download the zip file CarrierSMS.zip and extract it in the root directory of your "PHP Server Monitor" installation.
The zip file will extract "CarrierSMS-Install.php" to the root dir of your installation and "CarrierSMS.class.php" to the "src/psm/Txtmsg/" directory.
To run the install/update script, run: http://your.server.monitor/CarrierSMS-Install.php
(You may have to give write permissions to CarrierSMS-Install.php)
Screen ShotsInstallUser/ProfileConfigComments - Feedback - bugs
If you find something wrong please let me know.
If you have a comment please let me know.
Send Feedback, Comments and Bugs to
About the Author
Glen Arason in the owner/operator of ITI Internetworking Technologies Inc.
ITI provides Consulting Services, Domain Name Registration, and Domain Hosting for Canadians coast to coast.
Glen is a certified Developer, Site Designer and Internetworking professional.