Hello.
We use the BulkSMS service with our customer management system so it seemed a natural choice to use BulkSMS for zabbix too.
Using the examples on their site I created two working scripts, one that polls for the remaining texts on the account and the other that polls for the remaining allowance per day.
Both scripts rely on global macros defined {BULKSMS_USER} & {BULKSMS_PASS} instead of coding them into the PHP scripts, all working and good and when the password changes I only need visit one place to update the password. (Our support company change it every two weeks)
I've now written a third script to send messages, on the command line it works as - bulksms_send.php <username> <password> <mobile> <message>
I've set it up in media type as a script and trying to pass script parameters as {BULKSMS_USER} {BULKSMS_PASS} {ALERT.SENDTO} {ALERT.SUBJECT} & {ALERT.MESSAGE}
The script logs what it receives : {$BULKSMS_USER} {$BULKSMS_PASS} 447583xxxxxx Test subject This is the test message from Zabbix
(Obviously I have masked my mobile number) it doesn't actually translate the ${BULKSMS_USER} & ${BULKSMS_PASS} from the global macros it passes this exact text which obviously doesn't work.
It works if I put the username and password in but its not as elegant and I have to visit another place to change the password. is there a way to pass global macros as parameters to scripts within media types ?
We use the BulkSMS service with our customer management system so it seemed a natural choice to use BulkSMS for zabbix too.
Using the examples on their site I created two working scripts, one that polls for the remaining texts on the account and the other that polls for the remaining allowance per day.
Both scripts rely on global macros defined {BULKSMS_USER} & {BULKSMS_PASS} instead of coding them into the PHP scripts, all working and good and when the password changes I only need visit one place to update the password. (Our support company change it every two weeks)
I've now written a third script to send messages, on the command line it works as - bulksms_send.php <username> <password> <mobile> <message>
I've set it up in media type as a script and trying to pass script parameters as {BULKSMS_USER} {BULKSMS_PASS} {ALERT.SENDTO} {ALERT.SUBJECT} & {ALERT.MESSAGE}
The script logs what it receives : {$BULKSMS_USER} {$BULKSMS_PASS} 447583xxxxxx Test subject This is the test message from Zabbix
(Obviously I have masked my mobile number) it doesn't actually translate the ${BULKSMS_USER} & ${BULKSMS_PASS} from the global macros it passes this exact text which obviously doesn't work.
It works if I put the username and password in but its not as elegant and I have to visit another place to change the password. is there a way to pass global macros as parameters to scripts within media types ?