In our enviroment, we use the Nagios XI user account to linked to a contact. When we send out a notification we get the Respond URL by using the macro %responseulr%.
We also have regular contacts that do not have a Nagios XI linked to it. I would like to add the response URL to the alert. How can I update the notify-host-by-email command to insert the response URL? I couldn't find the macro. I also tried using the xi_host_notification_handler, but only appears to work when the contact is linked to a user account. We would like to avoid creating a linked account for every contact, if possable
Thank you,
Don
Contact Macro with Respond URL
Re: Contact Macro with Respond URL
The complications with this request lie in a non user linked contact not having a username/ticketID for the rapid response url to authenticate with XI. Are you only interested in the ability to acknowledge through a url?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Contact Macro with Respond URL
Yes, I would like to be able to acknowledge alerts from a URL and that makes since about needing the username/ticketID relationship to authenicate automatically. I have setup the Notification Parser plugin that will email a report with a link to each host/service that has notification disabled. It orginally was configured to automatically authenicate by placing a user id and password to the URL (clear text). I've since modified the script, so now it prompts for authenication before allowing access. I wasn't sure if there was a notification command that could do something simillar and if there is a way to auto authenicate without showing a id/password in the URL would be a nice option.
Thank you,
Don
Thank you,
Don
Re: Contact Macro with Respond URL
The only auto authentication mechanism in XI for the web ui is the ticketid system. In order to acknowledge, authentication must happen. As contacts made in the CCM are not linked to the postgres database, they would not be able to use a rapid response url. Do you have some catch-all users configured for those contacts (sharing XI credentials)?DonB wrote: I wasn't sure if there was a notification command that could do something simillar and if there is a way to auto authenicate without showing a id/password in the URL would be a nice option.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Contact Macro with Respond URL
My configuration goal was to have only one Nagios XI account for each of our system admins. But then that user would have a minium of three contacts, one for emails only (warnings only), one for email/pages (critical) and the contact that matches to the nagios xi user, it doesn't send any notifications. I will use this contact to be added to all the servers that a SA is responsable for, so when they log into NagiosXI, they only see the servers they manage. We could have servers we just want to monitor and log the performance without having to send any notifications, as well. That is why I went with 3 contacts per user. This account will not be able to manage the two other contacts, only a Nagios Admin will have the rights. If we had a response URL that prompted for authenication, that could work for us.
Re: Contact Macro with Respond URL
We added the ability to secure the rapid response URL by forcing authentication. To do so, add the following lines:
To the file:
Make sure to add it inside of the php tags (line#7 is a good place to add it). This should prompt for the xi login before redirecting to the object from the notification email.
Code: Select all
// Add authentication to the rapid response url
$cfg['secure_response_url']=1;Code: Select all
/usr/local/nagiosxi/html/config.inc.phpFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Contact Macro with Respond URL
Thank you for the response. I wasn't looking to disable the authentication for rapid response when using xi_host_notification_handler command. I was just using the Nagios Parser as an example. I was hoping there is a script that could place a macro in a contact that would allow me to acknowledge an alert. A modified version of notify-host-by-email command, but has the logic to insert a hyper link. The link doesn't have to pass any credentials, I can manually enter that during my connection to nagios.
Re: Contact Macro with Respond URL
Authentication is disabled by default. By altering the php var above, you force authentication from the rapid response url. The rapid response url, after clicking, will allow you to acknowledge the problem. Is this what you are looking for?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Contact Macro with Respond URL
To be honest, I'm not certain... But the more I learn about Nagios, I'm thinking I'm going to create a nagiosxi user id for every core contact, I'll only use the user (dummy) accounts to manage the default message templates and being able to use the xi notification macros in the messages. No one will ever log in with them, they will use their primary account to log into the web site. And the user will be automatically logged into the site to acknowledge an alert, no matter which contact sends it.
Thank you for all your help.
Don
Thank you for all your help.
Don