Hello There, Guest!  
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Error in commands notify-service-by-telegram and notify-host-by-telegram

I wondered why I did not receive any notifications (neither email nor telegram).

As far as email is concerned, there is already a report on an error regarding the "from" field.

As I did also not receive any telegrams, I first tested the telegram_nems.lua script and that worked.
Looking at the command line in NConf however showed that both notify-service-by-telegram and notify-host-by-telegram refer to the old command:


Obviously the command line arguments are not complete either.
Hi Robbie,

Could you have a look at this?
This should be an easy fix.


Hmm, thanks baggins. I could actually really use your assistance with this one because I couldn't figure out how Telegram works. I'm looking for someone who uses it to test and even assist with writing the documentation for this feature.

Please see this message I'd posted to you a long time ago which went unanswered: https://forum.category5.tv/thread-96-pos...tml#pid757

Let me know what needs changing, specifically (eg., what NConf should have the commands set to) and I'll get working on it.

Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
Hi Robbie,

You have in fact already done most of the work, but probably forgotten about it!

To start with: in /usr/local/bin you have now a script called telegram_nems.lua which is a modified version of my original script called telegram_nagios.lua.
The new script takes two additional arguments: the bot (arg[1] and the chat_id arg[2]. 
The bot and the chat_id are now stored in the resource.cfg as $USER11$ and $USER12$.

In Nconf however you have still the old command line: (This is for notify-host-by telegram, notify-service-by telegram is similar)


so this should be changed to:


That should do it.

Sorry about not responding to the previous message, I must have overlooked it.

Easy peasy, thanks baggins. :) Yeah, I snuck this feature in at the last minute of 1.3 feature freeze... so I'll get it fixed and ready for the next release (perhaps 1.3.1).

There's such an overlap right now between 1.3 and 1.4 so I'll decide how best to do this.

Thanks again!
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
Posting this here in case it helps someone since I couldn't find a straight forward explanation.  There may be a simpler way of doing this, but this is how I made it work.  None of this is my original work, so I've included links to where I found the answers.  

First create a bot: 

Within the Telegram app, send a message to @BotFather
/newbot <botname>

Make note of the Token you receive in return.  This is what you'll use for the "Your Bot" field in NEMS System Settings Tool (must add 'bot' before the token). 

Allow your bot to join groups: 
send a message to @BotFather

The Chat ID seems to be a bit tricky to obtain.  
Compose a new message in Telegram, choosing the new group option.   
Add <botname> to the group.

Message your bot. 
/my_id <botname>

Look for 'chat":{"id":'.   The id will be something like -12345678910. This is what you'll use for the Chat ID.   


Hit save and hopefully you'll be in business.
That's wonderful, thank you lonehorse.

I'll add a link to your post in the docs for now, and inevitably write it in to the docs.

Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
Forum Jump:

Users browsing this thread: 1 Guest(s)