You need to associate the contact with the relevant alerts.

I should come up with some defaulting mechanism to use more than just email.

Adam.

Sent from BlueMail

On Mar 29, 2016, at 22:35, Joey Stanford <joey@stan4d.net> wrote:
Sweet!

What’s the magic to get this to fire?

I added an alert contact with the details as well as adding

$config[‘alert’][‘transports’]['telegram']['bot_hash'] = 'XXX'

but when I run test_alert.php it always defaults to email. I had previously removed my default notification config entries.



On Mar 28, 2016, at 22:58 , Cody Cook <observium@codycook.us> wrote:

Well, I played around with it long enough to figure it out.
You need to....
https://api.telegram.org/bot<TOKEN>/getUpdates
Look for the chat ID you want the bot to harass, then use that, rather than the @username. The API documentation made me think I could use a username instead of a unique chat identifier.
Pretty sweet. I'll use the heck out of this.
<image.png>


On Mon, Mar 28, 2016 at 9:13 PM, Cody Cook <observium@codycook.us> wrote:
Sorry, forgot to mention I ran -d -d on the request.

DEBUG: Send:
.

DEBUG: Recv: 250 2.0.0 OK 1459224715 v9sm39002373pfi.50 - gsmtp
DEBUG: Send: QUIT

DEBUG: Recv: 221 2.0.0 closing connection v9sm39002373pfi.50 - gsmtp
o Notifying [telegram] Telegram Notifier:
{"recipient":"RECIP","bot_hash":"AUTHTOKEN"}

REQUEST[https://api.telegram.org/botAUTHTOKEN/sendMessage]
REQUEST STATUS[400 Bad Request]
REQUEST RUNTIME[1.059s]
RESPONSE[

]


$http_response_header - /opt/observium/includes/alerts.inc.php:1287
/opt/observium/includes/common.inc.php:2877


array(
[0] => string(24) "HTTP/1.1 400 Bad Request"
[1] => string(19) "Server: nginx/1.6.2"
[2] => string(35) "Date: Tue, 29 Mar 2016 04:11:56 GMT"
[3] => string(30) "Content-Type: application/json"
[4] => string(18) "Content-Length: 82"
[5] => string(17) "Connection: close"
)

$opts - /opt/observium/includes/alerts.inc.php:1287
/opt/observium/includes/common.inc.php:2878


array(
[http] => array(
[method] => string(4) "POST"
[content] => string(304) "chat_id=didyouexpectthat&text=ALERT+%3A+There+is+a+switch+down%2C+possibly+preventing+traffic+from+passing+accurately.%0A%0ADevice+name+%3A+m5300.threefifteen.info%0ADevice+Uptime+%3A+Down+21m+32s%0A%0AMore+informations+%3A+https%3A%2F%2Fobservium.threefifteen.info%2Fdevice%2Fdevice%3D1%2Ftab%3Dalert%2F"
[timeout] => string(2) "15"
[header] => string(37) "User-Agent: Observium/0.16.3.7711\r\n"
)
)


On Mon, Mar 28, 2016 at 9:09 PM, Cody Cook <observium@codycook.us> wrote:
Hi,
Noticed an alert checker for Telegram bots. Just recently got into Telegram.
Is there any information on this?
I setup my username (both with and without @) and put in the token from BotFather in the config and used test_alert.php -a 9 and it says it sends an alert.
Do I need something to customize my bot to make it send messages?

Thanks




observium mailing list
observium@observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium



observium mailing list
observium@observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium