Notes In Alert Messages
-
EnvBroker1
- Posts: 65
- Joined: Thu Oct 31, 2013 11:50 am
Notes In Alert Messages
In nagios core, there was a hosts notes file that you could edit and put information like who you would want your 24/7 facility to call when alerts were generated, especially after hours. How do I do that in Nagios Core? I can't edit the individual users' notification preferences because it would just be a static message.
I also tried putting information in the Host Management, Misc Settings, Notes area. But that seemed to only show if I went chose the, view this in core, option. Something our HelpDesk and Operations people won't be able to do.
Any help you can provide would be much appreciated, especially if I just missed a simple setting.
Thanks
Eric
I also tried putting information in the Host Management, Misc Settings, Notes area. But that seemed to only show if I went chose the, view this in core, option. Something our HelpDesk and Operations people won't be able to do.
Any help you can provide would be much appreciated, especially if I just missed a simple setting.
Thanks
Eric
Re: Notes In Alert Messages
To be clear, are you asking how to do this in XI or Core? This was posted in the XI section and we don't often get questions about Core in the Customer section.EnvBroker1 wrote:How do I do that in Nagios Core?
In XI you can edit the notifications that get sent out to include the host notes in the message:
https://assets.nagios.com/downloads/nag ... iables.pdf
https://assets.nagios.com/downloads/nag ... #hostnotes
Is this what you are looking for?
Former Nagios employee
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Notes In Alert Messages
BAM!
https://exchange.nagios.org/directory/A ... nt/details
Is that what you're looking for?
Or are you looking to drag the existing notes field into notifications - it hasn't changed.
https://exchange.nagios.org/directory/A ... nt/details
Is that what you're looking for?
Or are you looking to drag the existing notes field into notifications - it hasn't changed.
-
EnvBroker1
- Posts: 65
- Joined: Thu Oct 31, 2013 11:50 am
Re: Notes In Alert Messages
Yes looking to do this in core. Taking off for a late lunch, but I'll check these two responses out and see if that does the trick. Thanks for both of the replies.
-
EnvBroker1
- Posts: 65
- Joined: Thu Oct 31, 2013 11:50 am
Re: Notes In Alert Messages
I have a lot of this worked out now. Looking back at the previous posts, I wasn't doing a good job of explaining things. So I'll start over.
I was looking to do this in Nagios XI, not Nagios core. I just meant that it worked fine when we had Nagios core, so I wanted to do it in Nagios XI.
I believe there is an error in the "Nagios XI - Understanding Notification Variables" Rev 1.0 - September 2015. I try to make sure I follow directions to the letter and this caused my problem. The example for service notifications says if you create a variable name "=_NOTE", but later when editing the xi_service_notification_handler command, append it with "--notes=" So I named it NOTE, but referenced it as notes as directed.
To me that seems like it's definitely wrong. So I used NOTE and --note and now that works fine. The issue I'm still having is on our old Nagios core system, we had a hostsnotes and servicenotes file and the Nagios email alerts would pull contact information from these files. That's the part I'm trying to fix now.
I know that information is still out there because if I go to the advanced tab and choose "Look at this host in Nagios Core", the information from that file is displayed. In the example below it pulls the "Contact SUG@EITS"
So I need to be able to find that file and variable that still displays the information and add it to the email alert template.
In Nagios Core, I had to edit the hostnotes file from the command line in a format like
define host {
name SUGNotesHost
notes Contact SUG@EITS
register 0
}
So I need to know where Nagios XI keeps these files now.
Can I manually edit them or does it have to be done through the GUI so it won't get overwritten.
What's the variable name Nagios XI is using to load the message and how do I add it to the email alert template.
I'm sure it's not that complex, but it's just not coming to me or if it is, I'm missing it like I missed the difference in NOTE and notes.
Thanks and sorry for the novel.
I was looking to do this in Nagios XI, not Nagios core. I just meant that it worked fine when we had Nagios core, so I wanted to do it in Nagios XI.
I believe there is an error in the "Nagios XI - Understanding Notification Variables" Rev 1.0 - September 2015. I try to make sure I follow directions to the letter and this caused my problem. The example for service notifications says if you create a variable name "=_NOTE", but later when editing the xi_service_notification_handler command, append it with "--notes=" So I named it NOTE, but referenced it as notes as directed.
To me that seems like it's definitely wrong. So I used NOTE and --note and now that works fine. The issue I'm still having is on our old Nagios core system, we had a hostsnotes and servicenotes file and the Nagios email alerts would pull contact information from these files. That's the part I'm trying to fix now.
I know that information is still out there because if I go to the advanced tab and choose "Look at this host in Nagios Core", the information from that file is displayed. In the example below it pulls the "Contact SUG@EITS"
So I need to be able to find that file and variable that still displays the information and add it to the email alert template.
In Nagios Core, I had to edit the hostnotes file from the command line in a format like
define host {
name SUGNotesHost
notes Contact SUG@EITS
register 0
}
So I need to know where Nagios XI keeps these files now.
Can I manually edit them or does it have to be done through the GUI so it won't get overwritten.
What's the variable name Nagios XI is using to load the message and how do I add it to the email alert template.
I'm sure it's not that complex, but it's just not coming to me or if it is, I'm missing it like I missed the difference in NOTE and notes.
Thanks and sorry for the novel.
You do not have the required permissions to view the files attached to this post.
Re: Notes In Alert Messages
The "NOTE" in the host/service has nothing to do with the "notes" in the command... If you had "SOMETHING" instead of "NOTE", you would add to your command:To me that seems like it's definitely wrong. So I used NOTE and --note and now that works fine.
Code: Select all
--notes="$_HOSTSOMETHING$"Code: Select all
--notes="$_SERVICESOMETHING$"Code: Select all
Whatever: %notes%Code: Select all
_TEST NAGIOSCode: Select all
--mynewtest="$_HOSTTEST$"Code: Select all
TEST CUSTOM MACRO: %mynewtest%***** Nagios XI Alert *****
Notification Type: CUSTOM
Host: localhost
State: UP
Address: 127.0.0.1
Info: OK - 127.0.0.1: rta 0.008ms, lost 0%
Date/Time: 2016-02-11 16:52:58
Respond: http://x.x.x.x/nagiosxi/rr.php?uid=1-14 ... 58aeae0817
Nagios URL: http://x.x.x.x/nagiosxi/
TEST CUSTOM MACRO: NAGIOS
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
EnvBroker1
- Posts: 65
- Joined: Thu Oct 31, 2013 11:50 am
Re: Notes In Alert Messages
Okay, I'll address one thing at a time.
The documentation I referenced clearly says when you define a custom variable, you have to go to the notification handler and edit the command line value and append it with that variable.
It uses examples of
Custom Variable Command Line value
_MAC --mac=
_TEST --test=
_NOTE --notes=
Are you saying that in the last example, defining a variable as NOTE but putting it in the command line as notes doesn't matter? If it doesn't matter then that's fine, but that's why I said it seems like there's a problem with the documentation. Because normally when you define a variable, you have to reference it by the name you defined it as.
This part is no longer a problem for me, I just wanted someone to look at the document and if it is incorrect, make a change. I know that normally there are different avenues for bringing up possible documentation issues. Probably the forum was not the best place to bring that up, but I just threw it in there.
The documentation I referenced clearly says when you define a custom variable, you have to go to the notification handler and edit the command line value and append it with that variable.
It uses examples of
Custom Variable Command Line value
_MAC --mac=
_TEST --test=
_NOTE --notes=
Are you saying that in the last example, defining a variable as NOTE but putting it in the command line as notes doesn't matter? If it doesn't matter then that's fine, but that's why I said it seems like there's a problem with the documentation. Because normally when you define a variable, you have to reference it by the name you defined it as.
This part is no longer a problem for me, I just wanted someone to look at the document and if it is incorrect, make a change. I know that normally there are different avenues for bringing up possible documentation issues. Probably the forum was not the best place to bring that up, but I just threw it in there.
-
EnvBroker1
- Posts: 65
- Joined: Thu Oct 31, 2013 11:50 am
Re: Notes In Alert Messages
My current issue.
In Nagios XI, if I choose to view a host in Nagios Core
Home-->Host Detail-->
Select any host
Advanced Tab-->View In Nagios Core
On that screen, it will display notes (see the highlighted previous post - Contact SUG@EITS). In our old Nagios core free version, before going to Nagios XI, this was modified through and pulled from the hostnotes file.
Lastly, how to I get the information previously contained in those notes files to display in the alerts.
Thanks
In Nagios XI, if I choose to view a host in Nagios Core
Home-->Host Detail-->
Select any host
Advanced Tab-->View In Nagios Core
On that screen, it will display notes (see the highlighted previous post - Contact SUG@EITS). In our old Nagios core free version, before going to Nagios XI, this was modified through and pulled from the hostnotes file.
It was also placed in the outgoing Nagios email alerts. I am trying to get that feature working again. So if anyone could tell me what happened to the hostnotes and servicenotes files, where they are located. Or if during the import, that information was parsed out to different configuration files.EnvBroker1 wrote:In Nagios Core, I had to edit the hostnotes file from the command line in a format like
define host {
name SUGNotesHost
notes Contact SUG@EITS
register 0
}
Lastly, how to I get the information previously contained in those notes files to display in the alerts.
Thanks
Re: Notes In Alert Messages
I totally agree with you that this particular document needs to be improved - it is a bit confusing as is.Are you saying that in the last example, defining a variable as NOTE but putting it in the command line as notes doesn't matter? If it doesn't matter then that's fine, but that's why I said it seems like there's a problem with the documentation. Because normally when you define a variable, you have to reference it by the name you defined it as.
We really appreciate the feedback from users, and this forum is the right place to bring up these issues!
Here's what I believe causes the confusion. The "_NOTE" macro in the host/service config:
matches this (in the command definition):_NOTE NAGIOS
not this:--notes="$_HOSTNOTE$"
On the other hand, the "notes" from the command definition:--notes="$_HOSTNOTE$"
matches the "%notes%" in the notification message field:--notes="$_HOSTNOTE$"
I didn't want to use note/notes in my previous example, as my head started to spin.Notes: %notes%
I am not sure if I am making this more clear or just adding to the confusion. Please, let me know.
Anyway, I hope we can improve the document, and make it a bit less confusing. The use of "note" and "notes" was probably not the best choice.
Be sure to check out our Knowledgebase for helpful articles and solutions!