Posts: 49
Threads: 8
Joined: Oct 2017
Reputation:
5
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:
/usr/local/bin/telegram_nagios.lua
Obviously the command line arguments are not complete either.
Posts: 49
Threads: 8
Joined: Oct 2017
Reputation:
5
Hi Robbie,
Could you have a look at this?
This should be an easy fix.
Thanks.
BR
Posts: 49
Threads: 8
Joined: Oct 2017
Reputation:
5
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)
/usr/local/bin/telegram_nagios.lua "$NOTIFICATIONTYPE$" "$HOSTNAME$" "$HOSTSTATE$" "$HOSTADDRESS$" "$HOSTOUTPUT$" "$LONGDATETIME$"
so this should be changed to:
/usr/local/bin/telegram_nems.lua $USER11$ $USER12$ "$NOTIFICATIONTYPE$" "$HOSTNAME$" "$HOSTSTATE$" "$HOSTADDRESS$" "$HOSTOUTPUT$" "$LONGDATETIME$"
That should do it.
Sorry about not responding to the previous message, I must have overlooked it.
BR
Posts: 1,045
Threads: 41
Joined: Mar 2012
Reputation:
25
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:
Posts: 1,045
Threads: 41
Joined: Mar 2012
Reputation:
25
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.
Cheers!
Robbie
Robbie Ferguson // The Bald Nerd
Did I help you out? Appreciate what I do? Please consider saying thanks:
Posts: 1
Threads: 0
Joined: May 2019
Reputation:
0
Same question from my side, adding "bot" in front of the token is not working for me