Page 1 of 1
how to add Authentication token
Posted: Thu Sep 27, 2018 3:58 am
by diksharawat
Hi,
I need to add a authentication token in my nagios to connect it to another monitoring tool.
I am not able to find anything that can work. please help.
Re: how to add Authentication token
Posted: Thu Sep 27, 2018 11:45 am
by scottwilkerson
Nagios Core does not have a concept of authentication tokens, it uses apache basic authentication with users/passwords.
Nagios XI has API tokens and access, in our commercial product
https://www.nagios.com/products/nagios-xi/
Re: how to add Authentication token
Posted: Wed Oct 03, 2018 12:53 am
by diksharawat
Is there any scope to add authorization token while sending an alert?
Re: how to add Authentication token
Posted: Wed Oct 03, 2018 9:46 am
by scottwilkerson
diksharawat wrote:Is there any scope to add authorization token while sending an alert?
No, however in Nagios XI we do have rapid response URLs that can be used without credentials.
Re: how to add Authentication token
Posted: Thu Oct 04, 2018 12:37 am
by diksharawat
Thanks for the reply @scottwilkerson.
I am sorry if i am able to make myself clear or if i am not getting what you.
My problem is:
I am integrating Nagios with Alerta, and for that i need to add token in my Nagios configuration, so that with correct token, Nagios will be authorized to send alerts to Alerta.
Our Alerta is using token concept to authorize who all can send alerts to it.
Is there a way i can do this with Nagios core or i need to buy NagiosXI?
Re: how to add Authentication token
Posted: Thu Oct 04, 2018 7:08 am
by scottwilkerson
I am not familiar with Alerta, do you need to ann Alerta's Authentication token?
There isn't an authentication token for Nagios or Nagios XI that can be included in notifications.
Re: how to add Authentication token
Posted: Thu Oct 04, 2018 8:42 am
by mcapra
Notification and event handlers have a concept of "arguments", as does any old Nagios command definition:
https://assets.nagios.com/downloads/nag ... tions.html
https://assets.nagios.com/downloads/nag ... dlers.html
Assuming this token is to be provided to some sort of API call, you could include that as an argument in your notification or event handler.
Here's a reference implementation of a
Twilio integration I did:
https://support.nagios.com/forum/viewto ... 94#p252294
In which case I'm passing my "token" via
-u <credentials> to a simple
curl. That
curl could be a custom script, some sort of binary, practically whatever you want/need to communicate with Alerta.
It looks like Alerta
has an API as well as a
Python client. Both of these could be integrated with Nagios Core as I have described above.
Re: how to add Authentication token
Posted: Thu Oct 04, 2018 12:53 pm
by scottwilkerson
Re: how to add Authentication token
Posted: Mon Nov 26, 2018 2:55 am
by diksharawat
@mcapra
Thanks for the reply.
I am not sending events to ALerta using curl. We are using ALerta's alerta-neb.c file given in
https://github.com/alerta/nagios-alerta.
I have given endpoint in nagios.cfg as Alerta's IP and port.
I am not able to find a way to add token.
Is there any way i can do that?
Re: how to add Authentication token
Posted: Mon Nov 26, 2018 8:51 am
by scottwilkerson
On the alerta page you linked I see this example, is this what you are looking for?
To provide the API key if authentication is enabled on the alerta server:
Code: Select all
broker_module=/usr/lib/nagios/alerta-neb.o http://localhost:8080 key=INSERT_API_KEY_HERE