I actually got this working without editing the original PHP file that was given in the original post. I had to do the following and you can adjust as necessary:
1. Edit the
/etc/php.ini and find the
variables_order section and set it to:
* Note you should restart apache *
2. Enabled
enable_environment_macros which can be done in in the CCM > Core Configs (you need to restart core but it will do that upon apply config at the end of this)
3. Downloaded the original script you sent in the original post (which includes NAGIOS_CONTACTPAGER) and saved it to:
4. Gave the sms-notification script
nagios:nagios ownership and set
+x so it could be executed
5. Created a command in the CCM called
notify_special_sms which was a
misc command with the following command line:
6. Added a new contact with
pager set to
5558109100 and gave that contact the
notify_special_sms notification command for host in the CCM - I also had to set the notifications enabled, and what to notify on
7. Added the new contact to a host
8. Apply config
9. I dumped the output of the sms-notification script to a file before it actually sent the values out anywhere so I checked to make sure the pager number was being added
As a small side note - XI has SMS capabilities built in by using the SMS texting email addresses provided by mobile carriers, but it uses the global event/notification handlers that are a part of XI, so you need to have an actual XI user to be able to do that.