Shinken can run on an android device like a phone. It can be very useful for one particular daemon : the reactionner that send alerts. With this, you can setup a “sms by phone” architecture, with high availability. We will see that you can also receive ACKs by SMS :)
All you need is one (or two if you want high availability) android phone with an internet connection and Wifi. Any version should work.
Go to http://pypi.python.org/pypi/Pyro4/ and download the same Pyro that you are using in Shinken.
The phone(s) will be a new reactionner daemon. You should want to only launch SMS with it, not mail commands or nother notifications. So you will have to define this reactionner to manage only the SMS commands. There is an example of such SMS-reactionner in the sample etc/shinken-specific.cfg file and the module AndroidSMS need by this reactionner to send SMS with android.
define reactionner{
reactionner_name reactionner-Android
address WIFIIPOFYOURPHONE
port 7769
spare 0
# Modules
modules AndroidSMS
reactionner_tags android_sms
}
# Reactionner can be launched under an android device
# and can be used to send SMS with this module
define module{
module_name AndroidSMS
module_type android_sms
}
The important lines are :
* address : put the Wifi address of your phone
* modules : load the Android module to be able to manage sms sent.
* reactionner_tags : only android_sms commands will be send to this reactionner.
In the commands.cfg, there are example of sms sending commands::
# For Android SMS things
# You need both reactionner_tag and module_type in most cases!
define command{
command_name notify-host-by-android-sms
command_line android_sms $CONTACTPAGER$ Host: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $HOSTSTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$
reactionner_tag android_sms
module_type android_sms
}
define command{
command_name notify-service-by-android-sms
command_line android_sms $CONTACTPAGER$ Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$
reactionner_tag android_sms
module_type android_sms
}
The important part are the reactionner_tag and module_type lines. With this parameter, you are sure the command will be managed by : * only the reactionner(s) with the tag android_sms, and in this reactionner, it will be managed by the module android_sms.
You only need to add theses commands to your contacts (or contact templates, or notification ways) to send them SMS :
define contact{
name generic-contact ; The name of this contact template
[...]
service_notification_commands notify-service-by-email,notify-service-by-android-sms ; send service notifications via email
host_notification_commands notify-host-by-email,notify-host-by-android-sms ; send host notifications via email
That's all.
You need to have a working android-reactionner with the sms module. The sms reception will be automatically enabled.
All you need is to send a SMS to the phone with the format :
For a service :
ACK host_name/service_descriptionFor an host :
ACK host_name
And it will automatically raise an acknowledgement for this object :)