Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send message to zabbix from tg-cli? #526

Closed
LordJohn42 opened this issue May 15, 2015 · 21 comments
Closed

How to send message to zabbix from tg-cli? #526

LordJohn42 opened this issue May 15, 2015 · 21 comments

Comments

@LordJohn42
Copy link

Hello guys. I have some problem with sending from Telegram to Zabbix.
I use this guideline - http://tobias.ws/blog/zabbix-com-notificacoes-pelo-telegram/.
Nothing to help.
When i test it, give this. http://higgs.rghost.ru/8fHSFZnRr/image.png
I use another solution for example http://paste2.org/H89yw59z.
This is solutions is work, but not work with zabbix. I dont know, why.
Request for solutions.
Best Regards.

@luckydonald
Copy link

Your command is msg <peer> "message" right?

@LordJohn42
Copy link
Author

luckydonald: Sure.

@gnumoksha
Copy link

@millermax I wrote the guideline, but it was in portuguese, because my english its bad.

I have a look into your screenshot and commands isn't correct. You can translate the article for your language?

For now, see #518 (comment)

Note: today more early i tried compile the project and i received error, try use the same commit that in article.

@LordJohn42
Copy link
Author

Yes, i can translate this article on Russian. My English is bad too.

It is doesent work.
I experimented, with key -e

telegram -k /etc/telegram-cli/tg-server.pub -WR -I -e "msg user#XXXXXXXX Hello"

Thats not work. I dont understand why does not it work.
Just not sent message.
ScreenShoot: http://plasmon.rghost.ru/6RhfbnLGs/image.png

@gnumoksha
Copy link

@millermax I can send message with the version 1.2.0 (the same as yours). I have write a resume here https://gist.github.com/gnumoksha/a95f237d82733ce1f748

Try send a message over telegram desktop https://desktop.telegram.org/

@LordJohn42
Copy link
Author

From telegram desktop or web version is ok.
I get this.
http://higgs.rghost.ru/8pggbCmTg/image.png

@gnumoksha
Copy link

@millermax I just perform the procedure in the ubuntu 14.04.2 LTS with success. Did you install the required packages?

Eg.

apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev make git -y

Is "normal" get some error in first execution

@LordJohn42
Copy link
Author

Ok. Checkout thats all.
I l do from this instructions https://gist.github.com/gnumoksha/a95f237d82733ce1f748
And i get this : http://tau.rghost.ru/7s5h7qnyC/image.png
What am i doing wrong ? :)

@gnumoksha
Copy link

@millermax I can't see error. That is ok. The contact does not received the message?

@LordJohn42
Copy link
Author

@gnumoksha No errors man. But message dont sent.

@gnumoksha
Copy link

@millermax try:

./telegram-cli -k tg-server.pub -c telegram.config -vvvv
[...]
> msg user#12345678 "please, go"
 *** reply_id=0, disable=0
[08:11]  user#12345678 <<< please, go
User user#12345678 is deleting typed message

And paste here

@LordJohn42
Copy link
Author

@gnumoksha You know, first run be successful. Message has been sent.
But, second attempt not.
http://paste2.org/kwpjsDaN

@gnumoksha
Copy link

@millermax you have many faults in communication and finally you got #400 PEER_ID INVALID. See #534 (comment)

@LordJohn42
Copy link
Author

@gnumoksha
Man this problem is resolve.
I can send message from console.
But i still cant send this to telegram from zabbix. :(
Thank you very much.

Note: I run the script from latest version on 1.3.1 work correctly.

@luckydonald
Copy link

For the script issue see #414 or #406, i think they might be related.

@luckydonald
Copy link

@gnumoksha The user change failes:

change_user_group: can't find the user telegramd to switch to

(which seems related to this trick: #414 (comment))
You probably just have to create the user.

@LordJohn42
Copy link
Author

@luckydonald Thats is not problem. I can send message from cli. But notifications not send from zabbix.

@gnumoksha
Copy link

@millermax ser this http://tobias.ws/blog/zabbix-com-notificacoes-pelo-telegram/#comment-14649 paste The outuput here

@luckydonald this warning is acceptable, but i think that error is in zabbix user

@luckydonald
Copy link

What is the exact command you use for zabbix?

@LordJohn42
Copy link
Author

@gnumoksha
Hmm. The problem beginning to be understood a little bit.
http://paste2.org/BNtkA64U

@LordJohn42
Copy link
Author

@gnumoksha I resolve a problem, man.
I reinstall telegram-cli on new server, from @gnumoksha guide line, and all works correctly.
Thank you for resolve this issues.
Check ps aux | grep telegram, for daemon telegram, that is most correctly.
RU:
Я переустановил telegram-cli на новом сервере, по гайду от @gnumoksha, и все заработало нормально.
Спасибо за решение проблемы.
Проверяйте внимательно настройки заббикса.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants