Sie sind auf Seite 1von 6

Configure a Whatsapp alert with Pandora FMS

Table of Contents
1 Using the script 1.1 Unpackage the code..................................................................................................................2 1.2 Retrieve auth password.............................................................................................................2 1.3 Executing the script manually...................................................................................................2 2 Configuring the alert 2.1 Configure a command............................................................................................................... 2.2 Configure an action................................................................................................................... 2.3 Configure a template.................................................................................................................! 3 Creating the alert

"ith #andora $%& is possi'le configure an alert that send a "hatsapp to a mo'ile phone using a unofficial (#) named "hats(#) *https+,,githu'.com,aesedepece,"hats(#)-.

1 Using the script


1.1 Unpackage the code
.he package contains a file named /send0whatsapp.php1 and a directores /whatsapi1 and /yowsup1. "e need to copy it in the same path. )n example ,tmp,send0whatsapp

1.2 Retrieve auth password


.he first step to use the script is o'tain the password from the "hatsapp servers using 2owsup pro3ect. )s a python pro3ect4 so we will need to have installed python and all the necessary dependences in our system )n the yowsup,src folder4 there are all the necessary to get it. $irst we must fill the config.example file with our phone num'er *with country prefix-5
cc63 phone63 777123 !7 id6 password6

.hen we execute the 2owsup script to receive a confirmation code in our phone *'y &%& or 8oice message-+
python .,yowsup9cli 9c config.example 9d 99re:uestcode voice python .,yowsup9cli 9c config.example 9d 99re:uestcode sms

)n few moments we will receive a 7 digit confirmation code in our phone. "e use it to re:uest the authentication password+
python .,yowsup9cli 9c config.example 9d 9R 123 !7

"e recei'e a 'ase7 coded password that is all we need to use the "hats(#).

1.3 Executing the script manually


( simple script in #;# has 'een created to accept parameters via console and 'e executed in the following way+ Syntax: php5 send_whatsapp.php [phone_number_source] [password] [phone_number_target] [message]

Example: php5 send_whatsapp.php 34666 !3456 c"#$c3d%cm&' 346666543! ()hat*s up )hatsapp+( <=.E&+ .he #hone num'ers have the country code as prefix .he script depends on the (#) used and it4 on the "hatsapp messenger servers. )f "hatshapp changes their systems4 is possi'le that the script doesn>t work.

2 Configuring the alert


"e>re going to show how configure an alert on #andora $%& to send a "hatsapp message step 'y step

2.1 Configure a command


"e configure a command in #andora $%& with the 2 first parameters of the script *num'er and imei of the source phone- in the field 14 the target phone num'er in the field 2 and the message in the field 3.

2.2 Configure an action


.hen we will configure an alert to send a "hatsapp message to4 in example4 the mo'ile phone of the support department. "e will fill the fields 1 and 24 with the phone num'er and )%E) of the source mo'ile and the target phone num'er *in this case the phone of support-. )n this way4 when we configure a template4 we only have to fill the field 3 with the desired message.

2.3 Configure a template


<ow we configure an alert template with the desired condition. )n this case4 we will check a module with the free disk ? and our alert will 'e fired when it 'e less than 2@?.

(s we said4 we fill the field 3 *the 2 first fields will 'e taken from action- with the desired message. )n this case /.he disk space is under 2@?1.

$inally we can set a recovery message to receive a message when the alert will 'e recovered. )n this case /.he free space disk is over 2@? again1. .he field 2 will 'e empty4 'ut if we want4 we can set it with a different phone num'er where receive the recovery whatsapps.

3 Creating the alert


.he last step is create the alert in the desired module4 and when the condition will 'e matched *the module value 'een less than 2@- the alert will 'e fired sending to the configured phone num'er a whatsapp message with the text. )n the same way a recovery message will 'e sended to the phone device if is configured.

Das könnte Ihnen auch gefallen