Perl CGI SMS gateway for Brovi/Huawei HiLink LTE modems (E3372-325). Provides a web dashboard and Zabbix webhook integration for alert notifications.
Copyright (c) 2026 PlurumTech.com. See LICENSE for terms.
- Send SMS via modem HTTP API
- Async SMS sending with job queue
- Web dashboard: device status, signal info, network, SMS inbox/outbox
- Zabbix 6+ GET-based webhook alert integration
- Apache Basic Auth protection
- Phone number normalization (
8...→+7...)
- Apache httpd with mod_cgi
- Perl 5 with
CGI,IO::Socket::INET,JSONmodules - HiLink modem (E3372-325 or similar) at
192.168.8.1
| File | Purpose |
|---|---|
HilinkSMS.pm |
Core Perl module — all modem logic |
sms-gw.pl |
CGI + CLI dual-mode (detects automatically) |
hilink-sms-cli.pl |
CLI-only tool (lightweight alternative) |
hilink-smsd.pl |
Standalone HTTP daemon (no Apache) |
hilink-dash.html |
Web dashboard UI |
hilink-auth.conf |
Apache Basic Auth config |
zabbix_hilink_sms_webhook.yaml |
Zabbix media type import |
- Copy files to server:
scp HilinkSMS.pm sms-gw.pl user@server:/var/www/cgi-bin/
scp hilink-dash.html user@server:/var/www/html/
scp hilink-auth.conf user@server:/etc/httpd/conf.d/- Set permissions:
chmod 755 /var/www/cgi-bin/sms-gw.pl /var/www/cgi-bin/HilinkSMS.pm
chgrp apache /var/www/cgi-bin/sms-gw.pl /var/www/cgi-bin/HilinkSMS.pm- Create log directory:
mkdir -p /var/www/cgi-bin/log
chown apache:apache /var/www/cgi-bin/log- Create htpasswd file:
htpasswd -c /var/www/cgi-bin/.htpasswd admin
chgrp apache /var/www/cgi-bin/.htpasswd
chmod 660 /var/www/cgi-bin/.htpasswd- Restart Apache:
systemctl restart httpdBy default, Basic Auth protects both the dashboard and CGI. To allow Zabbix server to send SMS without authentication, add your Zabbix server IP to hilink-auth.conf:
<RequireAny>
Require valid-user
Require ip <ZABBIX_SERVER_IP> # <-- replace with your Zabbix server IP
</RequireAny>Then reload Apache:
systemctl reload httpd- Dashboard:
http://server/hilink-dash.html - API (CGI):
http://server/cgi-bin/sms-gw.pl?action=send&phone=+71234567890&msg=Hello - API (CLI):
perl sms-gw.pl phone=+7XXXXXXXXXX text="Alert" - Default credentials:
admin/hilink2026
Import zabbix_hilink_sms_webhook.yaml as a media type in Zabbix 6+.
Configure user media with URL: http://server/cgi-bin/sms-gw.pl
Parameters: phone, msg — script sends GET with action=send.
Zabbix requests from the whitelisted IP bypass Basic Auth.
Send SMS directly from command line — for cron, scripts, monitoring:
perl sms-gw.pl phone=+7XXXXXXXXXX text="Alert: server down"
# or
perl hilink-sms-cli.pl phone=+7XXXXXXXXXX msg="Hello world"Both scripts talk directly to the modem at 192.168.8.1 with zero setup.
Run without Apache:
perl hilink-smsd.pl --daemon --port 8080Access API at http://localhost:8080/cgi-bin/sms-gw.pl?action=signal
No authentication, no Apache — works as a local API proxy on any machine with modem access.